Skip to content

Commit

Permalink
fixed amalgation file for nlohmann#2728
Browse files Browse the repository at this point in the history
  • Loading branch information
David Pfahler authored and harry75369 committed Aug 7, 2021
1 parent 6c99b75 commit 378fbda
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5262,6 +5262,7 @@ enum class input_format_t { json, cbor, msgpack, ubjson, bson };
// input adapters //
////////////////////

#ifndef JSON_NO_IO
/*!
Input adapter for stdio file access. This adapter read only 1 byte and do not use any
buffer. This adapter is a very low level adapter.
Expand Down Expand Up @@ -5353,6 +5354,7 @@ class input_stream_adapter
std::istream* is = nullptr;
std::streambuf* sb = nullptr;
};
#endif // JSON_NO_IO

// General-purpose iterator-based adapter. It might not be as fast as
// theoretically possible for some containers, but it is extremely versatile.
Expand Down Expand Up @@ -5639,6 +5641,7 @@ typename container_input_adapter_factory_impl::container_input_adapter_factory<C
return container_input_adapter_factory_impl::container_input_adapter_factory<ContainerType>::create(container);
}

#ifndef JSON_NO_IO
// Special cases with fast paths
inline file_input_adapter input_adapter(std::FILE* file)
{
Expand All @@ -5654,6 +5657,7 @@ inline input_stream_adapter input_adapter(std::istream&& stream)
{
return input_stream_adapter(stream);
}
#endif // JSON_NO_IO

using contiguous_bytes_input_adapter = decltype(input_adapter(std::declval<const char*>(), std::declval<const char*>()));

Expand Down Expand Up @@ -13183,6 +13187,7 @@ class output_vector_adapter : public output_adapter_protocol<CharType>
std::vector<CharType>& v;
};

#ifndef JSON_NO_IO
/// output adapter for output streams
template<typename CharType>
class output_stream_adapter : public output_adapter_protocol<CharType>
Expand All @@ -13206,6 +13211,7 @@ class output_stream_adapter : public output_adapter_protocol<CharType>
private:
std::basic_ostream<CharType>& stream;
};
#endif // JSON_NO_IO

/// output adapter for basic_string
template<typename CharType, typename StringType = std::basic_string<CharType>>
Expand Down Expand Up @@ -13238,8 +13244,10 @@ class output_adapter
output_adapter(std::vector<CharType>& vec)
: oa(std::make_shared<output_vector_adapter<CharType>>(vec)) {}

#ifndef JSON_NO_IO
output_adapter(std::basic_ostream<CharType>& s)
: oa(std::make_shared<output_stream_adapter<CharType>>(s)) {}
#endif // JSON_NO_IO

output_adapter(StringType& s)
: oa(std::make_shared<output_string_adapter<CharType, StringType>>(s)) {}
Expand Down Expand Up @@ -23688,7 +23696,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec

/// @name serialization
/// @{

#ifndef JSON_NO_IO
/*!
@brief serialize to stream

Expand Down Expand Up @@ -23748,7 +23756,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
{
return o << j;
}

#endif // JSON_NO_IO
/// @}


Expand Down Expand Up @@ -24006,7 +24014,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
// NOLINTNEXTLINE(hicpp-move-const-arg,performance-move-const-arg)
: detail::binary_reader<basic_json, decltype(ia), SAX>(std::move(ia)).sax_parse(format, sax, strict);
}

#ifndef JSON_NO_IO
/*!
@brief deserialize from stream
@deprecated This stream operator is deprecated and will be removed in
Expand Down Expand Up @@ -24051,7 +24059,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
parser(detail::input_adapter(i)).parse(false, j);
return i;
}

#endif // JSON_NO_IO
/// @}

///////////////////////////
Expand Down

0 comments on commit 378fbda

Please sign in to comment.