FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
void URI::appendPathComponent ( const std::string &  pc)

Appends the given path component to the URI

FB::URI uri("http://www.firebreath.org")
uri.appendPathComponent("some");
uri.appendPathComponent("path");
// uri.path == "/some/path"
Since
1.4b1

Definition at line 164 of file URI.cpp.

164  {
165  if (! pc.size()) return;
166  // make sure we have exactly one '/' between the old path and new path component[s]
167  if (path.size() && path[path.size() - 1] == '/') path.resize(path.size() - 1);
168  if (pc[0] != '/') path.push_back('/');
169  path += pc;
170 }