xlnt
|
Encapsulates a uniform resource identifier (URI) as described by RFC 3986. More...
#include <uri.hpp>
Public Member Functions | |
uri () | |
Constructs an empty URI. More... | |
uri (const uri &base, const uri &relative) | |
Constructs a URI by combining base with relative. More... | |
uri (const uri &base, const path &relative) | |
Constructs a URI by combining base with relative path. More... | |
uri (const std::string &uri_string) | |
Constructs a URI by parsing the given uri_string. More... | |
bool | is_relative () const |
Returns true if this URI is relative. More... | |
bool | is_absolute () const |
Returns true if this URI is not relative (i.e. absolute). More... | |
std::string | scheme () const |
Returns the scheme of this URI. E.g. the scheme of http://user:pass@example.com is "http" More... | |
std::string | authority () const |
Returns the authority of this URI. E.g. the authority of http://user:pass@example.com:80/document is "user:pass@example.com:80" More... | |
bool | has_authentication () const |
Returns true if an authentication section is specified for this URI. More... | |
std::string | authentication () const |
Returns the authentication of this URI. E.g. the authentication of http://user:pass@example.com is "user:pass" More... | |
std::string | username () const |
Returns the username of this URI. E.g. the username of http://user:pass@example.com is "user" More... | |
std::string | password () const |
Returns the password of this URI. E.g. the password of http://user:pass@example.com is "pass" More... | |
std::string | host () const |
Returns the host of this URI. E.g. the host of http://example.com:80/document is "example.com" More... | |
bool | has_port () const |
Returns true if a non-default port is specified for this URI. More... | |
std::size_t | port () const |
Returns the port of this URI. E.g. the port of https://example.com:443/document is "443" More... | |
const class path & | path () const |
Returns the path of this URI. E.g. the path of http://example.com/document is "/document" More... | |
bool | has_query () const |
Returns true if this URI has a non-null query string section. More... | |
std::string | query () const |
Returns the query string of this URI. E.g. the query of http://example.com/document?v=1&x=3#abc is "v=1&x=3" More... | |
bool | has_fragment () const |
Returns true if this URI has a non-empty fragment section. More... | |
std::string | fragment () const |
Returns the fragment section of this URI. E.g. the fragment of http://example.com/document#abc is "abc" More... | |
std::string | to_string () const |
Returns a string representation of this URI. More... | |
uri | make_absolute (const uri &base) |
If this URI is relative, an absolute URI will be returned by appending the path to the given absolute base URI. More... | |
uri | make_reference (const uri &base) |
If this URI is absolute, a relative URI will be returned by removing the common base path from the given absolute base URI. More... | |
bool | operator== (const uri &other) const |
Returns true if this URI is equivalent to other. More... | |
Encapsulates a uniform resource identifier (URI) as described by RFC 3986.
xlnt::uri::uri | ( | ) |
Constructs an empty URI.
Constructs a URI by combining base with relative.
Constructs a URI by combining base with relative path.
xlnt::uri::uri | ( | const std::string & | uri_string | ) |
Constructs a URI by parsing the given uri_string.
std::string xlnt::uri::authentication | ( | ) | const |
Returns the authentication of this URI. E.g. the authentication of http://user:pass@example.com is "user:pass"
std::string xlnt::uri::authority | ( | ) | const |
Returns the authority of this URI. E.g. the authority of http://user:pass@example.com:80/document is "user:pass@example.com:80"
std::string xlnt::uri::fragment | ( | ) | const |
Returns the fragment section of this URI. E.g. the fragment of http://example.com/document#abc is "abc"
bool xlnt::uri::has_authentication | ( | ) | const |
Returns true if an authentication section is specified for this URI.
bool xlnt::uri::has_fragment | ( | ) | const |
Returns true if this URI has a non-empty fragment section.
bool xlnt::uri::has_port | ( | ) | const |
Returns true if a non-default port is specified for this URI.
bool xlnt::uri::has_query | ( | ) | const |
Returns true if this URI has a non-null query string section.
std::string xlnt::uri::host | ( | ) | const |
Returns the host of this URI. E.g. the host of http://example.com:80/document is "example.com"
bool xlnt::uri::is_absolute | ( | ) | const |
Returns true if this URI is not relative (i.e. absolute).
bool xlnt::uri::is_relative | ( | ) | const |
Returns true if this URI is relative.
If this URI is relative, an absolute URI will be returned by appending the path to the given absolute base URI.
If this URI is absolute, a relative URI will be returned by removing the common base path from the given absolute base URI.
bool xlnt::uri::operator== | ( | const uri & | other | ) | const |
Returns true if this URI is equivalent to other.
std::string xlnt::uri::password | ( | ) | const |
Returns the password of this URI. E.g. the password of http://user:pass@example.com is "pass"
const class path& xlnt::uri::path | ( | ) | const |
Returns the path of this URI. E.g. the path of http://example.com/document is "/document"
std::size_t xlnt::uri::port | ( | ) | const |
Returns the port of this URI. E.g. the port of https://example.com:443/document is "443"
std::string xlnt::uri::query | ( | ) | const |
Returns the query string of this URI. E.g. the query of http://example.com/document?v=1&x=3#abc is "v=1&x=3"
std::string xlnt::uri::scheme | ( | ) | const |
Returns the scheme of this URI. E.g. the scheme of http://user:pass@example.com is "http"
std::string xlnt::uri::to_string | ( | ) | const |
Returns a string representation of this URI.
std::string xlnt::uri::username | ( | ) | const |
Returns the username of this URI. E.g. the username of http://user:pass@example.com is "user"