Class ModLength¶
Defined in File Modifier.h
Inheritance Relationships¶
Base Type¶
public URI::Template::Modifier(Class Modifier)
Class Documentation¶
-
class
URI::Template::ModLength: public URI::Template::Modifier¶ Length modifier.
This class represents length modifier for a variable.
Public Functions
-
ModLength() = default¶ Constructor.
-
virtual
~ModLength() = default¶ Destructor.
-
virtual ModifierType
Type() const override¶ Get type of the modifier.
- Returns
-
virtual char
Start() const override¶ Get starting character of the modifier.
- Returns
‘:’.
Public Static Functions
-
static bool
IsDigit(char c)¶ Fast and limited alternative to std::isdigit.
This function is used to parse length modifier in URI-template.
- Parameters
[in] c – Character to test.
- Returns
If
cin [0..9] range.
-
static unsigned
ToNumber(const std::string &num_str)¶ Fast and limited alternative to std::atoi.
This function is used to parse length modifier in URI-template.
num_strcan contain only [0..9] digits.Does not support signed notation.
- Parameters
[in] num_str – Character to test.
- Throws
std::runtime_error – if
num_strlength greater than 10.- Returns
Number
num_strrepresents.
-