Represents the 'success' or 'failure' of an operation, and holds an associated error message to describe the error when there's a failure. More...
#include <juce_Result.h>
Public Member Functions | |
Result (const Result &) | |
Result (Result &&) noexcept | |
bool | failed () const noexcept |
Returns true if this result indicates a failure. More... | |
const String & | getErrorMessage () const noexcept |
Returns the error message that was set when this result was created. More... | |
operator bool () const noexcept | |
Returns true if this result indicates a success. More... | |
bool | operator! () const noexcept |
Returns true if this result indicates a failure. More... | |
bool | operator!= (const Result &other) const noexcept |
Result & | operator= (const Result &) |
Result & | operator= (Result &&) noexcept |
bool | operator== (const Result &other) const noexcept |
bool | wasOk () const noexcept |
Returns true if this result indicates a success. More... | |
Static Public Member Functions | |
static Result | fail (const String &errorMessage) noexcept |
Creates a 'failure' result. More... | |
static Result | ok () noexcept |
Creates and returns a 'successful' result. More... | |
Private Member Functions | |
Result () noexcept | |
Result (const String &) noexcept | |
operator int () const | |
operator void * () const | |
Private Attributes | |
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.
Result::Result | ( | const Result & | ) |
|
noexcept |
|
privatenoexcept |
|
explicitprivatenoexcept |
Creates a 'failure' result.
If you pass a blank error message in here, a default "Unknown Error" message will be used instead.
Referenced by VideoComponent::Pimpl::DirectShowContext::getErrorMessageFromResult(), anonymous_namespace{juce_posix_SharedCode.h}::getResultForErrno(), VideoComponent::Pimpl::load(), and VideoComponent::Pimpl::DirectShowContext::loadFile().
|
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.
References operator!=(), and operator==().
Referenced by anonymous_namespace{juce_posix_SharedCode.h}::getResultForReturnValue(), VideoComponent::Pimpl::load(), and VideoComponent::Pimpl::DirectShowContext::loadFile().
|
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 |
|
noexcept |
Returns true if this result indicates a success.
|
private |