From Jason Turner

[fs.path.modifiers]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpexe2zs3c/{from.md → to.md} +111 -0
tmp/tmpexe2zs3c/{from.md → to.md} RENAMED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ##### `path` modifiers <a id="fs.path.modifiers">[[fs.path.modifiers]]</a>
2
+
3
+ ``` cpp
4
+ void clear() noexcept;
5
+ ```
6
+
7
+ *Postconditions:* `empty() == true`.
8
+
9
+ ``` cpp
10
+ path& make_preferred();
11
+ ```
12
+
13
+ *Effects:* Each *directory-separator* of the pathname in the generic
14
+ format is converted to *preferred-separator*.
15
+
16
+ *Returns:* `*this`.
17
+
18
+ [*Example 3*:
19
+
20
+ ``` cpp
21
+ path p("foo/bar");
22
+ std::cout << p << '\n';
23
+ p.make_preferred();
24
+ std::cout << p << '\n';
25
+ ```
26
+
27
+ On an operating system where *preferred-separator* is a slash, the
28
+ output is:
29
+
30
+ ``` cpp
31
+ "foo/bar"
32
+ "foo/bar"
33
+ ```
34
+
35
+ On an operating system where *preferred-separator* is a backslash, the
36
+ output is:
37
+
38
+ ``` cpp
39
+ "foo/bar"
40
+ "foo\bar"
41
+ ```
42
+
43
+ — *end example*]
44
+
45
+ ``` cpp
46
+ path& remove_filename();
47
+ ```
48
+
49
+ *Postconditions:* `!has_filename()`.
50
+
51
+ *Effects:* Remove the generic format pathname of `filename()` from the
52
+ generic format pathname.
53
+
54
+ *Returns:* `*this`.
55
+
56
+ [*Example 4*:
57
+
58
+ ``` cpp
59
+ path("foo/bar").remove_filename(); // yields "foo/"
60
+ path("foo/").remove_filename(); // yields "foo/"
61
+ path("/foo").remove_filename(); // yields "/"
62
+ path("/").remove_filename(); // yields "/"
63
+ ```
64
+
65
+ — *end example*]
66
+
67
+ ``` cpp
68
+ path& replace_filename(const path& replacement);
69
+ ```
70
+
71
+ *Effects:* Equivalent to:
72
+
73
+ ``` cpp
74
+ remove_filename();
75
+ operator/=(replacement);
76
+ ```
77
+
78
+ *Returns:* `*this`.
79
+
80
+ [*Example 5*:
81
+
82
+ ``` cpp
83
+ path("/foo").replace_filename("bar"); // yields "/bar" on POSIX
84
+ path("/").replace_filename("bar"); // yields "/bar" on POSIX
85
+ ```
86
+
87
+ — *end example*]
88
+
89
+ ``` cpp
90
+ path& replace_extension(const path& replacement = path());
91
+ ```
92
+
93
+ *Effects:*
94
+
95
+ - Any existing `extension()(` [[fs.path.decompose]]`)` is removed from
96
+ the pathname in the generic format, then
97
+ - If `replacement` is not empty and does not begin with a dot character,
98
+ a dot character is appended to the pathname in the generic format,
99
+ then
100
+ - `operator+=(replacement);`.
101
+
102
+ *Returns:* `*this`.
103
+
104
+ ``` cpp
105
+ void swap(path& rhs) noexcept;
106
+ ```
107
+
108
+ *Effects:* Swaps the contents (in all formats) of the two paths.
109
+
110
+ *Complexity:* Constant time.
111
+