![]() |
Kea 2.7.3
|
Token that represents regular expression (regex) matching. More...
#include <token.h>
Public Member Functions | |
TokenMatch (const std::string ®_exp) | |
Constructor. | |
virtual unsigned | evaluate (Pkt &pkt, ValueStack &values) |
Match regular expression. | |
const std::string & | getRegExp () const |
Returns regular expression. | |
![]() | |
virtual | ~Token () |
Virtual destructor. | |
virtual unsigned | getLabel () const |
Return the label of this token. | |
Additional Inherited Members | |
![]() | |
static bool | toBool (std::string value) |
Coverts a (string) value to a boolean. | |
Token that represents regular expression (regex) matching.
For example "match('foo', '_foobar_')" is true
TokenMatch::TokenMatch | ( | const std::string & | reg_exp | ) |
Constructor.
reg_exp | regular expression string |
EvalParseError | when the regular expression is not valid |
Definition at line 1472 of file token.cc.
References isc_throw, and isc::Exception::what().
|
virtual |
Match regular expression.
Evaluation uses only the last parameter (top of stack) which is popped. Pushes "true" when the regular expression evaluates to true, pushes "false" otherwise.
pkt | (unused) |
values | - stack of values (1 popped, 1 pushed) |
EvalBadStack | if there is no value on the stack |
Implements isc::dhcp::Token.
Definition at line 1482 of file token.cc.
References isc::dhcp::EVAL_DBG_STACK, isc::dhcp::EVAL_DEBUG_MATCH, isc::dhcp::EVAL_DEBUG_MATCH_ERROR, isc::dhcp::eval_logger, isc_throw, LOG_DEBUG, and LOG_ERROR.
|
inline |
Returns regular expression.
This method is used in testing to determine if the parser had instantiated TokenMatch with correct parameters.