Uri Class Reference

#include <librets/Uri.h>

Inheritance diagram for Uri:

RetsObject

List of all members.

Public Member Functions

 Uri (std::string uri)
 Constructor providing just the uri.
 Uri (std::string uri, std::string baseUri)
 Constructor providing both a base uri and additional uri information.
bool IsAbsolute () const
 Returns whether or not the uri is relative or absolute.
std::string GetScheme () const
 Returns the type of the uri, e.g.
void SetScheme (std::string scheme)
 Set the transport scheme.
std::string GetHost () const
 Returns the host portion of the uri.
void SetHost (std::string host)
 Set the host portion of the uri.
int GetPort () const
 Get the port number for the connection.
void SetPort (int port)
 Set the port number for the connection.
std::string GetPath () const
 Return the path portion of the uri.
void SetPath (std::string path)
 Set the path portion of the uri.
virtual std::ostream & Print (std::ostream &outputStream) const
 Prints the object in a standard form for debugging and error reporting.
virtual bool Equals (const RetsObject *object) const
 Checks to see if the uri are equal.
std::string ToString () const

Static Public Member Functions

static std::string Resolve (std::string uri, std::string baseUri)
 Given a base uri and path, return a fully formed uri.

Static Public Attributes

static const int DEFAULT_PORT = 80


Constructor & Destructor Documentation

Uri ( std::string  uri  ) 

Constructor providing just the uri.

Parameters:
uri A string containing the uri.

Uri ( std::string  uri,
std::string  baseUri 
)

Constructor providing both a base uri and additional uri information.

This allows construction of a full uri when only a relative uri is provided.

Parameters:
uri A string containing the relative uri.
baseUri A string containg the base uri.


Member Function Documentation

virtual bool Equals ( const RetsObject object  )  const [virtual]

Checks to see if the uri are equal.

Returns:
TRUE if they match.

Reimplemented from RetsObject.

std::string GetHost (  )  const

Returns the host portion of the uri.

Returns:
A string representing the host portion of the uri.

std::string GetPath (  )  const

Return the path portion of the uri.

Returns:
A string representing the path portion of the uri.

int GetPort (  )  const

Get the port number for the connection.

Returns:
An integer containing the port number. By default this is 80.

std::string GetScheme (  )  const

Returns the type of the uri, e.g.

"http", "ftp", "https".

Returns:
A string representing the transport scheme.

bool IsAbsolute (  )  const

Returns whether or not the uri is relative or absolute.

Returns:
TRUE if the uri is absolute.

virtual std::ostream& Print ( std::ostream &  outputStream  )  const [virtual]

Prints the object in a standard form for debugging and error reporting.

Reimplemented from RetsObject.

static std::string Resolve ( std::string  uri,
std::string  baseUri 
) [static]

Given a base uri and path, return a fully formed uri.

Parameters:
uri An absolute uri or the path portion of a relative uri.
baseUri The base uri when doing relative paths.
Returns:
A string containing a fully formatted uri.

void SetHost ( std::string  host  ) 

Set the host portion of the uri.

Parameters:
host A string representing the host portion of the uri.

void SetPath ( std::string  path  ) 

Set the path portion of the uri.

Parameters:
path A string containing the path.

void SetPort ( int  port  ) 

Set the port number for the connection.

Parameters:
port An integer representing the port number to set.

void SetScheme ( std::string  scheme  ) 

Set the transport scheme.

Parameters:
scheme A string containing the transport scheme suah as "http", "ftp", "https", etc.

std::string ToString (  )  const [inherited]


Member Data Documentation

const int DEFAULT_PORT = 80 [static]


Generated by  doxygen