| Home | Libraries | People | FAQ | More

##### url_base::scheme_id

(Inherited from `url_view_base`)

Return the scheme.

###### Synopsis

    urls::scheme
    scheme_id() const;

###### Description

This function returns a value which depends on the scheme in the url:

- If the scheme is a well-known scheme, corresponding value from the enumeration `urls::scheme` is returned.
- If a scheme is present but is not a well-known scheme, the value returned is `urls::scheme::unknown`.
- Otherwise, if the scheme is absent the value returned is `urls::scheme::none`.

###### Example

    assert( url_view( "wss://www.example.com/crypto.cgi" ).scheme_id() == scheme::wss );

###### Complexity

Constant.

###### Exception Safety

Throws nothing.

###### BNF

    URI             = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

    absolute-URI    = scheme ":" hier-part [ "?" query ]

    scheme          = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )

###### Specification

- 3.1. Scheme (rfc3986)

###### See Also

`has_scheme`, `scheme`.