25 |
#endif |
#endif |
26 |
|
|
27 |
#include <cstring> |
#include <cstring> |
28 |
|
#include <algorithm> |
29 |
|
|
30 |
#include <glibmmconfig.h> |
#include <glibmmconfig.h> |
31 |
// threads.h must be included first to be able to build with |
// threads.h must be included first to be able to build with |
117 |
return Glib::convert_with_fallback(utf8_string, GIG_STR_ENCODING, "UTF-8", "?"); |
return Glib::convert_with_fallback(utf8_string, GIG_STR_ENCODING, "UTF-8", "?"); |
118 |
} |
} |
119 |
|
|
120 |
|
inline Glib::ustring ltrim(Glib::ustring s) { |
121 |
|
s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace)))); |
122 |
|
return s; |
123 |
|
} |
124 |
|
|
125 |
|
inline Glib::ustring rtrim(Glib::ustring s) { |
126 |
|
s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end()); |
127 |
|
return s; |
128 |
|
} |
129 |
|
|
130 |
|
inline Glib::ustring trim(Glib::ustring s) { |
131 |
|
return ltrim(rtrim(s)); |
132 |
|
} |
133 |
|
|
134 |
template<class T> inline std::string ToString(T o) { |
template<class T> inline std::string ToString(T o) { |
135 |
std::stringstream ss; |
std::stringstream ss; |
136 |
ss << o; |
ss << o; |