19 using type_no_const =
typename std::remove_const<T>::type;
20 using elem_type =
typename details::inspector<type_no_const>::base_type;
21 using char_array_t =
typename details::type_char_array<type_no_const>::type;
22 static constexpr bool is_char_array = ! std::is_same<char_array_t, void>::value;
27 const bool is_fixed_len_string;
28 const size_t n_dimensions;
33template <
typename SrcStrT>
45template <std::
size_t FixedLen>
47 inline static DataType getDataType(
const DataType& element_type,
bool ds_fixed_str) {
56 throw DataSetException(
"Can't output variable-length to fixed-length strings");
72 : is_fixed_len_string(dtype.isFixedLenStr())
74 , n_dimensions(details::
inspector<type_no_const>::recursive_ndim -
75 ((is_fixed_len_string && is_char_array) ? 1 : 0))
77 create_datatype<elem_type>(), is_fixed_len_string)) {
78 if (is_fixed_len_string && std::is_same<elem_type, std::string>::value) {
80 "Use raw arrays or FixedLenStringArray");
83 if (dtype.
getClass() != data_type.getClass()) {
84 std::cerr <<
"h5gt WARNING: data and hdf5 dataset have different types: "
85 << data_type.string() <<
" -> " << dtype.
string() << std::endl;
create an HDF5 DataType from a C++ type
Definition H5DataType.hpp:124
Exception specific to h5gt DataSet interface.
Definition H5Exception.hpp:115
HDF5 Data Type.
Definition H5DataType.hpp:48
std::string string() const
Returns a friendly description of the type (e.g. Float32)
Definition H5DataType_misc.hpp:80
DataTypeClass getClass() const
Return the fundamental type.
Definition H5DataType_misc.hpp:32
Definition H5ReadWrite_misc.hpp:18
Definition H5Utils.hpp:49
Definition H5ReadWrite_misc.hpp:34