22inline std::string
format(
const char* fmt, ...) {
25 buffer =
new char[size];
28 int nsize = vsnprintf(buffer, size, fmt, vl);
29 std::string ret(buffer);
33 buffer =
new char[nsize - size + 2];
34 nsize = vsnprintf(buffer, (nsize - size) + 2, &fmt[size], vl);
47std::string
strip(
const std::string& in);
61void split(
const std::string& s,
char delim, Out result);
70std::vector<std::string>
split(
const std::string& s,
char delim);
79void split(
const std::string& s, Out result);
87std::vector<std::string>
split(
const std::string& s);
89std::vector<std::string>
split_by_regex(
const std::string& s,
const std::regex& regex);