From 57d822b6e20b1d7c96e535a37511de56df3d3679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20DELRIEU?= Date: Mon, 14 Aug 2017 19:28:01 +0200 Subject: [PATCH] add missing includes, put back include comments --- src/detail/conversions/from_json.hpp | 18 +++++++------ src/detail/conversions/to_json.hpp | 10 +++++--- src/detail/iterators/iter_impl.hpp | 9 +++++-- src/detail/iterators/iteration_proxy.hpp | 6 +++-- .../iterators/json_reverse_iterator.hpp | 6 ++--- src/detail/iterators/primitive_iterator.hpp | 7 +++--- src/detail/macro_scope.hpp | 2 ++ src/detail/meta.hpp | 9 ++++--- src/detail/parsing/binary_reader.hpp | 22 ++++++++++------ src/detail/parsing/binary_writer.hpp | 10 ++++---- src/detail/parsing/input_adapters.hpp | 19 +++++++++----- src/detail/parsing/lexer.hpp | 12 ++++++--- src/detail/parsing/output_adapters.hpp | 14 ++++++----- src/detail/parsing/parser.hpp | 11 +++++--- src/detail/serializer.hpp | 25 +++++++++++-------- src/detail/value_t.hpp | 5 ++-- src/json.hpp | 21 +++++----------- src/json_fwd.hpp | 4 +-- 18 files changed, 123 insertions(+), 87 deletions(-) diff --git a/src/detail/conversions/from_json.hpp b/src/detail/conversions/from_json.hpp index 471c1320..55925464 100644 --- a/src/detail/conversions/from_json.hpp +++ b/src/detail/conversions/from_json.hpp @@ -1,10 +1,16 @@ #ifndef NLOHMANN_JSON_DETAIL_CONVERSIONS_FROM_JSON_HPP #define NLOHMANN_JSON_DETAIL_CONVERSIONS_FROM_JSON_HPP -#include -#include -#include -#include +#include // transform +#include // array +#include // and, not +#include // forward_list +#include // inserter, front_inserter, end +#include // string +#include // tuple, make_tuple +#include // is_arithmetic, is_same, is_enum, underlying_type, is_convertible +#include // pair, declval +#include // valarray #include "detail/exceptions.hpp" #include "detail/macro_scope.hpp" @@ -15,10 +21,6 @@ namespace nlohmann { namespace detail { -/////////////// -// from_json // -/////////////// - // overloads for basic_json template parameters template::value and diff --git a/src/detail/conversions/to_json.hpp b/src/detail/conversions/to_json.hpp index 0c6d4749..0153b13d 100644 --- a/src/detail/conversions/to_json.hpp +++ b/src/detail/conversions/to_json.hpp @@ -1,9 +1,13 @@ #ifndef NLOHMANN_JSON_DETAIL_CONVERSIONS_TO_JSON_HPP #define NLOHMANN_JSON_DETAIL_CONVERSIONS_TO_JSON_HPP -#include -#include -#include +#include // or, and, not +#include // begin, end +#include // tuple, get +#include // is_same, is_constructible, is_floating_point, is_enum, underlying_type +#include // move, forward, declval, pair +#include // valarray +#include // vector #include "detail/meta.hpp" #include "detail/value_t.hpp" diff --git a/src/detail/iterators/iter_impl.hpp b/src/detail/iterators/iter_impl.hpp index 79b11b33..e11412c6 100644 --- a/src/detail/iterators/iter_impl.hpp +++ b/src/detail/iterators/iter_impl.hpp @@ -1,11 +1,16 @@ #ifndef NLOHMANN_JSON_DETAIL_ITERATORS_ITER_IMPL_HPP #define NLOHMANN_JSON_DETAIL_ITERATORS_ITER_IMPL_HPP -#include -#include +#include // not +#include // iterator, random_access_iterator_tag, bidirectional_iterator_tag, advance, next +#include // conditional, is_const, remove_const #include "detail/exceptions.hpp" +#include "detail/iterators/internal_iterator.hpp" +#include "detail/iterators/primitive_iterator.hpp" #include "detail/macro_scope.hpp" +#include "detail/meta.hpp" +#include "detail/value_t.hpp" namespace nlohmann { diff --git a/src/detail/iterators/iteration_proxy.hpp b/src/detail/iterators/iteration_proxy.hpp index 6a13f39d..e4ce84e4 100644 --- a/src/detail/iterators/iteration_proxy.hpp +++ b/src/detail/iterators/iteration_proxy.hpp @@ -1,8 +1,10 @@ #ifndef NLOHMANN_JSON_DETAIL_ITERATORS_ITERATION_PROXY_HPP #define NLOHMANN_JSON_DETAIL_ITERATORS_ITERATION_PROXY_HPP -#include -#include +#include // size_t +#include // string, to_string + +#include "detail/value_t.hpp" namespace nlohmann { diff --git a/src/detail/iterators/json_reverse_iterator.hpp b/src/detail/iterators/json_reverse_iterator.hpp index 52862d38..b0f4effe 100644 --- a/src/detail/iterators/json_reverse_iterator.hpp +++ b/src/detail/iterators/json_reverse_iterator.hpp @@ -1,9 +1,9 @@ #ifndef NLOHMANN_JSON_DETAIL_ITERATORS_JSON_REVERSE_ITERATOR_HPP #define NLOHMANN_JSON_DETAIL_ITERATORS_JSON_REVERSE_ITERATOR_HPP -#include -#include -#include +#include // ptrdiff_t +#include // reverse_iterator +#include // declval namespace nlohmann { diff --git a/src/detail/iterators/primitive_iterator.hpp b/src/detail/iterators/primitive_iterator.hpp index 8ebafe0e..c5cd4031 100644 --- a/src/detail/iterators/primitive_iterator.hpp +++ b/src/detail/iterators/primitive_iterator.hpp @@ -1,9 +1,10 @@ #ifndef NLOHMANN_JSON_DETAIL_ITERATORS_PRIMITIVE_ITERATOR_HPP #define NLOHMANN_JSON_DETAIL_ITERATORS_PRIMITIVE_ITERATOR_HPP -#include -#include -#include +#include // not +#include // ptrdiff_t +#include // numeric_limits +#include // ostream namespace nlohmann { diff --git a/src/detail/macro_scope.hpp b/src/detail/macro_scope.hpp index b2ac7742..f20cc667 100644 --- a/src/detail/macro_scope.hpp +++ b/src/detail/macro_scope.hpp @@ -1,6 +1,8 @@ #ifndef NLOHMANN_JSON_MACRO_SCOPE_HPP #define NLOHMANN_JSON_MACRO_SCOPE_HPP +#include // not + // This file contains all internal macro definitions // You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them diff --git a/src/detail/meta.hpp b/src/detail/meta.hpp index a9b20443..35705183 100644 --- a/src/detail/meta.hpp +++ b/src/detail/meta.hpp @@ -1,10 +1,11 @@ #ifndef NLOHMANN_JSON_DETAIL_META_HPP #define NLOHMANN_JSON_DETAIL_META_HPP -#include -#include -#include // add_pointer, conditional, decay, enable_if, false_type, integral_constant, is_arithmetic, is_base_of, is_const, is_constructible, is_convertible, is_default_constructible, is_enum, is_floating_point, is_integral, is_nothrow_move_assignable, is_nothrow_move_constructible, is_pointer, is_reference, is_same, is_scalar, is_signed, remove_const, remove_cv, remove_pointer, remove_reference, true_type, underlying_type -#include +#include // not +#include // size_t +#include // numeric_limits +#include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type +#include // declval #include "json_fwd.hpp" #include "detail/macro_scope.hpp" diff --git a/src/detail/parsing/binary_reader.hpp b/src/detail/parsing/binary_reader.hpp index 0d8ce4ad..a1195393 100644 --- a/src/detail/parsing/binary_reader.hpp +++ b/src/detail/parsing/binary_reader.hpp @@ -1,14 +1,20 @@ #ifndef NLOHMANN_JSON_DETAIL_PARSING_BINARY_READER_HPP #define NLOHMANN_JSON_DETAIL_PARSING_BINARY_READER_HPP -#include -#include -#include -#include -#include -#include -#include -#include +#include // generate_n +#include // array +#include // assert +#include // ldexp +#include // size_t +#include // uint8_t, uint16_t, uint32_t, uint64_t +#include // memcpy +#include // setw, setfill +#include // hex +#include // back_inserter +#include // numeric_limits +#include // stringstream +#include // char_traits, string +#include // make_pair, move #include "detail/exceptions.hpp" #include "detail/macro_scope.hpp" diff --git a/src/detail/parsing/binary_writer.hpp b/src/detail/parsing/binary_writer.hpp index 25badd89..59583b9c 100644 --- a/src/detail/parsing/binary_writer.hpp +++ b/src/detail/parsing/binary_writer.hpp @@ -1,11 +1,11 @@ #ifndef NLOHMANN_JSON_DETAIL_PARSING_BINARY_WRITER_HPP #define NLOHMANN_JSON_DETAIL_PARSING_BINARY_WRITER_HPP -#include -#include -#include -#include -#include +#include // reverse +#include // array +#include // uint8_t, uint16_t, uint32_t, uint64_t +#include // memcpy +#include // numeric_limits #include "detail/parsing/binary_reader.hpp" #include "detail/parsing/output_adapters.hpp" diff --git a/src/detail/parsing/input_adapters.hpp b/src/detail/parsing/input_adapters.hpp index 17cf5892..7d4f2dee 100644 --- a/src/detail/parsing/input_adapters.hpp +++ b/src/detail/parsing/input_adapters.hpp @@ -1,12 +1,19 @@ #ifndef NLOHMANN_JSON_DETAIL_PARSING_INPUT_ADAPTERS_HPP #define NLOHMANN_JSON_DETAIL_PARSING_INPUT_ADAPTERS_HPP -#include -#include -#include -#include -#include -#include +#include // min +#include // array +#include // assert +#include // size_t +#include // strlen +#include // streamsize, streamoff, streampos +#include // istream +#include // begin, end, iterator_traits, random_access_iterator_tag, distance, next +#include // shared_ptr, make_shared, addressof +#include // accumulate +#include // string, char_traits +#include // enable_if, is_base_of, is_pointer, is_integral, remove_pointer +#include // pair, declval #include "detail/macro_scope.hpp" diff --git a/src/detail/parsing/lexer.hpp b/src/detail/parsing/lexer.hpp index b1232db0..f50b0521 100644 --- a/src/detail/parsing/lexer.hpp +++ b/src/detail/parsing/lexer.hpp @@ -1,9 +1,15 @@ #ifndef NLOHMANN_JSON_DETAIL_PARSING_LEXER_HPP #define NLOHMANN_JSON_DETAIL_PARSING_LEXER_HPP -#include -#include -#include +#include // localeconv +#include // size_t +#include // strtof, strtod, strtold, strtoll, strtoull +#include // initializer_list +#include // hex, uppercase +#include // setw, setfill +#include // stringstream +#include // char_traits, string +#include // vector #include "detail/macro_scope.hpp" #include "detail/parsing/input_adapters.hpp" diff --git a/src/detail/parsing/output_adapters.hpp b/src/detail/parsing/output_adapters.hpp index 5cbc11b9..71099038 100644 --- a/src/detail/parsing/output_adapters.hpp +++ b/src/detail/parsing/output_adapters.hpp @@ -1,12 +1,14 @@ #ifndef NLOHMANN_JSON_DETAIL_PARSING_OUTPUT_ADAPTERS_HPP #define NLOHMANN_JSON_DETAIL_PARSING_OUTPUT_ADAPTERS_HPP -#include -#include -#include -#include -#include -#include +#include // copy +#include // size_t +#include // streamsize +#include // back_inserter +#include // shared_ptr, make_shared +#include // basic_ostream +#include // basic_string +#include // vector namespace nlohmann { diff --git a/src/detail/parsing/parser.hpp b/src/detail/parsing/parser.hpp index c82c2f6d..52a9c4fe 100644 --- a/src/detail/parsing/parser.hpp +++ b/src/detail/parsing/parser.hpp @@ -1,15 +1,18 @@ #ifndef NLOHMANN_JSON_DETAIL_PARSING_PARSER_HPP #define NLOHMANN_JSON_DETAIL_PARSING_PARSER_HPP -#include -#include -#include -#include +#include // assert +#include // isfinite +#include // uint8_t +#include // function +#include // string +#include // move #include "detail/exceptions.hpp" #include "detail/macro_scope.hpp" #include "detail/parsing/input_adapters.hpp" #include "detail/parsing/lexer.hpp" +#include "detail/value_t.hpp" namespace nlohmann { diff --git a/src/detail/serializer.hpp b/src/detail/serializer.hpp index 955a3eac..0d3303d9 100644 --- a/src/detail/serializer.hpp +++ b/src/detail/serializer.hpp @@ -1,21 +1,24 @@ #ifndef NLOHMANN_JSON_DETAIL_SERIALIZER_HPP #define NLOHMANN_JSON_DETAIL_SERIALIZER_HPP -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include // reverse, remove, fill, find, none_of +#include // array +#include // assert +#include // and, or +#include // localeconv, lconv +#include // labs, isfinite, isnan, signbit +#include // size_t, ptrdiff_t +#include // uint8_t +#include // snprintf +#include // next +#include // numeric_limits +#include // string +#include // is_same #include "detail/macro_scope.hpp" #include "detail/meta.hpp" #include "detail/parsing/output_adapters.hpp" +#include "detail/value_t.hpp" namespace nlohmann { diff --git a/src/detail/value_t.hpp b/src/detail/value_t.hpp index dbfffd47..b96f294b 100644 --- a/src/detail/value_t.hpp +++ b/src/detail/value_t.hpp @@ -1,6 +1,7 @@ #ifndef NLOHMANN_JSON_DETAIL_VALUE_T_HPP #define NLOHMANN_JSON_DETAIL_VALUE_T_HPP +#include // array #include // and #include // size_t #include // uint8_t @@ -37,7 +38,7 @@ value with the default value for a given type @since version 1.0.0 */ -enum class value_t : uint8_t +enum class value_t : std::uint8_t { null, ///< null value object, ///< object (unordered set of name/value pairs) @@ -62,7 +63,7 @@ Returns an ordering that is similar to Python: */ inline bool operator<(const value_t lhs, const value_t rhs) noexcept { - static constexpr std::array order = {{ + static constexpr std::array order = {{ 0 /* null */, 3 /* object */, 4 /* array */, 5 /* string */, 1 /* boolean */, 2 /* integer */, 2 /* unsigned */, 2 /* float */ } diff --git a/src/json.hpp b/src/json.hpp index 4eb7ec79..f4c139e4 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -29,26 +29,17 @@ SOFTWARE. #ifndef NLOHMANN_JSON_HPP #define NLOHMANN_JSON_HPP -#include // all_of, copy, fill, find, for_each, generate_n, none_of, remove, reverse, transform -#include // array +#include // all_of, find, for_each #include // assert #include // and, not, or -#include // lconv, localeconv -#include // isfinite, labs, ldexp, signbit #include // nullptr_t, ptrdiff_t, size_t -#include // abort, strtod, strtof, strtold, strtoul, strtoll, strtoull -#include // memcpy, strlen -#include // forward_list -#include // function, hash, less +#include // hash, less #include // initializer_list -#include // hex -#include // istream, ostream -#include // advance, begin, back_inserter, bidirectional_iterator_tag, distance, end, inserter, iterator, iterator_traits, next, random_access_iterator_tag, reverse_iterator -#include // numeric_limits -#include // locale +#include // istream, ostream +#include // iterator_traits, random_access_iterator_tag #include // accumulate -#include // stringstream -#include // declval, forward, make_pair, move, pair, swap +#include // string, stoi, to_string +#include // declval, forward, move, pair, swap #include "json_fwd.hpp" #include "detail/macro_scope.hpp" diff --git a/src/json_fwd.hpp b/src/json_fwd.hpp index a068da18..f2a6b0f2 100644 --- a/src/json_fwd.hpp +++ b/src/json_fwd.hpp @@ -3,8 +3,8 @@ #include // int64_t, uint64_t #include // map -#include // addressof, allocator, allocator_traits, unique_ptr -#include // getline, stoi, string, to_string +#include // allocator +#include // string #include // vector /*!