radarlib
1.4.4
|
Functions for string manipulation and conversion. More...
#include <cstring>
#include <string>
#include <sstream>
#include <vector>
#include <utility>
#include <stdexcept>
#include <ctime>
#include <radarlib/defs.h>
Go to the source code of this file.
Namespaces | |
Radar::stringutils | |
String manipulation functions. | |
Functions | |
void | Radar::stringutils::split (const std::string &str, std::string &first, std::string &second, const char separator= ',') |
Splits a string into two parts, using the given separator. More... | |
void | Radar::stringutils::split (const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=" ") |
Splits a string into substrings using the chacatars of a given string as tokens separators. More... | |
std::string & | Radar::stringutils::trimleft (std::string &str) |
removes all spaces to the left of a string More... | |
std::string | Radar::stringutils::trimleft (const std::string &str) |
removes all spaces to the left of a string, building a new string More... | |
std::string & | Radar::stringutils::trimright (std::string &str) |
removes all spaces to the right of a string More... | |
std::string | Radar::stringutils::trimright (const std::string &str) |
removes all spaces to the right of a string, building a new string More... | |
std::string & | Radar::stringutils::trim (std::string &str) |
remove all space to the left and the right of a string More... | |
std::string | Radar::stringutils::trim (const std::string &str) |
removes all spaces to the left and the right of a string, building a new string More... | |
template<class T > | |
std::string | Radar::stringutils::toString (const T &value) |
Convert a value to its string rapresentation. More... | |
std::string | Radar::stringutils::toString (bool val) |
Convert a boolean value to its string rapresentation (0/1). More... | |
std::string | Radar::stringutils::toString (int val) |
Convert a int value to its string rapresentation . More... | |
std::string | Radar::stringutils::toString (long val) |
Convert a long value to its string rapresentation. More... | |
std::string | Radar::stringutils::toString (float val) |
Convert a float value to its string rapresentation. More... | |
std::string | Radar::stringutils::toString (double val) |
Convert a double value to its string rapresentation. More... | |
std::string | Radar::stringutils::toString (size_t val) |
Convert a size_t value to its string rapresentation. More... | |
template<class T > | |
std::string | Radar::stringutils::toString (const std::vector< T > &val, const char *sep=",") |
Convert a std::vector to a string. More... | |
std::string | Radar::stringutils::toString (const std::vector< bool > &val, const char *sep=",") |
Convert a std::vector of boolean values to a string. More... | |
std::string | Radar::stringutils::toString (const std::vector< int > &val, const char *sep=",") |
Convert a std::vector of int values to a string. More... | |
std::string | Radar::stringutils::toString (const std::vector< long > &val, const char *sep=",") |
Convert a std::vector of long values to a string. More... | |
std::string | Radar::stringutils::toString (const std::vector< float > &val, const char *sep=",") |
Convert a std::vector of float values to a string. More... | |
std::string | Radar::stringutils::toString (const std::vector< double > &val, const char *sep=",") |
Convert a std::vector of double values to a string. More... | |
template<class T > | |
std::string | Radar::stringutils::toString (const std::vector< std::pair< T, T > > value, const char *sep=",") |
Convert a std::vector of pair values to a string. More... | |
template<class T > | |
static T | Radar::stringutils::parse (const std::string &str, const std::string &typestr) |
Parse a std::string to a given type value. More... | |
bool | Radar::stringutils::parseBool (const std::string &str) throw (std::invalid_argument) |
Parse a std::string to a boolean value. More... | |
int | Radar::stringutils::parseInt (const std::string &str) throw (std::invalid_argument) |
Parse a std::string to an int value. More... | |
float | Radar::stringutils::parseFloat (const std::string &str) throw (std::invalid_argument) |
Parse a std::string to a float value. More... | |
double | Radar::stringutils::parseDouble (const std::string &str) throw (std::invalid_argument) |
Parse a std::string to a double value. More... | |
void | Radar::stringutils::parseSeq (const std::string &str, std::vector< bool > &val, const char *sep=",", const bool allowEmptyStr=true) |
Parse a string sequence of boolean values to a std::vector. More... | |
void | Radar::stringutils::parseSeq (const std::string &str, std::vector< int > &val, const char *sep=",", const bool allowEmptyStr=true) |
Parse a string sequence of integer values to a std::vector. More... | |
void | Radar::stringutils::parseSeq (const std::string &str, std::vector< double > &val, const char *sep=",", const bool allowEmptyStr=true) |
Parse a string sequence of double values to a std::vector. More... | |
void | Radar::stringutils::parseSeq (const std::string &str, std::vector< std::string > &val, const char *sep=",", const bool allowEmptyStr=true) |
Parse a string sequence of string tokens to a std::vector. More... | |
bool | Radar::stringutils::isInt (const std::string &str) |
Check if the string is a number. More... | |
Functions for string manipulation and conversion.