MCPcopy Create free account
hub / github.com/chrxh/alien / updateFile

Method updateFile

source/PersisterInterface/SavepointTableService.cpp:127–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127void 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
144void SavepointTableService::encodeDecode(boost::property_tree::ptree& tree, SavepointTable& table, ParserTask task) const
145{

Callers

nothing calls this directly

Calls 1

encodeDecodeFunction · 0.85

Tested by

no test coverage detected