1.8
Public Member Functions | List of all members
Uri Class Reference

A URI (Universal Resource Identifier) parser/builder that aims to be RFC 3986 compliant. More...

Public Member Functions

 Uri ()=default
 
 Uri (const std::string &uri)
 Construct a URI from a string. More...
 
EGT_NODISCARD const std::string & fragment () const
 Get the fragment part of the URI. More...
 
EGT_NODISCARD const std::string & host () const
 Get the host part of the URI. More...
 
EGT_NODISCARD const std::string & icon_size () const
 Get the icon size of the URI. More...
 
EGT_NODISCARD bool is_valid () const
 Is the URI syntactically valid. More...
 
 operator std::string () const
 Convert the URI to a string. More...
 
EGT_NODISCARD const std::string & path () const
 Get the path part of the URI. More...
 
EGT_NODISCARD const std::string & port () const
 Get the port part of the URI. More...
 
EGT_NODISCARD const std::string & query () const
 Get the query part of the URI. More...
 
EGT_NODISCARD const std::string & scheme () const
 Get the scheme part of the URI. More...
 
void set (const std::string &uri)
 Set the URI from a string. More...
 
EGT_NODISCARD std::string to_string () const
 Convert the URI to a string. More...
 

Detailed Description

A URI (Universal Resource Identifier) parser/builder that aims to be RFC 3986 compliant.

The current implementation uses the regex recommended by https://tools.ietf.org/html/rfc3986#page-50

Constructor & Destructor Documentation

◆ Uri() [1/2]

Uri ( )
default

◆ Uri() [2/2]

Uri ( const std::string &  uri)
explicit

Construct a URI from a string.

Parameters
[in]uriURI string

Member Function Documentation

◆ fragment()

EGT_NODISCARD const std::string& fragment ( ) const
inline

Get the fragment part of the URI.

◆ host()

EGT_NODISCARD const std::string& host ( ) const
inline

Get the host part of the URI.

◆ icon_size()

EGT_NODISCARD const std::string& icon_size ( ) const
inline

Get the icon size of the URI.

◆ is_valid()

EGT_NODISCARD bool is_valid ( ) const

Is the URI syntactically valid.

◆ operator std::string()

operator std::string ( ) const
inlineexplicit

Convert the URI to a string.

◆ path()

EGT_NODISCARD const std::string& path ( ) const
inline

Get the path part of the URI.

◆ port()

EGT_NODISCARD const std::string& port ( ) const
inline

Get the port part of the URI.

◆ query()

EGT_NODISCARD const std::string& query ( ) const
inline

Get the query part of the URI.

◆ scheme()

EGT_NODISCARD const std::string& scheme ( ) const
inline

Get the scheme part of the URI.

◆ set()

void set ( const std::string &  uri)
inline

Set the URI from a string.

◆ to_string()

EGT_NODISCARD std::string to_string ( ) const

Convert the URI to a string.