DUECA/DUSIME
|
Functions | |
template<typename T > | |
string & | dueca::operator<< (string &lhs, const T &rhs) |
std::string stream in operator More... | |
template<class T > | |
T & | dueca::s2num (const string &s, T &num) |
Convert a string to a numeric. More... | |
template<typename T > | |
string | dueca::num2s (const T &num, int width=-1) |
Convert any numeric to a string. More... | |
template<class T > | |
string | dueca::real2s (const T &num) |
Convert a floating point value to a string. More... | |
string | dueca::replaceAll (string s, const string &search, const string &repl) |
Replace all occurences of a certain search string in a string. More... | |
unsigned int | dueca::split (const string &input, vector< string > &output, const string &separators=" \\5") |
Split strings into pieces. More... | |
string | dueca::trim (const string &s, const string &pattern=", \\5") |
Strip definable characters from both ends of a string. More... | |
string& dueca::operator<< | ( | string & | lhs, |
const T & | rhs | ||
) |
std::string stream in operator
Templated function that converts the right-hand-side object to a string, and appends it to a string.
lhs | String to append to |
rhs | Object to append to string lhs |
T& dueca::s2num | ( | const string & | s, |
T & | num | ||
) |
Convert a string to a numeric.
s | String containing a textual representation of a number |
num | The variable to output the converted numeric to |
string dueca::num2s | ( | const T & | num, |
int | width = -1 |
||
) |
Convert any numeric to a string.
num | Numeric to convert to a string |
width | (optional) When provided, the returned string is padded to the right with zeros to the specified width |
string dueca::real2s | ( | const T & | num | ) |
Convert a floating point value to a string.
The converted string uses scientific format, and higher precision than num2s
num | Value to convert to a string |
string dueca::replaceAll | ( | string | s, |
const string & | search, | ||
const string & | repl | ||
) |
Replace all occurences of a certain search string in a string.
s | Source string |
search | Substring to be replaced |
repl | Replacement string |
unsigned int dueca::split | ( | const string & | input, |
vector< string > & | output, | ||
const string & | separators = " \\5" |
||
) |
Split strings into pieces.
input | Input string to cut into pieces |
output | Vector to append the pieces to. If the vector is not empty, pieces are appended to the end of the vector |
separators | Character(s) to recognise as separator between pieces |
string dueca::trim | ( | const string & | s, |
const string & | pattern = ", \\5" |
||
) |
Strip definable characters from both ends of a string.
s | String to parse |
pattern | Characters that should be trimmed from the string |