1#ifndef RITSUKO_MISCELLANEOUS_HPP
2#define RITSUKO_MISCELLANEOUS_HPP
29template<
class H5Object_>
33 throw std::runtime_error(
"expected '" + std::string(name) +
"' attribute to be a scalar");
48template<
class H5Object_>
54 throw std::runtime_error(
"expected '" + std::string(name) +
"' attribute to be a string with a UTF-8 compatible encoding");
57 if (attr.getTypeClass() != H5T_STRING) {
58 throw std::runtime_error(
"expected '" + std::string(name) +
"' attribute to be a string");
Get the length of a 1-dimensional HDF5 dataset.
Check if a string datatype uses a UTF-8 encoding.
bool is_utf8_string(const H5::StrType &stype)
Definition is_utf8_string.hpp:27
H5::Attribute open_attribute(const Object_ &handle, const char *name)
Definition open.hpp:88
bool is_scalar(const H5::DataSpace &space)
Definition get_1d_length.hpp:70
H5::Attribute open_scalar_attribute(const H5Object_ &handle, const char *name)
Definition miscellaneous.hpp:30
std::string open_and_load_scalar_string_attribute(const H5Object_ &handle, const char *name, bool utf8=true)
Definition miscellaneous.hpp:49
std::string load_scalar_string_attribute(const H5::Attribute &attr)
Definition load_attribute.hpp:27
Assorted helper functions for parsing and validation.
Definition choose_missing_placeholder.hpp:15
Convenience functions to safely open HDF5 handles.