Specialization for std::string.
More...
template<>
struct qmcplusplus::h5data_proxy< std::string >
Specialization for std::string.
Definition at line 136 of file hdf_stl.h.
◆ data_type
◆ h5data_proxy()
◆ read()
bool read |
( |
data_type & |
ref, |
|
|
hid_t |
grp, |
|
|
const std::string & |
aname, |
|
|
hid_t |
xfer_plist = H5P_DEFAULT |
|
) |
| |
|
inline |
Definition at line 142 of file hdf_stl.h.
144 hid_t dataset = H5Dopen(grp, aname.c_str(), H5P_DEFAULT);
147 hid_t datatype = H5Dget_type(dataset);
149 if (datatype == H5T_NATIVE_CHAR)
151 hid_t dataspace = H5Dget_space(dataset);
152 hid_t status = H5Sget_simple_extent_dims(dataspace, &dim_out, NULL);
157 dim_out = H5Tget_size(datatype);
160 herr_t ret = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, xfer_plist, &(ref[0]));
◆ write()
bool write |
( |
const data_type & |
ref, |
|
|
hid_t |
grp, |
|
|
const std::string & |
aname, |
|
|
hid_t |
xfer_plist = H5P_DEFAULT |
|
) |
| const |
|
inline |
Definition at line 168 of file hdf_stl.h.
170 hid_t str80 = H5Tcopy(H5T_C_S1);
171 H5Tset_size(str80, ref.size());
175 hid_t h1 = H5Dopen(grp, aname.c_str(), H5P_DEFAULT);
178 hid_t dataspace = H5Screate_simple(1, &dim, NULL);
179 hid_t dataset = H5Dcreate(grp, aname.c_str(), str80, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
180 ret = H5Dwrite(dataset, str80, H5S_ALL, H5S_ALL, xfer_plist, ref.data());
186 ret = H5Dwrite(h1, str80, H5S_ALL, H5S_ALL, xfer_plist, ref.data());
The documentation for this struct was generated from the following file:
- /home/pk7/projects/qmc/for_cron_doxygen/qmcpack/src/io/hdf/hdf_stl.h