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

Method writeJSON

GLTF/src/GLTFBuffer.cpp:20–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20void GLTF::Buffer::writeJSON(void* writer, GLTF::Options* options) {
21 rapidjson::Writer<rapidjson::StringBuffer>* jsonWriter = (rapidjson::Writer<rapidjson::StringBuffer>*)writer;
22 jsonWriter->Key("byteLength");
23 jsonWriter->Int(this->byteLength);
24 if (!options->binary || !options->embeddedBuffers) {
25 jsonWriter->Key("uri");
26 if (options->embeddedBuffers) {
27 uri = "data:application/octet-stream;base64," + std::string(Base64::encode(this->data, this->byteLength));
28 }
29 else {
30 uri = options->name + std::to_string(id) + ".bin";
31 }
32 jsonWriter->String(uri.c_str());
33 }
34 GLTF::Object::writeJSON(writer, options);
35}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected