133{
134 if (path.find(".terr3dpack") == std::string::npos)
135 {
136 path = path + ".terr3dpack";
137 }
138
139 Serialize();
140 std::ofstream outfile;
141 outfile.open(appState->projectManager->GetResourcePath() + PATH_SEPARATOR "project.terr3d");
142 outfile << data.
dump(4,
' ',
false);
143 outfile.close();
144 MkDir(GetExecutableDir() + PATH_SEPARATOR "Data" PATH_SEPARATOR "temp");
145 std::string uid = GenerateId(64);
146 SaveFile(GetExecutableDir() + "Data" + PATH_SEPARATOR "temp" PATH_SEPARATOR + uid);
147 zip_t *packed = zip_open(path.c_str(), 9, 'w');
148 zip_walk(packed, appState->projectManager->GetResourcePath().c_str());
149 zip_close(packed);
150}
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