MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / has_dataset

Method has_dataset

cpp/dolfinx/io/HDF5Interface.cpp:146–160  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

144}
145//-----------------------------------------------------------------------------
146bool io::hdf5::has_dataset(hid_t handle, const std::string& dataset_path)
147{
148 const hid_t lapl_id = H5Pcreate(H5P_LINK_ACCESS);
149 if (lapl_id < 0)
150 throw std::runtime_error("Failed to create HDF5 property list");
151
152 const htri_t link_status = H5Lexists(handle, dataset_path.c_str(), lapl_id);
153 if (link_status < 0)
154 throw std::runtime_error("Failed to check existence of HDF5 link in group");
155
156 if (H5Pclose(lapl_id) < 0)
157 throw std::runtime_error("Call to H5Pclose unsuccessful");
158
159 return link_status;
160}
161//-----------------------------------------------------------------------------
162void io::hdf5::set_attribute(hid_t handle, const std::string& attr_name,
163 const std::string& value)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected