|
TrueReality
v0.1.1912
|
Classes | |
| class | IsDelimeter |
| Generic string delimeter check function class. More... | |
| class | IsSlash |
| Determines if the current character is a forward slash. More... | |
| class | IsSpace |
| A functor which tests if a character is whitespace. More... | |
| struct | StrCompareFunc |
| A functor for using std::find or whatever that will compare two strings case sensitive or insensitive. More... | |
| class | StringTokenizer |
| The predicate should evaluate to true when applied to a separator. More... | |
Functions | |
| static const std::string | STR_BLANK ("") |
| Constant value for a blank String. More... | |
| TR_UTIL_EXPORT const std::string & | Trim (std::string &toTrim) |
| Trims whitespace off the front and end of a string. More... | |
| TR_UTIL_EXPORT int | StrCompare (const std::string &one, const std::string &two, bool caseSensitive=true) |
| Compares strings like strcmp or stricmp or strcasecmp. More... | |
| TR_UTIL_EXPORT void | ToLowerCase (std::string &str) |
| Converts the whole string to lower case. More... | |
| TR_UTIL_EXPORT std::string | ToLowerCase (const std::string &str) |
| Converts the whole string to lower case, slower version. More... | |
| TR_UTIL_EXPORT void | ToUpperCase (std::string &str) |
| Converts the whole string to upper case. More... | |
| TR_UTIL_EXPORT std::string | ToUpperCase (const std::string &str) |
| Converts the whole string to upper case, slower version. More... | |
| template<class VecType > | |
| bool | ParseVec (const std::string &value, VecType &vec, unsigned size, unsigned numberPrecision=16) |
| A templated function for taking any of the osg vector types and reading the data from a string. More... | |
| template<typename T > | |
| std::string | ToString (const T &t, int precision=-1) |
| A utility function to convert a basic type into a string. More... | |
| template<typename T > | |
| T | FromString (const std::string &u) |
| Converts a string to a specified type. More... | |
| template<> | |
| bool TR_UTIL_EXPORT | FromString< bool > (const std::string &u) |
| Special exception for bool where things like "True", "TRUE", and "true" should be accepted. More... | |
| bool TR_UTIL_EXPORT | Match (const char *wildCards, const char *str) |
| Matches. More... | |
| void TR_UTIL_EXPORT | MakeIndexString (unsigned index, std::string &toFill, unsigned paddedLength=4) |
| Makes index string. More... | |
| bool TR_UTIL_EXPORT | TakeToken (std::string &data, std::string &outToken, char openChar, char closeChar) |
| Reads the next token fromm the given string data. More... | |
| void TR_UTIL_EXPORT | FindAndReplace (std::string &modifiedString, const std::string &findWhat, const std::string &replaceWith) |
| Finds all instances of the findWhat string in the string modifiedString and replaces them with the replaceWith string. More... | |
| template<> | |
| bool | FromString< bool > (const std::string &u) |
| Special exception for bool where things like "True", "TRUE", and "true" should be accepted. More... | |
| static bool | Scan (const char *&wildCards, const char *&str) |
| static bool | WildMatch (const char *wildCards, const char *str) |
| void trUtil::StringUtils::FindAndReplace | ( | std::string & | modifiedString, |
| const std::string & | findWhat, | ||
| const std::string & | replaceWith | ||
| ) |
Finds all instances of the findWhat string in the string modifiedString and replaces them with the replaceWith string.
| [out] | modifiedString | The string we are modifying. |
| [in] | findWhat | The string we want to remove from modifiedString. |
| [in] | replaceWith | The string we want to put in modifiedString. |
Definition at line 310 of file StringUtils.cpp.
References LOG_E.
Referenced by FromString(), and trUtil::VersionUtil::GetCurrentCommitNum().

| T trUtil::StringUtils::FromString | ( | const std::string & | u | ) |
Converts a string to a specified type.
| u | string to be converted to the specified template argument type. |
Typical use:
Definition at line 362 of file StringUtils.h.
References FindAndReplace(), FromString< bool >(), MakeIndexString(), Match(), and TakeToken().

| bool trUtil::StringUtils::FromString< bool > | ( | const std::string & | u | ) |
Special exception for bool where things like "True", "TRUE", and "true" should be accepted.
| bool | Type of the bool. |
| u | The std::string to process. |
Definition at line 126 of file StringUtils.cpp.
Referenced by FromString().

| bool trUtil::StringUtils::FromString< bool > | ( | const std::string & | u | ) |
Special exception for bool where things like "True", "TRUE", and "true" should be accepted.
| bool | Type of the bool. |
| u | The std::string to process. |
Definition at line 126 of file StringUtils.cpp.
Referenced by FromString().

| void trUtil::StringUtils::MakeIndexString | ( | unsigned | index, |
| std::string & | toFill, | ||
| unsigned | paddedLength = 4 |
||
| ) |
Makes index string.
| index | Zero-based index of the. | |
| [in,out] | toFill | to fill. |
| paddedLength | (Optional) Length of the padded. |
Definition at line 222 of file StringUtils.cpp.
Referenced by FromString().

| bool trUtil::StringUtils::Match | ( | const char * | wildCards, |
| const char * | str | ||
| ) |
Matches.
| wildCards | The wild cards. |
| str | The string. |
Definition at line 216 of file StringUtils.cpp.
References WildMatch().
Referenced by FromString(), and Scan().


| bool trUtil::StringUtils::ParseVec | ( | const std::string & | value, |
| VecType & | vec, | ||
| unsigned | size, | ||
| unsigned | numberPrecision = 16 |
||
| ) |
A templated function for taking any of the osg vector types and reading the data from a string.
If the string is empty or "NULL" it will set the vector to all 0s. It expects the data to be the proper number floating point values. The function will fail if there are not enough values.
| value | the string data. | |
| [in,out] | vec | the vector to fill. |
| size | the length of the vector since the osg types have no way to query that. | |
| numberPrecision | (Optional) This value indicates how much precision the numbers will contain when read from the string. (setprecision on std::istream) |
Definition at line 287 of file StringUtils.h.
|
static |
Definition at line 133 of file StringUtils.cpp.
References Match().
Referenced by WildMatch().


|
static |
Constant value for a blank String.
Referenced by trUtil::VersionUtil::GetCurrentCommitNum(), and trUtil::PathUtils::GetDataPath().

| int trUtil::StringUtils::StrCompare | ( | const std::string & | one, |
| const std::string & | two, | ||
| bool | caseSensitive = true |
||
| ) |
Compares strings like strcmp or stricmp or strcasecmp.
| one | the first string to compare. |
| two | the string to compare one to. |
| caseSensitive | (Optional) optional parameter to specify case sensitivity, which defaults to on. |
Definition at line 74 of file StringUtils.cpp.
References strCmp.
Referenced by trUtil::FileUtils::DirGetFiles(), and trUtil::StringUtils::StrCompareFunc::operator()().

| bool trUtil::StringUtils::TakeToken | ( | std::string & | data, |
| std::string & | outToken, | ||
| char | openChar, | ||
| char | closeChar | ||
| ) |
Reads the next token fromm the given string data.
This will also remove the token from the data string and return you the token (with the open and close characters removed). The beginning of the data string must always begin with an opening character or this will cause problems.
| [in] | data | The string data. |
| [out] | outToken | The first token from the string data. |
| [in] | openChar | The character that starts the token. |
| [in] | closeChar | The character that ends the token. |
Definition at line 231 of file StringUtils.cpp.
Referenced by FromString().

| void trUtil::StringUtils::ToLowerCase | ( | std::string & | str | ) |
Converts the whole string to lower case.
| [in,out] | str | The string. |
Definition at line 89 of file StringUtils.cpp.
Referenced by ToLowerCase().

| std::string trUtil::StringUtils::ToLowerCase | ( | const std::string & | str | ) |
Converts the whole string to lower case, slower version.
| str | The string. |
Definition at line 98 of file StringUtils.cpp.
References ToLowerCase().

| std::string trUtil::StringUtils::ToString | ( | const T & | t, |
| int | precision = -1 |
||
| ) |
A utility function to convert a basic type into a string.
Use template argument T for the type you'd like to convert.
| t | the instance of the type to converted. Typical use: float num = 5.67f; std::string mynum = StringUtils::ToString( num ); |
| precision | (Optional) The precision. |
Definition at line 334 of file StringUtils.h.
Referenced by trUtil::hash< trBase::UniqueId >::operator()(), trUtil::hash< const trBase::UniqueId >::operator()(), and trUtil::DateTime::TimeFormat::TimeFormat().

| void trUtil::StringUtils::ToUpperCase | ( | std::string & | str | ) |
Converts the whole string to upper case.
| [in,out] | str | The string. |
Definition at line 107 of file StringUtils.cpp.
Referenced by ToUpperCase().

| std::string trUtil::StringUtils::ToUpperCase | ( | const std::string & | str | ) |
Converts the whole string to upper case, slower version.
| str | The string. |
Definition at line 116 of file StringUtils.cpp.
References ToUpperCase().

| const std::string & trUtil::StringUtils::Trim | ( | std::string & | toTrim | ) |
Trims whitespace off the front and end of a string.
| [in,out] | toTrim | the string to trim. |
Definition at line 58 of file StringUtils.cpp.
|
static |
Definition at line 187 of file StringUtils.cpp.
References Scan().
Referenced by Match().

