116 |
return Glib::convert_with_fallback(utf8_string, GIG_STR_ENCODING, "UTF-8", "?"); |
return Glib::convert_with_fallback(utf8_string, GIG_STR_ENCODING, "UTF-8", "?"); |
117 |
} |
} |
118 |
|
|
119 |
|
inline Glib::ustring ltrim(Glib::ustring s) { |
120 |
|
s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace)))); |
121 |
|
return s; |
122 |
|
} |
123 |
|
|
124 |
|
inline Glib::ustring rtrim(Glib::ustring s) { |
125 |
|
s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end()); |
126 |
|
return s; |
127 |
|
} |
128 |
|
|
129 |
|
inline Glib::ustring trim(Glib::ustring s) { |
130 |
|
return ltrim(rtrim(s)); |
131 |
|
} |
132 |
|
|
133 |
template<class T> inline std::string ToString(T o) { |
template<class T> inline std::string ToString(T o) { |
134 |
std::stringstream ss; |
std::stringstream ss; |
135 |
ss << o; |
ss << o; |