Kea 2.7.6
isc::dhcp::TokenHexString Class Reference

Token representing a constant string in hexadecimal format. More...

#include <token.h>

+ Inheritance diagram for isc::dhcp::TokenHexString:

Public Member Functions

 TokenHexString (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 after decoding or an empty string if decoding fails (note it should not if the parser is correct)
 
- 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

Token representing a constant string in hexadecimal format.

This token holds value of a constant string giving in an hexadecimal format, for instance 0x666f6f is "foo"

Definition at line 151 of file token.h.

Constructor & Destructor Documentation

◆ TokenHexString()

TokenHexString::TokenHexString ( const std::string & str)

Value is set during token construction.

Parameters
strconstant string to be represented (must be "0x" or "0X" followed by a string of hexadecimal digits or decoding will fail)

Definition at line 52 of file token.cc.

References isc::util::encode::decodeHex().

+ Here is the call graph for this function:

Member Function Documentation

◆ evaluate()

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

Token evaluation (puts value of the constant string on the stack after decoding or an empty string if decoding fails (note it should not if the parser is correct)

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 81 of file token.cc.

References isc::dhcp::EVAL_DBG_STACK, isc::dhcp::EVAL_DEBUG_HEXSTRING, 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::TokenHexString::value_
protected

Constant value.

Definition at line 170 of file token.h.

Referenced by evaluate().


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