|
|
@ -10,6 +10,7 @@
|
|
|
|
#include <algorithm>
|
|
|
|
#include <algorithm>
|
|
|
|
#include <cctype>
|
|
|
|
#include <cctype>
|
|
|
|
#include <locale>
|
|
|
|
#include <locale>
|
|
|
|
|
|
|
|
#include <cstring>
|
|
|
|
|
|
|
|
|
|
|
|
#pragma GCC diagnostic push
|
|
|
|
#pragma GCC diagnostic push
|
|
|
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
|
|
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
|
|
@ -127,6 +128,22 @@ static std::vector<std::string> str_tokenize(const std::string& s, const std::st
|
|
|
|
return v;
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void trim_char(char* str) {
|
|
|
|
|
|
|
|
if(!str)
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char* ptr = str;
|
|
|
|
|
|
|
|
int len = strlen(ptr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while(len-1 > 0 && isspace(ptr[len-1]))
|
|
|
|
|
|
|
|
ptr[--len] = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while(*ptr && isspace(*ptr))
|
|
|
|
|
|
|
|
++ptr, --len;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
memmove(str, ptr, len + 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#pragma GCC diagnostic pop
|
|
|
|
#pragma GCC diagnostic pop
|
|
|
|
|
|
|
|
|
|
|
|
#endif //MANGOHUD_STRING_UTILS_H
|
|
|
|
#endif //MANGOHUD_STRING_UTILS_H
|
|
|
|