MCPcopy Create free account
hub / github.com/bupticybee/TexasSolver / end_array

Method end_array

include/json.hpp:4778–4804  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4776 }
4777
4778 bool end_array()
4779 {
4780 bool keep = true;
4781
4782 if (ref_stack.back())
4783 {
4784 keep = callback(static_cast<int>(ref_stack.size()) - 1, parse_event_t::array_end, *ref_stack.back());
4785 if (not keep)
4786 {
4787 // discard array
4788 *ref_stack.back() = discarded;
4789 }
4790 }
4791
4792 assert(not ref_stack.empty());
4793 assert(not keep_stack.empty());
4794 ref_stack.pop_back();
4795 keep_stack.pop_back();
4796
4797 // remove discarded value
4798 if (not keep and not ref_stack.empty() and ref_stack.back()->is_array())
4799 {
4800 ref_stack.back()->m_value.array->pop_back();
4801 }
4802
4803 return true;
4804 }
4805
4806 bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/,
4807 const detail::exception& ex)

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.80
pop_backMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected