iFun Engine API  1.0.0-b6053
Great Technology for Great Games
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 stringhost () const
 Returns host part of a given URI. More...
 
Urioperator= (const Uri &rhs)
 Assign operator.
 
bool Parse (const string &uri_string)
 Parses the given URI. More...
 
const stringpath () const
 Returns path part of a given URI. More...
 
uint16_t port () const
 Returns port number of a given URI. More...
 
const stringprotocol () const
 Returns protocol of a given URI. More...
 
const stringquery_string () const
 Returns query string part of a given URI. More...
 
const stringraw () 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

◆ Uri()

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

Member Function Documentation

◆ host()

const string& fun::http::Uri::host ( ) const
Returns
host string.

◆ Parse()

bool fun::http::Uri::Parse ( const string uri_string)
Returns
true if succeeded. false, otherwise.

◆ path()

const string& fun::http::Uri::path ( ) const
Returns
path string.

◆ port()

uint16_t fun::http::Uri::port ( ) const
Returns
port number in uint16_t.

◆ protocol()

const string& fun::http::Uri::protocol ( ) const
Returns
protocol protocol string

◆ query_string()

const string& fun::http::Uri::query_string ( ) const
Returns
query string

◆ raw()

const string& fun::http::Uri::raw ( ) const
Returns
URI string.