Represents error during the rule parsing.
More...
#include <RuleParser.hpp>
|
| RuleParserError (const std::string &rule_spec, const std::string &hint="", const std::string &file="", size_t error_line=0, unsigned int error_offset=0) |
| Constructs RuleParserError. More...
|
|
void | setHint (const std::string &hint) |
| Sets the describtion of the error. More...
|
|
void | setOffset (size_t offset) |
| Sets the offset where the error occured. More...
|
|
void | setFileInfo (const std::string &file, size_t error_line, size_t error_offset=0) |
| Sets exact location where the error occured. More...
|
|
const char * | what () const noexcept |
| Describes the exception. More...
|
|
const std::string & | rule () const |
| Returns string representation of the rule. More...
|
|
const std::string & | hint () const |
| Returns error hint. More...
|
|
bool | hasFileInfo () const |
| Decides whether information about error location is set. More...
|
|
const std::string | fileInfo () const |
| Returns string containing file, line and offset where the error occured. More...
|
|
const std::string & | file () const |
| File where the rule is located. More...
|
|
size_t | line () const |
| Line number where the rule is located. More...
|
|
size_t | offset () const |
| Offset where the error occured. More...
|
|
|
const std::string | _rule_spec |
|
std::string | _hint |
|
size_t | _offset |
|
std::string | _file |
|
size_t | _line |
|
Represents error during the rule parsing.
◆ RuleParserError()
usbguard::RuleParserError::RuleParserError |
( |
const std::string & |
rule_spec, |
|
|
const std::string & |
hint = "" , |
|
|
const std::string & |
file = "" , |
|
|
size_t |
error_line = 0 , |
|
|
unsigned int |
error_offset = 0 |
|
) |
| |
|
inline |
Constructs RuleParserError.
- Parameters
-
rule_spec | String representation of the rule. |
hint | Describes what happened. |
file | File where the rule is located. |
error_line | Line in the file where the error occured. |
error_offset | Offset where the error occured. |
◆ file()
const std::string& usbguard::RuleParserError::file |
( |
| ) |
const |
|
inline |
File where the rule is located.
- Returns
- File where the rule is located.
◆ fileInfo()
const std::string usbguard::RuleParserError::fileInfo |
( |
| ) |
const |
|
inline |
Returns string containing file, line and offset where the error occured.
- Returns
- String containing file, line and offset where the error occured.
◆ hasFileInfo()
bool usbguard::RuleParserError::hasFileInfo |
( |
| ) |
const |
|
inline |
Decides whether information about error location is set.
- Returns
- True if information about error location is set, false otherwise.
◆ hint()
const std::string& usbguard::RuleParserError::hint |
( |
| ) |
const |
|
inline |
Returns error hint.
- Returns
- Hint.
◆ line()
size_t usbguard::RuleParserError::line |
( |
| ) |
const |
|
inline |
Line number where the rule is located.
- Returns
- line number where the rule is located.
◆ offset()
size_t usbguard::RuleParserError::offset |
( |
| ) |
const |
|
inline |
Offset where the error occured.
- Returns
- offset where the error occured.
◆ rule()
const std::string& usbguard::RuleParserError::rule |
( |
| ) |
const |
|
inline |
Returns string representation of the rule.
- Returns
- string representation of the rule.
◆ setFileInfo()
void usbguard::RuleParserError::setFileInfo |
( |
const std::string & |
file, |
|
|
size_t |
error_line, |
|
|
size_t |
error_offset = 0 |
|
) |
| |
|
inline |
Sets exact location where the error occured.
- Parameters
-
file | File where the rule is located. |
error_line | Line in the file where the error occured. |
error_offset | Offset where the error occured. |
◆ setHint()
void usbguard::RuleParserError::setHint |
( |
const std::string & |
hint | ) |
|
|
inline |
Sets the describtion of the error.
- Parameters
-
hint | Describes what happened. |
◆ setOffset()
void usbguard::RuleParserError::setOffset |
( |
size_t |
offset | ) |
|
|
inline |
Sets the offset where the error occured.
- Parameters
-
offset | Offset where the error occured. |
◆ what()
const char* usbguard::RuleParserError::what |
( |
| ) |
const |
|
inlinenoexcept |
Describes the exception.
- Returns
- Describes what happened.
The documentation for this class was generated from the following file: