LibPkg
|
A class to represent a uniform resource identifier. More...
#include <uri.h>
Public Member Functions | |
uri () | |
Construct empty URI. More... | |
uri (const string &s) | |
Construct URI from string. More... | |
operator string () | |
Convert URI to string. More... | |
uri | operator+ (const uri &rel_uri) |
Resolve relative URI to produce absolute URI. More... | |
uri & | operator+= (const uri &rel_uri) |
Resolve relative URI to produce absolute URI. More... | |
const string & | scheme () const |
Get scheme component. More... | |
const string & | authority () const |
Get authority component. More... | |
const string & | path () const |
Get path component. More... | |
const string & | query () const |
Get query component. More... | |
const string & | fragment () const |
Get fragment component. More... | |
uri & | scheme (const string &scheme) |
Set scheme component. More... | |
uri & | authority (const string &authority) |
Set authority component. More... | |
uri & | path (const string &path) |
Set path component. More... | |
uri & | query (const string &query) |
Set query component. More... | |
uri & | fragment (const string &fragment) |
Set fragment component. More... | |
A class to represent a uniform resource identifier.
This is a suitable representation for accessing the individual components of a URI (the scheme, authority, path, query and fragment). Where an opaque representation is sufficient, a string is likely to be a more efficient method of storage.
For simplicity, the scheme, authority, query and fragment are taken to include the prefix/suffix with which they are associated. This does not match the syntax given in RFC 2396.
pkg::uri::uri | ( | ) |
Construct empty URI.
|
explicit |
Construct URI from string.
pkg::uri::operator string | ( | ) |
Convert URI to string.
Resolve relative URI to produce absolute URI.
This URI acts as the base.
rel_uri | the relative URI |
References authority(), fragment(), path(), query(), and scheme().
Referenced by operator+=().
Resolve relative URI to produce absolute URI.
This URI initially acts as the base.
rel_uri | the relative URI |
References operator+().
|
inline |
Get scheme component.
This should either be blank (meaning that there is no scheme component) or end with ":".
Referenced by fragment(), operator+(), and scheme().
|
inline |
Get authority component.
This should either be blank (meaning that there is no authority component) or begin with "//".
Referenced by authority(), fragment(), and operator+().
|
inline |
|
inline |
Get query component.
This should either be blank (meaning that there is no query component) or begin with "?".
Referenced by fragment(), operator+(), and query().
|
inline |
Get fragment component.
This should either be blank (meaning that there is no fragment component) or begin with "#".
References authority(), path(), query(), and scheme().
Referenced by fragment(), and operator+().
uri & pkg::uri::scheme | ( | const string & | scheme | ) |
Set scheme component.
This should either be blank (meaning that there is no scheme component) or end with ":".
scheme | the required scheme component |
References scheme().
uri & pkg::uri::authority | ( | const string & | authority | ) |
Set authority component.
This should either be blank (meaning that there is no authority component) or begin with "//".
authority | the required authority component |
References authority().
uri & pkg::uri::path | ( | const string & | path | ) |
Set path component.
path | the required path component |
References path().
uri & pkg::uri::query | ( | const string & | query | ) |
Set query component.
This should either be blank (meaning that there is no query component) or begin with "?".
query | the required query component |
References query().
uri & pkg::uri::fragment | ( | const string & | fragment | ) |
Set fragment component.
This should either be blank (meaning that there is no fragment component) or begin with "#".
fragment | the required fragment component |
References fragment().
Reference Manual | LibPkg | Version 0.6.1 (28 Jan 2015) |