MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / end_array

Method end_array

Source/Utils/json.hpp:5651–5677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5649 }
5650
5651 bool end_array()
5652 {
5653 bool keep = true;
5654
5655 if (ref_stack.back())
5656 {
5657 keep = callback(static_cast<int>(ref_stack.size()) - 1, parse_event_t::array_end, *ref_stack.back());
5658 if (!keep)
5659 {
5660 // discard array
5661 *ref_stack.back() = discarded;
5662 }
5663 }
5664
5665 JSON_ASSERT(!ref_stack.empty());
5666 JSON_ASSERT(!keep_stack.empty());
5667 ref_stack.pop_back();
5668 keep_stack.pop_back();
5669
5670 // remove discarded value
5671 if (!keep && !ref_stack.empty() && ref_stack.back()->is_array())
5672 {
5673 ref_stack.back()->m_value.array->pop_back();
5674 }
5675
5676 return true;
5677 }
5678
5679 template<class Exception>
5680 bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/,

Callers

nothing calls this directly

Calls 3

pop_backMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected