TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ get_binary() [1/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>>
binary_t & nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::get_binary ( )
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 21128 of file json.hpp.

21129 {
21130 if (!is_binary())
21131 {
21132 JSON_THROW(type_error::create(302, "type must be binary, but is " + std::string(type_name()), *this));
21133 }
21134
21135 return *get_ptr<binary_t *>();
21136 }
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