mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-10 05:38:58 +08:00
Pretty print output JSON.
This commit is contained in:
parent
5d8c5c832b
commit
fcaacde94c
@ -380,13 +380,13 @@ bool SaveGLTF(const std::string& output_filename,
|
||||
|
||||
picojson::value v = picojson::value(root);
|
||||
|
||||
std::ofstream ifs(output_filename);
|
||||
std::ofstream ifs(output_filename.c_str());
|
||||
if (ifs.bad()) {
|
||||
std::cerr << "Failed to open " << output_filename << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string s = v.serialize();
|
||||
std::string s = v.serialize(/* pretty */true);
|
||||
ifs.write(s.data(), s.size());
|
||||
ifs.close();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user