| 74 | }; |
| 75 | |
| 76 | DIR* opendir(const char* path) |
| 77 | { |
| 78 | DIR* dir = new DIR; |
| 79 | dir->ent.d_name = 0; |
| 80 | #ifdef HAVE_WINRT |
| 81 | cv::String full_path = cv::String(path) + "\\*"; |
| 82 | wchar_t wfull_path[MAX_PATH]; |
| 83 | size_t copied = mbstowcs(wfull_path, full_path.c_str(), MAX_PATH); |
| 84 | CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1)); |
| 85 | dir->handle = ::FindFirstFileExW(wfull_path, FindExInfoStandard, |
| 86 | &dir->data, FindExSearchNameMatch, NULL, 0); |
| 87 | #else |
| 88 | dir->handle = ::FindFirstFileExA((cv::String(path) + "\\*").c_str(), |
| 89 | FindExInfoStandard, &dir->data, FindExSearchNameMatch, NULL, 0); |
| 90 | #endif |
| 91 | if(dir->handle == INVALID_HANDLE_VALUE) |
| 92 | { |
| 93 | /*closedir will do all cleanup*/ |
| 94 | delete dir; |
| 95 | return 0; |
| 96 | } |
| 97 | return dir; |
| 98 | } |
| 99 | |
| 100 | dirent* readdir(DIR* dir) |
| 101 | { |
no test coverage detected