#include <Error.hh>
|
| Error () |
| Default constructor. More...
|
|
| Error (const ErrorCode _code, const std::string &_message) |
| Constructor. More...
|
|
| Error (const ErrorCode _code, const std::string &_message, const std::string &_filePath) |
| Constructor. More...
|
|
| Error (const ErrorCode _code, const std::string &_message, const std::string &_filePath, int _lineNumber) |
| Constructor. More...
|
|
ErrorCode | Code () const |
| Get the error code. More...
|
|
std::optional< std::string > | FilePath () const |
| Get the file path associated with this error. More...
|
|
std::optional< int > | LineNumber () const |
| Get the line number associated with this error. More...
|
|
std::string | Message () const |
| Get the error message, which is a description of the error. More...
|
|
void | SetFilePath (const std::string &_filePath) |
| Sets the file path that is associated with this error. More...
|
|
void | SetLineNumber (int _lineNumber) |
| Sets the line number that is associated with this error. More...
|
|
std::optional< std::string > | XmlPath () const |
| Get the XPath-like trace that is associated with this error. More...
|
|
◆ Error() [1/4]
sdf::v12::Error::Error |
( |
| ) |
|
◆ Error() [2/4]
sdf::v12::Error::Error |
( |
const ErrorCode |
_code, |
|
|
const std::string & |
_message |
|
) |
| |
Constructor.
- Parameters
-
[in] | _code | The error code. |
[in] | _message | A description of the error. |
- See also
- ErrorCode.
◆ Error() [3/4]
sdf::v12::Error::Error |
( |
const ErrorCode |
_code, |
|
|
const std::string & |
_message, |
|
|
const std::string & |
_filePath |
|
) |
| |
Constructor.
- Parameters
-
[in] | _code | The error code. |
[in] | _message | A description of the error. |
[in] | _filePath | The file path that is related to this error. |
- See also
- ErrorCode.
◆ Error() [4/4]
sdf::v12::Error::Error |
( |
const ErrorCode |
_code, |
|
|
const std::string & |
_message, |
|
|
const std::string & |
_filePath, |
|
|
int |
_lineNumber |
|
) |
| |
Constructor.
- Parameters
-
[in] | _code | The error code. |
[in] | _message | A description of the error. |
[in] | _filePath | The file path that is related to this error. |
[in] | _lineNumber | The line number in the provided file path where this error was raised. |
- See also
- ErrorCode.
◆ Code()
Get the error code.
- Returns
- An error code.
- See also
- ErrorCode.
◆ FilePath()
std::optional<std::string> sdf::v12::Error::FilePath |
( |
| ) |
const |
Get the file path associated with this error.
- Returns
- Returns the path of the file that this error is related to, nullopt otherwise.
◆ LineNumber()
std::optional<int> sdf::v12::Error::LineNumber |
( |
| ) |
const |
Get the line number associated with this error.
- Returns
- Returns the line number. nullopt otherwise.
◆ Message()
std::string sdf::v12::Error::Message |
( |
| ) |
const |
Get the error message, which is a description of the error.
- Returns
- Error message.
◆ operator bool()
sdf::v12::Error::operator bool |
( |
| ) |
const |
|
explicit |
Safe bool conversion.
- Returns
- True if this Error's Code() != NONE. In otherwords, this is true when there is an error.
◆ operator==()
bool sdf::v12::Error::operator== |
( |
const bool |
_value | ) |
const |
Compare this Error to a boolean value.
- Returns
- True if the boolean evaluation of this Error equals _value. If _value == false, then true is returned when this Error's Code() is equal to NONE and false is returned otherwise. If _value == true, then true is returned when this Error's Code() is not equal to NONE and false is returned otherwise.
- See also
- explicit operator bool() const
◆ SetFilePath()
void sdf::v12::Error::SetFilePath |
( |
const std::string & |
_filePath | ) |
|
Sets the file path that is associated with this error.
- Parameters
-
[in] | _filePath | The file path that is related to this error. (e.g. /tmp/test_file.sdf) |
◆ SetLineNumber()
void sdf::v12::Error::SetLineNumber |
( |
int |
_lineNumber | ) |
|
Sets the line number that is associated with this error.
- Parameters
-
[in] | _lineNumber | The line number that is related to this error. |
◆ SetXmlPath()
void sdf::v12::Error::SetXmlPath |
( |
const std::string & |
_xmlPath | ) |
|
Safe bool conversion.
- Returns
- True if this Error's Code() != NONE. In otherwords, this is true when there is an error.
◆ XmlPath()
std::optional<std::string> sdf::v12::Error::XmlPath |
( |
| ) |
const |
Get the XPath-like trace that is associated with this error.
- Returns
- Returns the XPath-like trace that this error is related to, nullopt otherwise.
The documentation for this class was generated from the following file: