1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add formspec api versioning

This commit is contained in:
sapier 2014-06-25 19:04:47 +02:00
parent 1367895ae2
commit ebf7ea5019
6 changed files with 130 additions and 34 deletions

View file

@ -27,6 +27,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <vector>
#include <sstream>
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
struct FlagDesc {
const char *name;
u32 flag;
@ -316,6 +319,17 @@ inline std::string unescape_string(std::string &s)
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);