tmp/tmp798blpx7/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
##### `path` appends <a id="fs.path.append">[[fs.path.append]]</a>
|
| 2 |
+
|
| 3 |
+
The append operations use `operator/=` to denote their semantic effect
|
| 4 |
+
of appending *preferred-separator* when needed.
|
| 5 |
+
|
| 6 |
+
``` cpp
|
| 7 |
+
path& operator/=(const path& p);
|
| 8 |
+
```
|
| 9 |
+
|
| 10 |
+
*Effects:* If
|
| 11 |
+
`p.is_absolute() || (p.has_root_name() && p.root_name() != root_name())`,
|
| 12 |
+
then `operator=(p)`.
|
| 13 |
+
|
| 14 |
+
Otherwise, modifies `*this` as if by these steps:
|
| 15 |
+
|
| 16 |
+
- If `p.has_root_directory()`, then removes any root directory and
|
| 17 |
+
relative path from the generic format pathname. Otherwise, if
|
| 18 |
+
`!has_root_directory() && is_absolute()` is `true` or if
|
| 19 |
+
`has_filename()` is `true`, then appends `path::preferred_separator`
|
| 20 |
+
to the generic format pathname.
|
| 21 |
+
- Then appends the native format pathname of `p`, omitting any
|
| 22 |
+
*root-name* from its generic format pathname, to the native format
|
| 23 |
+
pathname.
|
| 24 |
+
|
| 25 |
+
[*Example 2*:
|
| 26 |
+
|
| 27 |
+
Even if `//host` is interpreted as a *root-name*, both of the paths
|
| 28 |
+
`path("//host")/"foo"` and `path("//host/")/"foo"` equal `"//host/foo"`.
|
| 29 |
+
|
| 30 |
+
Expression examples:
|
| 31 |
+
|
| 32 |
+
``` cpp
|
| 33 |
+
// On POSIX,
|
| 34 |
+
path("foo") / ""; // yields "foo/"
|
| 35 |
+
path("foo") / "/bar"; // yields "/bar"
|
| 36 |
+
// On Windows, backslashes replace slashes in the above yields
|
| 37 |
+
|
| 38 |
+
// On Windows,
|
| 39 |
+
path("foo") / "c:/bar"; // yields "c:/bar"
|
| 40 |
+
path("foo") / "c:"; // yields "c:"
|
| 41 |
+
path("c:") / ""; // yields "c:"
|
| 42 |
+
path("c:foo") / "/bar"; // yields "c:/bar"
|
| 43 |
+
path("c:foo") / "c:bar"; // yields "c:foo/bar"
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
— *end example*]
|
| 47 |
+
|
| 48 |
+
*Returns:* `*this`.
|
| 49 |
+
|
| 50 |
+
``` cpp
|
| 51 |
+
template <class Source>
|
| 52 |
+
path& operator/=(const Source& source);
|
| 53 |
+
template <class Source>
|
| 54 |
+
path& append(const Source& source);
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
*Effects:* Equivalent to: `return operator/=(path(source));`
|
| 58 |
+
|
| 59 |
+
``` cpp
|
| 60 |
+
template <class InputIterator>
|
| 61 |
+
path& append(InputIterator first, InputIterator last);
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
*Effects:* Equivalent to: `return operator/=(path(first, last));`
|
| 65 |
+
|