mirror of
https://github.com/nlohmann/json.git
synced 2026-10-03 05:00:30 +00:00
Merge branch 'json-view/04-unicode-escapes' into json-view/08-view-builder
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
@@ -5129,7 +5129,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
/// @{
|
||||
#ifndef JSON_NO_IO
|
||||
/// @brief serialize to stream
|
||||
/// @sa https://json.nlohmann.me/api/basic_json/operator_ltlt/
|
||||
/// @sa https://json.nlohmann.me/api/operator_ltlt/
|
||||
friend std::ostream& operator<<(std::ostream& o, const basic_json& j)
|
||||
{
|
||||
// read width member and use it as the indentation parameter if nonzero
|
||||
@@ -5148,7 +5148,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
}
|
||||
|
||||
/// @brief serialize to stream
|
||||
/// @sa https://json.nlohmann.me/api/basic_json/operator_ltlt/
|
||||
/// @sa https://json.nlohmann.me/api/operator_ltlt/
|
||||
/// @deprecated This function is deprecated since 3.0.0 and will be removed in
|
||||
/// version 4.0.0 of the library. Please use
|
||||
/// operator<<(std::ostream&, const basic_json&) instead; that is,
|
||||
@@ -5317,7 +5317,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
#endif
|
||||
#ifndef JSON_NO_IO
|
||||
/// @brief deserialize from stream
|
||||
/// @sa https://json.nlohmann.me/api/basic_json/operator_gtgt/
|
||||
/// @sa https://json.nlohmann.me/api/operator_gtgt/
|
||||
/// @deprecated This stream operator is deprecated since 3.0.0 and will be removed in
|
||||
/// version 4.0.0 of the library. Please use
|
||||
/// operator>>(std::istream&, basic_json&) instead; that is,
|
||||
@@ -5329,7 +5329,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
}
|
||||
|
||||
/// @brief deserialize from stream
|
||||
/// @sa https://json.nlohmann.me/api/basic_json/operator_gtgt/
|
||||
/// @sa https://json.nlohmann.me/api/operator_gtgt/
|
||||
friend std::istream& operator>>(std::istream& i, basic_json& j)
|
||||
{
|
||||
// parse into a temporary so that j is left unchanged if parsing fails
|
||||
@@ -6525,6 +6525,10 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
// Any other object type places its members itself - std::map
|
||||
// in key order, a hash map in an order its operator== ignores -
|
||||
// so a member-by-member diff always reproduces target there.
|
||||
#ifdef JSON_HEDLEY_MSVC_VERSION
|
||||
#pragma warning(push )
|
||||
#pragma warning(disable : 4127) // ignore warning to replace if with if constexpr
|
||||
#endif
|
||||
if (!detail::is_ordered_map<object_t>::value
|
||||
|| (common_keys_source_order == common_keys_target_order && new_keys_form_suffix))
|
||||
{
|
||||
@@ -6535,6 +6539,9 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
common_keys = std::move(common_keys_source_order);
|
||||
return true;
|
||||
}
|
||||
#ifdef JSON_HEDLEY_MSVC_VERSION
|
||||
#pragma warning( pop )
|
||||
#endif
|
||||
|
||||
// slow path: the common keys are in a different relative
|
||||
// order in source and target (only possible for a
|
||||
@@ -7031,10 +7038,10 @@ struct formatter<nlohmann::NLOHMANN_BASIC_JSON_TPL, char> // NOLINT(cert-dcl58-c
|
||||
int indent = -1;
|
||||
char indent_char = ' ';
|
||||
|
||||
constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator
|
||||
constexpr format_parse_context::iterator parse(format_parse_context& ctx)
|
||||
{
|
||||
auto it = ctx.begin();
|
||||
const auto end = ctx.end();
|
||||
format_parse_context::iterator it = ctx.begin();
|
||||
const format_parse_context::iterator end = ctx.end();
|
||||
constexpr auto is_align = [](char c)
|
||||
{
|
||||
return c == '<' || c == '>' || c == '^';
|
||||
|
||||
Reference in New Issue
Block a user