Function relativeToWeb
Computes the relative path
to this path
from
using web base_path
path
rules.
The difference to relativeTo
is that a path
not ending in a slash
will not be considered as a path
to a directory and the parent path
will instead be used.
Prototype
Parameters
Name | Description |
---|---|
path | The destination path |
base_path | The path from which the relative path starts |
See also
relativeTo
Example
assert(Path("/some/path") .relativeToWeb(Path("/")) == Path("some/path"));
assert(Path("/some/path/") .relativeToWeb(Path("/some/other/path/")) == Path("../../path/"));
assert(Path("/some/path/") .relativeToWeb(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.