Sailfish Crypto
API DocumentationResult Class
(Sailfish::Crypto::Result)The result of a crypto operation More...
Header: | #include <Crypto/result.h> |
Public Types
enum | ErrorCode { NoError, UnknownError, SerializationError, StorageError, ..., OtherError } |
enum | ResultCode { Succeeded, Pending, Failed } |
Properties
- code : Sailfish::Crypto::Result::ResultCode
- errorCode : Sailfish::Crypto::Result::ErrorCode
- errorMessage : QString
- storageErrorCode : int
Public Functions
Result(Sailfish::Crypto::Result::ResultCode resultCode = Succeeded) | |
Result(Sailfish::Crypto::Result::ErrorCode errorCode, const QString &errorMessage) | |
Result(Sailfish::Crypto::Result::ErrorCode errorCode, int storageErrorCode, const QString &errorMessage) | |
Result(const Result &other) | |
~Result() | |
Sailfish::Crypto::Result::ResultCode | code() const |
Sailfish::Crypto::Result::ErrorCode | errorCode() const |
QString | errorMessage() const |
void | setCode(int c) |
void | setCode(Sailfish::Crypto::Result::ResultCode c) |
void | setErrorCode(int c) |
void | setErrorCode(Sailfish::Crypto::Result::ErrorCode c) |
void | setErrorMessage(const QString &m) |
void | setStorageErrorCode(int c) |
int | storageErrorCode() const |
Result & | operator=(const Sailfish::Crypto::Result &other) |
Detailed Description
The result of a crypto operation
The result encapsulates information about whether a given crypto operation succeeded, failed, or is pending conclusion. If the operation failed, the result will also include some extra information about why the operation failed, to better allow client applications to handle the failure gracefully.
Property Documentation
code : Sailfish::Crypto::Result::ResultCode
Access functions:
Sailfish::Crypto::Result::ResultCode | code() const |
void | setCode(int c) |
void | setCode(Sailfish::Crypto::Result::ResultCode c) |
errorCode : Sailfish::Crypto::Result::ErrorCode
Access functions:
Sailfish::Crypto::Result::ErrorCode | errorCode() const |
void | setErrorCode(int c) |
void | setErrorCode(Sailfish::Crypto::Result::ErrorCode c) |
errorMessage : QString
Access functions:
QString | errorMessage() const |
void | setErrorMessage(const QString &m) |
storageErrorCode : int
Access functions:
int | storageErrorCode() const |
void | setStorageErrorCode(int c) |
Member Function Documentation
Result::Result(Sailfish::Crypto::Result::ResultCode resultCode = Succeeded)
Default constructs an instance of Result.
Result::Result(Sailfish::Crypto::Result::ErrorCode errorCode, const QString &errorMessage)
Default constructs an instance of Result.
Result::Result(Sailfish::Crypto::Result::ErrorCode errorCode, int storageErrorCode, const QString &errorMessage)
Default constructs an instance of Result.
Result::Result(const Result &other)
Constructs a copy of the other result
Result::~Result()
Destroys the result
Sailfish::Crypto::Result::ResultCode Result::code() const
Returns the result code associated with the result
Note: Getter function for property code.
See also setCode().
Sailfish::Crypto::Result::ErrorCode Result::errorCode() const
Returns the error code associated with the result
Note: Getter function for property errorCode.
See also setErrorCode().
QString Result::errorMessage() const
Returns the error message associated with the result
The error message is not meant for consumption by users of the application, as it will not be translated and may contain technical information. It is primarily intended for use by developers during development and debugging of applications.
Note: Getter function for property errorMessage.
See also setErrorMessage().
void Result::setCode(int c)
Sets the result code associated with the result to c
Note: Setter function for property code.
See also code().
void Result::setErrorCode(int c)
Sets the error code associated with the result to c
Note: Setter function for property errorCode.
See also errorCode().
void Result::setErrorMessage(const QString &m)
Sets the error message associated with the result to m
Note: Setter function for property errorMessage.
See also errorMessage().
void Result::setStorageErrorCode(int c)
Sets the storage error code associated with the result to c
Note: Setter function for property storageErrorCode.
See also storageErrorCode().
int Result::storageErrorCode() const
Returns the storage error code associated with the result
Some crypto operations will interact with the secrets storage backend (for example, when retrieving a Key from some crypto storage plugin). Such an operation may fail due to an error emitted by the storage backend, and if so, the storage-specific error code will be included here.
The returned value will be a specific Sailfish::Secrets::Result::ErrorCode
value.
Note: Getter function for property storageErrorCode.
See also setStorageErrorCode().
Result &Result::operator=(const Sailfish::Crypto::Result &other)
Copy-assignment operator.