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

Public Member Functions

 UTF8String (void)
 
 UTF8String (const UTF8String &str)
 
 UTF8String (const JString &str)
 
 UTF8String (const char *str)
 
 UTF8String (const EG_CHAR *str)
 
 ~UTF8String (void)
 
UTF8Stringoperator= (const UTF8String &Rhs)
 
UTF8Stringoperator= (const JString &Rhs)
 
UTF8Stringoperator= (const char *Rhs)
 
UTF8Stringoperator= (const EG_CHAR *Rhs)
 
 operator const char * (void) const
 
 operator JString (void) const
 
JString JStringRepresentation (void) const
 
unsigned int size (void) const
 
- Public Member Functions inherited from BaseCharString
 BaseCharString ()
 
virtual ~BaseCharString (void)
 
const char * cstr (void) const
 
unsigned int length (void) const
 
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
 

Static Public Member Functions

static unsigned int size (const JString &str)
 
- 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 UTF8String class is a container class for char* strings, encoded with UTF8.

This is the UTF8 implementation of BaseCharString. Please look at the doc of the abstract base class for more information.

Constructor & Destructor Documentation

◆ UTF8String() [1/5]

UTF8String ( void  )

Constructor: Creates an empty UTF8String.

◆ UTF8String() [2/5]

UTF8String ( const UTF8String wstr)

Copy-Constructor: Creates a new UTF8String from a deep copy of the argument string.

Parameters
wstrThe UTF8String to copy.

◆ UTF8String() [3/5]

UTF8String ( const JString wstr)

Copy-Constructor: Creates a new UTF8String from a deep copy of the argument string.

Parameters
wstrThe JString to copy.

◆ UTF8String() [4/5]

UTF8String ( const char *  str)

Copy-Constructor: Creates a new UTF8String from a deep copy of the argument string.

Parameters
strThe UTF8 string to copy.

◆ UTF8String() [5/5]

UTF8String ( const EG_CHAR *  wstr)

Copy-Constructor: Creates a new UTF8String from a deep copy of the argument string.

Parameters
wstrThe Unicode string to copy.

◆ ~UTF8String()

~UTF8String ( void  )

Destructor.

Member Function Documentation

◆ operator=() [1/4]

UTF8String & operator= ( const UTF8String Rhs)

operator=.

Makes a deep copy of its right operand into its left operand.

This overwrites old data in the left operand.

◆ operator=() [2/4]

UTF8String & operator= ( const JString Rhs)

operator=.

Makes a deep copy of its right operand into its left operand.

This overwrites old data in the left operand.

◆ operator=() [3/4]

UTF8String & operator= ( const char *  Rhs)

operator=.

Makes a deep copy of its right operand into its left operand.

This overwrites old data in the left operand.

◆ operator=() [4/4]

UTF8String & operator= ( const EG_CHAR *  Rhs)

operator=.

Makes a deep copy of its right operand into its left operand.

This overwrites old data in the left operand.

◆ operator const char *()

operator const char * ( void  ) const
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.

Implements BaseCharString.

◆ operator JString()

operator JString ( void  ) const
virtual

operator JString.

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

This overwrites old data in the left operand.

Implements BaseCharString.

◆ JStringRepresentation()

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

Implements BaseCharString.

◆ size() [1/2]

unsigned int size ( void  ) const
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

Implements BaseCharString.

◆ size() [2/2]

unsigned int size ( const JString str)
static
Parameters
stra JString instance
Returns
the size in bytes that an UTF8 representation of the provided JString instance would have