mirror of
https://github.com/nlohmann/json.git
synced 2025-07-28 12:02:00 +03:00
🚚 rename Hedley macros
This commit is contained in:
@ -244,7 +244,7 @@ class json_pointer
|
||||
*/
|
||||
void pop_back()
|
||||
{
|
||||
if (NLOHMANN_JSON_HEDLEY_UNLIKELY(empty()))
|
||||
if (JSON_HEDLEY_UNLIKELY(empty()))
|
||||
{
|
||||
JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent"));
|
||||
}
|
||||
@ -268,7 +268,7 @@ class json_pointer
|
||||
*/
|
||||
const std::string& back()
|
||||
{
|
||||
if (NLOHMANN_JSON_HEDLEY_UNLIKELY(empty()))
|
||||
if (JSON_HEDLEY_UNLIKELY(empty()))
|
||||
{
|
||||
JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent"));
|
||||
}
|
||||
@ -332,7 +332,7 @@ class json_pointer
|
||||
const int res = std::stoi(s, &processed_chars);
|
||||
|
||||
// check if the string was completely read
|
||||
if (NLOHMANN_JSON_HEDLEY_UNLIKELY(processed_chars != s.size()))
|
||||
if (JSON_HEDLEY_UNLIKELY(processed_chars != s.size()))
|
||||
{
|
||||
JSON_THROW(detail::out_of_range::create(404, "unresolved reference token '" + s + "'"));
|
||||
}
|
||||
@ -342,7 +342,7 @@ class json_pointer
|
||||
|
||||
json_pointer top() const
|
||||
{
|
||||
if (NLOHMANN_JSON_HEDLEY_UNLIKELY(empty()))
|
||||
if (JSON_HEDLEY_UNLIKELY(empty()))
|
||||
{
|
||||
JSON_THROW(detail::out_of_range::create(405, "JSON pointer has no parent"));
|
||||
}
|
||||
@ -474,7 +474,7 @@ class json_pointer
|
||||
case detail::value_t::array:
|
||||
{
|
||||
// error condition (cf. RFC 6901, Sect. 4)
|
||||
if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0'))
|
||||
if (JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0'))
|
||||
{
|
||||
JSON_THROW(detail::parse_error::create(106, 0,
|
||||
"array index '" + reference_token +
|
||||
@ -532,7 +532,7 @@ class json_pointer
|
||||
|
||||
case detail::value_t::array:
|
||||
{
|
||||
if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token == "-"))
|
||||
if (JSON_HEDLEY_UNLIKELY(reference_token == "-"))
|
||||
{
|
||||
// "-" always fails the range check
|
||||
JSON_THROW(detail::out_of_range::create(402,
|
||||
@ -541,7 +541,7 @@ class json_pointer
|
||||
}
|
||||
|
||||
// error condition (cf. RFC 6901, Sect. 4)
|
||||
if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0'))
|
||||
if (JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0'))
|
||||
{
|
||||
JSON_THROW(detail::parse_error::create(106, 0,
|
||||
"array index '" + reference_token +
|
||||
@ -597,7 +597,7 @@ class json_pointer
|
||||
|
||||
case detail::value_t::array:
|
||||
{
|
||||
if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token == "-"))
|
||||
if (JSON_HEDLEY_UNLIKELY(reference_token == "-"))
|
||||
{
|
||||
// "-" cannot be used for const access
|
||||
JSON_THROW(detail::out_of_range::create(402,
|
||||
@ -606,7 +606,7 @@ class json_pointer
|
||||
}
|
||||
|
||||
// error condition (cf. RFC 6901, Sect. 4)
|
||||
if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0'))
|
||||
if (JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0'))
|
||||
{
|
||||
JSON_THROW(detail::parse_error::create(106, 0,
|
||||
"array index '" + reference_token +
|
||||
@ -656,7 +656,7 @@ class json_pointer
|
||||
|
||||
case detail::value_t::array:
|
||||
{
|
||||
if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token == "-"))
|
||||
if (JSON_HEDLEY_UNLIKELY(reference_token == "-"))
|
||||
{
|
||||
// "-" always fails the range check
|
||||
JSON_THROW(detail::out_of_range::create(402,
|
||||
@ -665,7 +665,7 @@ class json_pointer
|
||||
}
|
||||
|
||||
// error condition (cf. RFC 6901, Sect. 4)
|
||||
if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0'))
|
||||
if (JSON_HEDLEY_UNLIKELY(reference_token.size() > 1 and reference_token[0] == '0'))
|
||||
{
|
||||
JSON_THROW(detail::parse_error::create(106, 0,
|
||||
"array index '" + reference_token +
|
||||
@ -712,7 +712,7 @@ class json_pointer
|
||||
}
|
||||
|
||||
// check if nonempty reference string begins with slash
|
||||
if (NLOHMANN_JSON_HEDLEY_UNLIKELY(reference_string[0] != '/'))
|
||||
if (JSON_HEDLEY_UNLIKELY(reference_string[0] != '/'))
|
||||
{
|
||||
JSON_THROW(detail::parse_error::create(107, 1,
|
||||
"JSON pointer must be empty or begin with '/' - was: '" +
|
||||
@ -747,9 +747,9 @@ class json_pointer
|
||||
assert(reference_token[pos] == '~');
|
||||
|
||||
// ~ must be followed by 0 or 1
|
||||
if (NLOHMANN_JSON_HEDLEY_UNLIKELY(pos == reference_token.size() - 1 or
|
||||
(reference_token[pos + 1] != '0' and
|
||||
reference_token[pos + 1] != '1')))
|
||||
if (JSON_HEDLEY_UNLIKELY(pos == reference_token.size() - 1 or
|
||||
(reference_token[pos + 1] != '0' and
|
||||
reference_token[pos + 1] != '1')))
|
||||
{
|
||||
JSON_THROW(detail::parse_error::create(108, 0, "escape character '~' must be followed with '0' or '1'"));
|
||||
}
|
||||
@ -874,7 +874,7 @@ class json_pointer
|
||||
static BasicJsonType
|
||||
unflatten(const BasicJsonType& value)
|
||||
{
|
||||
if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not value.is_object()))
|
||||
if (JSON_HEDLEY_UNLIKELY(not value.is_object()))
|
||||
{
|
||||
JSON_THROW(detail::type_error::create(314, "only objects can be unflattened"));
|
||||
}
|
||||
@ -884,7 +884,7 @@ class json_pointer
|
||||
// iterate the JSON object values
|
||||
for (const auto& element : *value.m_value.object)
|
||||
{
|
||||
if (NLOHMANN_JSON_HEDLEY_UNLIKELY(not element.second.is_primitive()))
|
||||
if (JSON_HEDLEY_UNLIKELY(not element.second.is_primitive()))
|
||||
{
|
||||
JSON_THROW(detail::type_error::create(315, "values in object must be primitive"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user