Add metafilesystem hook to add optimized implementations of compute recursive directory size

This commit is contained in:
Henrik Rydgård
2021-09-11 18:12:29 +02:00
parent e842d395fa
commit 48310d15a9
11 changed files with 88 additions and 13 deletions
+15 -1
View File
@@ -136,5 +136,19 @@ public:
startingDirectory = dir;
}
u64 getDirSize(const std::string &dirPath);
int64_t ComputeRecursiveDirectorySize(const std::string &dirPath);
// Shouldn't ever be called, but meh.
bool ComputeRecursiveDirSizeIfFast(const std::string &path, int64_t *size) override {
int64_t sizeTemp = ComputeRecursiveDirectorySize(path);
if (sizeTemp >= 0) {
*size = sizeTemp;
return true;
} else {
return false;
}
}
private:
int64_t RecursiveSize(const std::string &dirPath);
};