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

Method CloseFile

IO/GeoJSON/vtkGeoJSONWriter.cxx:156–175  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

154
155//------------------------------------------------------------------------------
156void vtkGeoJSONWriter::CloseFile(ostream* fp)
157{
158 vtkDebugMacro(<< "Closing file\n");
159
160 if (fp != nullptr)
161 {
162 if (this->WriteToOutputString)
163 {
164 std::ostringstream* ostr = static_cast<std::ostringstream*>(fp);
165
166 delete[] this->OutputString;
167 this->OutputStringLength = static_cast<int>(ostr->str().size());
168 //+1's account for null terminator
169 this->OutputString = new char[ostr->str().size() + 1];
170 memcpy(this->OutputString, ostr->str().c_str(), this->OutputStringLength + 1);
171 }
172
173 delete fp;
174 }
175}
176
177//------------------------------------------------------------------------------
178void vtkGeoJSONWriter::ConditionalComma(vtkIdType cnt, vtkIdType limit)

Callers 1

WriteDataMethod · 0.95

Calls 3

sizeMethod · 0.45
strMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected