Photon C++ Client API
5.0.7.3
|
Public Member Functions | |
JString (unsigned int bufferlen=0) | |
JString (const char *Value) | |
JString (const EG_CHAR *Value) | |
JString (const JString &Value) | |
JString (const UTF8String &Value) | |
JString (const ANSIString &Value) | |
~JString (void) | |
JString & | operator= (const JString &Rhs) |
JString & | operator= (const char *Rhs) |
JString & | operator= (const EG_CHAR *Rhs) |
JString & | operator= (const UTF8String &Rhs) |
JString & | operator= (const ANSIString &Rhs) |
JString & | operator= (char Rhs) |
JString & | operator= (signed char Rhs) |
JString & | operator= (unsigned char Rhs) |
JString & | operator= (EG_CHAR Rhs) |
JString & | operator= (short aNum) |
JString & | operator= (unsigned short aNum) |
JString & | operator= (int aNum) |
JString & | operator= (unsigned int aNum) |
JString & | operator= (long aNum) |
JString & | operator= (unsigned long aNum) |
JString & | operator= (long long aNum) |
JString & | operator= (unsigned long long aNum) |
JString & | operator= (float aNum) |
JString & | operator= (double aNum) |
JString & | operator= (long double aNum) |
JString & | operator= (bool aBool) |
operator const EG_CHAR * (void) const | |
JString & | operator+= (const JString &Rhs) |
template<typename Etype > | |
JString & | operator+= (const Etype &Rhs) |
bool | operator== (const JString &Rhs) const |
bool | operator!= (const JString &Rhs) const |
bool | operator< (const JString &Rhs) const |
bool | operator> (const JString &Rhs) const |
bool | operator<= (const JString &Rhs) const |
bool | operator>= (const JString &Rhs) const |
EG_CHAR | operator[] (unsigned int Index) const |
EG_CHAR & | operator[] (unsigned int Index) |
unsigned int | capacity (void) const |
EG_CHAR | charAt (unsigned int index) const |
int | compareTo (const JString &anotherString) const |
const JString & | concat (const JString &str) |
const EG_CHAR * | cstr (void) const |
JString | deleteChars (unsigned int start, unsigned int length) const |
bool | endsWith (const JString &suffix) const |
void | ensureCapacity (unsigned int minCapacity) |
bool | equals (const JString &anotherString) const |
bool | equalsIgnoreCase (const JString &anotherString) const |
int | indexOf (char ch) const |
int | indexOf (char ch, unsigned int fromIndex) const |
int | indexOf (EG_CHAR ch) const |
int | indexOf (EG_CHAR ch, unsigned int fromIndex) const |
int | indexOf (const JString &str) const |
int | indexOf (const JString &str, unsigned int fromIndex) const |
int | lastIndexOf (char ch) const |
int | lastIndexOf (char ch, unsigned int fromIndex) const |
int | lastIndexOf (EG_CHAR ch) const |
int | lastIndexOf (EG_CHAR ch, unsigned int fromIndex) const |
int | lastIndexOf (const JString &str) const |
int | lastIndexOf (const JString &str, unsigned int fromIndex) const |
unsigned int | length (void) const |
JString | replace (char oldChar, char newChar) const |
JString | replace (EG_CHAR oldChar, EG_CHAR newChar) const |
JString | replace (const JString &match, const JString &replacement) const |
bool | startsWith (const JString &prefix) const |
bool | startsWith (const JString &prefix, unsigned int offset) const |
JString | substring (unsigned int beginIndex) const |
JString | substring (unsigned int beginIndex, unsigned int endIndex) const |
JString | toLowerCase (void) const |
JString | toUpperCase (void) const |
int | toInt (void) const |
JString | trim (void) |
UTF8String | UTF8Representation (void) const |
ANSIString | ANSIRepresentation (void) const |
virtual JString & | toString (JString &retStr, bool withTypes=false) const |
virtual JString & | toString (JString &retStr, bool withTypes=false) const=0 |
JString | toString (bool withTypes=false) const |
Public Member Functions inherited from ToString | |
virtual | ~ToString (void) |
virtual JString | typeToString (void) const |
JString | toString (bool withTypes=false) const |
Related Functions | |
(Note that these are not member functions.) | |
template<typename _Elem , typename _Traits > | |
std::basic_ostream< _Elem, _Traits > & | operator<< (::std::basic_ostream< _Elem, _Traits > &stream, const JString &string) |
template<typename Etype > | |
JString | operator+ (const JString &Lsh, const Etype &Rsh) |
template<typename Etype > | |
JString | operator+ (const Etype &Lsh, const JString &Rsh) |
template<typename Etype > | |
bool | operator== (const JString &Lsh, const Etype &Rsh) |
template<typename Etype > | |
bool | operator== (const Etype &Lsh, const JString &Rsh) |
template<typename Etype > | |
bool | operator!= (const JString &Lsh, const Etype &Rsh) |
template<typename Etype > | |
bool | operator!= (const Etype &Lsh, const JString &Rsh) |
template<typename Etype > | |
bool | operator< (const JString &Lsh, const Etype &Rsh) |
template<typename Etype > | |
bool | operator< (const Etype &Lsh, const JString &Rsh) |
template<typename Etype > | |
bool | operator> (const JString &Lsh, const Etype &Rsh) |
template<typename Etype > | |
bool | operator> (const Etype &Lsh, const JString &Rsh) |
template<typename Etype > | |
bool | operator<= (const JString &Lsh, const Etype &Rsh) |
template<typename Etype > | |
bool | operator<= (const Etype &Lsh, const JString &Rsh) |
template<typename Etype > | |
bool | operator>= (const JString &Lsh, const Etype &Rsh) |
template<typename Etype > | |
bool | operator>= (const Etype &Lsh, const JString &Rsh) |
JString | operator+ (const JString &Lsh, const JString &Rsh) |
The JString class is a representation of Text strings, based on the String class from Sun Java.
This class is used to avoid dealing with char pointers/arrays directly, while staying independent from the String class in the Standard Template Library of C++, as some compilers do not implement the STL.
|
explicit |
Constructor: Creates an empty JString.
bufferlen | optional, let the string allocate memory for x characters |
JString | ( | const char * | Value | ) |
Copy-Constructor: Creates a new JString from a deep copy of the argument string.
Value | The UTF8 string to copy. |
JString | ( | const EG_CHAR * | Value | ) |
Copy-Constructor: Creates a new JString from a deep copy of the argument string.
Value | The UTF16 string to copy. |
JString | ( | const UTF8String & | Value | ) |
Copy-Constructor: Creates a new JString from a deep copy of the argument string.
Value | The UTF8String to copy. |
JString | ( | const ANSIString & | Value | ) |
Copy-Constructor: Creates a new JString from a deep copy of the argument string.
Value | :The ANSIString to copy. |
~JString | ( | void | ) |
Destructor.
operator=.
Makes a deep copy of its right operand into its left operand.
This overwrites old data in the left operand.
JString & operator= | ( | const char * | Rhs | ) |
operator=.
Makes a deep copy of its right operand (which is assumed to be encoded as UTF8) into its left operand.
This overwrites old data in the left operand.
JString & 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.
JString & 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.
JString & operator= | ( | const ANSIString & | Rhs | ) |
operator=.
Makes a deep copy of its right operand into its left operand.
This overwrites old data in the left operand.
JString & operator= | ( | char | aChar | ) |
operator=.
saves a string representation of its right operand in its left operand.
This overwrites old data in the left operand.
JString & operator= | ( | signed char | aChar | ) |
operator=.
saves a string representation of its right operand in its left operand.
This overwrites old data in the left operand.
JString & operator= | ( | unsigned char | aChar | ) |
operator=.
saves a string representation of its right operand in its left operand.
This overwrites old data in the left operand.
JString & operator= | ( | EG_CHAR | aWideChar | ) |
operator=.
saves a string representation of its right operand in its left operand.
This overwrites old data in the left operand.
JString & operator= | ( | short | aNum | ) |
operator=.
saves a string representation of its right operand in its left operand.
This overwrites old data in the left operand.
JString & operator= | ( | unsigned short | aNum | ) |
operator=.
saves a string representation of its right operand in its left operand.
This overwrites old data in the left operand.
JString & operator= | ( | int | aNum | ) |
operator=.
saves a string representation of its right operand in its left operand.
This overwrites old data in the left operand.
JString & operator= | ( | unsigned int | aNum | ) |
operator=.
saves a string representation of its right operand in its left operand.
This overwrites old data in the left operand.
JString & operator= | ( | long | aNum | ) |
operator=.
saves a string representation of its right operand in its left operand.
This overwrites old data in the left operand.
JString & operator= | ( | unsigned long | aNum | ) |
operator=.
saves a string representation of its right operand in its left operand.
This overwrites old data in the left operand.
JString & operator= | ( | long long | aNum | ) |
operator=.
saves a string representation of its right operand in its left operand.
This overwrites old data in the left operand.
JString & operator= | ( | unsigned long long | aNum | ) |
operator=.
saves a string representation of its right operand in its left operand.
This overwrites old data in the left operand.
JString & operator= | ( | float | aNum | ) |
operator=.
saves a string representation of its right operand in its left operand.
This overwrites old data in the left operand.
JString & operator= | ( | double | aNum | ) |
operator=.
saves a string representation of its right operand in its left operand.
This overwrites old data in the left operand.
JString & operator= | ( | long double | aNum | ) |
operator=.
saves a string representation of its right operand in its left operand.
This overwrites old data in the left operand.
JString & operator= | ( | bool | aBool | ) |
operator=.
saves a string representation of its right operand in its left operand.
This overwrites old data in the left operand.
operator const EG_CHAR * | ( | void | ) | const |
operator const EG_CHAR*.
Copies a pointer to the internal representation of the instance
operator+=.
Attaches its right operand to its left operand.
JString & operator+= | ( | const Etype & | Rhs | ) |
operator+=.
Attaches its right operand to its left operand.
bool operator== | ( | const JString & | Rhs | ) | const |
operator==.
bool operator!= | ( | const JString & | Rhs | ) | const |
operator!=.
bool operator< | ( | const JString & | Rhs | ) | const |
operator<. The return value indicates the lexicographic relation between the operands.
bool operator> | ( | const JString & | Rhs | ) | const |
operator>. The return value indicates the lexicographic relation between the operands.
bool operator<= | ( | const JString & | Rhs | ) | const |
operator<=. The return value indicates the lexicographic relation between the operands.
bool operator>= | ( | const JString & | Rhs | ) | const |
operator>=. The return value indicates the lexicographic relation between the operands.
EG_CHAR operator[] | ( | unsigned int | index | ) | const |
operator[]. Accesses the character of the string at the given index like in an array. This does not check for valid indexes and shows undefined behavior for invalid indexes
EG_CHAR & operator[] | ( | unsigned int | index | ) |
operator[]. Accesses the character of the string at the given index like in an array. This does not check for valid indexes and shows undefined behavior for invalid indexes
unsigned int capacity | ( | void | ) | const |
Returns the current capacity of the JString.
EG_CHAR charAt | ( | unsigned int | index | ) | const |
Returns the character of the JString at the passed index. This does not check for valid indexes and shows undefined behavior for invalid indexes!
index | the index of the element, that should be returned. Must not be bigger than the current size of the string! |
int compareTo | ( | const JString & | anotherString | ) | const |
Attaches the passed string to the string, the function is called for.
str | the string to attach |
const EG_CHAR * cstr | ( | void | ) | const |
JString deleteChars | ( | unsigned int | start, |
unsigned int | length | ||
) | const |
Deletes a substring inside a returned copy of the string. This does not affect the original string.
start | start of the substring |
length | length of the substring |
bool endsWith | ( | const JString & | suffix | ) | const |
Checks, if the JString, this function is called for, ends with the passed string.
suffix | the string to check for, if the other one ends with it |
void ensureCapacity | ( | unsigned int | minCapacity | ) |
Resizes the JString to the passed capacity, if its old capacity has been smaller. Most likely the whole JString has to be copied into new memory, so this is an expensive operation for huge JStrings. Call this function first, before you use concat()-function and/or +=operators a lot of times on this JString-instance, to avoid multiple expensive resizes through appending.
minCapacity | the new capacity for the JString in number of characters. |
bool equals | ( | const JString & | anotherString | ) | const |
Checks, if the JString, this function is called for, is equal to the passed string. This function is case-sensitive.
anotherString | the string to check for, if it is equal to other one |
bool equalsIgnoreCase | ( | const JString & | anotherString | ) | const |
Checks, if the JString, this function is called for, is, equal to the passed string. This function is not case-sensitive.
anotherString | the string to check for, if it is equal to other one |
int indexOf | ( | char | ch | ) | const |
Returns the index of the first occurrence of the parameter in the string, the function is called for. Searching begins at the first character of the string and goes forward, until the end of the string is reached.
ch | the character to search for |
int indexOf | ( | char | ch, |
unsigned int | fromIndex | ||
) | const |
Returns the index of the first occurrence of the parameter in the string, the function is called for. Searching begins at the passed index and goes forward, until the end of the string is reached.
ch | the character to search for |
fromIndex | the index, to begin the search from |
int indexOf | ( | EG_CHAR | ch | ) | const |
Returns the index of the first occurrence of the parameter in the string, the function is called for. Searching begins at the first character of the string and goes forward, until the end of the string is reached.
ch | the character to search for |
int indexOf | ( | EG_CHAR | ch, |
unsigned int | fromIndex | ||
) | const |
Returns the index of the first occurrence of the parameter in the string, the function is called for. Searching begins at the passed index and goes forward, until the end of the string is reached.
ch | the character to search for |
fromIndex | the index, to begin the search from |
int indexOf | ( | const JString & | str | ) | const |
Returns the index of the first occurrence of the parameter in the string, the function is called for. Searching begins at the first character of the string and goes forward, until the end of the string is reached.
str | the string to search for |
int indexOf | ( | const JString & | str, |
unsigned int | fromIndex | ||
) | const |
Returns the index of the first occurrence of the parameter in the string, the function is called for. Searching begins at the passed index and goes forward, until the end of the string is reached.
str | the string to search for |
fromIndex | the index, to begin the search from |
int lastIndexOf | ( | char | ch | ) | const |
Returns the index of the last occurrence of the parameter in the string, the function is called on. Searching begins at the last character of the string and goes forward, until the start of the string is reached.
ch | the character to search for |
int lastIndexOf | ( | char | ch, |
unsigned int | fromIndex | ||
) | const |
Returns the index of the last occurrence of the parameter in the string, the function is called on. Searching begins at the passed index and goes backward, until the start of the string is reached.
ch | the character to search for |
fromIndex | the index, to begin the search from |
int lastIndexOf | ( | EG_CHAR | ch | ) | const |
Returns the index of the last occurrence of the parameter in the string, the function is called on. Searching begins at the last character of the string and goes forward, until the start of the string is reached.
ch | the character to search for |
int lastIndexOf | ( | EG_CHAR | ch, |
unsigned int | fromIndex | ||
) | const |
Returns the index of the last occurrence of the parameter in the string, the function is called on. Searching begins at the passed index and goes backward, until the start of the string is reached.
ch | the character to search for |
fromIndex | the index, to begin the search from |
int lastIndexOf | ( | const JString & | str | ) | const |
Returns the index of the last occurrence of the parameter in the string, the function is called for. Searching begins at the last character of the string and goes forward, until the start of the string is reached.
str | the string to search for |
int lastIndexOf | ( | const JString & | str, |
unsigned int | fromIndex | ||
) | const |
Returns the index of the last occurrence of the parameter in the string, the function is called for. Searching begins at the passed index and goes backward, until the start of the string is reached.
str | the string to search for |
fromIndex | the index, to begin the search from |
unsigned int length | ( | void | ) | const |
JString replace | ( | char | oldChar, |
char | newChar | ||
) | const |
Searches the string for all occurrences of parameter 1 and replaces them with parameter 2. The result of the replacements is returned as a new instance, while the original string stays unchanged.
oldChar | the character to search for |
newChar | the character to replace the other one with |
JString replace | ( | EG_CHAR | oldChar, |
EG_CHAR | newChar | ||
) | const |
Searches the string for all occurrences of parameter 1 and replaces them with parameter 2. The result of the replacements is returned as a new instance, while the original string stays unchanged.
oldChar | the character to search for |
newChar | the character to replace oldChar with |
Searches the string for all occurrences of parameter 1 and replaces them with parameter 2. The result of the replacements is returned as a new instance, while the original string stays unchanged.
match | the substring to search for |
replacement | the string to replace match with |
bool startsWith | ( | const JString & | prefix | ) | const |
Checks, if the string, begins with the passed prefix
prefix | the prefix to search for |
bool startsWith | ( | const JString & | prefix, |
unsigned int | offset | ||
) | const |
Checks, if the substring of the string, starting at the passed index, begins with the passed prefix
prefix | the prefix to search for |
offset | start of the substring to check for |
JString substring | ( | unsigned int | beginIndex | ) | const |
Returns a substring of the string, beginning at the passed index
beginIndex | start of the substring to return |
JString substring | ( | unsigned int | beginIndex, |
unsigned int | endIndex | ||
) | const |
Returns a substring of the string, beginning at the first passed index and ending at the second one
beginIndex | index of the first character of the substring to return |
endIndex | index of the last character of the substring to return + 1 |
JString toLowerCase | ( | void | ) | const |
Copies the string and changes all upper case characters in the copy to lower case. This does not affect the original string.
JString toUpperCase | ( | void | ) | const |
Copies the string and changes all lower case characters in the copy to upper case. This does not affect the original string.
int toInt | ( | void | ) | const |
Converts the string into an integer. Conversion ends at the first character, that can not be interpreted as a number.
JString trim | ( | void | ) |
Removes all whitespaces at the start and end of the string. e.g.: L" Hello World! " -> "Hello World!"
UTF8String UTF8Representation | ( | void | ) | const |
Converts the string to UTF8 and returns the converted string. Use this, if you need to pass the JString to an API, which does not support wide strings. This is a non-lossy conversion.
ANSIString ANSIRepresentation | ( | void | ) | const |
Converts the string to ANSI, using the current locale, and returns the converted string. Use this, if you need to pass the JString to an API, which does not support Unicode. Attention: This is a lossy conversion, if any characters in the string are not supported by the current locale (which is most likely for characters not common in western languages)!
retStr | reference 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 |
withTypes | set to true, to include type information in the generated string |
Implements ToString.
toString |
retStr | reference 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 |
withTypes | set to true, to include type information in the generated string |
JString toString |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
withTypes | set to true, to include type information in the generated string |
|
related |
operator<<.
Used to print the JString to a std::wostream.
operator+.
Adds its right operand to its left operand and returns the result as a new JString.
operator+.
Adds its right operand to its left operand and returns the result as a new JString.
|
related |
operator==.
|
related |
operator==.
|
related |
operator!=.
|
related |
operator!=.
|
related |
operator<. The return value indicates the lexicographic relation between the operands.
|
related |
operator<. The return value indicates the lexicographic relation between the operands.
|
related |
operator>. The return value indicates the lexicographic relation between the operands.
|
related |
operator>. The return value indicates the lexicographic relation between the operands.
|
related |
operator<=. The return value indicates the lexicographic relation between the operands.
|
related |
operator<=. The return value indicates the lexicographic relation between the operands.
|
related |
operator>=. The return value indicates the lexicographic relation between the operands.
|
related |
operator>=. The return value indicates the lexicographic relation between the operands.