MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / getFilesInDir

Function getFilesInDir

plugins/plugin_utils/plugin_files.cpp:265–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263}
264
265std::vector<std::string> getFilesInDir(const char* dir, const char* filter,
266 bool recrusive) {
267 std::vector<std::string> list;
268 if (!dir) {
269 return list;
270 }
271
272 std::string realFilter = "*.*";
273 if (filter) {
274 realFilter = filter;
275 }
276
277 std::string directory = convertPathToDelims(dir);
278
279 if (directory.size() && *(directory.end() - 1) == _DirDelim) {
280 directory.erase(directory.end() - 1);
281 }
282
283#ifdef _WIN32
284 WindowsAddFileStack(directory.c_str(), realFilter.c_str(), recrusive, list);
285#else
286 LinuxAddFileStack(directory.c_str(), realFilter.c_str(), recrusive, list);
287#endif
288 return list;
289}
290
291std::vector<std::string> getDirsInDir(const char* dir) {
292 std::vector<std::string> list;

Callers

nothing calls this directly

Calls 6

convertPathToDelimsFunction · 0.85
WindowsAddFileStackFunction · 0.85
LinuxAddFileStackFunction · 0.85
c_strMethod · 0.80
sizeMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected