mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
fixed POSIXCPUInfo trim
This commit is contained in:
parent
e0ab3830af
commit
6cbc09954a
1 changed files with 10 additions and 9 deletions
|
|
@ -39,17 +39,18 @@
|
||||||
|
|
||||||
Platform::SystemInfo_struct Platform::SystemInfo;
|
Platform::SystemInfo_struct Platform::SystemInfo;
|
||||||
|
|
||||||
static inline void rtrim(std::string &s)
|
// trim from start (in place)
|
||||||
{
|
static inline void ltrim(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());
|
s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](unsigned char ch) {
|
||||||
//FIXME !!!! s.erase(std::find_if(s.rbegin(), s.rend(), static_cast<int(*)(int)>(std::isspace).base(), s.end());
|
return !std::isspace(ch);
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void ltrim(std::string &s)
|
// trim from end (in place)
|
||||||
{
|
static inline void rtrim(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))));
|
s.erase(std::find_if(s.rbegin(), s.rend(), [](unsigned char ch) {
|
||||||
//using lambada
|
return !std::isspace(ch);
|
||||||
s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int c) {return !std::isspace(c);}));
|
}).base(), s.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
static void getCPUInformation()
|
static void getCPUInformation()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue