Skip to content

Commit

Permalink
fixup! fixup! fixup! Add backwards compatibility with json_pointer<ba…
Browse files Browse the repository at this point in the history
…sic_json>
  • Loading branch information
falbrechtskirchinger committed Apr 7, 2022
1 parent b29fee9 commit bebf36a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions include/nlohmann/detail/json_pointer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ class json_pointer
};

NLOHMANN_BASIC_JSON_TPL_DECLARATION
struct string_t_helper<NLOHMANN_BASIC_JSON_TPL>
// NOLINTNEXTLINE(readability/alt_tokens)
struct JSON_HEDLEY_DEPRECATED_FOR(3.10.6, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) string_t_helper<NLOHMANN_BASIC_JSON_TPL>
{
using type JSON_HEDLEY_DEPRECATED_FOR(3.10.6, "basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>")
= StringType;
using type = StringType;
};

public:
Expand Down
14 changes: 7 additions & 7 deletions include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2223,7 +2223,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec

template<class ValueType, class BasicJsonType, typename std::enable_if<
detail::is_getable<basic_json_t, ValueType>::value, int>::type = 0>
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, "basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>")
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) // NOLINT(readability/alt_tokens)
ValueType value(const ::nlohmann::json_pointer<BasicJsonType>& ptr, const ValueType& default_value) const
{
return value(ptr.convert(), default_value);
Expand All @@ -2239,7 +2239,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}

template<typename BasicJsonType>
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, "basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>")
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) // NOLINT(readability/alt_tokens)
JSON_HEDLEY_NON_NULL(3)
string_t value(const typename ::nlohmann::json_pointer<BasicJsonType>& ptr, const char* default_value) const
{
Expand Down Expand Up @@ -2522,7 +2522,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}

template<typename BasicJsonType>
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, "basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>")
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) // NOLINT(readability/alt_tokens)
bool contains(const typename ::nlohmann::json_pointer<BasicJsonType> ptr) const
{
return ptr.contains(this);
Expand Down Expand Up @@ -4217,7 +4217,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}

template<typename BasicJsonType>
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, "basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>")
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) // NOLINT(readability/alt_tokens)
reference operator[](const ::nlohmann::json_pointer<BasicJsonType>& ptr)
{
return ptr.get_unchecked(this);
Expand All @@ -4231,7 +4231,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}

template<typename BasicJsonType>
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, "basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>")
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) // NOLINT(readability/alt_tokens)
const_reference operator[](const ::nlohmann::json_pointer<BasicJsonType>& ptr) const
{
return ptr.get_unchecked(this);
Expand All @@ -4245,7 +4245,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}

template<typename BasicJsonType>
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, "basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>")
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) // NOLINT(readability/alt_tokens)
reference at(const ::nlohmann::json_pointer<BasicJsonType>& ptr)
{
return ptr.get_checked(this);
Expand All @@ -4259,7 +4259,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}

template<typename BasicJsonType>
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, "basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>")
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) // NOLINT(readability/alt_tokens)
const_reference at(const ::nlohmann::json_pointer<BasicJsonType>& ptr) const
{
return ptr.get_checked(this);
Expand Down
20 changes: 10 additions & 10 deletions single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12503,10 +12503,10 @@ class json_pointer
};

NLOHMANN_BASIC_JSON_TPL_DECLARATION
struct string_t_helper<NLOHMANN_BASIC_JSON_TPL>
// NOLINTNEXTLINE(readability/alt_tokens)
struct JSON_HEDLEY_DEPRECATED_FOR(3.10.6, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) string_t_helper<NLOHMANN_BASIC_JSON_TPL>
{
using type JSON_HEDLEY_DEPRECATED_FOR(3.10.6, "basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>")
= StringType;
using type = StringType;
};

public:
Expand Down Expand Up @@ -19673,7 +19673,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec

template<class ValueType, class BasicJsonType, typename std::enable_if<
detail::is_getable<basic_json_t, ValueType>::value, int>::type = 0>
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, "basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>")
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) // NOLINT(readability/alt_tokens)
ValueType value(const ::nlohmann::json_pointer<BasicJsonType>& ptr, const ValueType& default_value) const
{
return value(ptr.convert(), default_value);
Expand All @@ -19689,7 +19689,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}

template<typename BasicJsonType>
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, "basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>")
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) // NOLINT(readability/alt_tokens)
JSON_HEDLEY_NON_NULL(3)
string_t value(const typename ::nlohmann::json_pointer<BasicJsonType>& ptr, const char* default_value) const
{
Expand Down Expand Up @@ -19972,7 +19972,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}

template<typename BasicJsonType>
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, "basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>")
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) // NOLINT(readability/alt_tokens)
bool contains(const typename ::nlohmann::json_pointer<BasicJsonType> ptr) const
{
return ptr.contains(this);
Expand Down Expand Up @@ -21667,7 +21667,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}

template<typename BasicJsonType>
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, "basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>")
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) // NOLINT(readability/alt_tokens)
reference operator[](const ::nlohmann::json_pointer<BasicJsonType>& ptr)
{
return ptr.get_unchecked(this);
Expand All @@ -21681,7 +21681,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}

template<typename BasicJsonType>
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, "basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>")
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) // NOLINT(readability/alt_tokens)
const_reference operator[](const ::nlohmann::json_pointer<BasicJsonType>& ptr) const
{
return ptr.get_unchecked(this);
Expand All @@ -21695,7 +21695,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}

template<typename BasicJsonType>
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, "basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>")
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) // NOLINT(readability/alt_tokens)
reference at(const ::nlohmann::json_pointer<BasicJsonType>& ptr)
{
return ptr.get_checked(this);
Expand All @@ -21709,7 +21709,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}

template<typename BasicJsonType>
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, "basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>")
JSON_HEDLEY_DEPRECATED_FOR(3.10.6, basic_json::json_pointer or nlohmann::json_pointer<basic_json::string_t>) // NOLINT(readability/alt_tokens)
const_reference at(const ::nlohmann::json_pointer<BasicJsonType>& ptr) const
{
return ptr.get_checked(this);
Expand Down

0 comments on commit bebf36a

Please sign in to comment.