MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / getFileList

Function getFileList

src/Core/Utils/FileUtils.cpp:62–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60 }
61
62 std::vector<std::string> getFileList(const std::string& path)
63 {
64 Debug::Log->trace("<FileUtils> Get File List at {0}", path);
65
66 std::vector<std::string> fileList;
67#ifdef _USE_FILESYSTEM_FALLBACK
68 tinydir_dir dir;
69 tinydir_open(&dir, path.c_str());
70
71 while (dir.has_next)
72 {
73 tinydir_file file;
74 tinydir_readfile(&dir, &file);
75 if (!file.is_dir)
76 {
77 fileList.push_back(std::string(file.name));
78 }
79 tinydir_next(&dir);
80 }
81 tinydir_close(&dir);
82#else
83 for (auto& p : std::filesystem::directory_iterator(path))
84 {
85 if (std::filesystem::is_regular_file(p))
86 {
87 fileList.push_back(std::filesystem::path(p.path()).filename().string());
88 }
89 }
90#endif
91 return fileList;
92 }
93
94 bool fileExists(const std::string& path)
95 {

Callers 3

InstallFunction · 0.85
Loaders.cppFile · 0.85
initPluginsMethod · 0.85

Calls 8

tinydir_nextFunction · 0.85
tinydir_closeFunction · 0.85
traceMethod · 0.80
stringMethod · 0.80
pathMethod · 0.80
stringClass · 0.50
c_strMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected