system/Error: add FormatFileNotFound()
This commit is contained in:
parent
2c276770f0
commit
ce093be12c
@ -147,6 +147,18 @@ FormatErrno(const char *fmt, Args&&... args) noexcept
|
|||||||
return FormatErrno(errno, fmt, std::forward<Args>(args)...);
|
return FormatErrno(errno, fmt, std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename... Args>
|
||||||
|
static inline std::system_error
|
||||||
|
FormatFileNotFound(const char *fmt, Args&&... args) noexcept
|
||||||
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
return FormatLastError(ERROR_FILE_NOT_FOUND, fmt,
|
||||||
|
std::forward<Args>(args)...);
|
||||||
|
#else
|
||||||
|
return FormatErrno(ENOENT, fmt, std::forward<Args>(args)...);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
gcc_pure
|
gcc_pure
|
||||||
inline bool
|
inline bool
|
||||||
IsErrno(const std::system_error &e, int code) noexcept
|
IsErrno(const std::system_error &e, int code) noexcept
|
||||||
|
Loading…
Reference in New Issue
Block a user