CppCommon  1.0.4.1
C++ Common Library
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 
14 namespace CppCommon {
15 
17 
23 {
24 public:
25  SystemError() = delete;
26  SystemError(const SystemError&) = delete;
27  SystemError(SystemError&&) = delete;
28  ~SystemError() = delete;
29 
30  SystemError& operator=(const SystemError&) = delete;
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
SystemError & operator=(const SystemError &)=delete
SystemError & operator=(SystemError &&)=delete
static void ClearLast() noexcept
Clear the last system error code.
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.
Definition: system_error.h:52
static void SetLast(int error) noexcept
Set the last system error code.
C++ Common project definitions.
Definition: token_bucket.h:15