| 699 | } |
| 700 | |
| 701 | bool isRegularFile(const std::string& path) { |
| 702 | #if defined(_WIN32) || defined(_WIN64) |
| 703 | const DWORD attributes = GetFileAttributesW(WideFromUtf8(path).c_str()); |
| 704 | return attributes != INVALID_FILE_ATTRIBUTES && |
| 705 | (attributes & FILE_ATTRIBUTE_DIRECTORY) == 0; |
| 706 | #else |
| 707 | struct stat info; |
| 708 | if (stat(path.c_str(), &info) != 0) { |
| 709 | return false; |
| 710 | } |
| 711 | return (info.st_mode & S_IFMT) == S_IFREG; |
| 712 | #endif |
| 713 | } |
| 714 | |
| 715 | std::shared_ptr<ResourceProvider> |
| 716 | NewFilesystemResourceProvider(const std::string& configDirectory, |
no test coverage detected