Function traverse_or_create_groups(hid_t, const std::string&)

Function Documentation

h5utils::H5Group traverse_or_create_groups(hid_t parent, const std::string &path)

Recursively traverses or creates groups in an HDF5 file based on the given path.

This function takes a parent group identifier and a path string, and recursively traverses or creates the groups specified in the path. If a group in the path does not exist, it is created.

Parameters:
  • parent – The identifier of the parent group in the HDF5 file.

  • path – The path of groups to traverse or create, specified as a string with ‘/’ as the delimiter.

Throws:

std::runtime_error – If a group cannot be created or opened.

Returns:

The identifier of the final group in the path.