| 1 |
|
// Copyright 2022 Peter Dimov
|
1 |
|
// Copyright 2022 Peter Dimov
|
| 2 |
|
// Copyright 2023 Matt Borland
|
2 |
|
// Copyright 2023 Matt Borland
|
| 3 |
|
// Distributed under the Boost Software License, Version 1.0.
|
3 |
|
// Distributed under the Boost Software License, Version 1.0.
|
| 4 |
|
// https://www.boost.org/LICENSE_1_0.txt
|
4 |
|
// https://www.boost.org/LICENSE_1_0.txt
|
| 5 |
|
|
5 |
|
|
| 6 |
|
// https://stackoverflow.com/questions/38060411/visual-studio-2015-wont-suppress-error-c4996
|
6 |
|
// https://stackoverflow.com/questions/38060411/visual-studio-2015-wont-suppress-error-c4996
|
| 7 |
|
#ifndef _SCL_SECURE_NO_WARNINGS
|
7 |
|
#ifndef _SCL_SECURE_NO_WARNINGS
|
| 8 |
|
# define _SCL_SECURE_NO_WARNINGS
|
8 |
|
# define _SCL_SECURE_NO_WARNINGS
|
| 9 |
|
|
9 |
|
|
| 10 |
|
#ifndef NO_WARN_MBCS_MFC_DEPRECATION
|
10 |
|
#ifndef NO_WARN_MBCS_MFC_DEPRECATION
|
| 11 |
|
# define NO_WARN_MBCS_MFC_DEPRECATION
|
11 |
|
# define NO_WARN_MBCS_MFC_DEPRECATION
|
| 12 |
|
|
12 |
|
|
| 13 |
|
|
13 |
|
|
| 14 |
|
#include <boost/json/detail/charconv/detail/fast_float/fast_float.hpp>
|
14 |
|
#include <boost/json/detail/charconv/detail/fast_float/fast_float.hpp>
|
| 15 |
|
#include <boost/json/detail/charconv/detail/from_chars_float_impl.hpp>
|
15 |
|
#include <boost/json/detail/charconv/detail/from_chars_float_impl.hpp>
|
| 16 |
|
#include <boost/json/detail/charconv/from_chars.hpp>
|
16 |
|
#include <boost/json/detail/charconv/from_chars.hpp>
|
| 17 |
|
|
17 |
|
|
| 18 |
|
|
18 |
|
|
| 19 |
|
|
19 |
|
|
| 20 |
|
|
20 |
|
|
| 21 |
|
|
21 |
|
|
| 22 |
|
|
22 |
|
|
| 23 |
|
#if defined(__GNUC__) && __GNUC__ < 5
|
23 |
|
#if defined(__GNUC__) && __GNUC__ < 5
|
| 24 |
|
# pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
24 |
|
# pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
| 25 |
|
|
25 |
|
|
| 26 |
|
|
26 |
|
|
| 27 |
|
std::errc boost::json::detail::charconv::detail::errno_to_errc(int errno_value) noexcept
|
27 |
|
std::errc boost::json::detail::charconv::detail::errno_to_errc(int errno_value) noexcept
|
| 28 |
|
|
28 |
|
|
| 29 |
|
|
29 |
|
|
| 30 |
|
|
30 |
|
|
| 31 |
|
|
31 |
|
|
| 32 |
|
return std::errc::invalid_argument;
|
32 |
|
return std::errc::invalid_argument;
|
| 33 |
|
|
33 |
|
|
| 34 |
|
return std::errc::result_out_of_range;
|
34 |
|
return std::errc::result_out_of_range;
|
| 35 |
|
|
35 |
|
|
| 36 |
|
|
36 |
|
|
| 37 |
|
|
37 |
|
|
| 38 |
|
|
38 |
|
|
| 39 |
|
|
39 |
|
|
| 40 |
|
boost::json::detail::charconv::from_chars_result boost::json::detail::charconv::from_chars(const char* first, const char* last, double& value, boost::json::detail::charconv::chars_format fmt) noexcept
|
40 |
|
boost::json::detail::charconv::from_chars_result boost::json::detail::charconv::from_chars(const char* first, const char* last, double& value, boost::json::detail::charconv::chars_format fmt) noexcept
|
| 41 |
|
|
41 |
|
|
| 42 |
|
if (fmt != boost::json::detail::charconv::chars_format::hex)
|
42 |
|
if (fmt != boost::json::detail::charconv::chars_format::hex)
|
| 43 |
|
|
43 |
|
|
| 44 |
|
return boost::json::detail::charconv::detail::fast_float::from_chars(first, last, value, fmt);
|
44 |
|
return boost::json::detail::charconv::detail::fast_float::from_chars(first, last, value, fmt);
|
| 45 |
|
|
45 |
|
|
| 46 |
|
return boost::json::detail::charconv::detail::from_chars_float_impl(first, last, value, fmt);
|
46 |
|
return boost::json::detail::charconv::detail::from_chars_float_impl(first, last, value, fmt);
|
| 47 |
|
|
47 |
|
|