VTK  9.4.20250113
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
14VTK_ABI_NAMESPACE_BEGIN
15
17
23class VTKIOERF_EXPORT vtkHDF5Helper
24{
25public:
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);
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
71private:
72 vtkHDF5Helper(const vtkHDF5Helper&) = delete;
73 void operator=(const vtkHDF5Helper&) = delete;
74};
75
76VTK_ABI_NAMESPACE_END
77#endif
Abstract superclass for all arrays.
Helper class used to read hdf5 file format.
static bool ArrayExists(hid_t fileId, const char *pathName)
Check existence of array defined by pathName relative to fileId.
static std::vector< std::string > GetChildren(const hid_t &id, const std::string &name)
Get childs of a specific group name and id.
static vtkAbstractArray * CreateDataArray(const hid_t &fileId, const std::string &path, const std::string &dataSetName)
Create an appropriate data array based on fileId and the array defined by pathName.
static hsize_t GetDataLength(hid_t arrayId)
Get length of array defined by arrayId.
static herr_t FileInfoCallBack(hid_t, const char *name, void *opdata)
FileInfo() is a callback function for H5Giterate().
static bool GroupExists(hid_t fileId, const char *groupName)
Check existence of group defined by groupName relative to fileId.
static vtkAbstractArray * CreateDataArray(const hid_t &fileId, const std::string &pathName)
Create an appropriate data array based on fileId and the array defined by pathName.
static std::string GetPathFromName(const hid_t &id, const std::string &path, const std::string &name)
Get the relative path for a name based on the id.
static std::vector< hsize_t > GetDataDimensions(hid_t arrayId)
Get dimension of array defined by arrayId.
int64_t hid_t