Rcuxx::Url Class Reference

#include <Url.h>

List of all members.


Detailed Description

Parse and store URL elements.

A URL is of the form

      http://user:pass@example.com:992/animal/bird?species=seagull#wings
      \___/  \________/\_________/\__/\__________/\______________/\____/
        |        |          |       |       |             |          |
      scheme   login      hosts   port    path          query  anchor/fragment
      

Public Types

typedef std::vector< std::string > StringVector

Public Member Functions

 Url (const std::string &url)
Urloperator= (const std::string &url)
void Print () const
const std::string & Raw () const
int Port () const
const std::string & Host () const
const std::string & Scheme () const
const std::string & Path () const
const std::string & Query () const
const std::string & Anchor () const
const std::string & User () const
const std::string & Password () const
const StringVectorOptions () const
void SetPort (int p)
void SetHost (const std::string &h)
void SetScheme (const std::string &s)
void SetPath (const std::string &p)
void SetQuery (const std::string &q)
void SetAnchor (const std::string &a)
void SetUser (const std::string &u)
void SetPassword (const std::string &p)

Protected Member Functions

void Parse (const std::string &url)

Protected Attributes

std::string fUrl
int fPort
std::string fHost
std::string fScheme
std::string fPath
std::string fQuery
std::string fAnchor
std::string fUser
std::string fPassword
StringVector fOptions

Member Typedef Documentation

typedef std::vector<std::string> Rcuxx::Url::StringVector

type of string vector


Constructor & Destructor Documentation

Rcuxx::Url::Url ( const std::string &  url  )  [inline]

Construtor.

Parameters:
url Url

References Parse().


Member Function Documentation

Url& Rcuxx::Url::operator= ( const std::string &  url  )  [inline]

Assignment operator.

Parameters:
url String to assign from
Returns:
Parsed object.

References Parse().

void Rcuxx::Url::Print (  )  const

Print to standard out.

const std::string& Rcuxx::Url::Raw (  )  const [inline]

Returns:
The URL as give by user

References fUrl.

int Rcuxx::Url::Port (  )  const [inline]

Returns:
Port number (-1 if not specified)

References fPort.

const std::string& Rcuxx::Url::Host (  )  const [inline]

Returns:
Host name

References fHost.

const std::string& Rcuxx::Url::Scheme (  )  const [inline]

Returns:
Scheme (e.g., http, ftp, or foo

References fScheme.

const std::string& Rcuxx::Url::Path (  )  const [inline]

Returns:
Path part

References fPath.

const std::string& Rcuxx::Url::Query (  )  const [inline]

Returns:
Query part

References fQuery.

const std::string& Rcuxx::Url::Anchor (  )  const [inline]

Returns:
Acnhor part

References fAnchor.

const std::string& Rcuxx::Url::User (  )  const [inline]

Returns:
User name part

References fUser.

const std::string& Rcuxx::Url::Password (  )  const [inline]

Returns:
Password part

References fPassword.

const StringVector& Rcuxx::Url::Options (  )  const

Returns:
list of options

void Rcuxx::Url::SetPort ( int  p  )  [inline]

Parameters:
p Port number (-1 if not specified)

References fPort.

void Rcuxx::Url::SetHost ( const std::string &  h  )  [inline]

Parameters:
h Host name

References fHost.

void Rcuxx::Url::SetScheme ( const std::string &  s  )  [inline]

Parameters:
s Scheme (e.g., http, ftp, or foo

References fScheme.

void Rcuxx::Url::SetPath ( const std::string &  p  )  [inline]

Parameters:
p Path part

References fPath.

void Rcuxx::Url::SetQuery ( const std::string &  q  )  [inline]

Parameters:
q Query part

References fQuery.

void Rcuxx::Url::SetAnchor ( const std::string &  a  )  [inline]

Parameters:
a Anchor part

References fAnchor.

void Rcuxx::Url::SetUser ( const std::string &  u  )  [inline]

Parameters:
u User name part

References fUser.

void Rcuxx::Url::SetPassword ( const std::string &  p  )  [inline]

Parameters:
p Password part

References fPassword.

void Rcuxx::Url::Parse ( const std::string &  url  )  [protected]

Parse the string url, and store parts.

Parameters:
url String to parse

Referenced by operator=(), and Url().


Member Data Documentation

std::string Rcuxx::Url::fUrl [protected]

Original url cached.

Referenced by Raw().

int Rcuxx::Url::fPort [protected]

Port number.

Referenced by Port(), and SetPort().

std::string Rcuxx::Url::fHost [protected]

Host name.

Referenced by Host(), and SetHost().

std::string Rcuxx::Url::fScheme [protected]

Scheme.

Referenced by Scheme(), and SetScheme().

std::string Rcuxx::Url::fPath [protected]

Path.

Referenced by Path(), and SetPath().

std::string Rcuxx::Url::fQuery [protected]

Query.

Referenced by Query(), and SetQuery().

std::string Rcuxx::Url::fAnchor [protected]

Anchor.

Referenced by Anchor(), and SetAnchor().

std::string Rcuxx::Url::fUser [protected]

User.

Referenced by SetUser(), and User().

std::string Rcuxx::Url::fPassword [protected]

Password.

Referenced by Password(), and SetPassword().

StringVector Rcuxx::Url::fOptions [mutable, protected]

Options.


The documentation for this class was generated from the following file:
Top of page Last update Wed Jun 4 00:52:17 2008
Copyright © 2004 Christian Holm Created by DoxyGen 1.5.6