Skip to content

Commit

Permalink
Add support for checking if an attribute exists in file (by name)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAce committed Apr 6, 2022
1 parent 0d1cb5e commit 2bc2354
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/h5pp/details/h5ppFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,14 @@ namespace h5pp {
return h5pp::hdf5::checkIfLinkExists(openFileHandle(), linkPath, plists.linkAccess);
}

[[nodiscard]] bool attributeExists(std::string_view linkPath, std::string_view attrName) const {
return h5pp::hdf5::checkIfAttrExists(openFileHandle(), linkPath, attrName);
}
template<typename h5x>
[[nodiscard]] bool attributeExists(const h5x &link, std::string_view attrName) const {
return h5pp::hdf5::checkIfAttrExists(link, attrName);
}

[[nodiscard]] std::vector<std::string> findLinks(std::string_view searchKey = "",
std::string_view searchRoot = "/",
long maxHits = -1,
Expand Down

0 comments on commit 2bc2354

Please sign in to comment.