VTK  9.7.1
vtkHDF5Helper.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 #ifndef vtkHDF5Helper_h
4 #define vtkHDF5Helper_h
5 
6 #include "vtkIOERFModule.h" // For export macro
7 
8 #define H5_USE_16_API
9 #include "vtk_hdf5.h" // For hid_t
10 
11 #include <string>
12 #include <vector>
13 
14 VTK_ABI_NAMESPACE_BEGIN
15 
16 class vtkAbstractArray;
17 
23 class VTKIOERF_EXPORT vtkHDF5Helper
24 {
25 public:
29  static std::vector<std::string> GetChildren(const hid_t& id, const std::string& name);
30 
34  static std::string GetPathFromName(
35  const hid_t& id, const std::string& path, const std::string& name);
36 
40  static bool ArrayExists(hid_t fileId, const char* pathName);
41 
45  static bool GroupExists(hid_t fileId, const char* groupName);
46 
50  static hsize_t GetDataLength(hid_t arrayId);
51 
55  static std::vector<hsize_t> GetDataDimensions(hid_t arrayId);
56 
58 
61  static vtkAbstractArray* CreateDataArray(const hid_t& fileId, const std::string& pathName);
62  static vtkAbstractArray* CreateDataArray(
63  const hid_t& fileId, const std::string& path, const std::string& dataSetName);
65 
69  static herr_t FileInfoCallBack(hid_t /* loc_id */, const char* name, void* opdata);
70 
71 private:
72  vtkHDF5Helper(const vtkHDF5Helper&) = delete;
73  void operator=(const vtkHDF5Helper&) = delete;
74 };
75 
76 VTK_ABI_NAMESPACE_END
77 #endif
Abstract superclass for all arrays.
VTKIOHDF_EXPORT herr_t FileInfoCallBack(hid_t loc_id, const char *name, const H5L_info_t *info, void *opdata)
Convenient callback method to retrieve a name when calling a H5Giterate()
int64_t hid_t
Definition: vtkHDFWriter.h:63
Helper class used to read hdf5 file format.
Definition: vtkHDF5Helper.h:23