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

Method CreateFile

IO/HDF/vtkHDFWriterImplementation.cxx:123–147  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

121
122//------------------------------------------------------------------------------
123bool vtkHDFWriter::Implementation::CreateFile(bool overwrite, const std::string& filename)
124{
125 // Create file
126 vtkDebugWithObjectMacro(
127 this->Writer, << "Creating file " << this->Writer->CurrentPiece << ": " << filename);
128
129 vtkHDF::ScopedH5FHandle file{ H5Fcreate(
130 filename.c_str(), overwrite ? H5F_ACC_TRUNC : H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT) };
131 if (file == H5I_INVALID_HID)
132 {
133 return false;
134 }
135
136 // Create the root group
137 vtkHDF::ScopedH5GHandle root = this->CreateHdfGroupWithLinkOrder(file, "VTKHDF");
138 if (root == H5I_INVALID_HID)
139 {
140 return false;
141 }
142
143 this->File = std::move(file);
144 this->Root = std::move(root);
145
146 return true;
147}
148
149//------------------------------------------------------------------------------
150bool vtkHDFWriter::Implementation::OpenFile()

Callers 2

WriteDataMethod · 0.45

Calls 3

H5FcreateFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected