Class Variable¶
Defined in File Variable.h
Class Documentation¶
-
class
URI::Template
::
Variable
¶ URI-template variable definition.
This class represent a variable defined in the template. After the operator (if any), each expression in the template contains a list of one or more comma-separated variable specifiers which are handled as instances of this class.
Public Functions
Parametrized constructor.
Creates a variable with known name and modifiers.
- Parameters
[in] name – Name of the variable.
[in] modifier – Modifier for the variable. nullptr is equivalent to Template::NOOP_MODIFIER.
[in] length – Prefix length if
modifier
is ModifierType::LENGTH.
-
~Variable
() = default¶ Destructor.
-
bool
IsPrefixed
() const¶ Check if the variable has ModifierType::LENGTH modifier.
-
bool
IsExploded
() const¶ Check if the variable has ModifierType::EXPLODE modifier.
-
const std::string &
Name
() const¶ Get the variable name.
-
unsigned
Length
() const¶ Get the variable prefix length.
Public Static Attributes
-
static const std::unordered_set<char>
kNameChars
¶ Collection of allowed characters for variable name: ALPHA / DIGIT / “_” / pct-encoded / “.”.
-
static const std::unordered_set<char>
kValueChars
¶ Collection of unreserved characters allowed for variable value: ALPHA / DIGIT / “-” / “.” / “_” / “~”/ “%” / “,”.
-
static const std::unordered_set<char>
kReservedChars
¶ Collection of reserved characters allowed for variable value: “:” / “/” / “?” / “#” / “[” / “]” / “@” / “!” / “$” / “&” / “’” / “(” / “)” / “*” / “+” / “,” / “;” / “=”.