Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the develop branch, built from commit a303dbfc6c.
PrevUpHomeNext

parse_authority

Parse an authority.

Synopsis

Defined in header <boost/url/authority_view.hpp>

system::result< authority_view >
parse_authority(
    core::string_view s);
Description

This function parses a string according to the authority grammar below, and returns an authority_view referencing the string. Ownership of the string is not transferred; the caller is responsible for ensuring that the lifetime of the string extends until the view is no longer being accessed.

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
Exception Safety

Throws nothing.

Return Value

A view to the parsed authority

Parameters

Name

Description

s

The string to parse

Specification
See Also

authority_view.

Convenience header <boost/url.hpp>


PrevUpHomeNext