#include <URI.h>
Use when in need to break down a URI's components. Basically a URI is a string like this:
* foo://username:password@example.com:8042/over/there/index.dtb;type=animal?name=ferret#nose * \ / \________________/\_________/ \__/\_________/ \___/ \_/ \_________/ \_________/ \__/ * | | | | | | | | | | * scheme userinfo hostname port path filename extension parameter(s) query fragment * \_______________________________/ * authority *
Definition at line 36 of file URI.h.
Public Types | |
typedef Map< String, String, _cmpf > | QueryMap |
typedef QueryMap::iterator | QueryMapIterator |
Public Member Functions | |
URI () | |
Default constructor, initializes an empty URI. | |
URI (const String &uri) | |
Initializes a URI object from a xvr2::String containing an uri. | |
~URI () | |
const String & | scheme () |
Returns the uri's scheme after a successful parse. | |
const String & | scheme () const |
Returns the uri's scheme after a successful parse. | |
const String & | host () |
Retrieves the host part on a uri. | |
const String & | host () const |
Retrieves the host part on a uri. | |
int | port () |
Retrieves the port specified in the URI. | |
const String & | path () |
Returns the associated path in the URI. | |
const String & | path () const |
Returns the associated path in the URI. | |
const String & | paramString () |
Returns a string containing a list of URI parameters, not to be confused with the query string which is the one that comes after ? (question mark sign). | |
const String & | paramString () const |
Returns a string containing a list of URI parameters, not to be confused with the query string which is the one that comes after ? (question mark sign). | |
const String & | queryString () |
Returns the query string on an URI which is the portion that comes after the ? (question mark sign). | |
const String & | queryString () const |
Returns the query string on an URI which is the portion that comes after the ? (question mark sign). | |
const String & | fragment () |
Returns the fragment portion in the URI. | |
const String & | fragment () const |
Returns the fragment portion in the URI. | |
const String & | user () |
Retrieves the username from the authority section. | |
const String & | user () const |
Retrieves the username from the authority section. | |
const String & | password () |
Retrieves the password from the authority section. | |
const String & | password () const |
Retrieves the password from the authority section. | |
virtual std::string | toString () |
Returns a string representation of this URI object. | |
URI & | operator= (const String &uri_str) |
Allows to change the contents of this URI by assigning it a String to be parsed thereafter. | |
URI::QueryMap | queryMap () |
virtual const char * | getClassName () |
Returns the name of the current class. | |
Static Public Member Functions | |
static void | debugmsg (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__) |
Will print a debug message to the screen. | |
static void | debugmsgln (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__) |
Protected Attributes | |
String | _uri |
String | _scheme |
String | _user |
String | _password |
String | _host |
String | _query_string |
String | _param_string |
String | _fragment |
int | _port |
String | _path |
QueryMap | query |
std::string | __cls_name |
Private Member Functions | |
void | parse () |
Will parse the contents of _uri in order to obtain all its components. | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const Object &s) |
Classes | |
struct | _cmpf |
typedef QueryMap::iterator xvr2::Net::URI::QueryMapIterator |
xvr2::Net::URI::URI | ( | ) |
Default constructor, initializes an empty URI.
xvr2::Net::URI::URI | ( | const String & | uri | ) |
Initializes a URI object from a xvr2::String containing an uri.
xvr2::Net::URI::~URI | ( | ) |
void xvr2::Net::URI::parse | ( | ) | [private] |
Will parse the contents of _uri in order to obtain all its components.
const String& xvr2::Net::URI::scheme | ( | ) |
Returns the uri's scheme after a successful parse.
const String& xvr2::Net::URI::scheme | ( | ) | const |
Returns the uri's scheme after a successful parse.
const String& xvr2::Net::URI::host | ( | ) |
Retrieves the host part on a uri.
const String& xvr2::Net::URI::host | ( | ) | const |
Retrieves the host part on a uri.
int xvr2::Net::URI::port | ( | ) |
Retrieves the port specified in the URI.
In case no port is specified X-VR2 will to guess it from a list of known schemes.
const String& xvr2::Net::URI::path | ( | ) |
const String& xvr2::Net::URI::path | ( | ) | const |
const String& xvr2::Net::URI::paramString | ( | ) |
Returns a string containing a list of URI parameters, not to be confused with the query string which is the one that comes after ? (question mark sign).
It is not very common to the a param string in an URI, in fact I've never seen it before so most of the time this method will return an empty String.
const String& xvr2::Net::URI::paramString | ( | ) | const |
Returns a string containing a list of URI parameters, not to be confused with the query string which is the one that comes after ? (question mark sign).
It is not very common to the a param string in an URI, in fact I've never seen it before so most of the time this method will return an empty String.
const String& xvr2::Net::URI::queryString | ( | ) |
Returns the query string on an URI which is the portion that comes after the ? (question mark sign).
This method returns the string as is, however if you need to have it broke down, you may better take a look at the queryMap method.
const String& xvr2::Net::URI::queryString | ( | ) | const |
Returns the query string on an URI which is the portion that comes after the ? (question mark sign).
This method returns the string as is, however if you need to have it broke down, you may better take a look at the queryMap method.
const String& xvr2::Net::URI::fragment | ( | ) |
const String& xvr2::Net::URI::fragment | ( | ) | const |
const String& xvr2::Net::URI::user | ( | ) |
Retrieves the username from the authority section.
Not everytime the authority section contains a username and password in the URI, for HTTP this practice is being phased out more and more.
const String& xvr2::Net::URI::user | ( | ) | const |
Retrieves the username from the authority section.
Not everytime the authority section contains a username and password in the URI, for HTTP this practice is being phased out more and more.
const String& xvr2::Net::URI::password | ( | ) |
Retrieves the password from the authority section.
Not everytime the authority section contains a username and password in the URI, for HTTP this practice is being phased out more and more.
const String& xvr2::Net::URI::password | ( | ) | const |
Retrieves the password from the authority section.
Not everytime the authority section contains a username and password in the URI, for HTTP this practice is being phased out more and more.
virtual std::string xvr2::Net::URI::toString | ( | ) | [virtual] |
URI::QueryMap xvr2::Net::URI::queryMap | ( | ) |
virtual const char* xvr2::Object::getClassName | ( | ) | [virtual, inherited] |
Returns the name of the current class.
static void xvr2::Object::debugmsg | ( | Object * | obj, | |
const char * | msg, | |||
int | linenumber = __LINE__ , |
|||
const char * | srcfile = __FILE__ | |||
) | [static, inherited] |
Will print a debug message to the screen.
static void xvr2::Object::debugmsgln | ( | Object * | obj, | |
const char * | msg, | |||
int | linenumber = __LINE__ , |
|||
const char * | srcfile = __FILE__ | |||
) | [static, inherited] |
std::ostream& operator<< | ( | std::ostream & | stream, | |
const Object & | s | |||
) | [friend, inherited] |
String xvr2::Net::URI::_uri [protected] |
String xvr2::Net::URI::_scheme [protected] |
String xvr2::Net::URI::_user [protected] |
String xvr2::Net::URI::_password [protected] |
String xvr2::Net::URI::_host [protected] |
String xvr2::Net::URI::_query_string [protected] |
String xvr2::Net::URI::_param_string [protected] |
String xvr2::Net::URI::_fragment [protected] |
int xvr2::Net::URI::_port [protected] |
String xvr2::Net::URI::_path [protected] |
QueryMap xvr2::Net::URI::query [protected] |
std::string xvr2::Object::__cls_name [protected, inherited] |