TrueReality  v0.1.1912
StringUtils.h File Reference
#include <trUtil/Export.h>
#include <trUtil/UnaryFunction.h>
#include <trUtil/WarningUtils.h>
#include <string>
#include <sstream>
#include <locale>
#include <vector>
#include <algorithm>
Include dependency graph for StringUtils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  trUtil::StringUtils::StringTokenizer< Pred >
 The predicate should evaluate to true when applied to a separator. More...
 
class  trUtil::StringUtils::IsSpace
 A functor which tests if a character is whitespace. More...
 
class  trUtil::StringUtils::IsSlash
 Determines if the current character is a forward slash. More...
 
class  trUtil::StringUtils::IsDelimeter
 Generic string delimeter check function class. More...
 
struct  trUtil::StringUtils::StrCompareFunc
 A functor for using std::find or whatever that will compare two strings case sensitive or insensitive. More...
 

Namespaces

 trUtil
 Namespace that holds various utility classes for the engine.
 
 trUtil::StringUtils
 

Functions

static const std::string trUtil::StringUtils::STR_BLANK ("")
 Constant value for a blank String. More...
 
TR_UTIL_EXPORT const std::string & trUtil::StringUtils::Trim (std::string &toTrim)
 Trims whitespace off the front and end of a string. More...
 
TR_UTIL_EXPORT int trUtil::StringUtils::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 trUtil::StringUtils::ToLowerCase (std::string &str)
 Converts the whole string to lower case. More...
 
TR_UTIL_EXPORT std::string trUtil::StringUtils::ToLowerCase (const std::string &str)
 Converts the whole string to lower case, slower version. More...
 
TR_UTIL_EXPORT void trUtil::StringUtils::ToUpperCase (std::string &str)
 Converts the whole string to upper case. More...
 
TR_UTIL_EXPORT std::string trUtil::StringUtils::ToUpperCase (const std::string &str)
 Converts the whole string to upper case, slower version. More...
 
template<class VecType >
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. More...
 
template<typename T >
std::string trUtil::StringUtils::ToString (const T &t, int precision=-1)
 A utility function to convert a basic type into a string. More...
 
template<typename T >
trUtil::StringUtils::FromString (const std::string &u)
 Converts a string to a specified type. More...
 
template<>
bool TR_UTIL_EXPORT trUtil::StringUtils::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 trUtil::StringUtils::Match (const char *wildCards, const char *str)
 Matches. More...
 
void TR_UTIL_EXPORT trUtil::StringUtils::MakeIndexString (unsigned index, std::string &toFill, unsigned paddedLength=4)
 Makes index string. More...
 
bool TR_UTIL_EXPORT trUtil::StringUtils::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 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. More...