32 #ifndef PLANCK_STRING_UTILS_H 33 #define PLANCK_STRING_UTILS_H 43 std::string
trim (
const std::string &orig);
47 template<
typename T> std::string
dataToString(
const T &x);
49 template<> std::string
dataToString (
const std::string &x);
52 template<> std::string
dataToString (
const long double &x);
59 template<
typename T>
void stringToData (
const std::string &x, T &value);
60 template<>
void stringToData (
const std::string &x, std::string &value);
61 template<>
void stringToData (
const std::string &x,
bool &value);
69 std::map<std::string,std::string> &dict);
71 void parse_cmdline_classic (
int argc,
const char **argv,
72 const std::vector<std::string> &leading_args,
73 std::map<std::string,std::string> &dict);
75 void parse_cmdline_classic (
int argc,
const char **argv,
76 std::map<std::string,std::string> &dict);
78 void parse_cmdline_equalsign (
int argc,
const char **argv,
79 const std::vector<std::string> &leading_args,
80 std::map<std::string,std::string> &dict);
82 void parse_cmdline_equalsign (
int argc,
const char **argv,
83 std::map<std::string,std::string> &dict);
88 bool equal_nocase (
const std::string &a,
const std::string &b);
91 std::string
tolower(
const std::string &input);
95 template<
typename T>
void split (
const std::string &inp, std::vector<T> &list);
99 template<
typename T>
inline std::vector<T>
split (
const std::string &inp)
100 { std::vector<T> res;
split(inp,res);
return res; }
104 void tokenize (
const std::string &inp,
char delim,
105 std::vector<std::string> &list);
109 inline std::vector<std::string>
tokenize (
const std::string &inp,
char delim)
111 std::vector<std::string> res;
119 std::vector<std::string> &words);
void tokenize(const std::string &inp, char delim, std::vector< std::string > &list)
std::string intToString(int64 x, tsize width)
void parse_words_from_file(const std::string &filename, std::vector< std::string > &words)
bool equal_nocase(const std::string &a, const std::string &b)
std::string trim(const std::string &orig)
void parse_file(const std::string &filename, std::map< std::string, std::string > &dict)
void stringToData(const std::string &x, T &value)
std::string dataToString(const T &x)
void split(const std::string &inp, std::vector< T > &list)
std::string tolower(const std::string &input)