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. | |
| const String & | getErrorMessage () const noexcept |
| Returns the error message that was set when this result was created. | |
| operator bool () const noexcept | |
| Returns true if this result indicates a success. | |
| bool | operator! () const noexcept |
| Returns true if this result indicates a failure. | |
| 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. | |
Static Public Member Functions | |
| static Result | fail (const String &errorMessage) noexcept |
| Creates a 'failure' result. | |
| static Result | ok () noexcept |
| Creates and returns a 'successful' result. | |
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.
@tags{Core}
| juce::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 juce::anonymous_namespace{juce_SharedCode_posix.h}::getResultForErrno().
|
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.
Referenced by juce::anonymous_namespace{juce_SharedCode_posix.h}::getResultForReturnValue().
|
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.
Referenced by juce::detail::ScopedContentSharerInterface::shareData(), and juce::detail::ScopedContentSharerInterface::shareImages().
|
private |