예제 #1
0
path path::operator/(const path & other) const {
	if(other.is_up()) {
		return resolve(*this, other);
	} else {
		return empty() ? other : other.empty() ? *this : path(pathstr + dir_sep + other.pathstr);
	}
}
예제 #2
0
path path::operator/(const path & other) const {
	if(other.is_absolute() || empty() || (is_dot() && !other.empty())) {
		return other;
	} else if(other.empty() || other.is_dot()) {
		return *this;
	} else if(other.is_up()) {
		return resolve(*this, other);
	} else {
		path result = *this;
		if(result.pathstr[result.pathstr.length() - 1] != dir_sep) {
			result.pathstr += dir_sep;
		}
		result.pathstr += other.pathstr;
		return result;
	}
}