diff --git a/src/hdf5_array.hpp b/src/hdf5_array.hpp index 43c5221..f9835a1 100644 --- a/src/hdf5_array.hpp +++ b/src/hdf5_array.hpp @@ -202,6 +202,29 @@ namespace CosmoTool { } }; + class hdf5_StringType + { + public: + H5::StrType type; + + hdf5_StringType() + : type(0, H5T_VARIABLE) + { + } + + static const hdf5_StringType *ctype() + { + static hdf5_StringType singleton; + return &singleton; + } + }; + + template<> struct get_hdf5_data_type { + static H5::DataType type() { + return hdf5_StringType::ctype()->type; + } + }; + class hdf5_BoolType { public: @@ -326,7 +349,7 @@ namespace CosmoTool { H5::DataSpace dataspace = dataset.getSpace(); std::vector dimensions(data.num_dimensions()); - if (dataspace.getSimpleExtentNdims() != data.num_dimensions()) + if ((size_t)dataspace.getSimpleExtentNdims() != (size_t)data.num_dimensions()) { throw InvalidDimensions(); }