]> git.stg.codes - stg.git/blobdiff - stglibs/common.lib/common.cpp
Added some handy funcs to work with IBPP statements.
[stg.git] / stglibs / common.lib / common.cpp
index 1068cfa12ed085351486dd462b844cc7603a4d73..d91c17956755bfb008d800dcac5fccac2ffe0f55 100644 (file)
@@ -47,6 +47,8 @@
 
 #include <iconv.h>
 
+#include <algorithm>
+
 #include <cstdlib>
 #include <cstdarg>
 #include <cstdio>
@@ -820,6 +822,18 @@ std::string & Trim(std::string & val)
 return TrimR(TrimL(val));
 }
 //---------------------------------------------------------------------------
+std::string ToLower(std::string value)
+{
+    std::transform(value.begin(), value.end(), value.begin(), ::tolower);
+    return value;
+}
+//---------------------------------------------------------------------------
+std::string ToUpper(std::string value)
+{
+    std::transform(value.begin(), value.end(), value.begin(), ::toupper);
+    return value;
+}
+//---------------------------------------------------------------------------
 #ifdef WIN32
 static int is_leap(unsigned y)
 {