add missing includes, put back include comments

This commit is contained in:
Théo DELRIEU 2017-08-14 19:28:01 +02:00
parent 9cab30cfce
commit 57d822b6e2
No known key found for this signature in database
GPG key ID: 51AC4B3A2C47C10F
18 changed files with 123 additions and 87 deletions

View file

@ -1,10 +1,16 @@
#ifndef NLOHMANN_JSON_DETAIL_CONVERSIONS_FROM_JSON_HPP #ifndef NLOHMANN_JSON_DETAIL_CONVERSIONS_FROM_JSON_HPP
#define NLOHMANN_JSON_DETAIL_CONVERSIONS_FROM_JSON_HPP #define NLOHMANN_JSON_DETAIL_CONVERSIONS_FROM_JSON_HPP
#include <array> #include <algorithm> // transform
#include <tuple> #include <array> // array
#include <utility> #include <ciso646> // and, not
#include <valarray> #include <forward_list> // forward_list
#include <iterator> // inserter, front_inserter, end
#include <string> // string
#include <tuple> // tuple, make_tuple
#include <type_traits> // is_arithmetic, is_same, is_enum, underlying_type, is_convertible
#include <utility> // pair, declval
#include <valarray> // valarray
#include "detail/exceptions.hpp" #include "detail/exceptions.hpp"
#include "detail/macro_scope.hpp" #include "detail/macro_scope.hpp"
@ -15,10 +21,6 @@ namespace nlohmann
{ {
namespace detail namespace detail
{ {
///////////////
// from_json //
///////////////
// overloads for basic_json template parameters // overloads for basic_json template parameters
template<typename BasicJsonType, typename ArithmeticType, template<typename BasicJsonType, typename ArithmeticType,
enable_if_t<std::is_arithmetic<ArithmeticType>::value and enable_if_t<std::is_arithmetic<ArithmeticType>::value and

View file

@ -1,9 +1,13 @@
#ifndef NLOHMANN_JSON_DETAIL_CONVERSIONS_TO_JSON_HPP #ifndef NLOHMANN_JSON_DETAIL_CONVERSIONS_TO_JSON_HPP
#define NLOHMANN_JSON_DETAIL_CONVERSIONS_TO_JSON_HPP #define NLOHMANN_JSON_DETAIL_CONVERSIONS_TO_JSON_HPP
#include <type_traits> #include <ciso646> // or, and, not
#include <utility> #include <iterator> // begin, end
#include <valarray> #include <tuple> // tuple, get
#include <type_traits> // is_same, is_constructible, is_floating_point, is_enum, underlying_type
#include <utility> // move, forward, declval, pair
#include <valarray> // valarray
#include <vector> // vector
#include "detail/meta.hpp" #include "detail/meta.hpp"
#include "detail/value_t.hpp" #include "detail/value_t.hpp"

View file

@ -1,11 +1,16 @@
#ifndef NLOHMANN_JSON_DETAIL_ITERATORS_ITER_IMPL_HPP #ifndef NLOHMANN_JSON_DETAIL_ITERATORS_ITER_IMPL_HPP
#define NLOHMANN_JSON_DETAIL_ITERATORS_ITER_IMPL_HPP #define NLOHMANN_JSON_DETAIL_ITERATORS_ITER_IMPL_HPP
#include <iterator> #include <ciso646> // not
#include <type_traits> #include <iterator> // iterator, random_access_iterator_tag, bidirectional_iterator_tag, advance, next
#include <type_traits> // conditional, is_const, remove_const
#include "detail/exceptions.hpp" #include "detail/exceptions.hpp"
#include "detail/iterators/internal_iterator.hpp"
#include "detail/iterators/primitive_iterator.hpp"
#include "detail/macro_scope.hpp" #include "detail/macro_scope.hpp"
#include "detail/meta.hpp"
#include "detail/value_t.hpp"
namespace nlohmann namespace nlohmann
{ {

View file

@ -1,8 +1,10 @@
#ifndef NLOHMANN_JSON_DETAIL_ITERATORS_ITERATION_PROXY_HPP #ifndef NLOHMANN_JSON_DETAIL_ITERATORS_ITERATION_PROXY_HPP
#define NLOHMANN_JSON_DETAIL_ITERATORS_ITERATION_PROXY_HPP #define NLOHMANN_JSON_DETAIL_ITERATORS_ITERATION_PROXY_HPP
#include <cstddef> #include <cstddef> // size_t
#include <string> #include <string> // string, to_string
#include "detail/value_t.hpp"
namespace nlohmann namespace nlohmann
{ {

View file

@ -1,9 +1,9 @@
#ifndef NLOHMANN_JSON_DETAIL_ITERATORS_JSON_REVERSE_ITERATOR_HPP #ifndef NLOHMANN_JSON_DETAIL_ITERATORS_JSON_REVERSE_ITERATOR_HPP
#define NLOHMANN_JSON_DETAIL_ITERATORS_JSON_REVERSE_ITERATOR_HPP #define NLOHMANN_JSON_DETAIL_ITERATORS_JSON_REVERSE_ITERATOR_HPP
#include <cstddef> #include <cstddef> // ptrdiff_t
#include <iterator> #include <iterator> // reverse_iterator
#include <utility> #include <utility> // declval
namespace nlohmann namespace nlohmann
{ {

View file

@ -1,9 +1,10 @@
#ifndef NLOHMANN_JSON_DETAIL_ITERATORS_PRIMITIVE_ITERATOR_HPP #ifndef NLOHMANN_JSON_DETAIL_ITERATORS_PRIMITIVE_ITERATOR_HPP
#define NLOHMANN_JSON_DETAIL_ITERATORS_PRIMITIVE_ITERATOR_HPP #define NLOHMANN_JSON_DETAIL_ITERATORS_PRIMITIVE_ITERATOR_HPP
#include <cstddef> #include <ciso646> // not
#include <iosfwd> #include <cstddef> // ptrdiff_t
#include <limits> #include <limits> // numeric_limits
#include <ostream> // ostream
namespace nlohmann namespace nlohmann
{ {

View file

@ -1,6 +1,8 @@
#ifndef NLOHMANN_JSON_MACRO_SCOPE_HPP #ifndef NLOHMANN_JSON_MACRO_SCOPE_HPP
#define NLOHMANN_JSON_MACRO_SCOPE_HPP #define NLOHMANN_JSON_MACRO_SCOPE_HPP
#include <ciso646> // not
// This file contains all internal macro definitions // This file contains all internal macro definitions
// You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them // You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them

View file

@ -1,10 +1,11 @@
#ifndef NLOHMANN_JSON_DETAIL_META_HPP #ifndef NLOHMANN_JSON_DETAIL_META_HPP
#define NLOHMANN_JSON_DETAIL_META_HPP #define NLOHMANN_JSON_DETAIL_META_HPP
#include <cstdint> #include <ciso646> // not
#include <limits> #include <cstddef> // size_t
#include <type_traits> // 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 <limits> // numeric_limits
#include <utility> #include <type_traits> // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type
#include <utility> // declval
#include "json_fwd.hpp" #include "json_fwd.hpp"
#include "detail/macro_scope.hpp" #include "detail/macro_scope.hpp"

View file

@ -1,14 +1,20 @@
#ifndef NLOHMANN_JSON_DETAIL_PARSING_BINARY_READER_HPP #ifndef NLOHMANN_JSON_DETAIL_PARSING_BINARY_READER_HPP
#define NLOHMANN_JSON_DETAIL_PARSING_BINARY_READER_HPP #define NLOHMANN_JSON_DETAIL_PARSING_BINARY_READER_HPP
#include <algorithm> #include <algorithm> // generate_n
#include <array> #include <array> // array
#include <cstdint> #include <cassert> // assert
#include <cstring> #include <cmath> // ldexp
#include <iomanip> #include <cstddef> // size_t
#include <sstream> #include <cstdint> // uint8_t, uint16_t, uint32_t, uint64_t
#include <string> #include <cstring> // memcpy
#include <utility> #include <iomanip> // setw, setfill
#include <ios> // hex
#include <iterator> // back_inserter
#include <limits> // numeric_limits
#include <sstream> // stringstream
#include <string> // char_traits, string
#include <utility> // make_pair, move
#include "detail/exceptions.hpp" #include "detail/exceptions.hpp"
#include "detail/macro_scope.hpp" #include "detail/macro_scope.hpp"

View file

@ -1,11 +1,11 @@
#ifndef NLOHMANN_JSON_DETAIL_PARSING_BINARY_WRITER_HPP #ifndef NLOHMANN_JSON_DETAIL_PARSING_BINARY_WRITER_HPP
#define NLOHMANN_JSON_DETAIL_PARSING_BINARY_WRITER_HPP #define NLOHMANN_JSON_DETAIL_PARSING_BINARY_WRITER_HPP
#include <algorithm> #include <algorithm> // reverse
#include <array> #include <array> // array
#include <cstdint> #include <cstdint> // uint8_t, uint16_t, uint32_t, uint64_t
#include <cstring> #include <cstring> // memcpy
#include <limits> #include <limits> // numeric_limits
#include "detail/parsing/binary_reader.hpp" #include "detail/parsing/binary_reader.hpp"
#include "detail/parsing/output_adapters.hpp" #include "detail/parsing/output_adapters.hpp"

View file

@ -1,12 +1,19 @@
#ifndef NLOHMANN_JSON_DETAIL_PARSING_INPUT_ADAPTERS_HPP #ifndef NLOHMANN_JSON_DETAIL_PARSING_INPUT_ADAPTERS_HPP
#define NLOHMANN_JSON_DETAIL_PARSING_INPUT_ADAPTERS_HPP #define NLOHMANN_JSON_DETAIL_PARSING_INPUT_ADAPTERS_HPP
#include <algorithm> #include <algorithm> // min
#include <array> #include <array> // array
#include <cstddef> #include <cassert> // assert
#include <iosfwd> #include <cstddef> // size_t
#include <memory> #include <cstring> // strlen
#include <string> #include <ios> // streamsize, streamoff, streampos
#include <istream> // istream
#include <iterator> // begin, end, iterator_traits, random_access_iterator_tag, distance, next
#include <memory> // shared_ptr, make_shared, addressof
#include <numeric> // accumulate
#include <string> // string, char_traits
#include <type_traits> // enable_if, is_base_of, is_pointer, is_integral, remove_pointer
#include <utility> // pair, declval
#include "detail/macro_scope.hpp" #include "detail/macro_scope.hpp"

View file

@ -1,9 +1,15 @@
#ifndef NLOHMANN_JSON_DETAIL_PARSING_LEXER_HPP #ifndef NLOHMANN_JSON_DETAIL_PARSING_LEXER_HPP
#define NLOHMANN_JSON_DETAIL_PARSING_LEXER_HPP #define NLOHMANN_JSON_DETAIL_PARSING_LEXER_HPP
#include <clocale> #include <clocale> // localeconv
#include <cstddef> #include <cstddef> // size_t
#include <vector> #include <cstdlib> // strtof, strtod, strtold, strtoll, strtoull
#include <initializer_list> // initializer_list
#include <ios> // hex, uppercase
#include <iomanip> // setw, setfill
#include <sstream> // stringstream
#include <string> // char_traits, string
#include <vector> // vector
#include "detail/macro_scope.hpp" #include "detail/macro_scope.hpp"
#include "detail/parsing/input_adapters.hpp" #include "detail/parsing/input_adapters.hpp"

View file

@ -1,12 +1,14 @@
#ifndef NLOHMANN_JSON_DETAIL_PARSING_OUTPUT_ADAPTERS_HPP #ifndef NLOHMANN_JSON_DETAIL_PARSING_OUTPUT_ADAPTERS_HPP
#define NLOHMANN_JSON_DETAIL_PARSING_OUTPUT_ADAPTERS_HPP #define NLOHMANN_JSON_DETAIL_PARSING_OUTPUT_ADAPTERS_HPP
#include <algorithm> #include <algorithm> // copy
#include <cstddef> #include <cstddef> // size_t
#include <iosfwd> #include <ios> // streamsize
#include <iterator> #include <iterator> // back_inserter
#include <memory> #include <memory> // shared_ptr, make_shared
#include <vector> #include <ostream> // basic_ostream
#include <string> // basic_string
#include <vector> // vector
namespace nlohmann namespace nlohmann
{ {

View file

@ -1,15 +1,18 @@
#ifndef NLOHMANN_JSON_DETAIL_PARSING_PARSER_HPP #ifndef NLOHMANN_JSON_DETAIL_PARSING_PARSER_HPP
#define NLOHMANN_JSON_DETAIL_PARSING_PARSER_HPP #define NLOHMANN_JSON_DETAIL_PARSING_PARSER_HPP
#include <cmath> #include <cassert> // assert
#include <functional> #include <cmath> // isfinite
#include <string> #include <cstdint> // uint8_t
#include <utility> #include <functional> // function
#include <string> // string
#include <utility> // move
#include "detail/exceptions.hpp" #include "detail/exceptions.hpp"
#include "detail/macro_scope.hpp" #include "detail/macro_scope.hpp"
#include "detail/parsing/input_adapters.hpp" #include "detail/parsing/input_adapters.hpp"
#include "detail/parsing/lexer.hpp" #include "detail/parsing/lexer.hpp"
#include "detail/value_t.hpp"
namespace nlohmann namespace nlohmann
{ {

View file

@ -1,21 +1,24 @@
#ifndef NLOHMANN_JSON_DETAIL_SERIALIZER_HPP #ifndef NLOHMANN_JSON_DETAIL_SERIALIZER_HPP
#define NLOHMANN_JSON_DETAIL_SERIALIZER_HPP #define NLOHMANN_JSON_DETAIL_SERIALIZER_HPP
#include <algorithm> #include <algorithm> // reverse, remove, fill, find, none_of
#include <array> #include <array> // array
#include <clocale> #include <cassert> // assert
#include <cmath> #include <ciso646> // and, or
#include <cstddef> #include <clocale> // localeconv, lconv
#include <cstdint> #include <cmath> // labs, isfinite, isnan, signbit
#include <cstdio> #include <cstddef> // size_t, ptrdiff_t
#include <iterator> #include <cstdint> // uint8_t
#include <limits> #include <cstdio> // snprintf
#include <string> #include <iterator> // next
#include <type_traits> #include <limits> // numeric_limits
#include <string> // string
#include <type_traits> // is_same
#include "detail/macro_scope.hpp" #include "detail/macro_scope.hpp"
#include "detail/meta.hpp" #include "detail/meta.hpp"
#include "detail/parsing/output_adapters.hpp" #include "detail/parsing/output_adapters.hpp"
#include "detail/value_t.hpp"
namespace nlohmann namespace nlohmann
{ {

View file

@ -1,6 +1,7 @@
#ifndef NLOHMANN_JSON_DETAIL_VALUE_T_HPP #ifndef NLOHMANN_JSON_DETAIL_VALUE_T_HPP
#define NLOHMANN_JSON_DETAIL_VALUE_T_HPP #define NLOHMANN_JSON_DETAIL_VALUE_T_HPP
#include <array> // array
#include <ciso646> // and #include <ciso646> // and
#include <cstddef> // size_t #include <cstddef> // size_t
#include <cstdint> // uint8_t #include <cstdint> // uint8_t
@ -37,7 +38,7 @@ value with the default value for a given type
@since version 1.0.0 @since version 1.0.0
*/ */
enum class value_t : uint8_t enum class value_t : std::uint8_t
{ {
null, ///< null value null, ///< null value
object, ///< object (unordered set of name/value pairs) 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 inline bool operator<(const value_t lhs, const value_t rhs) noexcept
{ {
static constexpr std::array<uint8_t, 8> order = {{ static constexpr std::array<std::uint8_t, 8> order = {{
0 /* null */, 3 /* object */, 4 /* array */, 5 /* string */, 0 /* null */, 3 /* object */, 4 /* array */, 5 /* string */,
1 /* boolean */, 2 /* integer */, 2 /* unsigned */, 2 /* float */ 1 /* boolean */, 2 /* integer */, 2 /* unsigned */, 2 /* float */
} }

View file

@ -29,26 +29,17 @@ SOFTWARE.
#ifndef NLOHMANN_JSON_HPP #ifndef NLOHMANN_JSON_HPP
#define NLOHMANN_JSON_HPP #define NLOHMANN_JSON_HPP
#include <algorithm> // all_of, copy, fill, find, for_each, generate_n, none_of, remove, reverse, transform #include <algorithm> // all_of, find, for_each
#include <array> // array
#include <cassert> // assert #include <cassert> // assert
#include <ciso646> // and, not, or #include <ciso646> // and, not, or
#include <clocale> // lconv, localeconv
#include <cmath> // isfinite, labs, ldexp, signbit
#include <cstddef> // nullptr_t, ptrdiff_t, size_t #include <cstddef> // nullptr_t, ptrdiff_t, size_t
#include <cstdlib> // abort, strtod, strtof, strtold, strtoul, strtoll, strtoull #include <functional> // hash, less
#include <cstring> // memcpy, strlen
#include <forward_list> // forward_list
#include <functional> // function, hash, less
#include <initializer_list> // initializer_list #include <initializer_list> // initializer_list
#include <iomanip> // hex
#include <iosfwd> // istream, ostream #include <iosfwd> // istream, ostream
#include <iterator> // advance, begin, back_inserter, bidirectional_iterator_tag, distance, end, inserter, iterator, iterator_traits, next, random_access_iterator_tag, reverse_iterator #include <iterator> // iterator_traits, random_access_iterator_tag
#include <limits> // numeric_limits
#include <locale> // locale
#include <numeric> // accumulate #include <numeric> // accumulate
#include <sstream> // stringstream #include <string> // string, stoi, to_string
#include <utility> // declval, forward, make_pair, move, pair, swap #include <utility> // declval, forward, move, pair, swap
#include "json_fwd.hpp" #include "json_fwd.hpp"
#include "detail/macro_scope.hpp" #include "detail/macro_scope.hpp"

View file

@ -3,8 +3,8 @@
#include <cstdint> // int64_t, uint64_t #include <cstdint> // int64_t, uint64_t
#include <map> // map #include <map> // map
#include <memory> // addressof, allocator, allocator_traits, unique_ptr #include <memory> // allocator
#include <string> // getline, stoi, string, to_string #include <string> // string
#include <vector> // vector #include <vector> // vector
/*! /*!