|
Tkrzw
|
#include <tkrzw_lib_common.h>
Public Types | |
| enum | Code : int32_t { SUCCESS = 0 , UNKNOWN_ERROR = 1 , SYSTEM_ERROR = 2 , NOT_IMPLEMENTED_ERROR = 3 , PRECONDITION_ERROR = 4 , INVALID_ARGUMENT_ERROR = 5 , CANCELED_ERROR = 6 , NOT_FOUND_ERROR = 7 , PERMISSION_ERROR = 8 , INFEASIBLE_ERROR = 9 , DUPLICATION_ERROR = 10 , BROKEN_DATA_ERROR = 11 , NETWORK_ERROR = 12 , APPLICATION_ERROR = 13 } |
| Enumeration of status codes. More... | |
Public Member Functions | |
| Status () | |
| Default constructor representing the success code. More... | |
| Status (Code code) | |
| Constructor representing a specific status. More... | |
| Status (Code code, std::string_view message) | |
| Constructor representing a specific status with a message. More... | |
| Status (const Status &rhs) | |
| Copy constructor. More... | |
| Status (Status &&rhs) | |
| Move constructor. More... | |
| ~Status () | |
| Destructor. More... | |
| Status & | operator= (const Status &rhs) |
| Assigns the internal state from another status object. More... | |
| Status & | operator= (Status &&rhs) |
| Assigns the internal state from another moved status object. More... | |
| Status & | operator|= (const Status &rhs) |
| Assigns the internal state from another status object only if the current state is success. More... | |
| Status & | operator|= (Status &&rhs) |
| Assigns the internal state from another status object only if the current state is success. More... | |
| Code | GetCode () const |
| Gets the status code. More... | |
| std::string | GetMessage () const |
| Gets the status message. More... | |
| bool | HasMessage () const |
| Checks whether the status has a non-empty message. More... | |
| char * | MakeMessageC () const |
| Makes a C string of the message. More... | |
| void | Set (Code code) |
| Sets the code and an empty message. More... | |
| void | Set (Code code, std::string_view message) |
| Sets the code and the message. More... | |
| bool | operator== (const Status &rhs) const |
| Checks whether the internal status code is equal to a given status. More... | |
| bool | operator!= (const Status &rhs) const |
| Checks whether the internal status code is not equal to a given status. More... | |
| bool | operator== (const Code &code) const |
| Checks whether the internal status code is equal to a given code. More... | |
| bool | operator!= (const Code &code) const |
| Checks whether the internal status code is not equal to a given code. More... | |
| bool | operator< (const Status &rhs) const |
| Compares this object with another status object. More... | |
| operator std::string () const | |
| Gets a string expression of the status. More... | |
| bool | IsOK () const |
| Returns true if the status is success. More... | |
| const Status & | OrDie () const |
| Throws an exception if the status is not success. More... | |
Static Public Member Functions | |
| static const char * | CodeName (Code code) |
| Gets the string name of a status code. More... | |
Status of operations.
| enum tkrzw::Status::Code : int32_t |
Enumeration of status codes.
| tkrzw::Status::Status | ( | ) |
Default constructor representing the success code.
|
explicit |
Constructor representing a specific status.
| code | The status code. |
| tkrzw::Status::Status | ( | Code | code, |
| std::string_view | message | ||
| ) |
Constructor representing a specific status with a message.
| code | The status code. |
| message | An arbitrary status message. |
| tkrzw::Status::Status | ( | const Status & | rhs | ) |
Copy constructor.
| rhs | The right-hand-side object. |
| tkrzw::Status::Status | ( | Status && | rhs | ) |
Move constructor.
| rhs | The right-hand-side object. |
| tkrzw::Status::~Status | ( | ) |
Destructor.
Assigns the internal state from another status object.
| rhs | The status object. |
Assigns the internal state from another moved status object.
| rhs | The status object. |
Assigns the internal state from another status object only if the current state is success.
| rhs | The status object. |
Assigns the internal state from another status object only if the current state is success.
| rhs | The status object. |
| Code tkrzw::Status::GetCode | ( | ) | const |
Gets the status code.
| std::string tkrzw::Status::GetMessage | ( | ) | const |
Gets the status message.
| bool tkrzw::Status::HasMessage | ( | ) | const |
Checks whether the status has a non-empty message.
| char* tkrzw::Status::MakeMessageC | ( | ) | const |
Makes a C string of the message.
| void tkrzw::Status::Set | ( | Code | code | ) |
Sets the code and an empty message.
| code | The status code. |
| void tkrzw::Status::Set | ( | Code | code, |
| std::string_view | message | ||
| ) |
Sets the code and the message.
| code | The status code. |
| message | An arbitrary status message. |
| bool tkrzw::Status::operator== | ( | const Status & | rhs | ) | const |
Checks whether the internal status code is equal to a given status.
| rhs | The status to compare. |
| bool tkrzw::Status::operator!= | ( | const Status & | rhs | ) | const |
Checks whether the internal status code is not equal to a given status.
| rhs | The status to compare. |
| bool tkrzw::Status::operator== | ( | const Code & | code | ) | const |
Checks whether the internal status code is equal to a given code.
| code | The code to compare. |
| bool tkrzw::Status::operator!= | ( | const Code & | code | ) | const |
Checks whether the internal status code is not equal to a given code.
| code | The code to compare. |
| bool tkrzw::Status::operator< | ( | const Status & | rhs | ) | const |
Compares this object with another status object.
| rhs | The status to compare. |
| tkrzw::Status::operator std::string | ( | ) | const |
Gets a string expression of the status.
| bool tkrzw::Status::IsOK | ( | ) | const |
Returns true if the status is success.
| const Status& tkrzw::Status::OrDie | ( | ) | const |
Throws an exception if the status is not success.
|
static |
Gets the string name of a status code.
| code | The status code. |