Defines classes for parsing and handling URLs and hosts.
This file contains the declaration of the Url and Host classes, which provide functionality for parsing and managing URLs and hosts within them. The Url class allows extraction and manipulation of various components of a URL, while the Host class focuses on handling and extracting domain-related information from a host.
The Url class encapsulates a URL and provides methods to access its components such as protocol, subdomain, domain, suffix, query, fragment, userinfo, port, and parameters. Additionally, it offers methods for constructing a URL string and obtaining specific parts of the URL.
The Host class represents a host part of a URL and offers functionalities for extracting domain-related details such as suffix, domain, subdomain, and the full domain. It also supports the removal of 'www' from the host and provides methods to obtain domain-specific information.
Example Usage:
TLD::Url url(
"https://www.example.com/path/to/resource");
std::cout << "URL Protocol: " << url.protocol() << std::endl;
std::cout << "URL Domain: " << url.domain() << std::endl;
std::cout << "URL Suffix: " << url.suffix() << std::endl;
std::cout << "URL Query: " << url.query() << std::endl;
std::cout << "Host Domain: " << host.domain() << std::endl;
std::cout << "Host Suffix: " << host.suffix() << std::endl;
std::cout << "Host Subdomain: " << host.subdomain() << std::endl;
Represents a Host part of a URL.
Definition urlparser.h:200
Represents a URL.
Definition urlparser.h:67