|
iLab Neuromorphic Robotics Toolkit
0.1
|
Various helpful methods for dealing with std::strings
Functions | |
| std::string | nrt::replaceEnvVars (std::string const &str) |
| std::vector< std::string > | nrt::splitString (std::string const &string, char const delimiter) |
| Split the string by the given delimiter. | |
| std::string | nrt::joinStrings (std::vector< std::string > const &strings, std::string const &delimiter) |
| Join a vector of strings with the given delimiter. | |
| std::string | nrt::trimString (std::string const &s) |
| Trim whitespace from both ends of a string. | |
| std::string | nrt::lTrimString (std::string const &s) |
| Trim whitespace from the left side of a string. | |
| std::string | nrt::rTrimString (std::string const &s) |
| Trim whitespace from the right side of a string. | |
| std::string | nrt::sformat (const char *fmt,...) __attribute__((format(__printf__ |
| Create a string using printf style arguments. | |
| std::string std::string | nrt::urlDecode (std::string const &str) |
| Decode url-encoded strings. | |
| std::string nrt::replaceEnvVars | ( | std::string const & | str | ) |
Replace all environment variables in the given string with the values found in the environment
| std::vector<std::string> nrt::splitString | ( | std::string const & | string, |
| char const | delimiter | ||
| ) |
Split the string by the given delimiter.
Referenced by nrt::operator>>().
| std::string nrt::joinStrings | ( | std::vector< std::string > const & | strings, |
| std::string const & | delimiter | ||
| ) |
Join a vector of strings with the given delimiter.
| std::string nrt::trimString | ( | std::string const & | s | ) |
Trim whitespace from both ends of a string.
| std::string nrt::lTrimString | ( | std::string const & | s | ) |
Trim whitespace from the left side of a string.
| std::string nrt::rTrimString | ( | std::string const & | s | ) |
Trim whitespace from the right side of a string.
| std::string nrt::sformat | ( | const char * | fmt, |
| ... | |||
| ) |
Create a string using printf style arguments.
Example:
std::string s = nrt::sformat("MyString_%f_%d", 1.0, 2);
Referenced by nrt::copyCvMat2Image(), nrt::copyIpl2Image(), nrt::operator<<(), and nrt::operator>>().
| std::string std::string nrt::urlDecode | ( | std::string const & | str | ) |
Decode url-encoded strings.