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

Method deleteSimulation

source/PersisterInterface/SerializerService.cpp:918–940  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

916}
917
918bool SerializerService::deleteSimulation(std::filesystem::path const& filename)
919{
920 try {
921 log(Priority::Important, "delete simulation " + filename.string());
922 std::filesystem::path settingsFilename(filename);
923 settingsFilename.replace_extension(std::filesystem::path(".settings.json"));
924 std::filesystem::path statisticsFilename(filename);
925 statisticsFilename.replace_extension(std::filesystem::path(".statistics.csv"));
926
927 if (!std::filesystem::remove(filename)) {
928 return false;
929 }
930 if (!std::filesystem::remove(settingsFilename)) {
931 return false;
932 }
933 if (!std::filesystem::remove(statisticsFilename)) {
934 return false;
935 }
936 return true;
937 } catch (...) {
938 return false;
939 }
940}
941
942bool SerializerService::serializeSimulationToStrings(SerializedSimulation& output, DeserializedSimulation const& input)
943{

Callers 3

truncateMethod · 0.80
deleteEntryMethod · 0.80

Calls 1

logFunction · 0.85

Tested by

no test coverage detected