| 18 | } |
| 19 | |
| 20 | void 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected