CppCommon  1.0.4.1
C++ Common Library
Public Member Functions | Static Public Member Functions | List of all members
CppCommon::SystemError Class Reference

System error. More...

#include <system_error.h>

Public Member Functions

 SystemError ()=delete
 
 SystemError (const SystemError &)=delete
 
 SystemError (SystemError &&)=delete
 
 ~SystemError ()=delete
 
SystemErroroperator= (const SystemError &)=delete
 
SystemErroroperator= (SystemError &&)=delete
 

Static Public Member Functions

static int GetLast () noexcept
 Get the last system error code. More...
 
static void SetLast (int error) noexcept
 Set the last system error code. More...
 
static void ClearLast () noexcept
 Clear the last system error code. More...
 
static std::string Description ()
 Convert the last system error code to the system error description. More...
 
static std::string Description (int error)
 Convert the given system error code to the system error description. More...
 

Detailed Description

System error.

System exception provides interface to get, set and clear the last system error.

Thread-safe.

Definition at line 22 of file system_error.h.

Constructor & Destructor Documentation

◆ SystemError() [1/3]

CppCommon::SystemError::SystemError ( )
delete

◆ SystemError() [2/3]

CppCommon::SystemError::SystemError ( const SystemError )
delete

◆ SystemError() [3/3]

CppCommon::SystemError::SystemError ( SystemError &&  )
delete

◆ ~SystemError()

CppCommon::SystemError::~SystemError ( )
delete

Member Function Documentation

◆ ClearLast()

void CppCommon::SystemError::ClearLast ( )
staticnoexcept

Clear the last system error code.

Definition at line 41 of file system_error.cpp.

◆ Description() [1/2]

static std::string CppCommon::SystemError::Description ( )
inlinestatic

Convert the last system error code to the system error description.

Returns
Last system error description
Examples
errors_system_error.cpp.

Definition at line 52 of file system_error.h.

◆ Description() [2/2]

std::string CppCommon::SystemError::Description ( int  error)
static

Convert the given system error code to the system error description.

Parameters
error- System error code
Returns
System error description

Definition at line 46 of file system_error.cpp.

◆ GetLast()

int CppCommon::SystemError::GetLast ( )
staticnoexcept

Get the last system error code.

Returns
Last system error code
Examples
errors_system_error.cpp.

Definition at line 23 of file system_error.cpp.

◆ operator=() [1/2]

SystemError& CppCommon::SystemError::operator= ( const SystemError )
delete

◆ operator=() [2/2]

SystemError& CppCommon::SystemError::operator= ( SystemError &&  )
delete

◆ SetLast()

void CppCommon::SystemError::SetLast ( int  error)
staticnoexcept

Set the last system error code.

Parameters
error- Last system error code to set

Definition at line 32 of file system_error.cpp.


The documentation for this class was generated from the following files: