15 #ifndef STRING_UTILS_H 16 #define STRING_UTILS_H 18 #include "dtoolbase.h" 21 #include "vector_string.h" 26 EXPCL_DTOOL
int cmp_nocase(
const string &s,
const string &s2);
29 EXPCL_DTOOL
int cmp_nocase_uh(
const string &s,
const string &s2);
32 EXPCL_DTOOL
string downcase(
const string &s);
35 EXPCL_DTOOL
string upcase(
const string &s);
38 EXPCL_DTOOL
int extract_words(
const string &str, vector_string &words);
42 EXPCL_DTOOL
void tokenize(
const string &str, vector_string &words,
43 const string &delimiters,
44 bool discard_repeated_delimiters =
false);
46 const wstring &delimiters,
47 bool discard_repeated_delimiters =
false);
50 EXPCL_DTOOL
string trim_left(
const string &str);
51 EXPCL_DTOOL wstring trim_left(
const wstring &str);
52 EXPCL_DTOOL
string trim_right(
const string &str);
53 EXPCL_DTOOL wstring trim_right(
const wstring &str);
54 EXPCL_DTOOL
string trim(
const string &str);
55 EXPCL_DTOOL wstring trim(
const wstring &str);
58 EXPCL_DTOOL
int string_to_int(
const string &str,
string &tail);
59 EXPCL_DTOOL
bool string_to_int(
const string &str,
int &result);
60 EXPCL_DTOOL
double string_to_double(
const string &str,
string &tail);
61 EXPCL_DTOOL
bool string_to_double(
const string &str,
double &result);
62 EXPCL_DTOOL
bool string_to_float(
const string &str,
float &result);
63 EXPCL_DTOOL
bool string_to_stdfloat(
const string &str, PN_stdfloat &result);
68 INLINE
string format_string(
const Thing &thing);
71 INLINE
string format_string(
const string &value);
72 INLINE
string format_string(
float value);
73 INLINE
string format_string(
double value);
74 INLINE
string format_string(
unsigned int value);
75 INLINE
string format_string(
int value);
76 INLINE
string format_string(PN_int64 value);
78 #include "string_utils.I" This is our own Panda specialization on the default STL vector.