------------------------------------------------------------------------------
| 121 | |
| 122 | //------------------------------------------------------------------------------ |
| 123 | bool 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 | //------------------------------------------------------------------------------ |
| 150 | bool vtkHDFWriter::Implementation::OpenFile() |
no test coverage detected