MCPcopy Create free account
hub / github.com/bcndev/bytecoin / end_object

Method end_object

src/seria/KVBinaryOutputStream.cpp:96–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96void KVBinaryOutputStream::end_object() {
97 invariant(!m_objects_stack.empty(), "");
98
99 auto level = std::move(m_stack.back());
100 m_stack.pop_back();
101
102 auto obj_stream = std::move(m_objects_stack.back());
103 m_objects_stack.pop_back();
104
105 IOutputStream &out = m_objects_stack.empty() ? m_target : stream();
106
107 if (verbose_debug)
108 std::cout << "end_object TYPE_OBJECT level.count=" << level.count << " level.name=" << (std::string)level.name
109 << std::endl;
110
111 write_array_size(out, level.count);
112 out.write(obj_stream.buffer().data(), obj_stream.buffer().size());
113 if (verbose_tokens)
114 std::cout << "OBJ c=" << level.count << std::endl;
115}
116
117bool KVBinaryOutputStream::begin_array(size_t &size, bool fixed_size) {
118 write_element_prefix(BIN_KV_SERIALIZE_TYPE_ARRAY);

Callers

nothing calls this directly

Calls 5

write_array_sizeFunction · 0.85
emptyMethod · 0.45
writeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected