Struct IRIView

Nested Relationships

Nested Types

Struct Documentation

struct IRIView

wrapper around a std::string_view that allows to access it as its IRI components.

Public Functions

explicit IRIView(std::string_view iri) noexcept
bool is_relative() const noexcept

is this IRI a relative reference? equivalent to scheme().empty()

Returns:

std::optional<std::string_view> scheme() const noexcept

the scheme part of the IRI

Returns:

std::optional<std::string_view> authority() const noexcept

the authority part of the IRI

Returns:

std::string_view path() const noexcept

the path of the IRI

Returns:

std::optional<std::string_view> query() const noexcept

the query part of the IRI

Returns:

std::optional<std::string_view> fragment() const noexcept

the fragment part of the IRI

Returns:

AllParts all_parts() const noexcept

all parts of the IRI. intended to be used with structured bindings: auto [scheme, auth, path, query, frag] = iri_view.all_parts(); more efficient than querying each part individually via its method.

Returns:

std::string_view to_absolute() const noexcept

everything except the fragment part of the IRI.

Returns:

std::optional<std::string_view> userinfo() const noexcept

the userinfo part of the authority.

Returns:

std::optional<std::string_view> host() const noexcept

the host part of the authority.

Returns:

std::optional<std::string_view> port() const noexcept

the port part of the authority.

Returns:

AuthorityParts all_authority_parts() const noexcept

all authority parts of the IRI. intended to be used with structured bindings: auto [userinfo, host, port] = iri_view.all_authority_parts(); more efficient than querying each part individually via its method.

Returns:

IRIFactoryError quick_validate(bool allow_relative = false) const noexcept

quickly checks if the IRI is valid according to the IRI specification (not the schemes specification). (does not accept relative references) (may miss invalid IRIs)

Returns:

struct AllParts

Public Members

std::optional<std::string_view> scheme
std::optional<std::string_view> authority
std::string_view path
std::optional<std::string_view> query
std::optional<std::string_view> fragment
struct AuthorityParts

Public Members

std::optional<std::string_view> userinfo
std::optional<std::string_view> host
std::optional<std::string_view> port