From: Maxim Mamontov Date: Wed, 9 Dec 2015 20:21:45 +0000 (+0200) Subject: Added specialization of str2x for doubles. X-Git-Tag: 2.409~174^2~9 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/adda4265c88314b4c78e2d46129ca09534931ede?ds=sidebyside;hp=--cc Added specialization of str2x for doubles. --- adda4265c88314b4c78e2d46129ca09534931ede diff --git a/stglibs/common.lib/common.cpp b/stglibs/common.lib/common.cpp index 22ec354b..8b62e68b 100644 --- a/stglibs/common.lib/common.cpp +++ b/stglibs/common.lib/common.cpp @@ -752,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) diff --git a/stglibs/common.lib/include/stg/common.h b/stglibs/common.lib/include/stg/common.h index f46c922a..af0f89a1 100644 --- a/stglibs/common.lib/include/stg/common.h +++ b/stglibs/common.lib/include/stg/common.h @@ -152,6 +152,7 @@ std::string ToPrintable(const std::string & src); //----------------------------------------------------------------------------- int str2x(const std::string & str, int32_t & x); int str2x(const std::string & str, uint32_t & x); +int str2x(const std::string & str, double & x); #ifndef WIN32 int str2x(const std::string & str, int64_t & x); int str2x(const std::string & str, uint64_t & x);