String related functions. More...
Functions | |
| string | GetUpper (const string &str) |
| Get Uppercase of given string. More... | |
| bool | StringMatch (const char *a, const char *b) |
| Match char ignore cases. More... | |
| bool | StringMatch (const string &text1, const string &text2) |
| Match Strings in UPPERCASE manner. More... | |
| void | TrimSpaces (string &str) |
| Trim Both leading and trailing spaces. More... | |
| string & | Trim (string &s) |
| Trim given string's heading and tailing by "<space>,\n,\t,\r". More... | |
| vector< string > | SplitString (const string &item) |
| Splits the given string by spaces. More... | |
| vector< string > | SplitString (const string &item, char delimiter) |
| Splits the given string based on the given delimiter. More... | |
| template<typename T > | |
| string | ValueToString (const T &val) |
| Convert value to string. More... | |
| void | CopyStringMap (const STRING_MAP &in_opts, STRING_MAP &out_opts) |
| Copy string map. | |
| void | UpdateStringMap (STRING_MAP &opts, const string &key, const string &value) |
| Add or modify element in a string map. | |
| string | itoa (vint number) |
| Convert a signed integer to a string. More... | |
| wstring | itow (vint number) |
| Convert a signed integer to an unicode string. More... | |
| string | i64toa (vint64_t number) |
| Convert a 64-bits signed integer to a string. More... | |
| wstring | i64tow (vint64_t number) |
| Convert a 64-bits signed integer to an unicode string. More... | |
| string | utoa (vuint number) |
| Convert an unsigned integer to a string. More... | |
| wstring | utow (vuint number) |
| Convert an unsigned integer to an unicode string. More... | |
| string | u64toa (vuint64_t number) |
| Convert a 64-bits unsigned integer to a string. More... | |
| wstring | u64tow (vuint64_t number) |
| Convert a 64-bits unsigned integer to an unicode string. More... | |
| string | ftoa (double number) |
| Convert a 64-bits floating pointer number to a string. More... | |
| wstring | ftow (double number) |
| Convert a 64-bits floating pointer number to an unicode string. More... | |
| string | wtoa (const wstring &wstr) |
| Convert an unicode string to an Ansi string. More... | |
| wstring | atow (const string &astr) |
| Convert an Ansi string to an unicode string. More... | |
| template<typename T > | |
| bool | SplitStringForValues (const string &items, const char delimiter, vector< T > &values) |
| Get numeric values by splitting the given string based on the given delimiter. | |
| vint | IsInt (const string &num_str, bool &success) |
| Check if a string is an signed integer, if ture, return the converted integer. More... | |
| vint | IsInt (const wstring &num_str, bool &success) |
| Check if an unicode string is an signed integer. More... | |
| vint64_t | IsInt64 (const string &num_str, bool &success) |
| Convert a string to an signed 64-bits integer. More... | |
| vint64_t | IsInt64 (const wstring &num_str, bool &success) |
| Convert an unicode string to an signed 64-bits integer. More... | |
| vuint | IsUInt (const string &num_str, bool &success) |
| Convert an Ansi string to an unsigned integer. More... | |
| vuint | IsUInt (const wstring &num_str, bool &success) |
| Convert an Unicode string to an unsigned integer. More... | |
| vuint64_t | IsUInt64 (const string &num_str, bool &success) |
| Convert an Ansi string to a 64-bits unsigned integer. More... | |
| vuint64_t | IsUInt64 (const wstring &num_str, bool &success) |
| Convert an Unicode string to a 64-bits unsigned integer. More... | |
| double | IsDouble (const string &num_str, bool &success) |
| Convert an Ansi string to 64-bits floating point number. More... | |
| double | IsDouble (const wstring &num_str, bool &success) |
| Convert an Ansi string to 64-bits floating point number. More... | |
| template<typename STRING_T > | |
| bool | IsNumber (const STRING_T &num_str) |
| Check if a string is a number (integer or float) | |
| template<typename STRING_T > | |
| vint | ToInt (const STRING_T &num_str) |
| Convert an Ansi or Unicode string to an integer. | |
| template<typename STRING_T > | |
| vint64_t | ToInt64 (const STRING_T &num_str) |
| Convert an Ansi or Unicode string to an signed 64-bits integer. | |
| template<typename STRING_T > | |
| vuint | ToUInt (const STRING_T &num_str) |
| Convert an Ansi or Unicode string to an unsigned integer. | |
| template<typename STRING_T > | |
| vuint64_t | ToUInt64 (const STRING_T &num_str) |
| Convert an Ansi or Unicode string to a 64-bits unsigned integer. | |
| template<typename STRING_T > | |
| double | ToDouble (const STRING_T &num_str) |
| Convert an Ansi or Unicode string to a 64-bits floating point number. | |
String related functions.
| wstring ccgl::utils_string::atow | ( | const string & | astr | ) |
Convert an Ansi string to an unicode string.
| [in] | astr | The Ansi string to convert |
| string ccgl::utils_string::ftoa | ( | double | number | ) |
Convert a 64-bits floating pointer number to a string.
| [in] | number | The number to convert |
| wstring ccgl::utils_string::ftow | ( | double | number | ) |
Convert a 64-bits floating pointer number to an unicode string.
| [in] | number | The number to convert |
| string ccgl::utils_string::GetUpper | ( | const string & | str | ) |
Get Uppercase of given string.
| [in] | str |
| string ccgl::utils_string::i64toa | ( | vint64_t | number | ) |
Convert a 64-bits signed integer to a string.
| [in] | number | The number to convert |
| wstring ccgl::utils_string::i64tow | ( | vint64_t | number | ) |
Convert a 64-bits signed integer to an unicode string.
| [in] | number | The number to convert |
| double ccgl::utils_string::IsDouble | ( | const string & | num_str, |
| bool & | success | ||
| ) |
Convert an Ansi string to 64-bits floating point number.
| [in] | num_str | The string to convert |
| [out] | success | Return true if succeed |
| double ccgl::utils_string::IsDouble | ( | const wstring & | num_str, |
| bool & | success | ||
| ) |
Convert an Ansi string to 64-bits floating point number.
| [in] | num_str | The string to convert |
| [out] | success | Return true if succeed |
| vint ccgl::utils_string::IsInt | ( | const string & | num_str, |
| bool & | success | ||
| ) |
Check if a string is an signed integer, if ture, return the converted integer.
| [in] | num_str | The string to convert |
| [out] | success | Return true if succeed |
| vint ccgl::utils_string::IsInt | ( | const wstring & | num_str, |
| bool & | success | ||
| ) |
Check if an unicode string is an signed integer.
| [in] | num_str | The string to convert |
| [out] | success | Return true if succeed |
| vint64_t ccgl::utils_string::IsInt64 | ( | const string & | num_str, |
| bool & | success | ||
| ) |
Convert a string to an signed 64-bits integer.
| [in] | num_str | The string to convert |
| [out] | success | Return true if succeed |
| vint64_t ccgl::utils_string::IsInt64 | ( | const wstring & | num_str, |
| bool & | success | ||
| ) |
Convert an unicode string to an signed 64-bits integer.
| [in] | num_str | The string to convert |
| [out] | success | Return true if succeed |
| vuint ccgl::utils_string::IsUInt | ( | const string & | num_str, |
| bool & | success | ||
| ) |
Convert an Ansi string to an unsigned integer.
| [in] | num_str | The string to convert |
| [out] | success | Return true if succeed |
| vuint ccgl::utils_string::IsUInt | ( | const wstring & | num_str, |
| bool & | success | ||
| ) |
Convert an Unicode string to an unsigned integer.
| [in] | num_str | The string to convert |
| [out] | success | Return true if succeed |
| vuint64_t ccgl::utils_string::IsUInt64 | ( | const string & | num_str, |
| bool & | success | ||
| ) |
Convert an Ansi string to a 64-bits unsigned integer.
| [in] | num_str | The string to convert |
| [out] | success | Return true if succeed |
| vuint64_t ccgl::utils_string::IsUInt64 | ( | const wstring & | num_str, |
| bool & | success | ||
| ) |
Convert an Unicode string to a 64-bits unsigned integer.
| [in] | num_str | The string to convert |
| [out] | success | Return true if succeed |
| string ccgl::utils_string::itoa | ( | vint | number | ) |
Convert a signed integer to a string.
| [in] | number | The number to convert |
| wstring ccgl::utils_string::itow | ( | vint | number | ) |
Convert a signed integer to an unicode string.
| [in] | number | The number to convert |
| vector< string > ccgl::utils_string::SplitString | ( | const string & | item | ) |
Splits the given string by spaces.
| [in] | item | string information |
| vector< string > ccgl::utils_string::SplitString | ( | const string & | item, |
| char | delimiter | ||
| ) |
Splits the given string based on the given delimiter.
| [in] | item | string information |
| [in] | delimiter | char |
| bool ccgl::utils_string::StringMatch | ( | const char * | a, |
| const char * | b | ||
| ) |
| bool ccgl::utils_string::StringMatch | ( | const string & | text1, |
| const string & | text2 | ||
| ) |
Match Strings in UPPERCASE manner.
| [in] | text1,text2 |
| string & ccgl::utils_string::Trim | ( | string & | s | ) |
Trim given string's heading and tailing by "<space>,\n,\t,\r".
| [in] | s | string information |
| void ccgl::utils_string::TrimSpaces | ( | string & | str | ) |
| string ccgl::utils_string::u64toa | ( | vuint64_t | number | ) |
Convert a 64-bits unsigned integer to a string.
| [in] | number | The number to convert |
| wstring ccgl::utils_string::u64tow | ( | vuint64_t | number | ) |
Convert a 64-bits unsigned integer to an unicode string.
| [in] | number | The number to convert |
| string ccgl::utils_string::utoa | ( | vuint | number | ) |
Convert an unsigned integer to a string.
| [in] | number | The number to convert |
| wstring ccgl::utils_string::utow | ( | vuint | number | ) |
Convert an unsigned integer to an unicode string.
| [in] | number | The number to convert |
| string ccgl::utils_string::ValueToString | ( | const T & | val | ) |
Convert value to string.
| [in] | val | value, e.g., a int, or float |
| string ccgl::utils_string::wtoa | ( | const wstring & | wstr | ) |
Convert an unicode string to an Ansi string.
| [in] | wstr | The unicode string to convert |