X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/3cc4710818c810ca4e899cfd3d52f091815017d2..53536f012e78a3d28ca1290109667ce2aba794d7:/stglibs/common.lib/common.cpp diff --git a/stglibs/common.lib/common.cpp b/stglibs/common.lib/common.cpp index 1068cfa1..8b62e68b 100644 --- a/stglibs/common.lib/common.cpp +++ b/stglibs/common.lib/common.cpp @@ -47,6 +47,8 @@ #include +#include + #include #include #include @@ -750,6 +752,11 @@ if (errno == ERANGE) return 0; } +//--------------------------------------------------------------------------- +int str2x(const std::string & str, double & x) +{ +return strtodouble2(str.c_str(), x); +} #ifndef WIN32 //--------------------------------------------------------------------------- int str2x(const std::string & str, int64_t & x) @@ -820,6 +827,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) { @@ -885,7 +904,7 @@ strncpy(inBuf, source.c_str(), source.length()); inBuf[source.length()] = 0; -#if defined(FREE_BSD) || defined(FREE_BSD5) || defined(WIN32) +#if defined(CONST_ICONV) const char * srcPos = inBuf; #else char * srcPos = inBuf;