##

URIPath Class Reference

The path component of a URI. More...

`#include <URI.hh>`

## Public Member Functions

| URIPath ()
| Constructor. More...
| URIPath (const std::string &_str)
| Construct a URIPath object from a string. More...
| URIPath (const URIPath &_path)
| Copy constructor. 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 URIPath & | operator/= (const std::string &_part)
| Compound assignment operator. More...
URIPath & | operator= (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() [1/3]

URIPath | ( |  | ) |

Constructor.

## URIPath() [2/3]

URIPath | ( | const URIPath & | _path | ) |

Copy constructor.

Parameters

  [in] | _path | Another URIPath.

## URIPath() [3/3]

URIPath | ( | const std::string & | _str | ) |

explicit

Construct a URIPath object from a string.

Parameters

  [in] | _str | A string.

## ~URIPath()

virtual ~URIPath | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## Clear()

void Clear | ( |  | ) |

Remove all parts of the path.

## Contains()

bool Contains | ( | const URIPath & | _other | ) | const

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

Parameters

  [in] | _other | Another path.

Returns
  True if this path contains _other.

## operator/()

const URIPath operator/ | ( | const std::string & | _part | ) | const

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

Parameters

  [in] | _part | Path part.

Returns
  A new Path that consists of "this / _part"

See also
  PushBack

## operator/=()

const URIPath& operator/= | ( | const std::string & | _part | ) |

Compound assignment operator.

Parameters

  [in] | _part | A new path to append.

Returns
  A new Path that consists of "this / _part"

## operator=()

URIPath& operator= | ( | const URIPath & | _path | ) |

Equal operator.

Parameters

  [in] | _path | Another URIPath.

Returns
  Itself.

## operator==()

bool operator== | ( | const URIPath & | _path | ) | const

Return true if the two paths match.

Parameters

  [in] | _part | Path part. return True of the paths match.

## Parse()

bool Parse | ( | const std::string & | _str | ) |

Parse a string as URIPath.

Parameters

  [in] | _str | A string.

Returns
  True if the string could be parsed as a URIPath.

## PushBack()

void PushBack | ( | const std::string & | _part | ) |

Push a new part onto the back of this path.

Parameters

  [in] | _part | Path part to push

See also
  operator/

## PushFront()

void PushFront | ( | const std::string & | _part | ) |

Push a new part onto the front of this path.

Parameters

  [in] | _part | Path part to push

## Str()

std::string Str | ( | const std::string & | _delim = `"/"` | ) | const

Get the path as a string.

Parameters

  [in] | _delim | Delimiter used to separate each part of the path.

Returns
  The path as a string, with each path part separated by _delim.

## Valid() [1/2]

bool Valid | ( |  | ) | const

Return true if this is a valid path.

Returns
  True if this is a valid URI path.

## Valid() [2/2]

static bool Valid | ( | const std::string & | _str | ) |

static

Return true if the string is a valid path.

Parameters

  [in] | _str | String to check.

Returns
  True if _str is a valid URI path.

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

- URI.hh