Soprano 2.9.4
|
Represents an error in Soprano. More...
#include <Soprano/Error/Error>
Public Member Functions | |
Error () | |
Error (const QString &message, int code=ErrorUnknown) | |
Error (const Error &) | |
virtual | ~Error () |
Error & | operator= (const Error &) |
operator bool () const | |
QString | message () const |
int | code () const |
bool | isParserError () const |
ParserError | toParserError () const |
Represents an error in Soprano.
Soprano::Error::Error::Error | ( | ) |
Create an Error object, representing success, i.e. no error.
Soprano::Error::Error::Error | ( | const QString & | message, |
int | code = ErrorUnknown |
||
) |
Create an Error object.
message | A human-readable error message. |
code | An optional machine-readable error code. Can be one of Soprano::ErrorCode or a user defined value which has to be bigger than ErrorUnknown. The redland backend for example uses error codes ErrorUnknown + redlandCode. |
Soprano::Error::Error::Error | ( | const Error & | ) |
Copy constructor
|
virtual |
Destructor
|
inline |
An Error evalutes to a boolean, indicating if an Error is "set".
Thus, an Error object can easily be checked as follows:
QString Soprano::Error::Error::message | ( | ) | const |
A string explaining the error in detail. This string is not necessarily translated (this depends on the plugin implementation).
int Soprano::Error::Error::code | ( | ) | const |
An error code. If the error code is ErrorNone the Error instance represents success. The code can either be one of the values of ErrorCode or a value above ErrorUnknown.
Example: The redland backend defines the error code as:
bool Soprano::Error::Error::isParserError | ( | ) | const |
true
if this Error instance represents a parser error. In that case the error can be converted to a ParserError. ParserError Soprano::Error::Error::toParserError | ( | ) | const |
Converts this error into a ParserError. This has the same effect as