Home | Libraries | People | FAQ | More |
All URLs conform to the generic syntax. Every URL is either hierarchical, or opaque, with the hierarchical URLs further distinguished by whether they are relative or absolute. Here are some examples of URLs and their identification:
Table 1.1. URL Examples
URL |
Notes |
---|---|
|
Hierarchical URL with |
|
Hierarchical URL with |
|
Opaque URL with |
|
Opaque URL with |
|
URL reference. Missing scheme and host. |
|
A Protocol-Relative Link (PRL). Not a URL. |
This library provides the following containers, which are capable of storing any possible URL:
url
:
A modifiable container for a URL.
url_view
:
A non-owning reference to a valid URL.
static_url
:
A URL with fixed-capacity storage.
These containers maintain a useful invariant: they always contain a valid URL.
This diagram shows the generic syntax which all URLs conform to:
In the sections that follow we discuss the main parts of the URL, parsing strings into the provided containers, modifying parts of the container while preserving invariants, and how to invoke common algorithms used with URLs.