CppCommon 1.0.5.0
C++ Common Library
Loading...
Searching...
No Matches
system_error.h
Go to the documentation of this file.
1
9#ifndef CPPCOMMON_ERRORS_SYSTEM_ERROR_H
10#define CPPCOMMON_ERRORS_SYSTEM_ERROR_H
11
12#include <string>
13
14namespace CppCommon {
15
17
23{
24public:
25 SystemError() = delete;
26 SystemError(const SystemError&) = delete;
28 ~SystemError() = delete;
29
32
34
37 static int GetLast() noexcept;
38
40
43 static void SetLast(int error) noexcept;
44
46 static void ClearLast() noexcept;
47
49
52 static std::string Description() { return Description(GetLast()); }
54
58 static std::string Description(int error);
59};
60
63} // namespace CppCommon
64
65#endif // CPPCOMMON_ERRORS_SYSTEM_ERROR_H
static void ClearLast() noexcept
Clear the last system error code.
SystemError & operator=(SystemError &&)=delete
static int GetLast() noexcept
Get the last system error code.
SystemError(const SystemError &)=delete
SystemError(SystemError &&)=delete
static std::string Description()
Convert the last system error code to the system error description.
SystemError & operator=(const SystemError &)=delete
static void SetLast(int error) noexcept
Set the last system error code.
C++ Common project definitions.