URIPath Class Reference

The path component of a URI. More...

#include <URI.hh>

Public Member Functions

 URIPath ()
 Constructor. More...
 
 URIPath (const URIPath &_path)
 Copy constructor. More...
 
 URIPath (const std::string &_str)
 Construct a URIPath object from a string. More...
 
virtual ~URIPath ()
 Destructor. More...
 
void Clear ()
 Remove all parts of the path. More...
 
bool Contains (const URIPath &_other) const
 Returns true if _other is a subset of this, counting from the beginning. More...
 
const URIPath operator/ (const std::string &_part) const
 Get the current path with the _part added to the end. More...
 
const URIPathoperator/= (const std::string &_part)
 Compound assignment operator. More...
 
URIPathoperator= (const URIPath &_path)
 Equal operator. More...
 
bool operator== (const URIPath &_path) const
 Return true if the two paths match. More...
 
bool Parse (const std::string &_str)
 Parse a string as URIPath. More...
 
void PushBack (const std::string &_part)
 Push a new part onto the back of this path. More...
 
void PushFront (const std::string &_part)
 Push a new part onto the front of this path. More...
 
std::string Str (const std::string &_delim="/") const
 Get the path as a string. More...
 
bool Valid () const
 Return true if this is a valid path. More...
 

Static Public Member Functions

static bool Valid (const std::string &_str)
 Return true if the string is a valid path. More...
 

Detailed Description

The path component of a URI.

Constructor & Destructor Documentation

URIPath ( )

Constructor.

URIPath ( const URIPath _path)

Copy constructor.

Parameters
[in]_pathAnother URIPath.
URIPath ( const std::string &  _str)

Construct a URIPath object from a string.

Parameters
[in]_strA string.
virtual ~URIPath ( )
virtual

Destructor.

Member Function Documentation

void Clear ( )

Remove all parts of the path.

bool Contains ( const URIPath _other) const

Returns true if _other is a subset of this, counting from the beginning.

Parameters
[in]_otherAnother path.
Returns
True if this path contains _other.
const URIPath operator/ ( const std::string &  _part) const

Get the current path with the _part added to the end.

Parameters
[in]_partPath part.
Returns
A new Path that consists of "this / _part"
See also
PushBack
const URIPath& operator/= ( const std::string &  _part)

Compound assignment operator.

Parameters
[in]_partA new path to append.
Returns
A new Path that consists of "this / _part"
URIPath& operator= ( const URIPath _path)

Equal operator.

Parameters
[in]_pathAnother URIPath.
Returns
Itself.
bool operator== ( const URIPath _path) const

Return true if the two paths match.

Parameters
[in]_partPath part. return True of the paths match.
bool Parse ( const std::string &  _str)

Parse a string as URIPath.

Parameters
[in]_strA string.
Returns
True if the string could be parsed as a URIPath.
void PushBack ( const std::string &  _part)

Push a new part onto the back of this path.

Parameters
[in]_partPath part to push
See also
operator/
void PushFront ( const std::string &  _part)

Push a new part onto the front of this path.

Parameters
[in]_partPath part to push
std::string Str ( const std::string &  _delim = "/") const

Get the path as a string.

Parameters
[in]_delimDelimiter used to separate each part of the path.
Returns
The path as a string, with each path part separated by _delim.
static bool Valid ( const std::string &  _str)
static

Return true if the string is a valid path.

Parameters
[in]_strString to check.
Returns
True if _str is a valid URI path.
bool Valid ( ) const

Return true if this is a valid path.

Returns
True if this is a valid URI path.

The documentation for this class was generated from the following file: