MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / getFilesInDirectory

Method getFilesInDirectory

src/utils/Utils.cpp:74–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74std::list<std::string> Utils::getFilesInDirectory(const std::string& directory, const std::string& ext, bool recursive)
75{
76 std::list<std::string> l;
77
78 forEachFile(directory, [&](const std::string& path, const std::string& name, const std::string& fext) {
79 std::string extlower = fext;
80 std::transform(extlower.begin(), extlower.end(), extlower.begin(), ::tolower);
81
82 if (ext == "*" || extlower == ext)
83 l.push_back(path);
84 },
85 recursive);
86
87 return l;
88}
89
90bool Utils::fileExists(const std::string& file)
91{

Callers

nothing calls this directly

Calls 3

push_backMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected