75 hid_t file_id = H5Fopen(dataset().c_str(),H5F_ACC_RDONLY,H5P_DEFAULT);
77 throw InternalErr(__FILE__,__LINE__,
"Fail to obtain the HDF5 file ID .");
82 dset_id = H5Dopen2(file_id,var_path.c_str(),H5P_DEFAULT);
84 dset_id = H5Dopen2(file_id,name().c_str(),H5P_DEFAULT);
88 throw InternalErr(__FILE__,__LINE__,
"Fail to obtain the datatype .");
91 hid_t dtypeid = H5Dget_type(dset_id);
95 throw InternalErr(__FILE__,__LINE__,
"Fail to obtain the datatype .");
98 size_t size = H5Tget_size(dtypeid);
104 throw InternalErr(__FILE__, __LINE__,
"cannot return the size of datatype");
108 if(H5Tis_variable_str(dtypeid) >0){
109 vector<string>finstrval;
111 read_vlen_string(dset_id,1,
nullptr,
nullptr,
nullptr,finstrval);
112 string strval = finstrval[0];
119 get_data(dset_id, (
void *) chr.data());
121 string str(chr.begin(),chr.end());