MCPcopy Create free account
hub / github.com/Scobalula/Greyhound / EnumerateFiles

Method EnumerateFiles

src/WraithXCOD/WraithXCOD/CascFileSystem.cpp:149–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149size_t CascFileSystem::EnumerateFiles(const std::string& pattern, std::function<void(const std::string&, const size_t)> onFileFound)
150{
151 size_t entriesConsumed = 0;
152 HANDLE fileHandle;
153 CASC_FIND_DATA findData;
154
155 fileHandle = CascFindFirstFile(StorageHandle, pattern.c_str(), &findData, NULL);
156
157 if (fileHandle != INVALID_HANDLE_VALUE)
158 {
159 do
160 {
161 if (findData.bFileAvailable)
162 {
163 if (findData.bFileAvailable)
164 {
165 onFileFound(findData.szFileName, findData.FileSize);
166 }
167 }
168 } while (CascFindNextFile(fileHandle, &findData));
169 }
170
171 CascFindClose(fileHandle);
172
173 return false;
174}

Callers

nothing calls this directly

Calls 3

CascFindFirstFileFunction · 0.85
CascFindNextFileFunction · 0.85
CascFindCloseFunction · 0.85

Tested by

no test coverage detected