Stride Reference Manual
1.0
|
String utilities. More...
#include <StringUtils.h>
Static Public Member Functions | |
template<typename T > | |
static T | fromString (std::string const &s) |
Builds a value of type T representation from a string. More... | |
static std::vector< std::string > | split (const std::string &str, const std::string &delimiters) |
Split a string (in order of occurence) by splitting it on the given delimiters. More... | |
static std::vector< std::string > | tokenize (const std::string &str, const std::string &delimiters) |
Tokenize a string (in order of occurence) with the given delimiters. More... | |
template<typename T > | |
static std::string | toString (T const &value) |
Builds a string representation of a value of type T. More... | |
template<typename T > | |
static std::string | toString (T const &value, int width, char fill= ' ') |
Builds a string representation with minimum width of a value of type T. More... | |
static std::string | toLower (std::string const &source) |
Builds a string with lower case characters only. More... | |
static std::string | toUpper (std::string const &source) |
Builds a string with upper case characters only. More... | |
static std::string | trimRight (std::string const &source, std::string const &t=" ") |
Trim characters at right end of string. More... | |
static std::string | trimLeft (std::string const &source, std::string const &t=" ") |
Trim characters at left end of string. More... | |
static std::string | trim (std::string const &source, std::string const &t=" ") |
Trim characters at both ends of string. More... | |
static std::string | replace (std::string source, std::string from, std::string to) |
Replace all occurences of a string with another. More... | |
String utilities.
Definition at line 37 of file StringUtils.h.
|
inlinestatic |
Builds a value of type T representation from a string.
Definition at line 41 of file StringUtils.h.
|
inlinestatic |
Split a string (in order of occurence) by splitting it on the given delimiters.
Definition at line 49 of file StringUtils.h.
Referenced by stride::PopulationBuilder::build(), stride::SimulatorBuilder::initializeDistricts(), stride::SimulatorBuilder::initializeLocations(), and stride::run::Runner::Runner().
|
inlinestatic |
Tokenize a string (in order of occurence) with the given delimiters.
Multiple consecutive delimiters do NOT define "empty" tokens; they are simply skipped.
Definition at line 58 of file StringUtils.h.
|
inlinestatic |
Builds a string representation of a value of type T.
Definition at line 80 of file StringUtils.h.
|
inlinestatic |
Builds a string representation with minimum width of a value of type T.
Definition at line 88 of file StringUtils.h.
|
inlinestatic |
Builds a string with lower case characters only.
Definition at line 95 of file StringUtils.h.
Referenced by stride::util::InstallDirs::initialize().
|
inlinestatic |
Builds a string with upper case characters only.
Definition at line 103 of file StringUtils.h.
|
inlinestatic |
Trim characters at right end of string.
Definition at line 111 of file StringUtils.h.
Referenced by trim().
|
inlinestatic |
Trim characters at left end of string.
Definition at line 117 of file StringUtils.h.
Referenced by trim().
|
inlinestatic |
Trim characters at both ends of string.
Definition at line 123 of file StringUtils.h.
References trimLeft(), and trimRight().
Referenced by stride::run::Runner::Runner().
|
inlinestatic |
Replace all occurences of a string with another.
Definition at line 129 of file StringUtils.h.
Referenced by stride::run::Runner::Runner().