| 88 | } |
| 89 | |
| 90 | bool IsRegularFile(const std::string& path) { |
| 91 | #if defined(_WIN32) || defined(_WIN64) |
| 92 | const DWORD attributes = GetFileAttributesW(LocalWideFromUtf8(path).c_str()); |
| 93 | return attributes != INVALID_FILE_ATTRIBUTES && |
| 94 | (attributes & FILE_ATTRIBUTE_DIRECTORY) == 0; |
| 95 | #else |
| 96 | struct stat info; |
| 97 | if (stat(path.c_str(), &info) != 0) { |
| 98 | return false; |
| 99 | } |
| 100 | return (info.st_mode & S_IFMT) == S_IFREG; |
| 101 | #endif |
| 102 | } |
| 103 | |
| 104 | std::string ResolveAuxPath(const std::string& dictPath, |
| 105 | const std::string& modelPath, |
no test coverage detected