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:
te::common::uri::uri::uri | ( | ) |
Construct.
te::common::uri::uri::uri | ( | const std::string & | v | ) |
Construct from encoded string.
std::invalid_argument | if invalid encoding |
|
inline |
|
inline |
|
inline |
std::string te::common::uri::uri::encoding | ( | ) | const |
Calculate encoded string.
|
inline |
|
inline |
bool te::common::uri::uri::is_null | ( | ) | const |
Test if null/empty.
std::ostream& te::common::uri::uri::operator<< | ( | std::ostream & | os | ) | const |
Stream out encoding.
|
staticprivate |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
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.
|
private |
|
private |
|
private |
|
private |