♻️ rename internal_binary_t with binary_t

This commit is contained in:
Niels Lohmann 2020-05-17 22:50:27 +02:00
parent dead99eb0e
commit 904642f261
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
59 changed files with 536 additions and 457 deletions

View file

@ -228,7 +228,7 @@ template <typename BasicJsonType, typename ConstructibleArrayType,
is_constructible_array_type<BasicJsonType, ConstructibleArrayType>::value and
not is_constructible_object_type<BasicJsonType, ConstructibleArrayType>::value and
not is_constructible_string_type<BasicJsonType, ConstructibleArrayType>::value and
not std::is_same<ConstructibleArrayType, typename BasicJsonType::internal_binary_t>::value and
not std::is_same<ConstructibleArrayType, typename BasicJsonType::binary_t>::value and
not is_basic_json<ConstructibleArrayType>::value,
int > = 0 >
auto from_json(const BasicJsonType& j, ConstructibleArrayType& arr)
@ -246,14 +246,14 @@ void())
}
template <typename BasicJsonType>
void from_json(const BasicJsonType& j, typename BasicJsonType::internal_binary_t& bin)
void from_json(const BasicJsonType& j, typename BasicJsonType::binary_t& bin)
{
if (JSON_HEDLEY_UNLIKELY(not j.is_binary()))
{
JSON_THROW(type_error::create(302, "type must be binary, but is " + std::string(j.type_name())));
}
bin = *j.template get_ptr<const typename BasicJsonType::internal_binary_t*>();
bin = *j.template get_ptr<const typename BasicJsonType::binary_t*>();
}
template<typename BasicJsonType, typename ConstructibleObjectType,

View file

@ -71,19 +71,19 @@ template<>
struct external_constructor<value_t::binary>
{
template<typename BasicJsonType>
static void construct(BasicJsonType& j, const typename BasicJsonType::internal_binary_t& b)
static void construct(BasicJsonType& j, const typename BasicJsonType::binary_t& b)
{
j.m_type = value_t::binary;
typename BasicJsonType::internal_binary_t value{b};
typename BasicJsonType::binary_t value{b};
j.m_value = value;
j.assert_invariant();
}
template<typename BasicJsonType>
static void construct(BasicJsonType& j, typename BasicJsonType::internal_binary_t&& b)
static void construct(BasicJsonType& j, typename BasicJsonType::binary_t&& b)
{
j.m_type = value_t::binary;
typename BasicJsonType::internal_binary_t value{std::move(b)};
typename BasicJsonType::binary_t value{std::move(b)};
j.m_value = value;
j.assert_invariant();
}
@ -280,7 +280,7 @@ template <typename BasicJsonType, typename CompatibleArrayType,
CompatibleArrayType>::value and
not is_compatible_object_type<BasicJsonType, CompatibleArrayType>::value and
not is_compatible_string_type<BasicJsonType, CompatibleArrayType>::value and
not std::is_same<typename BasicJsonType::internal_binary_t, CompatibleArrayType>::value and
not std::is_same<typename BasicJsonType::binary_t, CompatibleArrayType>::value and
not is_basic_json<CompatibleArrayType>::value,
int> = 0>
void to_json(BasicJsonType& j, const CompatibleArrayType& arr)
@ -289,7 +289,7 @@ void to_json(BasicJsonType& j, const CompatibleArrayType& arr)
}
template <typename BasicJsonType>
void to_json(BasicJsonType& j, const typename BasicJsonType::internal_binary_t& bin)
void to_json(BasicJsonType& j, const typename BasicJsonType::binary_t& bin)
{
external_constructor<value_t::binary>::construct(j, bin);
}