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

Method begin

src/validate_json_writer.cpp:50–65  ·  view source on GitHub ↗

Begins a new structured section identified by the given key and makes it the current write context

Source from the content-addressed store, hash-verified

48
49/// Begins a new structured section identified by the given key and makes it the current write context
50BOOL ValidateJsonWriter::begin(const std::string& key, ContainerType type) {
51 if (file == nullptr || stack.empty()) return FALSE;
52
53 Json& current = *stack.back();
54
55 if (type == ContainerType::Array) {
56 if (!current.contains(key)) current[key] = Json::array();
57 current[key].push_back(Json::object());
58 stack.push_back(&current[key].back());
59 } else {
60 current[key] = Json::object();
61 stack.push_back(&current[key]);
62 }
63
64 return TRUE;
65}
66
67/// Begins a sub-section within the current section and makes it the active write context
68BOOL ValidateJsonWriter::beginsub(const std::string& key, ContainerType type) {

Callers

nothing calls this directly

Calls 1

emptyMethod · 0.80

Tested by

no test coverage detected