| 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 | { |
no test coverage detected