Uniform Resource Identifier (URI) reference. More...
#include <uri.h>
Public Types | |
| typedef te::common::uri::authority | authority_type |
| authority type More... | |
| typedef te::common::uri::fragment | fragment_type |
| fragment type More... | |
| typedef te::common::uri::path | path_type |
| path type More... | |
| typedef te::common::uri::query | query_type |
| query type More... | |
| typedef te::common::uri::scheme | scheme_type |
| scheme type More... | |
Public Member Functions | |
| const authority_type & | authority () const |
| Get authority. More... | |
| authority_type & | authority () |
| Get authority. More... | |
| bool | empty () const |
| Test if null/empty. More... | |
| std::string | encoding () const |
| Calculate encoded string. More... | |
| const fragment_type & | fragment () const |
| Get fragment. More... | |
| fragment_type & | fragment () |
| Get fragment. More... | |
| bool | is_null () const |
| Test if null/empty. More... | |
| std::ostream & | operator<< (std::ostream &os) const |
| Stream out encoding. More... | |
| const path_type & | path () const |
| Get path. More... | |
| path_type & | path () |
| Get path. More... | |
| const query_type & | query () const |
| Get query. More... | |
| query_type & | query () |
| Get query. More... | |
| bool | relative () const |
| Test if relative (null scheme). More... | |
| const scheme_type & | scheme () const |
| Get scheme (null if relative). More... | |
| scheme_type & | scheme () |
| Get scheme (null if relative). More... | |
| uri () | |
| Construct. More... | |
| uri (const std::string &v) | |
| Construct from encoded string. More... | |
Static Private Member Functions | |
| static bool | parse_literal (std::string::const_iterator &first, std::string::const_iterator last, const char *v) |
Private Attributes | |
| authority_type | authority_ |
| fragment_type | fragment_ |
| path_type | path_ |
| query_type | query_ |
| scheme_type | scheme_ |
Friends | |
| bool TECOMMONEXPORT | parse (std::string::const_iterator &first, std::string::const_iterator last, uri &v, std::string *errs) |
| Parse URI, returning whether found or not and advancing first and setting URI if found. More... | |
Uniform Resource Identifier (URI) reference.
A "URI-reference" is either a URI or a relative reference.
Syntax: Note that it is up to the application to correctly compose a URI reference with a missing scheme or authority, i.e. to make sure the initial path chars (if any) do not look like a scheme or authority (it helps with this library that the path class cannot have empty segments so it cannot have a URI authority-like prefix).
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
relative-ref = relative-part [ "?" query ] [ "#" fragment ]
relative-part = "//" authority path-abempty
| path-absolute
| path-noscheme
| path-empty
hier-part = "//" authority path-abempty
| path-absolute
| path-rootless
| path-empty
path-abempty = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty = 0<pchar>
Example:
Definition at line 110 of file attic/src/common/URI/uri.h.
authority type
Definition at line 113 of file attic/src/common/URI/uri.h.
fragment type
Definition at line 116 of file attic/src/common/URI/uri.h.
path type
Definition at line 114 of file attic/src/common/URI/uri.h.
query type
Definition at line 115 of file attic/src/common/URI/uri.h.
scheme type
Definition at line 112 of file attic/src/common/URI/uri.h.
| te::common::uri::uri::uri | ( | const std::string & | v | ) |
|
inline |
Get authority.
Definition at line 126 of file attic/src/common/URI/uri.h.
Referenced by te::common::URL::getEncodedString(), te::common::URL::getHost(), te::common::URL::getHostPort(), te::common::URL::getHostType(), te::common::URL::getLogin(), te::common::URL::getPassword(), te::common::URL::getString(), te::common::URL::setHost(), te::common::URL::setHostPort(), te::common::URL::setLogin(), te::common::URL::setPassword(), and te::common::URL::setProtocol().
|
inline |
Get authority.
Definition at line 127 of file attic/src/common/URI/uri.h.
|
inline |
Test if null/empty.
Definition at line 121 of file attic/src/common/URI/uri.h.
| std::string te::common::uri::uri::encoding | ( | ) | const |
|
inline |
Get fragment.
Definition at line 132 of file attic/src/common/URI/uri.h.
Referenced by te::common::URL::getEncodedFragmentString(), te::common::URL::getFragmentString(), and te::common::URL::setEncodedFragmentString().
|
inline |
Get fragment.
Definition at line 133 of file attic/src/common/URI/uri.h.
References te::common::uri::operator<<(), te::common::uri::parse(), and TECOMMONEXPORT.
| bool te::common::uri::uri::is_null | ( | ) | const |
Test if null/empty.
Definition at line 40 of file uri.cpp.
References authority_, te::common::uri::fragment::empty(), te::common::uri::path::empty(), fragment_, te::common::uri::scheme::is_null(), te::common::uri::authority::is_null(), path_, query_, and scheme_.
| std::ostream & te::common::uri::uri::operator<< | ( | std::ostream & | os | ) | const |
Stream out encoding.
Definition at line 48 of file uri.cpp.
References authority_, te::common::uri::urisyn::AUTHORITY_TRAITS, te::common::uri::fragment::empty(), fragment_, te::common::uri::urisyn::FRAGMENT_TRAITS, te::common::uri::scheme::is_null(), te::common::uri::authority::is_null(), path_, query_, te::common::uri::urisyn::QUERY_TRAITS, scheme_, and te::common::uri::urisyn::SCHEME_TRAITS.
Referenced by encoding().
|
staticprivate |
Definition at line 60 of file uri.cpp.
Referenced by te::common::uri::parse().
|
inline |
Get path.
Definition at line 128 of file attic/src/common/URI/uri.h.
Referenced by te::common::URL::addPath(), te::common::URL::beginPath(), te::common::URL::clearPath(), te::common::URL::endPath(), te::common::URL::getEncodedPathString(), te::common::URL::getPathString(), te::common::URL::isAbsolutePath(), te::common::URL::isDirectoryPath(), te::common::URL::isEmptyPath(), te::common::URL::setEncodedPathString(), te::common::URL::setIsAbsolutePath(), and te::common::URL::setIsDirectoryPath().
|
inline |
Get path.
Definition at line 129 of file attic/src/common/URI/uri.h.
|
inline |
Get query.
Definition at line 130 of file attic/src/common/URI/uri.h.
Referenced by te::common::URL::addQuery(), te::common::URL::beginQuery(), te::common::URL::clearQuery(), te::common::URL::endQuery(), te::common::URL::findQueryKey(), te::common::URL::getEncodedQueryString(), te::common::URL::getQuerySize(), and te::common::URL::setEncodedQueryString().
|
inline |
Get query.
Definition at line 131 of file attic/src/common/URI/uri.h.
|
inline |
Test if relative (null scheme).
Definition at line 123 of file attic/src/common/URI/uri.h.
|
inline |
Get scheme (null if relative).
Definition at line 124 of file attic/src/common/URI/uri.h.
Referenced by te::common::URL::getProtocol(), te::common::uri::parse(), and te::common::URL::setProtocol().
|
inline |
Get scheme (null if relative).
Definition at line 125 of file attic/src/common/URI/uri.h.
|
friend |
Parse URI, returning whether found or not and advancing first and setting URI if found.
Does not skip leading space.
If errs is specified parsing is more lax allowing decoding and other errors and setting errs with the error messages. See the individual component parse functions for details.
Definition at line 73 of file uri.cpp.
Referenced by te::common::uri::parse(), and uri().
|
private |
Definition at line 140 of file attic/src/common/URI/uri.h.
Referenced by is_null(), and operator<<().
|
private |
Definition at line 143 of file attic/src/common/URI/uri.h.
Referenced by is_null(), and operator<<().
|
private |
Definition at line 141 of file attic/src/common/URI/uri.h.
Referenced by is_null(), and operator<<().
|
private |
Definition at line 142 of file attic/src/common/URI/uri.h.
Referenced by is_null(), and operator<<().
|
private |
Definition at line 139 of file attic/src/common/URI/uri.h.
Referenced by is_null(), and operator<<().