|
USB EPROM/Flash Programmer
|
String Handling Helper Class. More...
#include <string.hpp>
Public Types | |
| typedef std::vector< std::string > | TStringVector |
| Vector of strings type. More... | |
Static Public Member Functions | |
| static std::string | upper (const std::string &src) |
| Converts a string to uppercase. More... | |
| static std::string | lower (const std::string &src) |
| Converts a string to lowercase. More... | |
| static std::string | trim (const std::string &src) |
| Removes blank characters from left/right of the string. More... | |
| static TStringVector | split (const std::string &src, char separator, bool trim=false) |
| Splits a string into a vector, from a separator. More... | |
| static int | toInt (const std::string &src, uint base=10) |
| Converts a string to an integer value. More... | |
| static float | toFloat (const std::string &src) |
| Converts a string to a float point value. More... | |
| static std::string | fromInt (int src, uint base=10, uint digits=0, char fill=' ') |
| Converts an integer value to a string. More... | |
| static std::string | fromFloat (float src, uint precision=3) |
| Converts a float point value to a string. More... | |
String Handling Helper Class.
The purpose of this class is to handle strings.
| typedef std::vector<std::string> TStringVector |
Vector of strings type.
|
static |
Converts a string to uppercase.
| src | Source string. |
|
static |
Converts a string to lowercase.
| src | Source string. |
|
static |
Removes blank characters from left/right of the string.
| src | Source string. |
|
static |
Splits a string into a vector, from a separator.
| src | Source string. |
| separator | Separator character. |
| trim | If true, cleans each token before add into vector. |
|
static |
Converts a string to an integer value.
| src | Source string. |
| base | Numerical base. Default is 10 (decimal). |
|
static |
Converts a string to a float point value.
| src | Source string. |
|
static |
Converts an integer value to a string.
| src | Integer value. |
| base | Numerical base. Default is 10 (decimal). |
| digits | Number of min digits to format (left pad with fill). Default is zero. |
| fill | Fill character. Default is space. |
|
static |
Converts a float point value to a string.
| src | Float point value. |
| precision | Number of decimals (precision). Default is 3. |