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

Method GetDirectories

Goldleaf/source/fs/fs_StdExplorer.cpp:35–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33 }
34
35 std::vector<std::string> StdExplorer::GetDirectories(const std::string &path) {
36 std::vector<std::string> dirs;
37 const auto full_path = this->MakeFull(path);
38
39 auto dp = opendir(full_path.c_str());
40 if(dp) {
41 while(true) {
42 auto dt = readdir(dp);
43 if(dt == nullptr) {
44 break;
45 }
46 const std::string name = dt->d_name;
47 if((name != ".") && (name != "..")) {
48 if(dt->d_type & DT_DIR) {
49 dirs.push_back(name);
50 }
51 }
52 }
53 closedir(dp);
54 }
55 return dirs;
56 }
57
58 std::vector<std::string> StdExplorer::GetFiles(const std::string &path) {
59 std::vector<std::string> files;

Callers 4

GetContentsMethod · 0.45
CopyDirectoryMethod · 0.45
DoCopyDirectoryProgressFunction · 0.45
GetDirectorySizeMethod · 0.45

Calls 1

MakeFullMethod · 0.80

Tested by

no test coverage detected