44
55// See https://github.com/danielaparker/jsoncons for latest version
66
7- #ifndef JSONCONS_UTILITY_TO_NUMBER_HPP
8- #define JSONCONS_UTILITY_TO_NUMBER_HPP
7+ #ifndef JSONCONS_UTILITY_READ_NUMBER_HPP
8+ #define JSONCONS_UTILITY_READ_NUMBER_HPP
99
1010#include < cctype>
1111#include < cstddef>
@@ -743,11 +743,11 @@ hexstr_to_integer(const CharT* s, std::size_t length, T& n)
743743 return to_number_result<CharT>(s, std::errc ());
744744}
745745
746- // to_double
746+ // decstr_to_double
747747
748748#if defined(JSONCONS_HAS_STD_FROM_CHARS)
749749
750- inline to_number_result<char > to_double (const char * s, std::size_t length, double & val)
750+ inline to_number_result<char > decstr_to_double (const char * s, std::size_t length, double & val)
751751 {
752752 const char * cur = s+length;
753753 const auto res = std::from_chars (s, cur, val);
@@ -758,7 +758,7 @@ hexstr_to_integer(const CharT* s, std::size_t length, T& n)
758758 return to_number_result<char >{res.ptr ,res.ec };
759759 }
760760
761- inline to_number_result<wchar_t > to_double (const wchar_t * s, std::size_t length, double & val)
761+ inline to_number_result<wchar_t > decstr_to_double (const wchar_t * s, std::size_t length, double & val)
762762 {
763763 std::string buf (length,' 0' );
764764 for (size_t i = 0 ; i < length; ++i)
@@ -776,7 +776,7 @@ hexstr_to_integer(const CharT* s, std::size_t length, T& n)
776776
777777#elif defined(JSONCONS_HAS_MSC_STRTOD_L)
778778
779- inline to_number_result<char > to_double (const char * s, std::size_t length, double & val)
779+ inline to_number_result<char > decstr_to_double (const char * s, std::size_t length, double & val)
780780 {
781781 static _locale_t locale = _create_locale (LC_NUMERIC, " C" );
782782
@@ -794,7 +794,7 @@ hexstr_to_integer(const CharT* s, std::size_t length, T& n)
794794 return to_number_result<char >{end};
795795 }
796796
797- inline to_number_result<wchar_t > to_double (const wchar_t * s, std::size_t length, double & val)
797+ inline to_number_result<wchar_t > decstr_to_double (const wchar_t * s, std::size_t length, double & val)
798798 {
799799 static _locale_t locale = _create_locale (LC_NUMERIC, " C" );
800800
@@ -815,7 +815,7 @@ hexstr_to_integer(const CharT* s, std::size_t length, T& n)
815815
816816#elif defined(JSONCONS_HAS_STRTOLD_L)
817817
818- inline to_number_result<char > to_double (const char * s, std::size_t length, double & val)
818+ inline to_number_result<char > decstr_to_double (const char * s, std::size_t length, double & val)
819819 {
820820 locale_t locale = newlocale (LC_ALL_MASK, " C" , (locale_t ) 0 );
821821
@@ -833,7 +833,7 @@ hexstr_to_integer(const CharT* s, std::size_t length, T& n)
833833 return to_number_result<char >{end};
834834 }
835835
836- inline to_number_result<wchar_t > to_double (const wchar_t * s, std::size_t length, double & val)
836+ inline to_number_result<wchar_t > decstr_to_double (const wchar_t * s, std::size_t length, double & val)
837837 {
838838 locale_t locale = newlocale (LC_ALL_MASK, " C" , (locale_t ) 0 );
839839
@@ -853,7 +853,7 @@ hexstr_to_integer(const CharT* s, std::size_t length, T& n)
853853
854854#else
855855
856- inline to_number_result<char > to_double (const char * s, std::size_t length, double & val)
856+ inline to_number_result<char > decstr_to_double (const char * s, std::size_t length, double & val)
857857 {
858858 const char * cur = s+length;
859859 char *end = nullptr ;
@@ -882,7 +882,7 @@ hexstr_to_integer(const CharT* s, std::size_t length, T& n)
882882 return to_number_result<char >{str_end};
883883 }
884884
885- inline to_number_result<wchar_t > to_double (const wchar_t * s, std::size_t length, double & val)
885+ inline to_number_result<wchar_t > decstr_to_double (const wchar_t * s, std::size_t length, double & val)
886886 {
887887 const wchar_t * cur = s+length;
888888 wchar_t *end = nullptr ;
@@ -911,7 +911,7 @@ hexstr_to_integer(const CharT* s, std::size_t length, T& n)
911911 return to_number_result<wchar_t >{str_end};
912912 }
913913
914- inline to_number_result<char > to_double (char * s, std::size_t length)
914+ inline to_number_result<char > decstr_to_double (char * s, std::size_t length)
915915 {
916916 char * cur = s+length;
917917 char *end = nullptr ;
@@ -937,7 +937,7 @@ hexstr_to_integer(const CharT* s, std::size_t length, T& n)
937937 return to_number_result<char >{end};
938938 }
939939
940- inline to_number_result<wchar_t > to_double (wchar_t * s, std::size_t length)
940+ inline to_number_result<wchar_t > decstr_to_double (wchar_t * s, std::size_t length)
941941 {
942942 wchar_t * cur = s+length;
943943 wchar_t *end = nullptr ;
@@ -1026,4 +1026,4 @@ hexstr_to_integer(const CharT* s, std::size_t length, T& n)
10261026} // namespace utility
10271027} // namespace jsoncons
10281028
1029- #endif // JSONCONS_UTILITY_TO_NUMBER_HPP
1029+ #endif // JSONCONS_UTILITY_READ_NUMBER_HPP
0 commit comments