MCPcopy Create free account
hub / github.com/LAStools/LAStools / end_array

Method end_array

src/json.hpp:7139–7169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7137 }
7138
7139 bool end_array()
7140 {
7141 bool keep = true;
7142
7143 if (ref_stack.back())
7144 {
7145 keep = callback(static_cast<int>(ref_stack.size()) - 1, parse_event_t::array_end, *ref_stack.back());
7146 if (keep)
7147 {
7148 ref_stack.back()->set_parents();
7149 }
7150 else
7151 {
7152 // discard array
7153 *ref_stack.back() = discarded;
7154 }
7155 }
7156
7157 JSON_ASSERT(!ref_stack.empty());
7158 JSON_ASSERT(!keep_stack.empty());
7159 ref_stack.pop_back();
7160 keep_stack.pop_back();
7161
7162 // remove discarded value
7163 if (!keep && !ref_stack.empty() && ref_stack.back()->is_array())
7164 {
7165 ref_stack.back()->m_data.m_value.array->pop_back();
7166 }
7167
7168 return true;
7169 }
7170
7171 template<class Exception>
7172 bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/,

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected