예제 #1
0
 Path & Path::operator+=(const Path & path)
 {
   Path::StringVec sv;
   sv.push_back(std::string(path_));
   sv.push_back(std::string(path.path_));
   path_ = Path::join(sv.begin(), sv.end());
   return *this;
 }
예제 #2
0
 Path operator+(const Path & p1, const Path & p2)
 {
   Path::StringVec sv;
   sv.push_back(std::string(p1));
   sv.push_back(std::string(p2));
   return Path::join(sv.begin(), sv.end());
 }
예제 #3
0
  std::string Path::getParent(const std::string & path)
  {
    if (path == "") 
      return "";

    std::string np = Path::normalize(path);
    Path::StringVec sv = Path::split(np);
    sv.push_back("..");

    return Path::normalize(Path::join(sv.begin(), sv.end()));
  }