|
@@ -146,6 +146,19 @@ protected:
|
|
|
/// option. If the option is not found, an empty string ("") is returned.
|
|
|
class TokenOption : public Token {
|
|
|
public:
|
|
|
+
|
|
|
+ /// @brief Token representation type.
|
|
|
+ ///
|
|
|
+ /// There are many possible ways in which option can be presented.
|
|
|
+ /// Currently the textual and hexadecimal representations are
|
|
|
+ /// supported. The type of representation is specified in the
|
|
|
+ /// constructor and it affects the value generated by the
|
|
|
+ /// @c TokenOption::evaluate function.
|
|
|
+ enum RepresentationType {
|
|
|
+ TEXTUAL,
|
|
|
+ HEXADECIMAL
|
|
|
+ };
|
|
|
+
|
|
|
/// @brief Constructor that takes an option code as a parameter
|
|
|
/// @param option_code code of the option
|
|
|
///
|
|
@@ -153,8 +166,9 @@ public:
|
|
|
/// introduce complex dependency of the libkea-eval on libdhcpsrv.
|
|
|
///
|
|
|
/// @param option_code code of the option to be represented.
|
|
|
- TokenOption(uint16_t option_code)
|
|
|
- :option_code_(option_code) {}
|
|
|
+ /// @param rep_type Token representation type.
|
|
|
+ TokenOption(const uint16_t option_code, const RepresentationType& rep_type)
|
|
|
+ : option_code_(option_code), representation_type_(rep_type) {}
|
|
|
|
|
|
/// @brief Evaluates the values of the option
|
|
|
///
|
|
@@ -177,7 +191,8 @@ public:
|
|
|
}
|
|
|
|
|
|
private:
|
|
|
- uint16_t option_code_; ///< code of the option to be extracted
|
|
|
+ uint16_t option_code_; ///< Code of the option to be extracted
|
|
|
+ RepresentationType representation_type_; ///< Representation type.
|
|
|
};
|
|
|
|
|
|
/// @brief Token that represents equality operator (compares two other tokens)
|