]> git.stg.codes - stg.git/blobdiff - stglibs/common.lib/include/stg/common.h
Fixed stupid bug in case conversion functions.
[stg.git] / stglibs / common.lib / include / stg / common.h
index 80d32aba45a45116b523e81a4340e30b16e8c3fa..6c71289b1efc9bcd5814d52f59e40fc03bf8df8b 100644 (file)
@@ -96,6 +96,9 @@ std::string &   TrimL(std::string & val);
 std::string &   TrimR(std::string & val);
 std::string &   Trim(std::string & val);
 
+std::string     ToLower(const std::string & value);
+std::string     ToUpper(const std::string & value);
+
 std::string     IconvString(const std::string & source, const std::string & from, const std::string & to);
 
 int ParseInt(const std::string & str, int * val);
@@ -112,7 +115,11 @@ int str2x(const std::string & str, varT & x);
 template <typename varT>
 const std::string & x2str(varT x, std::string & s);
 template <typename varT>
+std::string x2str(varT x) { std::string s; return x2str(x, s); }
+template <typename varT>
 const std::string & unsigned2str(varT x, std::string & s);
+template <typename varT>
+std::string unsigned2str(varT x) { std::string s; return unsigned2str(x, s); }
 
 //-----------------------------------------------------------------------------
 template <typename varT>
@@ -148,7 +155,7 @@ int str2x(const std::string & str, varT & x)
         x += str[i] - '0';
     }
 
-    x*= minus;
+    x *= minus;
 
     return 0;
 }