FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
std::string FB::URI::UrlDirectory ( ) const

Returns current Directory from the url of the page.

Definition at line 231 of file URI.cpp.

232 {
233  std::stringstream res;
234  res << protocol << string("://");
235  if (!login.empty()) res << login << "@";
236  res << domain;
237  if (port) res << ":" << boost::lexical_cast<string>(port);
238  std::string dir = res.str();
239  if (path.empty() || path[path.size()-1] == '/') return string();
240  size_t loc = path.rfind("/");
241  if (loc == std::string::npos) return path;
242  dir += path.substr(0,loc);
243  return dir;
244 }