Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

string_util Namespace Reference


Detailed Description

some common string processing functions, for std::string


Functions

string makeLower (const std::string &s) ATTR_must_check
 returns lower case version of s
string makeUpper (const std::string &s) ATTR_must_check
 returns upper case version of s
string removePrefix (const std::string &str, const std::string &pre) ATTR_must_check
 returns str with pre removed - if pre is not fully matched, str is returned unchanged
string tildeExpansion (const std::string &str) ATTR_must_check
 replaces ~USER prefix with specified user's home directory, or ~ prefix with current HOME environment setting; returns str if no valid expansion is found
string trim (const std::string &str) ATTR_must_check
 removes whitespace (as defined by isspace()) from the beginning and end of str, and returns the result
bool parseArgs (const std::string &input, std::vector< std::string > &args, std::vector< unsigned int > &offsets)
 parses the input string into an arg list, with corresponding offsets of each arg in the original input


Function Documentation

std::string string_util::makeLower ( const string &  s  ) 

returns lower case version of s

Definition at line 10 of file string_util.cc.

Referenced by EchoBehavior::intersect(), EchoBehavior::processEvent(), and ControlBase::takeInput().

std::string string_util::makeUpper ( const string &  s  ) 

returns upper case version of s

Definition at line 18 of file string_util.cc.

Referenced by WalkCalibration::setupReady().

std::string string_util::removePrefix ( const string &  str,
const string &  pre 
)

returns str with pre removed - if pre is not fully matched, str is returned unchanged

Definition at line 26 of file string_util.cc.

std::string string_util::tildeExpansion ( const string &  str  ) 

replaces ~USER prefix with specified user's home directory, or ~ prefix with current HOME environment setting; returns str if no valid expansion is found

Definition at line 32 of file string_util.cc.

std::string string_util::trim ( const string &  str  ) 

removes whitespace (as defined by isspace()) from the beginning and end of str, and returns the result

Definition at line 58 of file string_util.cc.

bool string_util::parseArgs ( const string &  input,
vector< string > &  args,
std::vector< unsigned int > &  offsets 
)

parses the input string into an arg list, with corresponding offsets of each arg in the original input

Definition at line 70 of file string_util.cc.

Referenced by EchoBehavior::processEvent(), ControlBase::takeInput(), and Controller::takeLine().


Tekkotsu v3.0
Generated Wed Oct 4 00:05:24 2006 by Doxygen 1.4.7