MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / dump_object

Method dump_object

extlibs/vili/src/node.cpp:135–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 }
134
135 std::string node::dump_object(bool root) const
136 {
137 const auto& map = std::get<object>(m_data);
138 std::string dump_value = (root) ? "" : "{\n";
139 size_t index = 0;
140 const size_t max_size = this->size();
141 for (const auto& [key, value] : map)
142 {
143 if (!value.is_null())
144 {
145 dump_value += " " + key + ": " + indent(value.dump());
146 if (index < max_size - 1)
147 {
148 dump_value += ",\n";
149 }
150 else
151 {
152 dump_value += "\n";
153 }
154 }
155 index++;
156 }
157 if (!root)
158 dump_value += "}";
159 return dump_value;
160 }
161
162 node node::from_type(node_type type)
163 {

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.95
indentFunction · 0.70
is_nullMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected