| 72 | } |
| 73 | |
| 74 | std::list<std::string> Utils::getFilesInDirectory(const std::string& directory, const std::string& ext, bool recursive) |
| 75 | { |
| 76 | std::list<std::string> l; |
| 77 | |
| 78 | forEachFile(directory, [&](const std::string& path, const std::string& name, const std::string& fext) { |
| 79 | std::string extlower = fext; |
| 80 | std::transform(extlower.begin(), extlower.end(), extlower.begin(), ::tolower); |
| 81 | |
| 82 | if (ext == "*" || extlower == ext) |
| 83 | l.push_back(path); |
| 84 | }, |
| 85 | recursive); |
| 86 | |
| 87 | return l; |
| 88 | } |
| 89 | |
| 90 | bool Utils::fileExists(const std::string& file) |
| 91 | { |