|
@@ -39,17 +39,18 @@
|
|
|
|
|
|
Platform::SystemInfo_struct Platform::SystemInfo;
|
|
Platform::SystemInfo_struct Platform::SystemInfo;
|
|
|
|
|
|
-static inline void rtrim(std::string &s)
|
|
|
|
-{
|
|
|
|
- //XXTH deprecated! s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
|
|
|
|
- //FIXME !!!! s.erase(std::find_if(s.rbegin(), s.rend(), static_cast<int(*)(int)>(std::isspace).base(), s.end());
|
|
|
|
|
|
+// trim from start (in place)
|
|
|
|
+static inline void ltrim(std::string &s) {
|
|
|
|
+ s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](unsigned char ch) {
|
|
|
|
+ return !std::isspace(ch);
|
|
|
|
+ }));
|
|
}
|
|
}
|
|
|
|
|
|
-static inline void ltrim(std::string &s)
|
|
|
|
-{
|
|
|
|
- //XXTH deprecated! s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
|
|
|
|
- //using lambada
|
|
|
|
- s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int c) {return !std::isspace(c);}));
|
|
|
|
|
|
+// trim from end (in place)
|
|
|
|
+static inline void rtrim(std::string &s) {
|
|
|
|
+ s.erase(std::find_if(s.rbegin(), s.rend(), [](unsigned char ch) {
|
|
|
|
+ return !std::isspace(ch);
|
|
|
|
+ }).base(), s.end());
|
|
}
|
|
}
|
|
|
|
|
|
static void getCPUInformation()
|
|
static void getCPUInformation()
|