| 77 | } |
| 78 | |
| 79 | bool ScanDir::next() |
| 80 | { |
| 81 | #ifdef _WIN32 |
| 82 | if (handle == NULL) |
| 83 | { |
| 84 | handle = FindFirstFile ((directory + "\\" + pattern).c_str(), &data); |
| 85 | return handle != INVALID_HANDLE_VALUE; |
| 86 | } |
| 87 | |
| 88 | return FindNextFile (handle, &data) != 0; |
| 89 | #else |
| 90 | if (!dir) |
| 91 | return false; |
| 92 | |
| 93 | while ((data = os_utils::readdir (dir))) |
| 94 | { |
| 95 | if (match (pattern.c_str(), data->d_name)) |
| 96 | return true; |
| 97 | } |
| 98 | |
| 99 | return false; |
| 100 | #endif |
| 101 | } |
| 102 | |
| 103 | const char* ScanDir::getFileName() |
| 104 | { |