suplibxx
1.3.13
|
Functions | |
bool | suplib::iscomment (const std::string &str, const std::string &ignore=" \t", const std::string &comment="#") |
determine if the string is a comment. More... | |
std::string & | suplib::prune (std::string &str) |
remove leading and trailing white space from a string More... | |
double | suplib::str2d (const char *txt) |
convert string to double-precision number More... | |
float | suplib::str2f (const char *txt) |
convert string to floating-point number More... | |
int | suplib::str2i (const char *txt, int base=10) |
convert string to integer number More... | |
long | suplib::str2l (const char *txt, int base=10) |
convert string to long number More... | |
unsigned long | suplib::str2ul (const char *txt, int base=10) |
convert string to long number More... | |
std::string & | suplib::trim (std::string &str) |
remove leading white space from a string More... | |
bool suplib::iscomment | ( | const std::string & | str, |
const std::string & | ignore = " \t" , |
||
const std::string & | comment = "#" |
||
) |
determine if the string is a comment.
str | the string upon which to operate |
iscomment scans str to determine if the first character following all the ignore characters is a comment character. It compares the position of the first non-ignore character with the position of the first comment character. If they are the same and occur before the end of the string, it returns true. Otherwise it returns false.
Definition at line 45 of file iscomment.cc.
std::string & suplib::prune | ( | std::string & | str | ) |
remove leading and trailing white space from a string
str | the string upon which to operate |
prune deletes leading and trailing white space, where white space is defined as blanks, tabs, new lines, and carriage returns.
double suplib::str2d | ( | const char * | txt | ) |
convert string to double-precision number
txt | the string upon which to operate |
str2d() converts the initial portion of the string pointed to by txt to type double representation. It throws an exception, of type Exception, if txt is not a legitimate double precision number.
float suplib::str2f | ( | const char * | txt | ) |
convert string to floating-point number
txt | the string upon which to operate |
str2f() converts the initial portion of the string pointed to by txt to type float representation. It throws an exception, of type Exception, if txt is not a legitimate floating point number.
int suplib::str2i | ( | const char * | txt, |
int | base = 10 |
||
) |
convert string to integer number
txt | the string upon which to operate |
str2i() converts the initial portion of the string pointed to by txt to type integer representation. It throws an exception, of type Exception, if txt is not a legitimate integer.
long suplib::str2l | ( | const char * | txt, |
int | base = 10 |
||
) |
convert string to long number
txt | the string upon which to operate |
str2l() converts the initial portion of the string pointed to by txt to type long representation. It throws an exception, of type Exception, if txt is not a legitimate long.
unsigned long suplib::str2ul | ( | const char * | txt, |
int | base = 10 |
||
) |
convert string to long number
txt | the string upon which to operate |
str2ul() converts the initial portion of the string pointed to by txt to type unsigned long representation. It throws an exception, of type Exception, if txt is not a legitimate long.
std::string & suplib::trim | ( | std::string & | str | ) |