MCPcopy Create free account
hub / github.com/Kitware/VTK / Export

Method Export

Serialization/Manager/vtkObjectManager.cxx:167–197  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

165
166//------------------------------------------------------------------------------
167void vtkObjectManager::Export(const std::string& filename, int indent, char indentChar)
168{
169 std::string objectStatesFileName = filename, blobsFileName = filename + ".blobs.json";
170 if (!vtksys::SystemTools::StringEndsWith(filename, ".json"))
171 {
172 objectStatesFileName = filename + ".states.json";
173 blobsFileName = filename + ".blobs.json";
174 }
175 {
176 std::ofstream ofs(objectStatesFileName);
177 try
178 {
179 ofs << this->Context->States().dump(indent, indentChar);
180 }
181 catch (nlohmann::json::type_error& e)
182 {
183 vtkErrorMacro(<< "Failed to dump json. message=" << e.what());
184 }
185 }
186 {
187 std::ofstream ofs(blobsFileName);
188 try
189 {
190 ofs << this->Context->Blobs().dump(indent, indentChar);
191 }
192 catch (nlohmann::json::type_error& e)
193 {
194 vtkErrorMacro(<< "Failed to dump json. message=" << e.what());
195 }
196 }
197}
198
199//------------------------------------------------------------------------------
200std::vector<vtkTypeUInt32> vtkObjectManager::ImportFromJSON(const nlohmann::json& importJson)

Callers 5

vtkSessionExportFunction · 0.45
serializeMethod · 0.45
serializeMethod · 0.45
serializeMethod · 0.45
serializeMethod · 0.45

Calls 3

StringEndsWithFunction · 0.85
dumpMethod · 0.80
whatMethod · 0.45

Tested by 4

serializeMethod · 0.36
serializeMethod · 0.36
serializeMethod · 0.36
serializeMethod · 0.36