StringTools Namespace Reference

Contains methods for string manipulation. More...


Enumerations

enum  KeywordCase { CASE_UNCHANGED, CASE_LOWER, CASE_UPPER, CASE_CAPITALIZE }

Functions

string change_case (const string &s, const KeywordCase kcase) throw ()
string trimRight (const string &value)
string getParantheseVal (const string &s)
vector< string > splitString (const string &s, unsigned char delim)
template<class T >
bool str2num (T &val, const std::string &s, std::ios_base &(*f)(std::ios_base &))


Detailed Description

Contains methods for string manipulation.


Enumeration Type Documentation

Change Keyword case

Enumerator:
CASE_UNCHANGED  do not alter case
CASE_LOWER  convert to lower case
CASE_UPPER  convert to upper case
CASE_CAPITALIZE  convert first character to upper case


Function Documentation

string StringTools::change_case ( const string &  s,
const KeywordCase  kcase = CASE_LOWER 
) throw ()

Change character case of strings

Parameters:
s input string
kcase case modification indicator
Returns:
modified string

References CASE_CAPITALIZE, CASE_LOWER, CASE_UNCHANGED, and CASE_UPPER.

Referenced by CmdLineOptions::CmdLineOptions(), ConfigurationReader::ConfigurationReader(), highlight::CodeGenerator::encodingDefined(), CmdLineOptions::getIndentScheme(), and CmdLineOptions::omitEncoding().

string StringTools::getParantheseVal ( const string &  s  ) 

Parse data within parantheses

Parameters:
s String, containing a opening and a closing paranthesis
Returns:
value between "(", ")"

Referenced by highlight::LanguageDefinition::load(), and highlight::DocumentStyle::load().

vector< string > StringTools::splitString ( const string &  s,
unsigned char  delim 
)

Split string and return items separated by a delimiter

Parameters:
s string containing tokens
delim Token delimiter
Returns:
vector containing found tokens

template<class T >
bool StringTools::str2num ( T &  val,
const std::string &  s,
std::ios_base &(*)(std::ios_base &)  f 
) [inline]

Convert string to a numeric value of the given type

Parameters:
val variable of specified type which will contain the numeric value
s string containing a number
f format specifier function (IO manipulator)
Returns:
true if successfull

string StringTools::trimRight ( const string &  value  ) 

Trim string (remove whitespace)

Parameters:
value String
Returns:
string trimmed on the left

Referenced by ConfigurationReader::ConfigurationReader().


Generated on Tue Oct 26 19:44:51 2010 for Highlight Code Converter by  doxygen 1.5.7.1