11 std::vector<std::string> ret;
13 std::string remainder = groupName;
14 size_t delimiter_pos = 0;
16 while ((delimiter_pos = remainder.find(
'/', delimiter_pos)) != std::string::npos)
18 if (delimiter_pos > 0)
20 ret.push_back(remainder.substr(0, delimiter_pos));
23 remainder = remainder.substr(delimiter_pos + 1);
28 if (remainder.size() > 0)
30 ret.push_back(remainder);
43 std::chrono::system_clock::time_point now = std::chrono::system_clock::now();
44 std::time_t t_now = std::chrono::system_clock::to_time_t(now);
45 std::string time(ctime(&t_now));
59 const std::string& groupName,
69 for (
size_t i = 0; i < groupNames.size(); i++)
71 if (cur_grp.
exist(groupNames[i]))
73 cur_grp = cur_grp.
getGroup(groupNames[i]);
83 throw std::runtime_error(
"HDF5IO - getGroup(): Groupname '" + groupNames[i] +
84 "' doesn't exist and create flag is false");
90 std::cout <<
"Error in getGroup (with group name '" << groupName <<
"': " << std::endl;
91 std::cout << e.
what() << std::endl;
106 for (
size_t i = 0; i < groupNames.size(); i++)
109 if (cur_grp.
exist(groupNames[i]))
111 cur_grp = cur_grp.
getGroup(groupNames[i]);
121 throw std::runtime_error(
"HDF5IO - getGroup(): Groupname '" + groupNames[i] +
122 "' doesn't exist and create flag is false");
128 std::cout <<
timestamp <<
"Error in HDF5Util::getGroup '" << groupName <<
"': " << std::endl;
136 bool exist(std::shared_ptr<HighFive::File> hdf5_file,
const std::string& groupName)
145 for (
size_t i = 0; i < groupNames.size(); i++)
147 if (cur_grp.
exist(groupNames[i]))
149 if (i < groupNames.size() - 1)
151 cur_grp = cur_grp.
getGroup(groupNames[i]);
162 std::cout <<
"Error in exist (with group name '" << groupName <<
"': " << std::endl;
163 std::cout << e.
what() << std::endl;
177 for (
size_t i = 0; i < groupNames.size(); i++)
179 if (cur_grp.
exist(groupNames[i]))
181 if (i < groupNames.size() - 1)
183 cur_grp = cur_grp.
getGroup(groupNames[i]);
194 std::cout <<
"Error in exist (with group name '" << groupName <<
"': " << std::endl;
195 std::cout << e.
what() << std::endl;
204 std::shared_ptr<HighFive::File> hdf5_file;
205 boost::filesystem::path path(
filename);
207 if (!boost::filesystem::exists(path))