Lines Matching refs:binary

2866     binary,           ///< binary array (ordered collection of bytes)
2874 - order: null < boolean < number < object < array < string < binary
2877 - binary is represented as a b"" string in python and directly comparable to a
2878 string; however, making a binary array directly comparable with a string would
2892 6 /* binary */
4367 case value_t::binary: // LCOV_EXCL_LINE
4632 case value_t::binary:
4856 JSON_THROW(type_error::create(302, concat("type must be binary, but is ", j.type_name()), &j));
4925 case value_t::binary:
5220 case value_t::binary:
5397 struct external_constructor<value_t::binary>
5403 j.m_type = value_t::binary;
5412 j.m_type = value_t::binary;
5655 external_constructor<value_t::binary>::construct(j, bin);
5816 /// @brief an internal type for a backed binary type
5865 /// @brief sets the binary subtype
5873 /// @brief return the binary subtype
5887 /// @brief clears the binary subtype
6019 case BasicJsonType::value_t::binary:
6651 @brief a binary value was read
6652 @param[in] val binary value
6654 @note It is safe to move the passed binary value.
6656 virtual bool binary(binary_t& val) = 0;
6662 @note binary formats may report the number of elements
6684 @note binary formats may report the number of elements
6791 bool binary(binary_t& val)
6975 bool binary(binary_t& val)
7259 bool binary(binary_t& /*unused*/)
8988 decltype(std::declval<T&>().binary(std::declval<Binary&>()));
9081 "Missing/invalid function: bool binary(binary_t&)");
9117 store ///< store tags as binary type
9134 // binary reader //
9154 @brief create a binary reader
9171 @param[in] format the binary format to parse
9312 @param[in,out] result A reference to the binary variable where the read
9325 exception_message(input_format_t::bson, concat("byte array length cannot be negative, is ", std::to_string(len)), "binary"), nullptr));
9328 // All BSON binary values have a subtype
9374 case 0x05: // binary
9378 return get_number<std::int32_t, true>(input_format_t::bson, len) && get_bson_binary(len, value) && sax->binary(value);
9417 The same binary layout is used for objects and arrays, hence it must be
9638 return get_cbor_binary(b) && sax->binary(b);
9816 // ignore binary subtype
9852 // use binary subtype and store in binary container
9887 return get_cbor_binary(b) && sax->binary(b);
10083 if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::cbor, "binary")))
10165 exception_message(input_format_t::cbor, concat("expected length specification (0x40-0x5B) or indefinite binary array type (0x5F); last byte: 0x", last_token), "binary"), nullptr));
10510 return get_msgpack_binary(b) && sax->binary(b);
11744 // Note, no reader for UBJSON binary types is implemented because they do
11946 if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "binary")))
12910 case value_t::binary:
13013 case value_t::binary:
13051 case value_t::binary:
13092 case value_t::binary:
13134 case value_t::binary:
13187 case value_t::binary:
13238 case value_t::binary:
13279 case value_t::binary:
13324 case value_t::binary:
13383 case value_t::binary:
13459 case value_t::binary:
13490 case value_t::binary:
14005 case detail::value_t::binary:
14086 case detail::value_t::binary:
14137 case detail::value_t::binary:
14193 case detail::value_t::binary:
14244 case detail::value_t::binary:
14323 case detail::value_t::binary:
14465 case detail::value_t::binary:
14947 // binary writer //
14962 @brief create a binary writer
14992 case value_t::binary:
15216 case value_t::binary:
15218 if (j.m_value.binary->has_subtype())
15220 if (j.m_value.binary->subtype() <= (std::numeric_limits<std::uint8_t>::max)())
15223 write_number(static_cast<std::uint8_t>(j.m_value.binary->subtype()));
15225 else if (j.m_value.binary->subtype() <= (std::numeric_limits<std::uint16_t>::max)())
15228 write_number(static_cast<std::uint16_t>(j.m_value.binary->subtype()));
15230 else if (j.m_value.binary->subtype() <= (std::numeric_limits<std::uint32_t>::max)())
15233 write_number(static_cast<std::uint32_t>(j.m_value.binary->subtype()));
15235 else if (j.m_value.binary->subtype() <= (std::numeric_limits<std::uint64_t>::max)())
15238 write_number(static_cast<std::uint64_t>(j.m_value.binary->subtype()));
15242 // step 1: write control byte and the binary array size
15243 const auto N = j.m_value.binary->size();
15273 reinterpret_cast<const CharType*>(j.m_value.binary->data()),
15527 case value_t::binary:
15529 // step 0: determine if the binary type has a set subtype to
15531 const bool use_ext = j.m_value.binary->has_subtype();
15534 const auto N = j.m_value.binary->size();
15599 write_number(static_cast<std::int8_t>(j.m_value.binary->subtype()));
15604 reinterpret_cast<const CharType*>(j.m_value.binary->data()),
15758 case value_t::binary:
15765 if (use_type && !j.m_value.binary->empty())
15775 write_number_with_ubjson_prefix(j.m_value.binary->size(), true, use_bjdata);
15781 reinterpret_cast<const CharType*>(j.m_value.binary->data()),
15782 j.m_value.binary->size());
15786 for (size_t i = 0; i < j.m_value.binary->size(); ++i)
15789 oa->write_character(j.m_value.binary->data()[i]);
16035 @return The size of the BSON-encoded binary array @a value
16062 @brief Writes a BSON element with key @a name and binary value @a value
16091 case value_t::binary:
16092 return header_size + calc_bson_binary_size(*j.m_value.binary);
16138 case value_t::binary:
16139 return write_bson_binary(name, *j.m_value.binary);
16508 case value_t::binary:
16809 @brief implements the Grisu2 algorithm for binary to decimal floating-point
17149 // This binary exponent range [-1137,960] results in a decimal exponent
17596 // decimal digits are sufficient to identify all binary floating-point
17980 - binary values are serialized as objects containing the subtype and the
18139 case value_t::binary:
18156 if (!val.m_value.binary->empty())
18158 for (auto i = val.m_value.binary->cbegin();
18159 i != val.m_value.binary->cend() - 1; ++i)
18164 dump_integer(val.m_value.binary->back());
18171 if (val.m_value.binary->has_subtype())
18173 dump_integer(val.m_value.binary->subtype());
18187 if (!val.m_value.binary->empty())
18189 for (auto i = val.m_value.binary->cbegin();
18190 i != val.m_value.binary->cend() - 1; ++i)
18195 dump_integer(val.m_value.binary->back());
18199 if (val.m_value.binary->has_subtype())
18201 dump_integer(val.m_value.binary->subtype());
19541 /// @brief a type for a packed binary type
19592 binary | binary | pointer to @ref binary_t
19609 /// binary (stored with pointer to save storage)
19610 binary_t* binary;
19653 case value_t::binary:
19655 binary = create<binary_t>();
19720 /// constructor for binary arrays
19721 json_value(const typename binary_t::container_type& value) : binary(create<binary_t>(value)) {}
19723 /// constructor for rvalue binary arrays
19724 json_value(typename binary_t::container_type&& value) : binary(create<binary_t>(std::move(value))) {}
19726 /// constructor for binary arrays (internal type)
19727 json_value(const binary_t& value) : binary(create<binary_t>(value)) {}
19729 /// constructor for rvalue binary arrays (internal type)
19730 json_value(binary_t&& value) : binary(create<binary_t>(std::move(value))) {}
19809 case value_t::binary:
19812 std::allocator_traits<decltype(alloc)>::destroy(alloc, binary);
19813 std::allocator_traits<decltype(alloc)>::deallocate(alloc, binary, 1);
19855 JSON_ASSERT(m_type != value_t::binary || m_value.binary != nullptr);
19900 case value_t::binary:
20051 case value_t::binary:
20123 /// @brief explicitly create a binary array (without subtype)
20124 /// @sa https://json.nlohmann.me/api/basic_json/binary/
20126 static basic_json binary(const typename binary_t::container_type& init)
20129 res.m_type = value_t::binary;
20134 /// @brief explicitly create a binary array (with subtype)
20135 /// @sa https://json.nlohmann.me/api/basic_json/binary/
20137 static basic_json binary(const typename binary_t::container_type& init, typename binary_t::subtype_type subtype)
20140 res.m_type = value_t::binary;
20145 /// @brief explicitly create a binary array
20146 /// @sa https://json.nlohmann.me/api/basic_json/binary/
20148 static basic_json binary(typename binary_t::container_type&& init)
20151 res.m_type = value_t::binary;
20156 /// @brief explicitly create a binary array (with subtype)
20157 /// @sa https://json.nlohmann.me/api/basic_json/binary/
20159 static basic_json binary(typename binary_t::container_type&& init, typename binary_t::subtype_type subtype)
20162 res.m_type = value_t::binary;
20232 case value_t::binary:
20284 case value_t::binary:
20286 m_value = *first.m_object->m_value.binary;
20362 case value_t::binary:
20364 m_value = *other.m_value.binary;
20541 /// @brief return whether value is a binary array
20545 return m_type == value_t::binary;
20664 /// get a pointer to the value (binary)
20667 return is_binary() ? m_value.binary : nullptr;
20670 /// get a pointer to the value (binary)
20673 return is_binary() ? m_value.binary : nullptr;
21067 /// @brief get a binary value
21073 JSON_THROW(type_error::create(302, detail::concat("type must be binary, but is ", type_name()), this));
21079 /// @brief get a binary value
21085 JSON_THROW(type_error::create(302, detail::concat("type must be binary, but is ", type_name()), this));
21612 case value_t::binary:
21629 std::allocator_traits<decltype(alloc)>::destroy(alloc, m_value.binary);
21630 std::allocator_traits<decltype(alloc)>::deallocate(alloc, m_value.binary, 1);
21631 m_value.binary = nullptr;
21682 case value_t::binary:
21700 std::allocator_traits<decltype(alloc)>::destroy(alloc, m_value.binary);
21701 std::allocator_traits<decltype(alloc)>::deallocate(alloc, m_value.binary, 1);
21702 m_value.binary = nullptr;
22102 case value_t::binary:
22141 case value_t::binary:
22175 case value_t::binary:
22231 case value_t::binary:
22233 m_value.binary->clear();
22715 swap(*(m_value.binary), other);
22731 swap(*(m_value.binary), other);
22782 case value_t::binary: \
22783 return (*lhs.m_value.binary) op (*rhs.m_value.binary); \
23343 case value_t::binary:
23344 return "binary";
23373 // binary serialization/deserialization //
23376 /// @name binary serialization/deserialization support
23943 case value_t::binary: // LCOV_EXCL_LINE
24243 case value_t::binary: