diff options
author | Max Kellermann <max@musicpd.org> | 2016-09-09 15:37:06 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2016-09-09 18:15:01 +0200 |
commit | fc7d3f64c007672e4c01172ccb1c46d083a8abd5 (patch) | |
tree | 3c72f16ee6cc919a17558678a1e270568182b8af /src/system | |
parent | 63ab7767a37a99b5651f32e067aeb5fcbb7bd033 (diff) |
input/Plugin: migrate open() from class Error to C++ exceptions
Diffstat (limited to 'src/system')
-rw-r--r-- | src/system/Error.hxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/system/Error.hxx b/src/system/Error.hxx index 4c9ad8613..7adf7921e 100644 --- a/src/system/Error.hxx +++ b/src/system/Error.hxx @@ -142,6 +142,19 @@ IsFileNotFound(const std::system_error &e) 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) { #ifdef WIN32 |