221{
222 if (path.size() <= 3)
223 {
224 return;
225 }
226
227 if (path.find(".terr3d") == std::string::npos)
228 {
229 path = path + ".terr3d";
230 }
231
232 if (path != appState->globals.currentOpenFilePath)
233 {
234 appState->globals.currentOpenFilePath = path;
235 }
236
237 Serialize();
238 std::ofstream outfile;
239 outfile.open(appState->projectManager->GetResourcePath() + PATH_SEPARATOR "project.terr3d");
240 outfile << data.
dump(4,
' ',
false);
241 outfile.close();
242 outfile.open(path);
243 outfile << data.
dump(4,
' ',
false);
244 outfile.close();
245}
string_t dump(const int indent=-1, const char indent_char=' ', const bool ensure_ascii=false, const error_handler_t error_handler=error_handler_t::strict) const
serialization