MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / set_begin

Method set_begin

native/thirdpart/json/json.hpp:9478–9509  ·  view source on GitHub ↗

! @brief set the iterator to the first value @pre The iterator is initialized; i.e. `m_object != nullptr`. */

Source from the content-addressed store, hash-verified

9476 @pre The iterator is initialized; i.e. `m_object != nullptr`.
9477 */
9478 void set_begin() noexcept
9479 {
9480 assert(m_object != nullptr);
9481
9482 switch (m_object->m_type)
9483 {
9484 case value_t::object:
9485 {
9486 m_it.object_iterator = m_object->m_value.object->begin();
9487 break;
9488 }
9489
9490 case value_t::array:
9491 {
9492 m_it.array_iterator = m_object->m_value.array->begin();
9493 break;
9494 }
9495
9496 case value_t::null:
9497 {
9498 // set to end so begin()==end() is true: null is empty
9499 m_it.primitive_iterator.set_end();
9500 break;
9501 }
9502
9503 default:
9504 {
9505 m_it.primitive_iterator.set_begin();
9506 break;
9507 }
9508 }
9509 }
9510
9511 /*!
9512 @brief set the iterator past the last value

Callers 2

beginFunction · 0.45
cbeginFunction · 0.45

Calls 2

beginMethod · 0.45
set_endMethod · 0.45

Tested by

no test coverage detected