| 125 | } |
| 126 | |
| 127 | void SavepointTableService::updateFile(SavepointTable& table) const |
| 128 | { |
| 129 | try { |
| 130 | std::ofstream stream(table.getFilename(), std::ios::binary); |
| 131 | if (!stream) { |
| 132 | throw std::runtime_error("Could not access save point table file: " + table.getFilename().string()); |
| 133 | } |
| 134 | boost::property_tree::ptree tree; |
| 135 | encodeDecode(tree, table, ParserTask::Encode); |
| 136 | boost::property_tree::json_parser::write_json(stream, tree); |
| 137 | } catch (std::exception const& e) { |
| 138 | throw std::runtime_error(std::string("The following error occurred: ") + e.what()); |
| 139 | } catch (...) { |
| 140 | throw std::runtime_error("Unknown error."); |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | void SavepointTableService::encodeDecode(boost::property_tree::ptree& tree, SavepointTable& table, ParserTask task) const |
| 145 | { |
nothing calls this directly
no test coverage detected