| Kea 3.0.2-git

isc::dhcp::TokenString Class Reference

The order where Token subtypes are declared should be: More...

`#include <token.h>`

Inheritance diagram for isc::dhcp::TokenString:
[legend]

## Public Member Functions
| TokenString (const std::string &str)
| Value is set during token construction.
virtual unsigned | evaluate (Pkt &pkt, ValueStack &values)
| Token evaluation (puts value of the constant string on the stack).
Public Member Functions inherited from isc::dhcp::Token
virtual | ~Token ()
| Virtual destructor.
virtual unsigned | getLabel () const
| Return the label of this token.

## Protected Attributes
std::string | value_
| Constant value.

## Additional Inherited Members
Static Public Member Functions inherited from isc::dhcp::Token
static bool | toBool (std::string value)
| Coverts a (string) value to a boolean.

## Detailed Description

The order where Token subtypes are declared should be:

- literal terminals
- option & co
- pkt field & co
- ==
- substring & co
- not, and, or

Token representing a constant string

This token holds value of a constant string, e.g. it represents "MSFT" in expression option[vendor-class].text == "MSFT"

Definition at line 129 of file token.h.

## Constructor & Destructor Documentation

## ◆ TokenString()

isc::dhcp::TokenString::TokenString | ( | const std::string & | str | ) |
| inline

Value is set during token construction.

Parameters

  str | constant string to be represented.

Definition at line 134 of file token.h.

References value_.

Referenced by isc::dhcp::TokenInteger::TokenInteger().

## Member Function Documentation

## ◆ evaluate()

unsigned TokenString::evaluate | ( | Pkt & | pkt,
|  | ValueStack & | values )
| virtual

Token evaluation (puts value of the constant string on the stack).

Parameters

  pkt | (ignored)
  values | (represented string will be pushed here)

Returns
  0 which means evaluate next token if any.

Implements isc::dhcp::Token.

Definition at line 40 of file token.cc.

References isc::dhcp::EVAL_DBG_STACK, isc::dhcp::EVAL_DEBUG_STRING, isc::dhcp::eval_logger, isc::dhcp::Pkt::getLabel(), LOG_DEBUG, and value_.

Here is the call graph for this function:

## Member Data Documentation

## ◆ value_

std::string isc::dhcp::TokenString::value_
| protected

Constant value.

Definition at line 144 of file token.h.

Referenced by TokenString(), and evaluate().

The documentation for this class was generated from the following files:

- token.h
- token.cc