]> git.stg.codes - stg.git/blobdiff - stglibs/common.lib/common.h
scriptexecuter become a plain C library
[stg.git] / stglibs / common.lib / common.h
index 6e9576983b5b95544a6f3ca2e40b9e18d5e39ca5..19a8773e3d93b031183f989f03a4012d9b66930e 100644 (file)
@@ -34,8 +34,8 @@
 #endif
 #include <string>
 
-#include "os_int.h"
-#include "stg_const.h"
+#include "stg/os_int.h"
+#include "stg/const.h"
 
 #define STAT_TIME_3         (1)
 #define STAT_TIME_2         (2)
@@ -98,6 +98,13 @@ std::string &   Trim(std::string & val);
 
 std::string     IconvString(const std::string & source, const std::string & from, const std::string & to);
 
+int ParseInt(const std::string & str, int * val);
+int ParseUnsigned(const std::string & str, unsigned * val);
+int ParseIntInRange(const std::string & str, int min, int max, int * val);
+int ParseUnsignedInRange(const std::string & str, unsigned min,
+                         unsigned max, unsigned * val);
+int ParseYesNo(const std::string & str, bool * val);
+
 //-----------------------------------------------------------------------------
 template <typename varT>
 int str2x(const std::string & str, varT & x)
@@ -221,8 +228,10 @@ int str2x(const std::string & str, int & x);
 int str2x(const std::string & str, unsigned & x);
 int str2x(const std::string & str, long & x);
 int str2x(const std::string & str, unsigned long & x);
+#ifndef WIN32
 int str2x(const std::string & str, long long & x);
 int str2x(const std::string & str, unsigned long long & x);
+#endif
 //-----------------------------------------------------------------------------
 const std::string & x2str(unsigned x, std::string & s);
 const std::string & x2str(unsigned long x, std::string & s);