From adda4265c88314b4c78e2d46129ca09534931ede 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 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); -- 2.43.2