|
LMMS
|
#include <Result.h>
Public Member Functions | |
| bool | wasOk () const noexcept |
| bool | failed () const noexcept |
| operator bool () const noexcept | |
| bool | operator! () const noexcept |
| const std::string & | getErrorMessage () const noexcept |
| Result (const Result &) | |
| Result & | operator= (const Result &) |
| bool | operator== (const Result &other) const noexcept |
| bool | operator!= (const Result &other) const noexcept |
Static Public Member Functions | |
| static Result | ok () noexcept |
| static Result | fail (const std::string &errorMessage) noexcept |
Private Member Functions | |
| Result () noexcept | |
| Result (const std::string &) noexcept | |
| operator int () const | |
| operator void * () const | |
Private Attributes | |
| std::string | errorMessage |
Represents the 'success' or 'failure' of an operation, and holds an associated error message to describe the error when there's a failure.
E.g.
| water::Result::Result | ( | const Result & | other | ) |
|
privatenoexcept |
|
explicitprivatenoexcept |
|
staticnoexcept |
Creates a 'failure' result. If you pass a blank error message in here, a default "Unknown Error" message will be used instead.
|
noexcept |
Returns true if this result indicates a failure. You can use getErrorMessage() to retrieve the error message associated with the failure.
|
noexcept |
Returns the error message that was set when this result was created. For a successful result, this will be an empty string;
|
inlinestaticnoexcept |
Creates and returns a 'successful' result.
|
noexcept |
Returns true if this result indicates a success. This is equivalent to calling wasOk().
|
private |
|
private |
|
noexcept |
Returns true if this result indicates a failure. This is equivalent to calling failed().
|
noexcept |
|
noexcept |
Returns true if this result indicates a success.
|
private |