57 auto dhandle = group.openDataSet(
"data");
58 auto dspace = dhandle.getSpace();
59 const auto ndims = dspace.getSimpleExtentNdims();
61 throw std::runtime_error(
"'data' should have non-zero dimensions");
63 auto dims = sanisizer::create<std::vector<hsize_t> >(ndims);
64 dspace.getSimpleExtentDims(dims.data());
67 if (version.lt(1, 1, 0)) {
68 output.
type = translate_type_0_99(dhandle.getTypeClass());
69 if (is_boolean_0_99(dhandle)) {
70 output.
type = BOOLEAN;
73 auto type = load_scalar_string_attribute(dhandle,
"type");
74 output.
type = translate_type_1_1(type);
75 if (!options.details_only) {
76 check_type_1_1(dhandle, output.
type);
80 if (!options.details_only) {
81 validate_missing_placeholder(dhandle, version);
82 if (dhandle.getTypeClass() == H5T_STRING) {
83 ritsuko::hdf5::validate_nd_strings(dhandle, dims);
87 }
catch (std::exception& e) {
88 throw std::runtime_error(
"failed to validate 'data'; " + std::string(e.what()));
91 transplant_dimensions(dims, output.
dimensions);
96 auto nhandle = group.openDataSet(
"native");
97 if (nhandle.getSpace().getSimpleExtentNdims() != 0) {
98 throw std::runtime_error(
"'native' attribute should be a scalar");
101 if (version.lt(1, 1, 0)) {
102 native = load_boolean_scalar_0_99(nhandle);
104 if (ritsuko::hdf5::exceeds_integer_limit(nhandle, 8,
true)) {
105 throw std::runtime_error(
"'native' attribute should use a datatype that fits into an 8-bit signed integer");
107 std::int8_t tmp_native;
108 nhandle.read(&tmp_native, H5::PredType::NATIVE_INT);
114 if (!options.details_only) {
115 if (group.exists(
"dimnames")) {
116 validate_dimnames_internal(group, output.
dimensions, version);
ArrayDetails validate_dense_array(const H5::Group &group, const ritsuko::Version &version, const Options &options)
Definition dense_array.hpp:53