From 7bed70818a176a8b79431c66235f5580163841a3 Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Wed, 9 Dec 2015 22:21:45 +0200 Subject: [PATCH] Added specialization of str2x for doubles. --- stglibs/common.lib/common.cpp | 5 +++++ stglibs/common.lib/include/stg/common.h | 1 + 2 files changed, 6 insertions(+) diff --git a/stglibs/common.lib/common.cpp b/stglibs/common.lib/common.cpp index 90493e9f..b527ac58 100644 --- a/stglibs/common.lib/common.cpp +++ b/stglibs/common.lib/common.cpp @@ -753,6 +753,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 e90ad75a..a20c3d9f 100644 --- a/stglibs/common.lib/include/stg/common.h +++ b/stglibs/common.lib/include/stg/common.h @@ -151,6 +151,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); -- 2.44.2