MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / scanAll

Method scanAll

source/base/StarDirectoryAssetSource.cpp:74–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74void DirectoryAssetSource::scanAll(String const& assetDirectory, StringList& output) const {
75 auto shouldIgnore = [this](String const& assetPath) {
76 for (auto const& pattern : m_ignorePatterns) {
77 if (assetPath.regexMatch(pattern, false, false))
78 return true;
79 }
80 return false;
81 };
82
83 // path must be passed in including the trailing '/'
84 String fsDirectory = toFilesystem(assetDirectory);
85 for (auto entry : File::dirList(fsDirectory)) {
86 String assetPath = assetDirectory + entry.first;
87 if (entry.second) {
88 scanAll(assetPath + "/", output);
89 } else {
90 if (!shouldIgnore(assetPath))
91 output.append(std::move(assetPath));
92 }
93 }
94}
95
96}

Callers

nothing calls this directly

Calls 2

regexMatchMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected