TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ get_binary() [2/2]

template<template< typename U, typename V, typename... Args > class ObjectType = std::map, template< typename U, typename... Args > class ArrayType = std::vector, class StringType = std::string, class BooleanType = bool, class NumberIntegerType = std::int64_t, class NumberUnsignedType = std::uint64_t, class NumberFloatType = double, template< typename U > class AllocatorType = std::allocator, template< typename T, typename SFINAE=void > class JSONSerializer = adl_serializer, class BinaryType = std::vector<std::uint8_t>>
const binary_t & nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::get_binary ( ) const
inline

Returns
reference to the binary value
Exceptions
type_error.302if the value is not binary
See also
see is_binary() to check if the value is binary
Since
version 3.8.0

Definition at line 21139 of file json.hpp.

21140 {
21141 if (!is_binary())
21142 {
21143 JSON_THROW(type_error::create(302, "type must be binary, but is " + std::string(type_name()), *this));
21144 }
21145
21146 return *get_ptr<const binary_t *>();
21147 }
constexpr bool is_binary() const noexcept
return whether value is a binary array
Definition: json.hpp:20476
JSON_HEDLEY_RETURNS_NON_NULL const char * type_name() const noexcept
return the type as string
Definition: json.hpp:24883