Class Literal

Class Documentation

class URI::Template::Literal

URI-template literal part.

This class represent text part of a template. The characters inside this part are intended to be copied literally to the URI reference if the character is allowed.

Public Functions

Literal(std::string &&lit_string)

Parametrized constructor.

Constructs literal part of the template from lit_string.

Parameters

[in] lit_string – A string to construct from.

Literal(const Literal&) = default

Copy constructor.

Literal &operator=(const Literal&) = default

Copy assignment.

Literal(Literal&&) noexcept = default

Move constructor.

Literal &operator=(Literal&&) noexcept = default

Move assignment.

~Literal() = default

Destructor.

std::size_t Size() const

Get size of the literal.

Returns

The number of elements in the literal.

const std::string &String() const noexcept

Get literal string.

bool operator==(const Literal &rhs) const

Compares the contents of two literals.

bool operator!=(const Literal &rhs) const

Compares the contents of two literals.

Public Static Attributes

static const std::unordered_set<char> kNotAllowedChars

Collection of not allowed characters in literal parts: CTL, SP, “””, “’”, “%” (aside from pct-encoded), “<”, “>”, “”, “^”, “`”, “{“, “|”, “}”.