iFun Engine API  1.0.0-b2601
Great Technology for Great Games
 All Classes Files Functions Variables Typedefs Macros
Public Member Functions | List of all members
fun::http::Uri Class Reference

Class to parse an URI string. More...

#include <http_util.h>

Public Member Functions

 Uri ()
 Default constructor. Holds empty URI.
 
 Uri (const string &uri_string)
 Constructor taking an URI string. More...
 
 Uri (const Uri &rhs)
 Copy constructor.
 
const string & host () const
 Returns host part of a given URI. More...
 
bool Parse (const string &uri_string)
 Parses the given URI. More...
 
const string & path () const
 Returns path part of a given URI. More...
 
uint16_t port () const
 Returns port number of a given URI. More...
 
const string & protocol () const
 Returns protocol of a given URI. More...
 
const string & query_string () const
 Returns query string part of a given URI. More...
 
const string & raw () const
 Returns the original URI. More...
 

Detailed Description

eg) http://www.ifunfactory.com:8080/hello/bye.php?a=1&b=2 protocol() => http host => www.fiunfactory.com port => 8080 path => /hello/bye.php query_string => "a=1&b=2" eg) localhost:80/path/to/file protocol() => "" host => localhost port => 80 path => /path/to/file query_string => ""

Constructor & Destructor Documentation

fun::http::Uri::Uri ( const string &  uri_string)
explicit
Parameters
uri_stringURI to parse.

Member Function Documentation

const string& fun::http::Uri::host ( ) const
Returns
host string.
bool fun::http::Uri::Parse ( const string &  uri_string)
Returns
true if succeeded. false, otherwise.
const string& fun::http::Uri::path ( ) const
Returns
path string.
uint16_t fun::http::Uri::port ( ) const
Returns
port number in uint16_t.
const string& fun::http::Uri::protocol ( ) const
Returns
protocol protocol string
const string& fun::http::Uri::query_string ( ) const
Returns
query string
const string& fun::http::Uri::raw ( ) const
Returns
URI string.