MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / cleanup

Function cleanup

src/workflow/Util.cpp:127–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127void cleanup(const openstudio::filesystem::path& runDirPath) {
128 namespace fs = openstudio::filesystem;
129
130 static constexpr std::array<std::string_view, 2> removeExtensions{".mtr", ".epw"};
131
132 for (const auto& dirEnt : fs::directory_iterator{runDirPath}) {
133 const auto& dirEntryPath = dirEnt.path();
134 if (fs::is_regular_file(dirEntryPath)) {
135 if (std::find(removeExtensions.cbegin(), removeExtensions.cend(), dirEntryPath.extension().string()) != removeExtensions.cend()) {
136 fs::remove(dirEntryPath);
137 }
138 }
139 }
140}
141
142/*****************************************************************************************************************************************************
143* E N E R G Y P L U S O U T P U T R E Q U E S T S *

Callers 1

runCleanupMethod · 0.85

Calls 5

cbeginMethod · 0.80
cendMethod · 0.80
extensionMethod · 0.80
pathMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected