Commit 6efa65ec authored by Johannes Schriewer's avatar Johannes Schriewer

Make Path equatable

parent 93f074ea
......@@ -179,6 +179,18 @@ public struct Path {
}
}
public func ==(lhs: Path, rhs: Path) -> Bool {
if lhs.components.count != rhs.components.count || lhs.isAbsolute != rhs.isAbsolute {
return false
}
for i in 0..<lhs.components.count {
if lhs.components[i] != rhs.components[i] {
return false
}
}
return true
}
public func +(lhs: Path, rhs: String) -> Path {
return lhs.join(Path(rhs))
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment