+ HashedStorage::Destroy()

This commit is contained in:
hagen 2023-05-15 00:00:00 +00:00
parent 5a09c11e90
commit d010d3575d
2 changed files with 11 additions and 0 deletions

View file

@ -270,6 +270,15 @@ namespace fs {
boost::filesystem::remove(path);
}
void HashedStorage::Destroy() {
std::string storage_root = GetRoot ();
if (storage_root.empty()) {
LogPrint(eLogError, "FS: you're trying to call HashedStorage.Destroy() before .SetPlace(), fix your code!");
return;
}
boost::filesystem::remove_all(storage_root);
}
void HashedStorage::Traverse(std::vector<std::string> & files) {
Iterate([&files] (const std::string & fname) {
files.push_back(fname);