format.hpp 853 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // Official repository: https://github.com/boostorg/json
  8. //
  9. #ifndef BOOST_JSON_DETAIL_FORMAT_HPP
  10. #define BOOST_JSON_DETAIL_FORMAT_HPP
  11. BOOST_JSON_NS_BEGIN
  12. namespace detail {
  13. int constexpr max_number_chars =
  14. 1 + // '-'
  15. 19 + // unsigned 64-bit mantissa
  16. 1 + // 'e'
  17. 1 + // '-'
  18. 5; // unsigned 16-bit exponent
  19. BOOST_JSON_DECL
  20. unsigned
  21. format_uint64(
  22. char* dest,
  23. std::uint64_t value) noexcept;
  24. BOOST_JSON_DECL
  25. unsigned
  26. format_int64(
  27. char* dest, int64_t i) noexcept;
  28. BOOST_JSON_DECL
  29. unsigned
  30. format_double(
  31. char* dest, double d) noexcept;
  32. } // detail
  33. BOOST_JSON_NS_END
  34. #endif