cpp-terminal 1.0.0
Small C++ library for writing multiplatform terminal applications
Loading...
Searching...
No Matches
Term::Private::Errno Class Reference

#include <cpp-terminal/private/exception.hpp>

Public Member Functions

 Errno (const Errno &) noexcept=default
 
 Errno (Errno &&) noexcept=default
 
 Errno () noexcept
 
virtual ~Errno () noexcept
 
Errnooperator= (Errno &&) noexcept=default
 
Errnooperator= (const Errno &) noexcept=default
 
std::int64_t error () const noexcept
 
bool check_value () const noexcept
 
Errnocheck_if (const bool &ret) noexcept
 
void throw_exception (const std::string &str={}) const
 

Private Attributes

std::int64_t m_errno {0}
 
bool m_check_value {false}
 

Detailed Description

Definition at line 54 of file exception.hpp.

Constructor & Destructor Documentation

◆ Errno() [1/3]

Term::Private::Errno::Errno ( const Errno & )
defaultnoexcept

◆ Errno() [2/3]

Term::Private::Errno::Errno ( Errno && )
defaultnoexcept

◆ Errno() [3/3]

Term::Private::Errno::Errno ( )
noexcept

Definition at line 115 of file exception.cpp.

116{
117#if defined(_WIN32)
118 _set_errno(0);
119#else
120 errno = {0}; //NOSONAR
121#endif
122}

◆ ~Errno()

Term::Private::Errno::~Errno ( )
virtualnoexcept

Definition at line 124 of file exception.cpp.

125{
126#if defined(_WIN32)
127 _set_errno(0);
128#else
129 errno = {0}; //NOSONAR
130#endif
131}

Member Function Documentation

◆ check_if()

Term::Private::Errno & Term::Private::Errno::check_if ( const bool & ret)
noexcept

Definition at line 137 of file exception.cpp.

138{
139#if defined(_WIN32)
140 int err{static_cast<int>(m_errno)};
141 _get_errno(&err);
142#else
143 m_errno = static_cast<std::uint32_t>(errno); //NOSONAR
144#endif
145 m_check_value = {ret};
146 return *this;
147}
std::int64_t m_errno
Definition exception.hpp:69

◆ check_value()

bool Term::Private::Errno::check_value ( ) const
noexcept

Definition at line 135 of file exception.cpp.

135{ return m_check_value; }

◆ error()

std::int64_t Term::Private::Errno::error ( ) const
noexcept

Definition at line 133 of file exception.cpp.

133{ return m_errno; }

◆ operator=() [1/2]

Errno & Term::Private::Errno::operator= ( const Errno & )
defaultnoexcept

◆ operator=() [2/2]

Errno & Term::Private::Errno::operator= ( Errno && )
defaultnoexcept

◆ throw_exception()

void Term::Private::Errno::throw_exception ( const std::string & str = {}) const

Definition at line 149 of file exception.cpp.

Member Data Documentation

◆ m_check_value

bool Term::Private::Errno::m_check_value {false}
private

Definition at line 70 of file exception.hpp.

70{false};

◆ m_errno

std::int64_t Term::Private::Errno::m_errno {0}
private

Definition at line 69 of file exception.hpp.

69{0};

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