#include <cstring>
#include <vector>
#include <sstream>
+#include <cctype>
+
+#define STRINGIFY(x) #x
+#define TOSTRING(x) STRINGIFY(x)
struct FlagDesc {
const char *name;
inline s64 stoi64(const std::string &s) {
std::stringstream tmp(s);
- long long t;
+ s64 t;
tmp >> t;
return t;
}
return res;
}
+inline bool is_number(const std::string& tocheck)
+{
+ std::string::const_iterator iter = tocheck.begin();
+
+ while (iter != tocheck.end() && std::isdigit(*iter)) {
+ ++iter;
+ }
+
+ return ((!tocheck.empty()) && (iter == tocheck.end()));
+}
+
std::string translatePassword(std::string playername, std::wstring password);
std::string urlencode(std::string str);
std::string urldecode(std::string str);