MCPcopy Create free account
hub / github.com/XorTroll/Goldleaf / GetDirectorySize

Method GetDirectorySize

Goldleaf/source/fs/fs_Explorer.cpp:346–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344 }
345
346 u64 Explorer::GetDirectorySize(const std::string &path) {
347 u64 size = 0;
348 const auto full_path = this->MakeFull(path);
349
350 const auto dirs = this->GetDirectories(full_path);
351 for(const auto &dir: dirs) {
352 size += this->GetDirectorySize(full_path + "/" + dir);
353 }
354
355 const auto files = this->GetFiles(full_path);
356 for(const auto &file: files) {
357 size += this->GetFileSize(full_path + "/" + file);
358 }
359 return size;
360 }
361
362}

Callers 2

CopyDirectoryProgressMethod · 0.95
OnDirectorySelectedMethod · 0.80

Calls 4

MakeFullMethod · 0.95
GetDirectoriesMethod · 0.45
GetFilesMethod · 0.45
GetFileSizeMethod · 0.45

Tested by

no test coverage detected