From fc7d3f64c007672e4c01172ccb1c46d083a8abd5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 9 Sep 2016 15:37:06 +0200 Subject: input/Plugin: migrate open() from class Error to C++ exceptions --- src/system/Error.hxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/system') 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 @@ -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) -- cgit v1.2.3