browserchooser 0.0.2
A simple browser chooser.
Loading...
Searching...
No Matches
urlparser.h File Reference
#include <expected>
#include <QtCore/QString>
Include dependency graph for urlparser.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum class  ParseUrlError { EmptyUrl }

Functions

std::expected< QString, ParseUrlError > parseUrl (const QString &url)

Enumeration Type Documentation

◆ ParseUrlError

enum class ParseUrlError
strong

Error code for URL parsing.

Function Documentation

◆ parseUrl()

std::expected< QString, ParseUrlError > parseUrl ( const QString & url)
nodiscard

Parses the given URL and returns the domain (host for http(s), filename for file).

Parameters
urlThe URL or path to parse.
Returns
The extracted domain, or an error if the URL is empty or invalid.