URL#

A rudimentary URL class

Info

To use declarations from this page, include the <essence/url.hpp> header.

class url#

A simple URL abstraction. Specialization available for std::formatter.

url::url(const std::string &raw)#

Default constructor accepting a raw url string.

std::string full() const#

Get the full url.

std::string base() const#

Get the base of the url, e.g.: https://foo.org from https://foo.org/foo/bar.ext.

std::string filename() const#

Get the deduced “file name” of the url, e.g.: bar.ext from https://foo.org/foo/bar.ext. Excellent for use with something like libcurl.

std::string domain() const#

Get the domain of the url, e.g.: foo.org from https://foo.org/foo/bar.ext.

std::string path() const#

Get the path of url, e.g.: foo/bar.ext from https://foo.org/foo/bar.ext.