A lightweight status object carrying an error code and message.
More...
#include <status.h>
|
| | Status ()=default |
| | Constructs an OK status.
|
| |
| | Status (StatusCode code, std::string message) |
| | Constructs a status with the given code and message.
|
| |
| auto | ok () const noexcept -> bool |
| | Returns true if the status represents success.
|
| |
| auto | code () const noexcept -> StatusCode |
| | Returns the error code.
|
| |
| auto | message () const noexcept -> std::string_view |
| | Returns the error message (empty for OK status).
|
| |
A lightweight status object carrying an error code and message.
A default-constructed Status is OK. Error states carry a non-empty message describing the failure.
◆ Status() [1/2]
| cppfig::Status::Status |
( |
| ) |
|
|
default |
◆ Status() [2/2]
| cppfig::Status::Status |
( |
StatusCode |
code, |
|
|
std::string |
message |
|
) |
| |
|
inline |
Constructs a status with the given code and message.
◆ code()
◆ message()
| auto cppfig::Status::message |
( |
| ) |
const -> std::string_view |
|
inlinenoexcept |
Returns the error message (empty for OK status).
◆ ok()
| auto cppfig::Status::ok |
( |
| ) |
const -> bool |
|
inlinenoexcept |
Returns true if the status represents success.
The documentation for this class was generated from the following file: