StringUtil Namespace Reference
[String Utils]

:: More...


Functions

void EncodeToXml (std::string &str)
std::string EncodeToXmlCopy (const std::string &str)
bool IsPrefix (const std::string &str, const std::string &prefix)
bool IsSuffix (const std::string &str, const std::string &suffix)
void ToLower (std::string::iterator start, std::string::iterator end)
 Inplace converts each character in substring [start, end) to lower-case.
void ToLower (std::string &str)
 Inplace converts each character in str to lower-case.
std::string ToLowerCopy (const std::string &str)
void Trim (std::string &str)
 Inplace removes all leading and trailing whitespace from str.
std::string TrimCopy (const std::string &str)


Detailed Description

::


Function Documentation

void StringUtil::EncodeToXml ( std::string &  str  ) 

Inplace converts each character in str which are considered an XML special character (&,<,>,',") will be converted to an XML entity( & -> &amp;).

Definition at line 98 of file StringUtil.cpp.

References EncodeToXmlCopy().

std::string StringUtil::EncodeToXmlCopy ( const std::string &  str  ) 

Returns:
A copy of str in which each character in str which are considered an XML special character (&,<,>,',") will be converted to an XML entity( & -> &amp;).

Definition at line 104 of file StringUtil.cpp.

Referenced by EncodeToXml().

bool StringUtil::IsPrefix ( const std::string &  str,
const std::string &  prefix 
)

Returns:
true if prefix is a prefix of str, and false if it is not.

Definition at line 10 of file StringUtil.cpp.

bool StringUtil::IsSuffix ( const std::string &  str,
const std::string &  suffix 
)

Returns:
true if suffix is a suffix of str, and false if it is not.

Definition at line 22 of file StringUtil.cpp.

void StringUtil::ToLower ( std::string::iterator  start,
std::string::iterator  end 
)

Inplace converts each character in substring [start, end) to lower-case.

Definition at line 39 of file StringUtil.cpp.

void StringUtil::ToLower ( std::string &  str  ) 

Inplace converts each character in str to lower-case.

Definition at line 34 of file StringUtil.cpp.

Referenced by ToLowerCopy().

std::string StringUtil::ToLowerCopy ( const std::string &  str  ) 

Returns:
A copy of str in which each character in str is converted to lower-case.

Definition at line 48 of file StringUtil.cpp.

References ToLower().

void StringUtil::Trim ( std::string &  str  ) 

Inplace removes all leading and trailing whitespace from str.

Definition at line 55 of file StringUtil.cpp.

Referenced by CommandRunner::Run(), and TrimCopy().

std::string StringUtil::TrimCopy ( const std::string &  str  ) 

Returns:
A copy of str which has removed all leading and trailing whitespace.

Definition at line 89 of file StringUtil.cpp.

References Trim().


Generated on Wed Jul 7 16:30:30 2010 for CS240Utils by  doxygen 1.5.8