![]() |
Arene Base
Fundamental Utilities For Safety Critical C++
|
A class representing a filesystem error value. Intended to be a wrapper around errno. More...
Public Types | |
| using | raw_error_code = int |
| Raw error code type. | |
Public Member Functions | |
| error_code () noexcept | |
| Construct with no error. | |
| constexpr | error_code (raw_error_code const error) noexcept |
| Construct with a specified error value. | |
| void | clear () noexcept |
| clear the error | |
| auto | message () const noexcept -> error_string |
| Get a message describing the error. | |
| operator bool () const noexcept | |
| Check if the error is non-zero, which represents there is an error. | |
| ARENE_NORETURN void | throw_error () const |
| Raise an exception produced from the error. | |
| ARENE_NORETURN void | throw_error_with_prefix (null_terminated_string_view const message_prefix) const |
| Raise an exception produced from the error with a descriptive message. | |
| constexpr auto | value () const noexcept -> raw_error_code |
| Get the stored error value. | |
Static Public Member Functions | |
| static auto | from_errno () noexcept -> error_code |
Create an instance from the current state of errno. | |
A class representing a filesystem error value. Intended to be a wrapper around errno.
Raw error code type.
|
inlinenoexcept |
Construct with no error.
value() == 0
|
inlineexplicitconstexprnoexcept |
Construct with a specified error value.
| error | The error value to construct from |
value() == error
|
inlinenoexcept |
clear the error
value() == 0 static_cast<bool>(*this) == false
|
staticnoexcept |
Create an instance from the current state of errno.
error_code with value() equal to the old value of errno errno to 0
|
noexcept |
Get a message describing the error.
error_string with a description of the error indicated by the stored error value
|
inlineexplicitnoexcept |
Check if the error is non-zero, which represents there is an error.
| ARENE_NORETURN void arene::base::filesystem::error_code::throw_error | ( | ) | const |
Raise an exception produced from the error.
| std::system_error | containing the error code |
| ARENE_NORETURN void arene::base::filesystem::error_code::throw_error_with_prefix | ( | null_terminated_string_view const | message_prefix | ) | const |
Raise an exception produced from the error with a descriptive message.
| message_prefix | A string to prefix the error message with |
| std::system_error | containing the error code prefixed with the given message. |
|
inlineconstexprnoexcept |
Get the stored error value.