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; }
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()); }
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())); }