Boost.URL

    • Quick Look
    • URLs
      • Parsing
      • Containers
      • Segments
      • Params
      • Normalization
      • String Token
      • Percent Encoding
      • Formatting
    • Customization
      • Parse Rules
      • Character Sets
      • Compound Rules
      • Ranges
      • RFC 3986
    • Examples
      • QR Code
      • Finicky
      • mailto URLs
      • Magnet Link
      • File Router
      • Router
      • Sanitizing URLs
    • Reference
      • Index
      • Concepts
        • CharSet
        • Rule
        • StringToken
      • Help Card

boost::urls::url_view_base::has_port

Return true if a port is present

Synopsis

Declared in header <boost/url/url_view_base.hpp>

bool
has_port() const noexcept;

Description

This function returns true if an authority is present and contains a port.

assert( url_view( "wss://www.example.com:443" ).has_port() );

Constant.

Throws nothing.

authority   = [ userinfo "@" ] host [ ":" port ]

port        = *DIGIT
  • 3.2.3. Port (rfc3986)

See Also

encoded_host_and_port , port , port_number .