From: Maxim Mamontov <faust.madf@gmail.com>
Date: Wed, 9 Dec 2015 20:21:45 +0000 (+0200)
Subject: Added specialization of str2x for doubles.
X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/7bed70818a176a8b79431c66235f5580163841a3?ds=inline;hp=--cc

Added specialization of str2x for doubles.
---

7bed70818a176a8b79431c66235f5580163841a3
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);