]> git.stg.codes - stg.git/blobdiff - stglibs/common.lib/common.cpp
Factored out user's parser.
[stg.git] / stglibs / common.lib / common.cpp
index 787b813d3728bf975571f4401756ad3863526a8a..c02f675c943c9c93abd6cbb9407eda1d1d84ea32 100644 (file)
@@ -819,6 +819,22 @@ std::string & Trim(std::string & val)
 return TrimR(TrimL(val));
 }
 //---------------------------------------------------------------------------
+std::string ToLower(const std::string & value)
+{
+    std::string res;
+    for (std::string::size_type pos = 0; pos < value.length(); ++pos)
+        res += tolower(value[pos]);
+    return value;
+}
+//---------------------------------------------------------------------------
+std::string ToUpper(const std::string & value)
+{
+    std::string res;
+    for (std::string::size_type pos = 0; pos < value.length(); ++pos)
+        res += toupper(value[pos]);
+    return value;
+}
+//---------------------------------------------------------------------------
 #ifdef WIN32
 static int is_leap(unsigned y)
 {