input/Plugin: migrate open() from class Error to C++ exceptions

This commit is contained in:
Max Kellermann
2016-09-09 15:37:06 +02:00
parent 63ab7767a3
commit fc7d3f64c0
44 changed files with 359 additions and 461 deletions

View File

@@ -140,6 +140,19 @@ IsFileNotFound(const std::system_error &e)
#endif
}
gcc_pure
static inline bool
IsPathNotFound(const std::system_error &e)
{
#ifdef WIN32
return e.code().category() == std::system_category() &&
e.code().value() == ERROR_PATH_NOT_FOUND;
#else
return e.code().category() == std::system_category() &&
e.code().value() == ENOTDIR;
#endif
}
gcc_pure
static inline bool
IsAccessDenied(const std::system_error &e)