MCPcopy Create free account
hub / github.com/KhronosGroup/COLLADA2GLTF / writeJSON

Method writeJSON

GLTF/src/GLTFObject.cpp:39–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39void GLTF::Object::writeJSON(void* writer, GLTF::Options* options) {
40 rapidjson::Writer<rapidjson::StringBuffer>* jsonWriter = (rapidjson::Writer<rapidjson::StringBuffer>*)writer;
41 if (this->name.length() > 0) {
42 jsonWriter->Key("name");
43 jsonWriter->String(this->name.c_str());
44 }
45 if (this->extensions.size() > 0) {
46 jsonWriter->Key("extensions");
47 jsonWriter->StartObject();
48 for (const auto extension : this->extensions) {
49 jsonWriter->Key(extension.first.c_str());
50 jsonWriter->StartObject();
51 extension.second->writeJSON(writer, options);
52 jsonWriter->EndObject();
53 }
54 jsonWriter->EndObject();
55 }
56 if (this->extras.size() > 0) {
57 jsonWriter->Key("extras");
58 jsonWriter->StartObject();
59 for (const auto extra : this->extras) {
60 jsonWriter->Key(extra.first.c_str());
61 jsonWriter->StartObject();
62 extra.second->writeJSON(writer, options);
63 jsonWriter->EndObject();
64 }
65 jsonWriter->EndObject();
66 }
67}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected