| 48 | |
| 49 | |
| 50 | std::vector<std::wstring> GetFilesInDirectory(const std::wstring& directory) { |
| 51 | std::vector<std::wstring> files; |
| 52 | WIN32_FIND_DATA findFileData; |
| 53 | HANDLE hFind = FindFirstFile(directory.c_str(), &findFileData); |
| 54 | |
| 55 | if (hFind == INVALID_HANDLE_VALUE) { |
| 56 | // Can be empty, ignore |
| 57 | if (g_Config.debug) { |
| 58 | LOG_W(LOG_INFO, L"No files found in %s", directory.c_str()); |
| 59 | } |
| 60 | return files; |
| 61 | } |
| 62 | |
| 63 | do { |
| 64 | const std::wstring fileOrDir = findFileData.cFileName; |
| 65 | if (fileOrDir != L"." && fileOrDir != L"..") { |
| 66 | files.push_back(StripToFirstDot(fileOrDir)); |
| 67 | } |
| 68 | } while (FindNextFile(hFind, &findFileData) != 0); |
| 69 | |
| 70 | FindClose(hFind); |
| 71 | return files; |
| 72 | } |
| 73 | |
| 74 | |
| 75 | std::string getRecordingsAsJson() { |
no test coverage detected