Function relativeTo
Computes the relative path
from
to this base_path
path
.
Prototype
Parameters
Name | Description |
---|---|
path | The destination path |
base_path | The path from which the relative path starts |
See also
relativeToWeb
Example
assert(Path("/some/path") .relativeTo(Path("/")) == Path("some/path"));
assert(Path("/some/path/") .relativeTo(Path("/some/other/path/")) == Path("../../path/"));
assert(Path("/some/path/") .relativeTo(Path("/some/other/path")) == Path("../../path/"));
Authors
Sönke Ludwig
Copyright
© 2012-2015 RejectedSoftware e.K.
License
Subject to the terms of the MIT license, as written in the included LICENSE.txt file.