7#ifndef MYGUI_STRING_UTILITY_H_
8#define MYGUI_STRING_UTILITY_H_
39 template<
typename T1,
typename T2>
47 template<
typename T1,
typename T2,
typename T3>
55 template<
typename T1,
typename T2,
typename T3,
typename T4>
63 template<
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
71 template<
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6>
79 template<
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7>
87 template<
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8>
95 template<
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8,
typename T9>
106 return _value ?
"true" :
"false";
124 if (item !=
' ' && item !=
'\t')
205 template<
typename T1,
typename T2>
218 if (item !=
' ' && item !=
'\t')
226 template<
typename T1,
typename T2>
239 if (item !=
' ' && item !=
'\t')
247 template<
typename T1,
typename T2>
260 if (item !=
' ' && item !=
'\t')
270 template<
typename Type>
278 _ret.push_back(
_source.substr(start, end - start));
291 std::vector<std::string>
result;
296 template<
typename T1,
typename T2,
typename T3,
typename T4>
308 if (item !=
' ' && item !=
'\t')
316 template<
typename T1,
typename T2,
typename T3>
328 if (item !=
' ' && item !=
'\t')
336 template<
typename T1,
typename T2>
348 if (item !=
' ' && item !=
'\t')
356 template<
typename T1>
368 if (item !=
' ' && item !=
'\t')
379 std::string value(
_value);
381 if ((value ==
"True") || (value ==
"true") || (value ==
"1"))
386 else if ((value ==
"False") || (value ==
"false") || (value ==
"0"))
397 size_t count =
_value.size();
400 for (
size_t index = 0; index < count; ++ index)
410 size_t count =
_value.size();
413 size_t offset =
_source.size() - count;
414 for (
size_t index = 0; index < count; ++ index)
void split(std::vector< Type > &_ret, const Type &_source, const Type &_delims)
size_t parseSizeT(const std::string &_value)
std::vector< std::string > split(const std::string &_source, const std::string &_delims="\t\n ")
bool parseComplex< bool >(const std::string &_value, bool &_p1)
int parseInt(const std::string &_value)
T1 parseValueEx2(const std::string &_value)
bool parseBool(const std::string &_value)
T parseValue(const std::string &_value)
double parseDouble(const std::string &_value)
short parseShort(const std::string &_value)
unsigned int parseUInt(const std::string &_value)
char parseChar(const std::string &_value)
bool parseComplex(const std::string &_value, T1 &_p1, T2 &_p2, T3 &_p3, T4 &_p4)
unsigned char parseUChar(const std::string &_value)
std::string toString< bool >(bool _value)
T1 parseValueEx4(const std::string &_value)
std::string toString(T p)
bool startWith(const std::string &_source, const std::string &_value)
bool endWith(const std::string &_source, const std::string &_value)
T1 parseValueEx3(const std::string &_value)
void trim(std::string &_str, bool _left=true, bool _right=true)
float parseFloat(const std::string &_value)
unsigned short parseUShort(const std::string &_value)