19 std::string
m_sprintf(
const char* _Format, ...);
20 std::wstring
m_swprintf(
const wchar_t* _Format, ...);
34 const char* start = str.c_str(), *expected_end = start + str.size();
36 T value = _StringToNumber<T>(start, &end);
37 if (end != expected_end)
return false;
49 template <
class T,
class _Tc>
57 template <
class T,
class _Tc>
62 const T tofind = ArgsSearchString<T>();
65 while (curpos != in.npos)
67 curpos = in.find_first_not_of(_Tc(
' '), curpos);
68 if (curpos == in.npos)
break;
69 size_t nextpos = in.find_first_of(tofind, curpos);
70 if (nextpos == in.npos) {
71 out.push_back(in.substr(curpos, in.npos));
74 _Tc c = in.at(nextpos);
75 size_t startfrom = c == _Tc(
' ') ? curpos : curpos + 1;
76 T token = GetStringEndingAtNext<T, _Tc>(in, c, startfrom, curpos);
77 if (token.size()) out.push_back(token);
82 typedef std::vector<std::string> (*tokargs_t)(
const std::string&);
83 typedef std::vector<std::wstring> (*tokargsw_t)(
const std::wstring&);
88 std::vector<T>
Tokenize(
const T& str,
const T& delim)
91 std::vector<T> tokens;
92 size_t p0 = 0, p1 = T::npos;
93 while (p0 != T::npos) {
94 p1 = str.find_first_of(delim, p0);
96 T token = str.substr(p0, p1 - p0);
97 tokens.push_back(token);
99 p0 = str.find_first_not_of(delim, p1);