|
std::deque< std::string > | split (const std::string &s, const char delimiter) |
| Split is returns a deque of s split up at the character delimiter. It handles these special cases: split("a:", ':') -> ["a", ""] split(":", ':') -> [""] split(":a", ':') -> ["", "a"]. More...
|
|
template<typename T > |
std::string | str (T x) |
| A pythonesque string function. This gets specialized in many ways. More...
|
|
std::string | str (const std::string &x) |
|
template<typename... T, size_t... I> |
std::string | str (const std::tuple< T... > &x, std::index_sequence< I... > idx) |
|
template<typename... T> |
std::string | str (const std::tuple< T... > &x) |
|
template<typename A , typename B > |
std::string | str (const std::pair< A, B > x) |
|
template<typename T , size_t N> |
std::string | str (const std::array< T, N > &a) |
|
template<typename T > |
std::string | str (const std::vector< T > &a, const std::string _sep=",") |
|
template<typename T , typename U > |
std::string | str (const std::map< T, U > &a) |
|
template<typename T > |
std::string | str (const std::set< T > &a) |
|
template<typename T > |
std::string | str (const std::atomic< T > &a) |
|
template<typename... Args> |
std::string | str (std::string _sep, Args... args) |
|
template<typename T > |
T | string_to (const std::string s) |
| Fleet includes this templated function to allow us to convert strings to a variety of formats. This is mostly used for reading data from text files. This recursively will unpack containers with some standard delimiters. Since it can handle Fleet types (e.g. defaultdata_t) it can be used to unpack data stored in strings (see e.g. Models/Sorting) More...
|
|
template<> |
std::string | string_to (const std::string s) |
|
template<> |
int | string_to (const std::string s) |
|
template<> |
long | string_to (const std::string s) |
|
template<> |
unsigned long | string_to (const std::string s) |
|
template<> |
double | string_to (const std::string s) |
|
template<> |
float | string_to (const std::string s) |
|
template<> |
bool | string_to (const std::string s) |
|
std::array< std::string, N > split |
( |
const std::string & |
s, |
|
|
const char |
delimiter |
|
) |
| |
Split is returns a deque of s split up at the character delimiter. It handles these special cases: split("a:", ':') -> ["a", ""] split(":", ':') -> [""] split(":a", ':') -> ["", "a"].
Split with a fixed return size, useful in parsing csv.
- Parameters
-
- Returns