MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / FindFiles

Method FindFiles

Util/src/FileFinder.cpp:33–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33std::vector<std::string> FileFinder::FindFiles() {
34 std::vector<std::string> files;
35
36 CollectFile(_root, files);
37
38 if (_ignorePatterns.empty()) {
39 return files;
40 }
41
42 std::vector<std::string> resultFiles;
43 auto rootPath = _root.string();
44 for (auto &originFile: files) {
45 auto matchFilePath = string_util::GetFileRelativePath(rootPath, originFile);
46 if (!matchFilePath.empty()) {
47 for (auto &pattern: _ignorePatterns) {
48 if (string_util::FileWildcardMatch(matchFilePath, pattern)) {
49 goto nextFile;
50 }
51 }
52 }
53 resultFiles.push_back(originFile);
54 nextFile:;//ignore
55 }
56 return resultFiles;
57}
58
59void FileFinder::CollectFile(std::filesystem::path directoryPath, std::vector<std::string> &paths) {
60 if (!std::filesystem::exists(directoryPath)) {

Callers 3

CheckWorkspaceMethod · 0.80
ReformatWorkspaceMethod · 0.80

Calls 3

emptyMethod · 0.45
stringMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected