Commit ce093be1 authored by Max Kellermann's avatar Max Kellermann

system/Error: add FormatFileNotFound()

parent 2c276770
...@@ -147,6 +147,18 @@ FormatErrno(const char *fmt, Args&&... args) noexcept ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment