system/Error: add IsAccessDenied()
This commit is contained in:
parent
3843972b05
commit
08754e6ce7
@ -138,4 +138,17 @@ IsFileNotFound(const std::system_error &e)
|
||||
#endif
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
static inline bool
|
||||
IsAccessDenied(const std::system_error &e)
|
||||
{
|
||||
#ifdef WIN32
|
||||
return e.code().category() == std::system_category() &&
|
||||
e.code().value() == ERROR_ACCESS_DENIED;
|
||||
#else
|
||||
return e.code().category() == std::system_category() &&
|
||||
e.code().value() == EACCES;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user