MySQL 8.3.0
Source Code Documentation
mysqlrouter::URI Class Reference

Parse and create URIs according to RFC3986. More...

#include <uri.h>

Public Member Functions

 URI (const std::string &uri, bool allow_path_rootless=true)
 Default constructor. More...
 
bool operator== (const URI &u2) const
 
bool operator!= (const URI &u2) const
 
std::string str () const
 return string representation of the URI More...
 
 URI ()
 overload More...
 
void set_uri (const std::string &uri)
 Sets URI using the given URI string. More...
 

Public Attributes

std::string scheme
 Scheme of the URI. More...
 
std::string host
 Host part found in the Authority. More...
 
uint16_t port
 Port found in the Authority. More...
 
std::string username
 Username part found in the Authority. More...
 
std::string password
 Password part found in the Authority. More...
 
URIPath path
 Path part of the URI. More...
 
URIQuery query
 Query part of the URI. More...
 
std::string fragment
 Fragment part of the URI. More...
 

Static Public Attributes

static const char query_delimiter = '&'
 Delimiter used in the Query part. More...
 

Private Member Functions

void init_from_uri (const std::string &uri)
 Sets information using the given URI. More...
 

Private Attributes

std::string uri_
 Copy of the original given URI. More...
 
bool allow_path_rootless_
 all URIs like mail:foo@e.nosp@m.xamp.nosp@m.le.or.nosp@m.g which don't have a authority More...
 

Detailed Description

Parse and create URIs according to RFC3986.

This class will parse and make the elements of the URI available as members.

Links:

Constructor & Destructor Documentation

◆ URI() [1/2]

mysqlrouter::URI::URI ( const std::string &  uri,
bool  allow_path_rootless = true 
)
inline

Default constructor.

Rootless URIs like "mailto:user@example.com" may be forbidden to make sure that simple "host:addr" doesn't get parsed as (scheme='host', path='addr')

Parameters
uriURI string to decode
allow_path_rootlessif parsing rootless URIs is allowed.

◆ URI() [2/2]

mysqlrouter::URI::URI ( )
inline

overload

Member Function Documentation

◆ init_from_uri()

void mysqlrouter::URI::init_from_uri ( const std::string &  uri)
private

Sets information using the given URI.

Takes a and parsers out all URI elements.

Throws URIError on errors.

Parameters
uriURI to use

◆ operator!=()

bool mysqlrouter::URI::operator!= ( const URI u2) const

◆ operator==()

bool mysqlrouter::URI::operator== ( const URI u2) const

◆ set_uri()

void mysqlrouter::URI::set_uri ( const std::string &  uri)
inline

Sets URI using the given URI string.

Parameters
uriURI as string

◆ str()

std::string mysqlrouter::URI::str ( ) const

return string representation of the URI

Member Data Documentation

◆ allow_path_rootless_

bool mysqlrouter::URI::allow_path_rootless_
private

all URIs like mail:foo@e.nosp@m.xamp.nosp@m.le.or.nosp@m.g which don't have a authority

◆ fragment

std::string mysqlrouter::URI::fragment

Fragment part of the URI.

◆ host

std::string mysqlrouter::URI::host

Host part found in the Authority.

◆ password

std::string mysqlrouter::URI::password

Password part found in the Authority.

◆ path

URIPath mysqlrouter::URI::path

Path part of the URI.

◆ port

uint16_t mysqlrouter::URI::port

Port found in the Authority.

◆ query

URIQuery mysqlrouter::URI::query

Query part of the URI.

◆ query_delimiter

const char mysqlrouter::URI::query_delimiter = '&'
static

Delimiter used in the Query part.

◆ scheme

std::string mysqlrouter::URI::scheme

Scheme of the URI.

◆ uri_

std::string mysqlrouter::URI::uri_
private

Copy of the original given URI.

◆ username

std::string mysqlrouter::URI::username

Username part found in the Authority.


The documentation for this class was generated from the following files: