Class authority_view
A non-owning reference to a valid authority
Synopsis
class authority_view
    : detail::parts_base;Declared in file <include/boost/url/detail/url_impl.hpp> on line 25
Defined in file <include/boost/url/authority_view.hpp> on line 82
Member Functions
| Name | Description | 
| Destructor | |
| Constructor | |
| Construct from a string. | |
| Constructor | |
| Assignment | |
| Return the number of characters in the authority | |
| Return true if the authority is empty | |
| Return a pointer to the first character | |
| Return the complete authority | |
| Return true if a userinfo is present | |
| Return the userinfo | |
| Return the userinfo | |
| Return the user | |
| Return the user | |
| Return true if a password is present | |
| Return the password | |
| Return the password | |
| Return the host type | |
| Return the host | |
| Return the host | |
| Return the host | |
| Return the host | |
| Return the host IPv4 address | |
| Return the host IPv6 address | |
| Return the host IPvFuture address | |
| Return the host name | |
| Return the host name | |
| Return true if a port is present | |
| Return the port | |
| Return the port | |
| Return the host and port | |
| Return the result of comparing this with another authority | 
Friends
| Name | Description | 
| Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. | |
| Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. | |
| Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. | |
| Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. | |
| Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. | |
| Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. | |
Description
Objects of this type represent valid authority strings constructed from a parsed, external
character buffer whose storage is managed
by the caller. That is, it acts like a
core::string_view in terms of ownership.
The caller is responsible for ensuring
that the lifetime of the underlying
character buffer extends until it is no
longer referenced.
Example 1
Construction from a string parses the input as an authority and throws an exception on error. Upon success, the constructed object points to the passed character buffer; ownership is not transferred.
authority_view a( "user:pass@www.example.com:8080" );Example 2
The parsing function parse_authority returns a result containing either a valid authority_view upon succcess, otherwise it contain an error. The error can be converted to an exception by the caller if desired:
system::result< authority_view > rv = parse_authority( "user:pass@www.example.com:8080" );BNF
authority     = [ userinfo "@" ] host [ ":" port ]
userinfo      = user [ ":" [ password ] ]
user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
host          = IP-literal / IPv4address / reg-name
port          = *DIGIT