PixelLightAPI
.
|
#include <String.h>
Public Types | |
enum | EFormat { ASCII = 0, Unicode = 1, UTF8 = 2 } |
Internal string format. More... | |
Public Member Functions | |
String () | |
Default constructor. | |
PLCORE_API | String (char nValue) |
Character constructor. | |
PLCORE_API | String (wchar_t nValue) |
PLCORE_API | String (const char *pszString, bool bCopy=true, int nLength=-1) |
Constructor. | |
PLCORE_API | String (const wchar_t *pszString, bool bCopy=true, int nLength=-1) |
PLCORE_API | String (const String &sString) |
Copy constructor. | |
String (bool bValue) | |
Number constructor. | |
PLCORE_API | String (int nValue) |
String (int64 nValue) | |
String (uint8 nValue) | |
String (uint32 nValue) | |
String (uint64 nValue) | |
String (float fValue) | |
String (double fValue) | |
String (void *pValue) | |
Pointer constructor. | |
String (StringBuffer *pStringBuffer) | |
Internal copy constructor. | |
~String () | |
Destructor. | |
uint32 | GetLength () const |
Returns the length of the string. | |
EFormat | GetFormat () const |
Returns the internal string format. | |
PLCORE_API uint32 | GetNumOfBytes (EFormat nFormat) const |
Returns the number of bytes the string is using in a specified format (ASCII, Unicode, UTF8) | |
char | operator[] (uint32 nIndex) const |
Get a ASCII character of the string. | |
const char * | GetASCII () const |
Returns the character string as ASCII. | |
operator const char * () const | |
Returns the character string as ASCII. | |
const wchar_t * | GetUnicode () const |
Returns the character string as Unicode. | |
operator const wchar_t * () const | |
Returns the character string as Unicode. | |
String & | operator= (const String &sString) |
Copy operator. | |
PLCORE_API String & | operator= (const char *pszString) |
Copy operator. | |
PLCORE_API String & | operator= (const wchar_t *pszString) |
PLCORE_API String | operator+ (const String &sString) const |
Concatenate strings. | |
PLCORE_API String | operator+ (const char *pszString) const |
Concatenate strings. | |
PLCORE_API String | operator+ (const wchar_t *pszString) const |
PLCORE_API String & | operator+= (const String &sString) |
Concatenate strings. | |
PLCORE_API String & | operator+= (const char *pszString) |
Concatenate strings. | |
PLCORE_API String & | operator+= (const wchar_t *pszString) |
PLCORE_API bool | operator< (const String &sString) const |
Compares this string and the given one lexicographically. | |
PLCORE_API bool | operator< (const char *pszString) const |
Compares this string and the given one lexicographically. | |
PLCORE_API bool | operator< (const wchar_t *pszString) const |
PLCORE_API bool | operator> (const String &sString) const |
Compares this string and the given one lexicographically. | |
PLCORE_API bool | operator> (const char *pszString) const |
Compares this string and the given one lexicographically. | |
PLCORE_API bool | operator> (const wchar_t *pszString) const |
bool | operator== (const String &sString) const |
Compare operator (case sensitive) | |
bool | operator== (const char *pszString) const |
Compare operator (case sensitive) | |
bool | operator== (const wchar_t *pszString) const |
bool | operator!= (const String &sString) const |
Compare operator (case sensitive) | |
bool | operator!= (const char *pszString) const |
Compare operator (case sensitive) | |
bool | operator!= (const wchar_t *pszString) const |
PLCORE_API bool | Compare (const String &sString, uint32 nPos=0, int nCount=-1) const |
Compare function (case sensitive) | |
PLCORE_API bool | Compare (const char *pszString, uint32 nPos=0, int nCount=-1) const |
Compare function (case sensitive) | |
PLCORE_API bool | Compare (const wchar_t *pszString, uint32 nPos=0, int nCount=-1) const |
PLCORE_API bool | CompareNoCase (const String &sString, uint32 nPos=0, int nCount=-1) const |
Compare function (case insensitive) | |
PLCORE_API bool | CompareNoCase (const char *pszString, uint32 nPos=0, int nCount=-1) const |
Compare function (case insensitive) | |
PLCORE_API bool | CompareNoCase (const wchar_t *pszString, uint32 nPos=0, int nCount=-1) const |
bool | IsAlphabetic () const |
Determines whether the string is alphabetic or not. | |
bool | IsAlphaNumeric () const |
Determines whether the string is alpha-numeric or not. | |
bool | IsNumeric () const |
Determines whether the string is numeric. | |
PLCORE_API bool | IsSubstring (const String &sString) const |
Checks whether the given string is a substring of this string or not. | |
PLCORE_API bool | IsSubstring (const char *pszString) const |
Checks whether the given string is a substring of this string or not. | |
PLCORE_API bool | IsSubstring (const wchar_t *pszString) const |
PLCORE_API int | IndexOf (const String &sString, uint32 nPos=0) const |
Returns the index of the substring if contained in this string. | |
PLCORE_API int | IndexOf (const char *pszString, uint32 nPos=0) const |
Returns the index of the substring if contained in this string. | |
PLCORE_API int | IndexOf (const wchar_t *pszString, uint32 nPos=0) const |
PLCORE_API int | LastIndexOf (const String &sString, int nPos=-1) const |
Searches from backwards for the index of the substring within this string. | |
PLCORE_API int | LastIndexOf (const char *pszString, int nPos=-1) const |
Searches from backwards for the index of the substring within this string. | |
PLCORE_API int | LastIndexOf (const wchar_t *pszString, int nPos=-1) const |
PLCORE_API String | GetSubstring (uint32 nPos, int nCount=-1) const |
Get a substring from the string. | |
String & | ToLower () |
Change all characters to lower case. | |
String & | ToUpper () |
Change all characters to upper case. | |
PLCORE_API String & | Delete (uint32 nPos=0, int nCount=-1) |
Delete a substring. | |
String & | Insert (char nCharacter, uint32 nPos=0) |
Insert a character at a given location. | |
String & | Insert (wchar_t nCharacter, uint32 nPos=0) |
PLCORE_API String & | Insert (const String &sString, uint32 nPos=0, int nCount=-1) |
Insert a string at a given location. | |
PLCORE_API String & | Insert (const char *pszString, uint32 nPos=0, int nCount=-1) |
Insert a string at a given location. | |
PLCORE_API String & | Insert (const wchar_t *pszString, uint32 nPos=0, int nCount=-1) |
PLCORE_API String & | Copy (const char *pszString, int nCount=-1) |
Copies a string. | |
PLCORE_API String & | Copy (const wchar_t *pszString, int nCount=-1) |
PLCORE_API uint32 | Replace (char nOld, char nNew) |
Replaces all occurrences of a character by another character. | |
PLCORE_API uint32 | Replace (wchar_t nOld, wchar_t nNew) |
PLCORE_API uint32 | Replace (const String &sOld, const String &sNew) |
Replaces all occurrences of a substring by another string. | |
PLCORE_API uint32 | Replace (const char *pszOld, const char *pszNew) |
Replaces all occurrences of a substring by another string. | |
PLCORE_API uint32 | Replace (const wchar_t *pszOld, const wchar_t *pszNew) |
PLCORE_API bool | SetCharacter (uint32 nIndex, char nCharacter) |
Sets a character at the given index. | |
PLCORE_API bool | SetCharacter (uint32 nIndex, wchar_t nCharacter) |
String & | TrimLeading () |
Removes all whitespace (tabs and spaces) at the beginning of the string. | |
String & | TrimTrailing () |
Removes all whitespace (tabs and spaces) at the end of the string. | |
PLCORE_API String & | Trim () |
Removes all whitespace (tabs and spaces) at the beginning and the end of the string. | |
String & | RemoveLineEndings () |
Removes line endings ("\r" or "\n") at the end of the string. | |
const char * | GetUTF8 () const |
Returns the character string as UTF8. | |
PLCORE_API bool | IsValidInteger () const |
PLCORE_API bool | IsValidFloat () const |
PLCORE_API bool | GetBool () const |
PLCORE_API char | GetChar () const |
PLCORE_API wchar_t | GetWideChar () const |
PLCORE_API int | GetInt () const |
PLCORE_API int64 | GetInt64 () const |
PLCORE_API uint8 | GetUInt8 () const |
PLCORE_API uint16 | GetUInt16 () const |
PLCORE_API uint32 | GetUInt32 () const |
PLCORE_API uint64 | GetUInt64 () const |
uint_ptr | GetUIntPtr () const |
PLCORE_API float | GetFloat () const |
PLCORE_API double | GetDouble () const |
String & | operator= (bool bValue) |
PLCORE_API String & | operator= (char nValue) |
PLCORE_API String & | operator= (wchar_t nValue) |
PLCORE_API String & | operator= (int nValue) |
PLCORE_API String & | operator= (int64 nValue) |
PLCORE_API String & | operator= (uint8 nValue) |
PLCORE_API String & | operator= (uint32 nValue) |
PLCORE_API String & | operator= (uint64 nValue) |
PLCORE_API String & | operator= (float fValue) |
PLCORE_API String & | operator= (double dValue) |
PLCORE_API String | operator+ (bool bValue) const |
PLCORE_API String | operator+ (char nValue) const |
PLCORE_API String | operator+ (wchar_t nValue) const |
PLCORE_API String | operator+ (int nValue) const |
String | operator+ (int64 nValue) const |
String | operator+ (uint8 nValue) const |
String | operator+ (uint32 nValue) const |
String | operator+ (uint64 nValue) const |
String | operator+ (float fValue) const |
String | operator+ (double dValue) const |
PLCORE_API String & | operator+= (bool bValue) |
PLCORE_API String & | operator+= (char nValue) |
PLCORE_API String & | operator+= (wchar_t nValue) |
String & | operator+= (int nValue) |
String & | operator+= (int64 nValue) |
String & | operator+= (uint8 nValue) |
String & | operator+= (uint32 nValue) |
String & | operator+= (uint64 nValue) |
String & | operator+= (float fValue) |
String & | operator+= (double dValue) |
Static Public Member Functions | |
static PLCORE_API String | Format (const char *pszFormat,...) |
Creates a new formatted string (like sprintf) | |
static PLCORE_API String | Format (const wchar_t *pszFormat,...) |
static PLCORE_API String | FromUTF8 (const char *pszUTF8, int nLength=-1, uint32 nNumOfBytes=0) |
Sets the character string as UTF8. | |
Friends | |
PLCORE_API friend String | operator+ (const char *pszString, const String &sString) |
Concatenate strings. | |
PLCORE_API friend String | operator+ (const wchar_t *pszString, const String &sString) |
PLCORE_API friend String | operator+ (bool bValue, const String &sString) |
PLCORE_API friend String | operator+ (char nValue, const String &sString) |
PLCORE_API friend String | operator+ (wchar_t nValue, const String &sString) |
String | operator+ (int nValue, const String &sString) |
String | operator+ (int64 nValue, const String &sString) |
String | operator+ (uint8 nValue, const String &sString) |
String | operator+ (uint32 nValue, const String &sString) |
String | operator+ (uint64 nValue, const String &sString) |
String | operator+ (float fValue, const String &sString) |
String | operator+ (double dValue, const String &sString) |
String class.
As long as you don't save your source codes in an UTF8 format you can also use the ASCII extension Ansi, meaning characters between 128-256. But with an UTF8 format, this may cause serious problems and you should use Unicode instead ASCII for characters above 128 (using codepage based ASCII is not recommended) to avoid encoding troubles!
For best compatibility with other string techniques, this class is using pointers instead of [] references, so a null pointer is a valid parameter.
* Usage example: * String sS; // Test string instance * sS = "Mini"; // Set string to 'Mini' as ASCII * sS += " Me"; // Concatenate 'Me' (ASCII) to string * const char *pS = sS.GetASCII(); // Get pointer to ASCII string content * const char *pS = sS; // Get pointer to ASCII string content (same as above) * sS = L"Mini"; // Set string to 'Mini' as Unicode * sS = L"\u65e5\u672c\u8a9e"; // Set string to 'nihon' (= Japanese) as Unicode * sS = String::FromUTF8("Mini"); // Set string to 'Mini' as UTF8 *
Internal string format.
PLCore::String::String | ( | ) | [inline] |
Default constructor.
PLCORE_API PLCore::String::String | ( | char | nValue | ) |
Character constructor.
[in] | nValue | Single character to put into the string |
PLCORE_API PLCore::String::String | ( | wchar_t | nValue | ) |
PLCORE_API PLCore::String::String | ( | const char * | pszString, |
bool | bCopy = true , |
||
int | nLength = -1 |
||
) |
[in] | pszString | String to save, can be a null pointer |
[in] | bCopy | Copy the given string or use this one directly? Do ONLY set bCopy to 'false' if you are sure there can't go anything wrong - the string class will take over control of the string buffer and also destroy it |
[in] | nLength | Length of the given string, (excluding the terminating zero) if negative, the length is calculated automatically |
PLCORE_API PLCore::String::String | ( | const wchar_t * | pszString, |
bool | bCopy = true , |
||
int | nLength = -1 |
||
) |
PLCORE_API PLCore::String::String | ( | const String & | sString | ) |
Copy constructor.
[in] | sString | String |
PLCore::String::String | ( | bool | bValue | ) | [inline] |
Number constructor.
[in] | nValue | Number to put into the string |
PLCORE_API PLCore::String::String | ( | int | nValue | ) |
PLCore::String::String | ( | int64 | nValue | ) | [inline] |
PLCore::String::String | ( | uint8 | nValue | ) | [inline] |
PLCore::String::String | ( | uint32 | nValue | ) | [inline] |
PLCore::String::String | ( | uint64 | nValue | ) | [inline] |
PLCore::String::String | ( | float | fValue | ) | [inline] |
PLCore::String::String | ( | double | fValue | ) | [inline] |
PLCore::String::String | ( | void * | pValue | ) | [inline] |
Pointer constructor.
[in] | pValue | Pointer to put into the string |
PLCore::String::String | ( | StringBuffer * | pStringBuffer | ) |
PLCore::String::~String | ( | ) | [inline] |
Destructor.
static PLCORE_API String PLCore::String::Format | ( | const char * | pszFormat, |
... | |||
) | [static] |
Creates a new formatted string (like sprintf)
[in] | pszFormat | The format string ... -> The variable arguments (can be a null pointer) |
static PLCORE_API String PLCore::String::Format | ( | const wchar_t * | pszFormat, |
... | |||
) | [static] |
static PLCORE_API String PLCore::String::FromUTF8 | ( | const char * | pszUTF8, |
int | nLength = -1 , |
||
uint32 | nNumOfBytes = 0 |
||
) | [static] |
Sets the character string as UTF8.
[in] | pszUTF8 | Pointer to the character string as UTF8, can be a null pointer |
[in] | nLength | Length of the given string, (excluding the terminating zero) if negative, the length is calculated automatically |
[in] | nNumOfBytes | Number of bytes of the string buffer (excluding the terminating zero, MUST be valid if not 0!) |
uint32 PLCore::String::GetLength | ( | ) | const [inline] |
Returns the length of the string.
String::EFormat PLCore::String::GetFormat | ( | ) | const [inline] |
Returns the internal string format.
PLCORE_API uint32 PLCore::String::GetNumOfBytes | ( | EFormat | nFormat | ) | const |
Returns the number of bytes the string is using in a specified format (ASCII, Unicode, UTF8)
[in] | nFormat | The internal string format |
char PLCore::String::operator[] | ( | uint32 | nIndex | ) | const [inline] |
Get a ASCII character of the string.
[in] | nIndex | Position of the ASCII character to retrieve |
const char * PLCore::String::GetASCII | ( | ) | const [inline] |
Returns the character string as ASCII.
PLCore::String::operator const char * | ( | ) | const [inline] |
Returns the character string as ASCII.
Returns the ASCII character string.
const wchar_t * PLCore::String::GetUnicode | ( | ) | const [inline] |
Returns the character string as Unicode.
PLCore::String::operator const wchar_t * | ( | ) | const [inline] |
Returns the character string as Unicode.
Returns the Unicode character string.
PLCORE_API String& PLCore::String::operator= | ( | const char * | pszString | ) |
Copy operator.
[in] | pszString | String to copy, can be a null pointer |
PLCORE_API String& PLCore::String::operator= | ( | const wchar_t * | pszString | ) |
PLCORE_API String PLCore::String::operator+ | ( | const char * | pszString | ) | const |
Concatenate strings.
[in] | pszString | String to add, can be a null pointer |
PLCORE_API String PLCore::String::operator+ | ( | const wchar_t * | pszString | ) | const |
PLCORE_API String& PLCore::String::operator+= | ( | const char * | pszString | ) |
Concatenate strings.
[in] | pszString | String to add, can be a null pointer |
PLCORE_API String& PLCore::String::operator+= | ( | const wchar_t * | pszString | ) |
PLCORE_API bool PLCore::String::operator< | ( | const String & | sString | ) | const |
Compares this string and the given one lexicographically.
[in] | sString | String to compare with |
PLCORE_API bool PLCore::String::operator< | ( | const char * | pszString | ) | const |
Compares this string and the given one lexicographically.
[in] | pszString | String to compare with, can be a null pointer |
PLCORE_API bool PLCore::String::operator< | ( | const wchar_t * | pszString | ) | const |
PLCORE_API bool PLCore::String::operator> | ( | const String & | sString | ) | const |
Compares this string and the given one lexicographically.
[in] | sString | String to compare with |
PLCORE_API bool PLCore::String::operator> | ( | const char * | pszString | ) | const |
Compares this string and the given one lexicographically.
[in] | pszString | String to compare with, can be a null pointer |
PLCORE_API bool PLCore::String::operator> | ( | const wchar_t * | pszString | ) | const |
bool PLCore::String::operator== | ( | const String & | sString | ) | const [inline] |
Compare operator (case sensitive)
[in] | sString | String to compare with |
bool PLCore::String::operator== | ( | const char * | pszString | ) | const [inline] |
Compare operator (case sensitive)
[in] | pszString | String to compare with, can be a null pointer |
bool PLCore::String::operator== | ( | const wchar_t * | pszString | ) | const [inline] |
bool PLCore::String::operator!= | ( | const String & | sString | ) | const [inline] |
Compare operator (case sensitive)
[in] | sString | String to compare with |
bool PLCore::String::operator!= | ( | const char * | pszString | ) | const [inline] |
Compare operator (case sensitive)
[in] | pszString | String to compare with, can be a null pointer |
bool PLCore::String::operator!= | ( | const wchar_t * | pszString | ) | const [inline] |
PLCORE_API bool PLCore::String::Compare | ( | const String & | sString, |
uint32 | nPos = 0 , |
||
int | nCount = -1 |
||
) | const |
Compare function (case sensitive)
[in] | sString | String to compare with |
[in] | nPos | Start position within this string |
[in] | nCount | Number of characters to compare, if negative compare all characters, if 0 the result is "true" |
PLCORE_API bool PLCore::String::Compare | ( | const char * | pszString, |
uint32 | nPos = 0 , |
||
int | nCount = -1 |
||
) | const |
Compare function (case sensitive)
[in] | pszString | String to compare with, can be a null pointer |
[in] | nPos | Start position within this string |
[in] | nCount | Number of characters to compare, if negative compare all characters, if 0 the result is "true" |
PLCORE_API bool PLCore::String::Compare | ( | const wchar_t * | pszString, |
uint32 | nPos = 0 , |
||
int | nCount = -1 |
||
) | const |
PLCORE_API bool PLCore::String::CompareNoCase | ( | const String & | sString, |
uint32 | nPos = 0 , |
||
int | nCount = -1 |
||
) | const |
Compare function (case insensitive)
[in] | sString | String to compare with |
[in] | nPos | Start position within this string |
[in] | nCount | Number of characters to compare, if negative compare all characters, if 0 the result is "true" |
PLCORE_API bool PLCore::String::CompareNoCase | ( | const char * | pszString, |
uint32 | nPos = 0 , |
||
int | nCount = -1 |
||
) | const |
Compare function (case insensitive)
[in] | pszString | String to compare with, can be a null pointer |
[in] | nPos | Start position within this string |
[in] | nCount | Number of characters to compare, if negative compare all characters, if 0 the result is "true" |
PLCORE_API bool PLCore::String::CompareNoCase | ( | const wchar_t * | pszString, |
uint32 | nPos = 0 , |
||
int | nCount = -1 |
||
) | const |
bool PLCore::String::IsAlphabetic | ( | ) | const [inline] |
Determines whether the string is alphabetic or not.
bool PLCore::String::IsAlphaNumeric | ( | ) | const [inline] |
Determines whether the string is alpha-numeric or not.
bool PLCore::String::IsNumeric | ( | ) | const [inline] |
Determines whether the string is numeric.
Determines whether the string is numeric or not.
PLCORE_API bool PLCore::String::IsSubstring | ( | const String & | sString | ) | const |
Checks whether the given string is a substring of this string or not.
[in] | sString | String to check, if empty string, 'true' will be returned |
PLCORE_API bool PLCore::String::IsSubstring | ( | const char * | pszString | ) | const |
Checks whether the given string is a substring of this string or not.
[in] | pszString | String to check, if a null pointer or empty, 'true' will be returned |
PLCORE_API bool PLCore::String::IsSubstring | ( | const wchar_t * | pszString | ) | const |
PLCORE_API int PLCore::String::IndexOf | ( | const String & | sString, |
uint32 | nPos = 0 |
||
) | const |
Returns the index of the substring if contained in this string.
[in] | sString | String to check, if empty string, < 0 will be returned |
[in] | nPos | Start position within this string |
PLCORE_API int PLCore::String::IndexOf | ( | const char * | pszString, |
uint32 | nPos = 0 |
||
) | const |
Returns the index of the substring if contained in this string.
[in] | pszString | String to check, if a null pointer or empty, < 0 will be returned |
[in] | nPos | Start position within this string |
PLCORE_API int PLCore::String::IndexOf | ( | const wchar_t * | pszString, |
uint32 | nPos = 0 |
||
) | const |
PLCORE_API int PLCore::String::LastIndexOf | ( | const String & | sString, |
int | nPos = -1 |
||
) | const |
Searches from backwards for the index of the substring within this string.
[in] | sString | String to check, if empty string, < 0 will be returned |
[in] | nPos | Start position within this string, if < 0 start at the last character |
PLCORE_API int PLCore::String::LastIndexOf | ( | const char * | pszString, |
int | nPos = -1 |
||
) | const |
Searches from backwards for the index of the substring within this string.
[in] | pszString | String to check, if a null pointer or empty, < 0 will be returned |
[in] | nPos | Start position within this string, if < 0 start at the last character |
PLCORE_API int PLCore::String::LastIndexOf | ( | const wchar_t * | pszString, |
int | nPos = -1 |
||
) | const |
PLCORE_API String PLCore::String::GetSubstring | ( | uint32 | nPos, |
int | nCount = -1 |
||
) | const |
Get a substring from the string.
[in] | nPos | Start position |
[in] | nCount | Number of characters to copy, negative for everything from nPos to the end of the string |
String & PLCore::String::ToLower | ( | ) | [inline] |
Change all characters to lower case.
String & PLCore::String::ToUpper | ( | ) | [inline] |
Change all characters to upper case.
PLCORE_API String& PLCore::String::Delete | ( | uint32 | nPos = 0 , |
int | nCount = -1 |
||
) |
Delete a substring.
[in] | nPos | Start position of deletion |
[in] | nCount | Number of characters to delete, if negative delete all characters |
String & PLCore::String::Insert | ( | char | nCharacter, |
uint32 | nPos = 0 |
||
) | [inline] |
Insert a character at a given location.
[in] | nCharacter | Character to insert |
[in] | nPos | Position at which to insert the character |
String & PLCore::String::Insert | ( | wchar_t | nCharacter, |
uint32 | nPos = 0 |
||
) | [inline] |
PLCORE_API String& PLCore::String::Insert | ( | const String & | sString, |
uint32 | nPos = 0 , |
||
int | nCount = -1 |
||
) |
Insert a string at a given location.
[in] | sString | String to insert |
[in] | nPos | Position at which to insert the string |
[in] | nCount | Number of characters to add, if negative insert the whole string |
PLCORE_API String& PLCore::String::Insert | ( | const char * | pszString, |
uint32 | nPos = 0 , |
||
int | nCount = -1 |
||
) |
Insert a string at a given location.
[in] | pszString | String to insert, can be a null pointer |
[in] | nPos | Position at which to insert the string |
[in] | nCount | Number of characters to add, if negative insert the whole string |
PLCORE_API String& PLCore::String::Insert | ( | const wchar_t * | pszString, |
uint32 | nPos = 0 , |
||
int | nCount = -1 |
||
) |
PLCORE_API String& PLCore::String::Copy | ( | const char * | pszString, |
int | nCount = -1 |
||
) |
Copies a string.
[in] | pszString | String to copy, can be a null pointer |
[in] | nCount | Number of characters to copy, if negative copy the whole string |
PLCORE_API String& PLCore::String::Copy | ( | const wchar_t * | pszString, |
int | nCount = -1 |
||
) |
PLCORE_API uint32 PLCore::String::Replace | ( | char | nOld, |
char | nNew | ||
) |
Replaces all occurrences of a character by another character.
[in] | nOld | Character to be replaced |
[in] | nNew | Character to replace with |
PLCORE_API uint32 PLCore::String::Replace | ( | wchar_t | nOld, |
wchar_t | nNew | ||
) |
PLCORE_API uint32 PLCore::String::Replace | ( | const String & | sOld, |
const String & | sNew | ||
) |
Replaces all occurrences of a substring by another string.
[in] | sOld | Substring to be replaced |
[in] | sNew | String to replace with |
PLCORE_API uint32 PLCore::String::Replace | ( | const char * | pszOld, |
const char * | pszNew | ||
) |
Replaces all occurrences of a substring by another string.
[in] | pszOld | Substring to be replaced, can be a null pointer |
[in] | pszNew | String to replace with, can be a null pointer |
PLCORE_API uint32 PLCore::String::Replace | ( | const wchar_t * | pszOld, |
const wchar_t * | pszNew | ||
) |
PLCORE_API bool PLCore::String::SetCharacter | ( | uint32 | nIndex, |
char | nCharacter | ||
) |
Sets a character at the given index.
[in] | nIndex | Character index |
[in] | nCharacter | Character to set at the given index |
PLCORE_API bool PLCore::String::SetCharacter | ( | uint32 | nIndex, |
wchar_t | nCharacter | ||
) |
String & PLCore::String::TrimLeading | ( | ) | [inline] |
Removes all whitespace (tabs and spaces) at the beginning of the string.
String & PLCore::String::TrimTrailing | ( | ) | [inline] |
Removes all whitespace (tabs and spaces) at the end of the string.
PLCORE_API String& PLCore::String::Trim | ( | ) |
Removes all whitespace (tabs and spaces) at the beginning and the end of the string.
String & PLCore::String::RemoveLineEndings | ( | ) | [inline] |
Removes line endings ("\r" or "\n") at the end of the string.
const char * PLCore::String::GetUTF8 | ( | ) | const [inline] |
Returns the character string as UTF8.
PLCORE_API bool PLCore::String::IsValidInteger | ( | ) | const |
PLCORE_API bool PLCore::String::IsValidFloat | ( | ) | const |
PLCORE_API bool PLCore::String::GetBool | ( | ) | const |
PLCORE_API char PLCore::String::GetChar | ( | ) | const |
PLCORE_API wchar_t PLCore::String::GetWideChar | ( | ) | const |
PLCORE_API int PLCore::String::GetInt | ( | ) | const |
PLCORE_API int64 PLCore::String::GetInt64 | ( | ) | const |
PLCORE_API uint8 PLCore::String::GetUInt8 | ( | ) | const |
PLCORE_API uint16 PLCore::String::GetUInt16 | ( | ) | const |
PLCORE_API uint32 PLCore::String::GetUInt32 | ( | ) | const |
PLCORE_API uint64 PLCore::String::GetUInt64 | ( | ) | const |
uint_ptr PLCore::String::GetUIntPtr | ( | ) | const [inline] |
PLCORE_API float PLCore::String::GetFloat | ( | ) | const |
PLCORE_API double PLCore::String::GetDouble | ( | ) | const |
String & PLCore::String::operator= | ( | bool | bValue | ) | [inline] |
PLCORE_API String& PLCore::String::operator= | ( | char | nValue | ) |
PLCORE_API String& PLCore::String::operator= | ( | wchar_t | nValue | ) |
PLCORE_API String& PLCore::String::operator= | ( | int | nValue | ) |
String & PLCore::String::operator= | ( | int64 | nValue | ) | [inline] |
String & PLCore::String::operator= | ( | uint8 | nValue | ) | [inline] |
String & PLCore::String::operator= | ( | uint32 | nValue | ) | [inline] |
String & PLCore::String::operator= | ( | uint64 | nValue | ) | [inline] |
String & PLCore::String::operator= | ( | float | fValue | ) | [inline] |
String & PLCore::String::operator= | ( | double | dValue | ) | [inline] |
PLCORE_API String PLCore::String::operator+ | ( | bool | bValue | ) | const |
PLCORE_API String PLCore::String::operator+ | ( | char | nValue | ) | const |
PLCORE_API String PLCore::String::operator+ | ( | wchar_t | nValue | ) | const |
String PLCore::String::operator+ | ( | int | nValue | ) | const [inline] |
String PLCore::String::operator+ | ( | int64 | nValue | ) | const [inline] |
String PLCore::String::operator+ | ( | uint8 | nValue | ) | const [inline] |
String PLCore::String::operator+ | ( | uint32 | nValue | ) | const [inline] |
String PLCore::String::operator+ | ( | uint64 | nValue | ) | const [inline] |
String PLCore::String::operator+ | ( | float | fValue | ) | const [inline] |
String PLCore::String::operator+ | ( | double | dValue | ) | const [inline] |
PLCORE_API String& PLCore::String::operator+= | ( | bool | bValue | ) |
PLCORE_API String& PLCore::String::operator+= | ( | char | nValue | ) |
PLCORE_API String& PLCore::String::operator+= | ( | wchar_t | nValue | ) |
String & PLCore::String::operator+= | ( | int | nValue | ) | [inline] |
String & PLCore::String::operator+= | ( | int64 | nValue | ) | [inline] |
String & PLCore::String::operator+= | ( | uint8 | nValue | ) | [inline] |
String & PLCore::String::operator+= | ( | uint32 | nValue | ) | [inline] |
String & PLCore::String::operator+= | ( | uint64 | nValue | ) | [inline] |
String & PLCore::String::operator+= | ( | float | fValue | ) | [inline] |
String & PLCore::String::operator+= | ( | double | dValue | ) | [inline] |
|