CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::URI Class Reference

A Uniform Resource Identifier (URI) is a unique sequence of characters that identifies a logical or physical resource used by web technologies. More...

#include <CeresEngine/Foundation/URI.hpp>

Public Member Functions

 URI ()=default
 Creates a new empty URI.
 
 URI (String raw)
 Creates a new URI by parsing it from a raw string.
 
 URI (const StringView raw)
 Creates a new URI by parsing it from a raw string.
 
 URI (const char *raw)
 Creates a new URI by parsing it from a raw string.
 
 URI (const FilePath &path)
 Creates a new URI by parsing it from a raw string.
 
 URI (const std::string_view raw)
 Creates a new URI by parsing it from a raw string.
 
template<typename CharTraits , typename Allocator >
 URI (const std::basic_string< char, CharTraits, Allocator > &raw)
 Creates a new URI by parsing it from a raw string.
 
 URI (const StringView scheme, const StringView path, const StringView host=StringView(), const StringView port=StringView(), const StringView query=StringView(), const StringView fragment=StringView(), const StringView userInfo=StringView())
 Creates a new URI from individual parts.
 
 URI (const URI &absolute, const URI &relative)
 Creates a new URI by resolving relative using absolute as the reference.
 
 URI (const URI &)=default
 Copies a URI from another.
 
URIoperator= (const URI &)=default
 Copies a URI from another.
 
 URI (URI &&)=default
 Moves a URI from another.
 
URIoperator= (URI &&)=default
 Moves a URI from another.
 
StringView getScheme () const noexcept
 A non-empty scheme component followed by a colon (:), consisting of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus (+), period (.), or hyphen (-).
 
void setScheme (const StringView scheme)
 A non-empty scheme component followed by a colon (:), consisting of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus (+), period (.), or hyphen (-).
 
bool hasScheme () const noexcept
 A non-empty scheme component followed by a colon (:), consisting of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus (+), period (.), or hyphen (-).
 
void clearScheme ()
 A non-empty scheme component followed by a colon (:), consisting of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus (+), period (.), or hyphen (-).
 
StringView getUserInfo () const noexcept
 An optional userinfo subcomponent that may consist of a user name and an optional password preceded by a colon (:), followed by an at symbol (@).
 
bool isUserInfoNested () const noexcept
 Checks if the user-info is a nested URI.
 
void setUserInfo (const StringView userInfo)
 An optional userinfo subcomponent that may consist of a user name and an optional password preceded by a colon (:), followed by an at symbol (@).
 
bool hasUserInfo () const noexcept
 An optional userinfo subcomponent that may consist of a user name and an optional password preceded by a colon (:), followed by an at symbol (@).
 
void clearUserInfo ()
 An optional userinfo subcomponent that may consist of a user name and an optional password preceded by a colon (:), followed by an at symbol (@).
 
StringView getHost () const noexcept
 A host subcomponent, consisting of either a registered name (including but not limited to a hostname), or an IP address.
 
bool isHostNested () const noexcept
 Checks if the host is a nested URI.
 
void setHost (const StringView host)
 A host subcomponent, consisting of either a registered name (including but not limited to a hostname), or an IP address.
 
bool hasHost () const noexcept
 A host subcomponent, consisting of either a registered name (including but not limited to a hostname), or an IP address.
 
void clearHost ()
 A host subcomponent, consisting of either a registered name (including but not limited to a hostname), or an IP address.
 
StringView getPort () const noexcept
 An optional port subcomponent preceded by a colon (:).
 
bool isPortNested () const noexcept
 Checks if the port is a nested URI.
 
void setPort (const StringView port)
 An optional port subcomponent preceded by a colon (:).
 
bool hasPort () const noexcept
 An optional port subcomponent preceded by a colon (:).
 
void clearPort ()
 An optional port subcomponent preceded by a colon (:).
 
StringView getPath () const noexcept
 A path component, consisting of a sequence of path segments separated by a slash (/).
 
bool isPathNested () const noexcept
 Checks if the path is a nested URI.
 
void setPath (const StringView path)
 A path component, consisting of a sequence of path segments separated by a slash (/).
 
bool hasPath () const noexcept
 A path component, consisting of a sequence of path segments separated by a slash (/).
 
void clearPath ()
 A path component, consisting of a sequence of path segments separated by a slash (/).
 
StringView getQuery () const noexcept
 An optional query component preceded by a question mark (?), containing a query string of non-hierarchical data.
 
bool isQueryNested () const noexcept
 Checks if the query is a nested URI.
 
void setQuery (const StringView query)
 An optional query component preceded by a question mark (?), containing a query string of non-hierarchical data.
 
bool hasQuery () const noexcept
 An optional query component preceded by a question mark (?), containing a query string of non-hierarchical data.
 
void clearQuery ()
 An optional query component preceded by a question mark (?), containing a query string of non-hierarchical data.
 
StringView getFragment () const noexcept
 An optional fragment component preceded by a hash (#).
 
bool isFragmentNested () const noexcept
 Checks if the fragment is a nested URI.
 
void setFragment (const StringView fragment)
 An optional fragment component preceded by a hash (#).
 
bool hasFragment () const noexcept
 An optional fragment component preceded by a hash (#).
 
void clearFragment ()
 An optional fragment component preceded by a hash (#).
 
String toString () const
 Converts the URI object into it's string representation.
 
bool isRelative () const noexcept
 Checks if the parsed URI is a relative reference URI.
 
bool isAbsolute () const noexcept
 Checks if the parsed URI is an absolute (and complete) URI.
 
bool isNested () const noexcept
 Checks if the parsed URI contains any nested part.
 
void clear () noexcept
 Clears the URI content.
 
bool isEmpty () const noexcept
 Checks if the URI is empty.
 
URI resolve (const URI &relative) const
 Resolves a relative URI using this URI as the reference.
 
URI canonicalize () const
 Converts the URI into a canonical form.
 
bool empty () const noexcept
 Checks if the URI is empty.
 

Private Types

using Part = TRange< std::size_t >
 A type used to internally represent a range in that contains the sub-string range contained in mData.
 

Private Member Functions

bool tryParse (String string)
 Tries to parse the URI from a string.
 
StringView get (const Part &part) const noexcept
 Gets a URI part.
 
void set (const Part &part, StringView newContent)
 Sets (and changes the content) of a URI part.
 
bool isPartNested (const Part &part) const noexcept
 

Private Attributes

Part mScheme
 A non-empty scheme component followed by a colon (:), consisting of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus (+), period (.), or hyphen (-).
 
Part mUserInfo
 An optional userinfo subcomponent that may consist of a user name and an optional password preceded by a colon (:), followed by an at symbol (@).
 
Part mHost
 A host subcomponent, consisting of either a registered name (including but not limited to a hostname), or an IP address.
 
Part mPort
 An optional port subcomponent preceded by a colon (:).
 
Part mPath
 A path component, consisting of a sequence of path segments separated by a slash (/).
 
Part mQuery
 An optional query component preceded by a question mark (?), containing a query string of non-hierarchical data.
 
Part mFragment
 An optional fragment component preceded by a hash (#).
 
String mData
 The raw URI data.
 

Detailed Description

A Uniform Resource Identifier (URI) is a unique sequence of characters that identifies a logical or physical resource used by web technologies.

URIs may be used to identify anything, including real-world objects, such as people and places, concepts, or information resources such as web pages and books. Some URIs provide a means of locating and retrieving information resources on a network (either on the Internet or on another private network, such as a computer filesystem or an Intranet); these are Uniform Resource Locators (URLs). A URL provides the location of the resource. A URI identifies the resource by name at the specified location or URL. Other URIs provide only a unique name, without a means of locating or retrieving the resource or information about it, these are Uniform Resource Names (URNs). The web technologies that use URIs are not limited to web browsers. URIs are used to identify anything described using the Resource Description Framework (RDF), for example, concepts that are part of an ontology defined using the Web Ontology Language (OWL), and people who are described using the Friend of a Friend vocabulary would each have an individual URI.

Each URI begins with a scheme name that refers to a specification for assigning identifiers within that scheme. As such, the URI syntax is a federated and extensible naming system wherein each scheme's specification may further restrict the syntax and semantics of identifiers using that scheme.

The URI generic syntax consists of a hierarchical sequence of five components:

URI = scheme:[//authority]path[?query][#fragment]
A Uniform Resource Identifier (URI) is a unique sequence of characters that identifies a logical or p...
Definition URI.hpp:54
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25

where the authority component divides into three subcomponents:

Member Typedef Documentation

◆ Part

using CeresEngine::URI::Part = TRange<std::size_t>
private

A type used to internally represent a range in that contains the sub-string range contained in mData.

Constructor & Destructor Documentation

◆ URI() [1/11]

CeresEngine::URI::URI ( )
default

Creates a new empty URI.

◆ URI() [2/11]

CeresEngine::URI::URI ( String  raw)
explicit

Creates a new URI by parsing it from a raw string.

Parameters
rawThe raw string to parse the URI component parts from.

◆ URI() [3/11]

CeresEngine::URI::URI ( const StringView  raw)
inlineexplicit

Creates a new URI by parsing it from a raw string.

Parameters
rawThe raw string to parse the URI component parts from.

◆ URI() [4/11]

CeresEngine::URI::URI ( const char raw)
inline

Creates a new URI by parsing it from a raw string.

Parameters
rawThe raw string to parse the URI component parts from.

◆ URI() [5/11]

CeresEngine::URI::URI ( const FilePath path)
explicit

Creates a new URI by parsing it from a raw string.

Parameters
pathThe path to create a new URI from.

◆ URI() [6/11]

CeresEngine::URI::URI ( const std::string_view  raw)
inlineexplicit

Creates a new URI by parsing it from a raw string.

Parameters
rawThe raw string to parse the URI component parts from.

◆ URI() [7/11]

template<typename CharTraits , typename Allocator >
CeresEngine::URI::URI ( const std::basic_string< char, CharTraits, Allocator > &  raw)
inlineexplicit

Creates a new URI by parsing it from a raw string.

Parameters
rawThe raw string to parse the URI component parts from.

◆ URI() [8/11]

CeresEngine::URI::URI ( const StringView  scheme,
const StringView  path,
const StringView  host = StringView(),
const StringView  port = StringView(),
const StringView  query = StringView(),
const StringView  fragment = StringView(),
const StringView  userInfo = StringView() 
)
inlineexplicit

Creates a new URI from individual parts.

Parameters
schemeThe URI scheme. Required.
pathThe URI path. Required, but can be empty.
hostThe URI authority host. Optional.
portThe URI authority port. Optional.
queryThe URI query. Optional.
fragmentThe URI fragment. Optional.
userInfoThe URI authority user info. Optional.

◆ URI() [9/11]

CeresEngine::URI::URI ( const URI absolute,
const URI relative 
)
inlineexplicit

Creates a new URI by resolving relative using absolute as the reference.

Parameters
absoluteThe absolute URI to use as reference
relativeThe relative URI to be normalize relative to absolute.

◆ URI() [10/11]

CeresEngine::URI::URI ( const URI )
default

Copies a URI from another.

◆ URI() [11/11]

CeresEngine::URI::URI ( URI &&  )
default

Moves a URI from another.

Member Function Documentation

◆ canonicalize()

URI CeresEngine::URI::canonicalize ( ) const

Converts the URI into a canonical form.

◆ clear()

void CeresEngine::URI::clear ( )
noexcept

Clears the URI content.

◆ clearFragment()

void CeresEngine::URI::clearFragment ( )
inline

An optional fragment component preceded by a hash (#).

The fragment contains a fragment identifier providing direction to a secondary resource, such as a section heading in an article identified by the remainder of the URI. When the primary resource is an HTML document, the fragment is often an getEntityID attribute of a specific element, and web browsers will scroll this element into view.

◆ clearHost()

void CeresEngine::URI::clearHost ( )
inline

A host subcomponent, consisting of either a registered name (including but not limited to a hostname), or an IP address.

IPv4 addresses must be in dot-decimal notation, and IPv6 addresses must be enclosed in brackets ([]).

◆ clearPath()

void CeresEngine::URI::clearPath ( )
inline

A path component, consisting of a sequence of path segments separated by a slash (/).

A path is always defined for a URI, though the defined path may be empty (zero length). A segment may also be empty, resulting in two consecutive slashes (//) in the path component. A path component may resemble or map exactly to a file system path, but does not always imply a relation to one. If an authority component is present, then the path component must either be empty or begin with a slash (/). If an authority component is absent, then the path cannot begin with an empty segment, that is with two slashes (//), as the following characters would be interpreted as an authority component. The final segment of the path may be referred to as a 'slug'.

◆ clearPort()

void CeresEngine::URI::clearPort ( )
inline

An optional port subcomponent preceded by a colon (:).

◆ clearQuery()

void CeresEngine::URI::clearQuery ( )
inline

An optional query component preceded by a question mark (?), containing a query string of non-hierarchical data.

Its syntax is not well defined, but by convention is most often a sequence of attribute–value pairs separated by a delimiter.

◆ clearScheme()

void CeresEngine::URI::clearScheme ( )
inline

A non-empty scheme component followed by a colon (:), consisting of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus (+), period (.), or hyphen (-).

Although schemes are case-insensitive, the canonical form is lowercase and documents that specify schemes must do so with lowercase letters. Examples of popular schemes include http, https, ftp, mailto, file, data, and irc. URI schemes should be registered with the Internet Assigned Numbers Authority (IANA), although non-registered schemes are used in practice.

◆ clearUserInfo()

void CeresEngine::URI::clearUserInfo ( )
inline

An optional userinfo subcomponent that may consist of a user name and an optional password preceded by a colon (:), followed by an at symbol (@).

Use of the format username:password in the userinfo subcomponent is deprecated for security reasons. Applications should not render as clear text any data after the first colon (:) found within a userinfo subcomponent unless the data after the colon is the empty string (indicating no password).

◆ empty()

bool CeresEngine::URI::empty ( ) const
inlinenoexcept

Checks if the URI is empty.

◆ get()

StringView CeresEngine::URI::get ( const Part part) const
inlineprivatenoexcept

Gets a URI part.

Computes the sub-string ´StringView´ based on the

Parameters
partThe part to get the value for.
Returns
The part sub-string.

◆ getFragment()

StringView CeresEngine::URI::getFragment ( ) const
inlinenoexcept

An optional fragment component preceded by a hash (#).

The fragment contains a fragment identifier providing direction to a secondary resource, such as a section heading in an article identified by the remainder of the URI. When the primary resource is an HTML document, the fragment is often an getEntityID attribute of a specific element, and web browsers will scroll this element into view.

◆ getHost()

StringView CeresEngine::URI::getHost ( ) const
inlinenoexcept

A host subcomponent, consisting of either a registered name (including but not limited to a hostname), or an IP address.

IPv4 addresses must be in dot-decimal notation, and IPv6 addresses must be enclosed in brackets ([]).

◆ getPath()

StringView CeresEngine::URI::getPath ( ) const
inlinenoexcept

A path component, consisting of a sequence of path segments separated by a slash (/).

A path is always defined for a URI, though the defined path may be empty (zero length). A segment may also be empty, resulting in two consecutive slashes (//) in the path component. A path component may resemble or map exactly to a file system path, but does not always imply a relation to one. If an authority component is present, then the path component must either be empty or begin with a slash (/). If an authority component is absent, then the path cannot begin with an empty segment, that is with two slashes (//), as the following characters would be interpreted as an authority component. The final segment of the path may be referred to as a 'slug'.

◆ getPort()

StringView CeresEngine::URI::getPort ( ) const
inlinenoexcept

An optional port subcomponent preceded by a colon (:).

◆ getQuery()

StringView CeresEngine::URI::getQuery ( ) const
inlinenoexcept

An optional query component preceded by a question mark (?), containing a query string of non-hierarchical data.

Its syntax is not well defined, but by convention is most often a sequence of attribute–value pairs separated by a delimiter.

◆ getScheme()

StringView CeresEngine::URI::getScheme ( ) const
inlinenoexcept

A non-empty scheme component followed by a colon (:), consisting of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus (+), period (.), or hyphen (-).

Although schemes are case-insensitive, the canonical form is lowercase and documents that specify schemes must do so with lowercase letters. Examples of popular schemes include http, https, ftp, mailto, file, data, and irc. URI schemes should be registered with the Internet Assigned Numbers Authority (IANA), although non-registered schemes are used in practice.

◆ getUserInfo()

StringView CeresEngine::URI::getUserInfo ( ) const
inlinenoexcept

An optional userinfo subcomponent that may consist of a user name and an optional password preceded by a colon (:), followed by an at symbol (@).

Use of the format username:password in the userinfo subcomponent is deprecated for security reasons. Applications should not render as clear text any data after the first colon (:) found within a userinfo subcomponent unless the data after the colon is the empty string (indicating no password).

◆ hasFragment()

bool CeresEngine::URI::hasFragment ( ) const
inlinenoexcept

An optional fragment component preceded by a hash (#).

The fragment contains a fragment identifier providing direction to a secondary resource, such as a section heading in an article identified by the remainder of the URI. When the primary resource is an HTML document, the fragment is often an getEntityID attribute of a specific element, and web browsers will scroll this element into view.

◆ hasHost()

bool CeresEngine::URI::hasHost ( ) const
inlinenoexcept

A host subcomponent, consisting of either a registered name (including but not limited to a hostname), or an IP address.

IPv4 addresses must be in dot-decimal notation, and IPv6 addresses must be enclosed in brackets ([]).

◆ hasPath()

bool CeresEngine::URI::hasPath ( ) const
inlinenoexcept

A path component, consisting of a sequence of path segments separated by a slash (/).

A path is always defined for a URI, though the defined path may be empty (zero length). A segment may also be empty, resulting in two consecutive slashes (//) in the path component. A path component may resemble or map exactly to a file system path, but does not always imply a relation to one. If an authority component is present, then the path component must either be empty or begin with a slash (/). If an authority component is absent, then the path cannot begin with an empty segment, that is with two slashes (//), as the following characters would be interpreted as an authority component. The final segment of the path may be referred to as a 'slug'.

◆ hasPort()

bool CeresEngine::URI::hasPort ( ) const
inlinenoexcept

An optional port subcomponent preceded by a colon (:).

◆ hasQuery()

bool CeresEngine::URI::hasQuery ( ) const
inlinenoexcept

An optional query component preceded by a question mark (?), containing a query string of non-hierarchical data.

Its syntax is not well defined, but by convention is most often a sequence of attribute–value pairs separated by a delimiter.

◆ hasScheme()

bool CeresEngine::URI::hasScheme ( ) const
inlinenoexcept

A non-empty scheme component followed by a colon (:), consisting of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus (+), period (.), or hyphen (-).

Although schemes are case-insensitive, the canonical form is lowercase and documents that specify schemes must do so with lowercase letters. Examples of popular schemes include http, https, ftp, mailto, file, data, and irc. URI schemes should be registered with the Internet Assigned Numbers Authority (IANA), although non-registered schemes are used in practice.

◆ hasUserInfo()

bool CeresEngine::URI::hasUserInfo ( ) const
inlinenoexcept

An optional userinfo subcomponent that may consist of a user name and an optional password preceded by a colon (:), followed by an at symbol (@).

Use of the format username:password in the userinfo subcomponent is deprecated for security reasons. Applications should not render as clear text any data after the first colon (:) found within a userinfo subcomponent unless the data after the colon is the empty string (indicating no password).

◆ isAbsolute()

bool CeresEngine::URI::isAbsolute ( ) const
inlinenoexcept

Checks if the parsed URI is an absolute (and complete) URI.

◆ isEmpty()

bool CeresEngine::URI::isEmpty ( ) const
noexcept

Checks if the URI is empty.

◆ isFragmentNested()

bool CeresEngine::URI::isFragmentNested ( ) const
inlinenoexcept

Checks if the fragment is a nested URI.

◆ isHostNested()

bool CeresEngine::URI::isHostNested ( ) const
inlinenoexcept

Checks if the host is a nested URI.

◆ isNested()

bool CeresEngine::URI::isNested ( ) const
noexcept

Checks if the parsed URI contains any nested part.

◆ isPartNested()

bool CeresEngine::URI::isPartNested ( const Part part) const
inlineprivatenoexcept

◆ isPathNested()

bool CeresEngine::URI::isPathNested ( ) const
inlinenoexcept

Checks if the path is a nested URI.

◆ isPortNested()

bool CeresEngine::URI::isPortNested ( ) const
inlinenoexcept

Checks if the port is a nested URI.

◆ isQueryNested()

bool CeresEngine::URI::isQueryNested ( ) const
inlinenoexcept

Checks if the query is a nested URI.

◆ isRelative()

bool CeresEngine::URI::isRelative ( ) const
inlinenoexcept

Checks if the parsed URI is a relative reference URI.

◆ isUserInfoNested()

bool CeresEngine::URI::isUserInfoNested ( ) const
inlinenoexcept

Checks if the user-info is a nested URI.

◆ operator=() [1/2]

URI & CeresEngine::URI::operator= ( const URI )
default

Copies a URI from another.

◆ operator=() [2/2]

URI & CeresEngine::URI::operator= ( URI &&  )
default

Moves a URI from another.

◆ resolve()

URI CeresEngine::URI::resolve ( const URI relative) const

Resolves a relative URI using this URI as the reference.

Parameters
relativeThe relative URI to be normalize.
Returns
The normalize URI.

◆ set()

void CeresEngine::URI::set ( const Part part,
StringView  newContent 
)
private

Sets (and changes the content) of a URI part.

Parameters
partThe part to be change the value for.
newContentThe new value to set the URI part content to.

◆ setFragment()

void CeresEngine::URI::setFragment ( const StringView  fragment)
inline

An optional fragment component preceded by a hash (#).

The fragment contains a fragment identifier providing direction to a secondary resource, such as a section heading in an article identified by the remainder of the URI. When the primary resource is an HTML document, the fragment is often an getEntityID attribute of a specific element, and web browsers will scroll this element into view.

◆ setHost()

void CeresEngine::URI::setHost ( const StringView  host)
inline

A host subcomponent, consisting of either a registered name (including but not limited to a hostname), or an IP address.

IPv4 addresses must be in dot-decimal notation, and IPv6 addresses must be enclosed in brackets ([]).

◆ setPath()

void CeresEngine::URI::setPath ( const StringView  path)
inline

A path component, consisting of a sequence of path segments separated by a slash (/).

A path is always defined for a URI, though the defined path may be empty (zero length). A segment may also be empty, resulting in two consecutive slashes (//) in the path component. A path component may resemble or map exactly to a file system path, but does not always imply a relation to one. If an authority component is present, then the path component must either be empty or begin with a slash (/). If an authority component is absent, then the path cannot begin with an empty segment, that is with two slashes (//), as the following characters would be interpreted as an authority component. The final segment of the path may be referred to as a 'slug'.

◆ setPort()

void CeresEngine::URI::setPort ( const StringView  port)
inline

An optional port subcomponent preceded by a colon (:).

◆ setQuery()

void CeresEngine::URI::setQuery ( const StringView  query)
inline

An optional query component preceded by a question mark (?), containing a query string of non-hierarchical data.

Its syntax is not well defined, but by convention is most often a sequence of attribute–value pairs separated by a delimiter.

◆ setScheme()

void CeresEngine::URI::setScheme ( const StringView  scheme)
inline

A non-empty scheme component followed by a colon (:), consisting of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus (+), period (.), or hyphen (-).

Although schemes are case-insensitive, the canonical form is lowercase and documents that specify schemes must do so with lowercase letters. Examples of popular schemes include http, https, ftp, mailto, file, data, and irc. URI schemes should be registered with the Internet Assigned Numbers Authority (IANA), although non-registered schemes are used in practice.

◆ setUserInfo()

void CeresEngine::URI::setUserInfo ( const StringView  userInfo)
inline

An optional userinfo subcomponent that may consist of a user name and an optional password preceded by a colon (:), followed by an at symbol (@).

Use of the format username:password in the userinfo subcomponent is deprecated for security reasons. Applications should not render as clear text any data after the first colon (:) found within a userinfo subcomponent unless the data after the colon is the empty string (indicating no password).

◆ toString()

String CeresEngine::URI::toString ( ) const

Converts the URI object into it's string representation.

◆ tryParse()

bool CeresEngine::URI::tryParse ( String  string)
private

Tries to parse the URI from a string.

Parameters
stringThe URI string to be parsed.
Returns
Returns true if the URI syntax is valid and was parsed correctly; false otherwise.

Member Data Documentation

◆ mData

String CeresEngine::URI::mData
private

The raw URI data.

A string, that contains the URI parts as strings. This string somewhat resembles the stringified URI, but it may not contain all separator characters like :, # and ?.

◆ mFragment

Part CeresEngine::URI::mFragment
private

An optional fragment component preceded by a hash (#).

The fragment contains a fragment identifier providing direction to a secondary resource, such as a section heading in an article identified by the remainder of the URI. When the primary resource is an HTML document, the fragment is often an getEntityID attribute of a specific element, and web browsers will scroll this element into view.

◆ mHost

Part CeresEngine::URI::mHost
private

A host subcomponent, consisting of either a registered name (including but not limited to a hostname), or an IP address.

IPv4 addresses must be in dot-decimal notation, and IPv6 addresses must be enclosed in brackets ([]).

◆ mPath

Part CeresEngine::URI::mPath
private

A path component, consisting of a sequence of path segments separated by a slash (/).

A path is always defined for a URI, though the defined path may be empty (zero length). A segment may also be empty, resulting in two consecutive slashes (//) in the path component. A path component may resemble or map exactly to a file system path, but does not always imply a relation to one. If an authority component is present, then the path component must either be empty or begin with a slash (/). If an authority component is absent, then the path cannot begin with an empty segment, that is with two slashes (//), as the following characters would be interpreted as an authority component. The final segment of the path may be referred to as a 'slug'.

◆ mPort

Part CeresEngine::URI::mPort
private

An optional port subcomponent preceded by a colon (:).

◆ mQuery

Part CeresEngine::URI::mQuery
private

An optional query component preceded by a question mark (?), containing a query string of non-hierarchical data.

Its syntax is not well defined, but by convention is most often a sequence of attribute–value pairs separated by a delimiter.

◆ mScheme

Part CeresEngine::URI::mScheme
private

A non-empty scheme component followed by a colon (:), consisting of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus (+), period (.), or hyphen (-).

Although schemes are case-insensitive, the canonical form is lowercase and documents that specify schemes must do so with lowercase letters. Examples of popular schemes include http, https, ftp, mailto, file, data, and irc. URI schemes should be registered with the Internet Assigned Numbers Authority (IANA), although non-registered schemes are used in practice.

◆ mUserInfo

Part CeresEngine::URI::mUserInfo
private

An optional userinfo subcomponent that may consist of a user name and an optional password preceded by a colon (:), followed by an at symbol (@).

Use of the format username:password in the userinfo subcomponent is deprecated for security reasons. Applications should not render as clear text any data after the first colon (:) found within a userinfo subcomponent unless the data after the colon is the empty string (indicating no password).


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