Photon C++ Client API  5.0.7.3
Public Member Functions | List of all members
BaseCharString Class Referenceabstract
Inheritance diagram for BaseCharString:
Inheritance graph
[legend]
Collaboration diagram for BaseCharString:
Collaboration graph
[legend]

Public Member Functions

 BaseCharString ()
 
virtual ~BaseCharString (void)
 
virtual operator const char * (void) const =0
 
virtual operator JString (void) const =0
 
const char * cstr (void) const
 
virtual JString JStringRepresentation (void) const =0
 
unsigned int length (void) const
 
virtual unsigned int size (void) const =0
 
virtual JStringtoString (JString &retStr, bool withTypes=false) const
 
virtual JStringtoString (JString &retStr, bool withTypes=false) const=0
 
JString toString (bool withTypes=false) const
 
- Public Member Functions inherited from Base
virtual ~Base (void)=0
 
- Public Member Functions inherited from LoggingBase< Base >
virtual ~LoggingBase (void)=0
 
- Public Member Functions inherited from ToString
virtual ~ToString (void)
 
virtual JString typeToString (void) const
 
JString toString (bool withTypes=false) const
 

Additional Inherited Members

- Static Public Member Functions inherited from LoggingBase< Base >
static void setListener (const BaseListener *pBaseListener)
 
static int getDebugOutputLevel (void)
 
static bool setDebugOutputLevel (int debugLevel)
 
static const LogFormatOptionsgetLogFormatOptions (void)
 
static void setLogFormatOptions (const LogFormatOptions &options)
 

Detailed Description

The BaseCharString class is the abstract base class for container classes, holding char* strings.

You are encouraged to add additional subclasses for encodings, for which there are no subclasses provided out of the box.
Subclasses of this class act as convenience classes for conversions between instances of class JString and char*'s.
The encoding of the char*'s is defined by the subclass. There should be one subclass for every supported encoding.
Subclasses of this class should only be used to hold or pass strings and for conversions between string encodings. Please use class JString for common string operations and modifications.

Constructor & Destructor Documentation

◆ BaseCharString()

Constructor.

◆ ~BaseCharString()

~BaseCharString ( void  )
virtual

Destructor.

Member Function Documentation

◆ operator const char *()

operator const char * ( void  ) const
pure virtual

operator const char*.

Copies a pointer to the content of its right operand into its left operand.

This overwrites old data in the left operand.

Implemented in ANSIString, and UTF8String.

◆ operator JString()

operator JString ( void  ) const
pure virtual

operator JString.

Copies a JString representation of its right operand into its left operand.

This overwrites old data in the left operand.

Implemented in ANSIString, and UTF8String.

◆ cstr()

const char * cstr ( void  ) const
Remarks
The data, to which the pointer points to, is only valid as long as the instance is valid.
Returns
a pointer to a char array representation of the string.

◆ JStringRepresentation()

JStringRepresentation ( void  ) const
pure virtual
Returns
a JString representation of the string.

Implemented in ANSIString, and UTF8String.

◆ length()

unsigned int length ( void  ) const
Returns
the length of the string in characters

◆ size()

unsigned int size ( void  ) const
pure virtual

The default implementation of this function will just return length(), but for multibyte strings like UTF8String the return values of length() and size() can differ.

Returns
the size of the string in bytes

Implemented in ANSIString, and UTF8String.

◆ toString() [1/3]

JString & toString ( JString retStr,
bool  withTypes = false 
) const
virtual
Remarks
The cost of this function depends a lot on implementation details of the implementing subclasses, but for container classes this function can become quite expensive, if the instance contains huge amounts of data, as its cost for many container class implementations increases disproportionately high to the size of the payload.
Parameters
retStrreference to a string, to store the return-value in; the information, which is generated by this function, will be attached at the end of any eventually existing previous content of the string
withTypesset to true, to include type information in the generated string
Returns
a JString representation of the instance and its contents for debugging purposes.

Implements ToString.

◆ toString() [2/3]

toString
Remarks
The cost of this function depends a lot on implementation details of the implementing subclasses, but for container classes this function can become quite expensive, if the instance contains huge amounts of data, as its cost for many container class implementations increases disproportionately high to the size of the payload.
Parameters
retStrreference to a string, to store the return-value in; the information, which is generated by this function, will be attached at the end of any eventually existing previous content of the string
withTypesset to true, to include type information in the generated string
Returns
a JString representation of the instance and its contents for debugging purposes.

◆ toString() [3/3]

JString toString

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
withTypesset to true, to include type information in the generated string
Returns
a JString representation of the instance and its contents for debugging purposes.
See also
JString