MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / removeFolder

Method removeFolder

switch/source/configuration.cpp:411–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409}
410
411void Configuration::removeFolder(std::unordered_map<u64, std::vector<std::string>>& map, const char* key, u64 id, const std::string& path)
412{
413 auto it = map.find(id);
414 if (it == map.end()) {
415 return;
416 }
417 auto& folders = it->second;
418 folders.erase(std::remove(folders.begin(), folders.end(), path), folders.end());
419 if (folders.empty()) {
420 map.erase(it);
421 mJson[key].erase(hexId(id));
422 }
423 else {
424 mJson[key][hexId(id)]["folders"] = folders;
425 }
426 save();
427}
428
429void Configuration::addAdditionalSaveFolder(u64 id, const std::string& path)
430{

Callers

nothing calls this directly

Calls 6

hexIdFunction · 0.85
findMethod · 0.80
endMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected