format.hpp 928 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // Copyright (c) 2019 Vinnie Falco ([email protected])
  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. namespace boost {
  12. namespace json {
  13. namespace detail {
  14. int constexpr max_number_chars =
  15. 1 + // '-'
  16. 19 + // unsigned 64-bit mantissa
  17. 1 + // 'e'
  18. 1 + // '-'
  19. 5; // unsigned 16-bit exponent
  20. BOOST_JSON_DECL
  21. unsigned
  22. format_uint64(
  23. char* dest,
  24. std::uint64_t value) noexcept;
  25. BOOST_JSON_DECL
  26. unsigned
  27. format_int64(
  28. char* dest, int64_t i) noexcept;
  29. BOOST_JSON_DECL
  30. unsigned
  31. format_double(
  32. char* dest, double d, bool allow_infinity_and_nan = false) noexcept;
  33. } // detail
  34. } // namespace json
  35. } // namespace boost
  36. #endif