| 146 | } |
| 147 | |
| 148 | string hdf5_load_string(hid_t loc_id, const string& dataset_name) { |
| 149 | // Get size of dataset |
| 150 | size_t size; |
| 151 | H5T_class_t class_; |
| 152 | herr_t status = \ |
| 153 | H5LTget_dataset_info(loc_id, dataset_name.c_str(), NULL, &class_, &size); |
| 154 | CHECK_GE(status, 0) << "Failed to get dataset info for " << dataset_name; |
| 155 | char *buf = new char[size]; |
| 156 | status = H5LTread_dataset_string(loc_id, dataset_name.c_str(), buf); |
| 157 | CHECK_GE(status, 0) |
| 158 | << "Failed to load int dataset with name " << dataset_name; |
| 159 | string val(buf); |
| 160 | delete[] buf; |
| 161 | return val; |
| 162 | } |
| 163 | |
| 164 | void hdf5_save_string(hid_t loc_id, const string& dataset_name, |
| 165 | const string& s) { |
no outgoing calls
no test coverage detected