tmp/tmpqcpbrhej/{from.md → to.md}
RENAMED
|
@@ -23,25 +23,21 @@ slashes, but that does not affect `path` equality.
|
|
| 23 |
|
| 24 |
``` cpp
|
| 25 |
path lexically_relative(const path& base) const;
|
| 26 |
```
|
| 27 |
|
| 28 |
-
*Returns:* `*this` made relative to `base`. Does not
|
| 29 |
-
resolve [[fs.class.path]] symlinks. Does not first
|
| 30 |
-
normalize [[fs.path.generic]] `*this` or `base`.
|
| 31 |
-
|
| 32 |
*Effects:* If:
|
| 33 |
|
| 34 |
- `root_name() != base.root_name()` is `true`, or
|
| 35 |
- `is_absolute() != base.is_absolute()` is `true`, or
|
| 36 |
- `!has_root_directory() && base.has_root_directory()` is `true`, or
|
| 37 |
- any *filename* in `relative_path()` or `base.relative_path()` can be
|
| 38 |
interpreted as a *root-name*,
|
| 39 |
|
| 40 |
returns `path()`.
|
| 41 |
|
| 42 |
-
[*Note
|
| 43 |
*relative-path* is acceptable as a *root-name*. — *end note*]
|
| 44 |
|
| 45 |
Determines the first mismatched element of `*this` and `base` as if by:
|
| 46 |
|
| 47 |
``` cpp
|
|
@@ -59,10 +55,14 @@ Then,
|
|
| 59 |
- returns an object of class `path` that is default-constructed,
|
| 60 |
followed by
|
| 61 |
- application of `operator/=(path(".."))` `n` times, and then
|
| 62 |
- application of `operator/=` for each element in \[`a`, `end()`).
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
[*Example 11*:
|
| 65 |
|
| 66 |
``` cpp
|
| 67 |
assert(path("/a/d").lexically_relative("/a/b/c") == "../../d");
|
| 68 |
assert(path("/a/b/c").lexically_relative("/a/d") == "../b/c");
|
|
@@ -76,26 +76,26 @@ The above assertions will succeed. On Windows, the returned path’s
|
|
| 76 |
*directory-separator* characters will be backslashes rather than
|
| 77 |
slashes, but that does not affect `path` equality.
|
| 78 |
|
| 79 |
— *end example*]
|
| 80 |
|
| 81 |
-
[*Note
|
| 82 |
operational function `relative()`. — *end note*]
|
| 83 |
|
| 84 |
-
[*Note
|
| 85 |
consistent matching of elements, apply `lexically_normal()` to `*this`,
|
| 86 |
`base`, or both. — *end note*]
|
| 87 |
|
| 88 |
``` cpp
|
| 89 |
path lexically_proximate(const path& base) const;
|
| 90 |
```
|
| 91 |
|
| 92 |
*Returns:* If the value of `lexically_relative(base)` is not an empty
|
| 93 |
path, return it. Otherwise return `*this`.
|
| 94 |
|
| 95 |
-
[*Note
|
| 96 |
operational function `proximate()`. — *end note*]
|
| 97 |
|
| 98 |
-
[*Note
|
| 99 |
consistent matching of elements, apply `lexically_normal()` to `*this`,
|
| 100 |
`base`, or both. — *end note*]
|
| 101 |
|
|
|
|
| 23 |
|
| 24 |
``` cpp
|
| 25 |
path lexically_relative(const path& base) const;
|
| 26 |
```
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
*Effects:* If:
|
| 29 |
|
| 30 |
- `root_name() != base.root_name()` is `true`, or
|
| 31 |
- `is_absolute() != base.is_absolute()` is `true`, or
|
| 32 |
- `!has_root_directory() && base.has_root_directory()` is `true`, or
|
| 33 |
- any *filename* in `relative_path()` or `base.relative_path()` can be
|
| 34 |
interpreted as a *root-name*,
|
| 35 |
|
| 36 |
returns `path()`.
|
| 37 |
|
| 38 |
+
[*Note 5*: On a POSIX implementation, no *filename* in a
|
| 39 |
*relative-path* is acceptable as a *root-name*. — *end note*]
|
| 40 |
|
| 41 |
Determines the first mismatched element of `*this` and `base` as if by:
|
| 42 |
|
| 43 |
``` cpp
|
|
|
|
| 55 |
- returns an object of class `path` that is default-constructed,
|
| 56 |
followed by
|
| 57 |
- application of `operator/=(path(".."))` `n` times, and then
|
| 58 |
- application of `operator/=` for each element in \[`a`, `end()`).
|
| 59 |
|
| 60 |
+
*Returns:* `*this` made relative to `base`. Does not
|
| 61 |
+
resolve [[fs.class.path]] symlinks. Does not first
|
| 62 |
+
normalize [[fs.path.generic]] `*this` or `base`.
|
| 63 |
+
|
| 64 |
[*Example 11*:
|
| 65 |
|
| 66 |
``` cpp
|
| 67 |
assert(path("/a/d").lexically_relative("/a/b/c") == "../../d");
|
| 68 |
assert(path("/a/b/c").lexically_relative("/a/d") == "../b/c");
|
|
|
|
| 76 |
*directory-separator* characters will be backslashes rather than
|
| 77 |
slashes, but that does not affect `path` equality.
|
| 78 |
|
| 79 |
— *end example*]
|
| 80 |
|
| 81 |
+
[*Note 6*: If symlink following semantics are desired, use the
|
| 82 |
operational function `relative()`. — *end note*]
|
| 83 |
|
| 84 |
+
[*Note 7*: If normalization [[fs.path.generic]] is needed to ensure
|
| 85 |
consistent matching of elements, apply `lexically_normal()` to `*this`,
|
| 86 |
`base`, or both. — *end note*]
|
| 87 |
|
| 88 |
``` cpp
|
| 89 |
path lexically_proximate(const path& base) const;
|
| 90 |
```
|
| 91 |
|
| 92 |
*Returns:* If the value of `lexically_relative(base)` is not an empty
|
| 93 |
path, return it. Otherwise return `*this`.
|
| 94 |
|
| 95 |
+
[*Note 8*: If symlink following semantics are desired, use the
|
| 96 |
operational function `proximate()`. — *end note*]
|
| 97 |
|
| 98 |
+
[*Note 9*: If normalization [[fs.path.generic]] is needed to ensure
|
| 99 |
consistent matching of elements, apply `lexically_normal()` to `*this`,
|
| 100 |
`base`, or both. — *end note*]
|
| 101 |
|