| 71 | } |
| 72 | |
| 73 | bool IsReadableFile(const std::string& path) { |
| 74 | #if defined(_WIN32) || defined(_WIN64) |
| 75 | const DWORD attributes = GetFileAttributesW(LocalWideFromUtf8(path).c_str()); |
| 76 | return attributes != INVALID_FILE_ATTRIBUTES && |
| 77 | (attributes & FILE_ATTRIBUTE_DIRECTORY) == 0; |
| 78 | #else |
| 79 | std::ifstream ifs(path.c_str()); |
| 80 | return ifs.is_open(); |
| 81 | #endif |
| 82 | } |
| 83 | |
| 84 | std::string BaseName(const std::string& path) { |
| 85 | const std::string::size_type pos = path.find_last_of("/\\"); |
no test coverage detected