TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ key()

template<typename IteratorType >
const string_type & nlohmann::detail::iteration_proxy_value< IteratorType >::key ( ) const
inline

return key of the iterator

Definition at line 4443 of file json.hpp.

4444 {
4445 JSON_ASSERT(anchor.m_object != nullptr);
4446
4447 switch (anchor.m_object->type())
4448 {
4449 // use integer array index as key
4450 case value_t::array:
4451 {
4453 {
4454 int_to_string( array_index_str, array_index );
4456 }
4457
4458 return array_index_str;
4459 }
4460
4461 // use key from the object
4462 case value_t::object:
4463 return anchor.key();
4464
4465 // use an empty key for all primitive types
4466 case value_t::null:
4467 case value_t::string:
4468 case value_t::boolean:
4472 case value_t::binary:
4473 case value_t::discarded:
4474 default:
4475 return empty_str;
4476 }
4477 }
IteratorType anchor
the iterator
Definition: json.hpp:4401
const string_type empty_str
an empty string (to return a reference for primitive values)
Definition: json.hpp:4409
std::size_t array_index_last
last stringified array index
Definition: json.hpp:4405
string_type array_index_str
a string representation of the array index
Definition: json.hpp:4407
std::size_t array_index
an index for arrays (used to create key names)
Definition: json.hpp:4403
@ number_integer
number value (signed integer)
@ discarded
discarded by the parser callback function
@ binary
binary array (ordered collection of bytes)
@ object
object (unordered set of name/value pairs)
@ number_float
number value (floating-point)
@ number_unsigned
number value (unsigned integer)
@ array
array (ordered collection of values)