From Jason Turner

[fstream]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmptaeuoai2/{from.md → to.md} +19 -28
tmp/tmptaeuoai2/{from.md → to.md} RENAMED
@@ -15,34 +15,34 @@ namespace std {
15
  basic_fstream();
16
  explicit basic_fstream(
17
  const char* s,
18
  ios_base::openmode mode = ios_base::in | ios_base::out);
19
  explicit basic_fstream(
20
- const std::filesystem::path::value_type* s,
21
  ios_base::openmode mode = ios_base::in|ios_base::out); // wide systems only; see [fstream.syn]
22
  explicit basic_fstream(
23
  const string& s,
24
  ios_base::openmode mode = ios_base::in | ios_base::out);
25
  explicit basic_fstream(
26
  const filesystem::path& s,
27
  ios_base::openmode mode = ios_base::in | ios_base::out);
28
- basic_fstream(const basic_fstream& rhs) = delete;
29
  basic_fstream(basic_fstream&& rhs);
30
 
31
  // [fstream.assign], assign and swap
32
- basic_fstream& operator=(const basic_fstream& rhs) = delete;
33
  basic_fstream& operator=(basic_fstream&& rhs);
34
  void swap(basic_fstream& rhs);
35
 
36
  // [fstream.members], members
37
  basic_filebuf<charT, traits>* rdbuf() const;
38
  bool is_open() const;
39
  void open(
40
  const char* s,
41
  ios_base::openmode mode = ios_base::in | ios_base::out);
42
  void open(
43
- const std::filesystem::path::value_type* s,
44
  ios_base::openmode mode = ios_base::in|ios_base::out); // wide systems only; see [fstream.syn]
45
  void open(
46
  const string& s,
47
  ios_base::openmode mode = ios_base::in | ios_base::out);
48
  void open(
@@ -65,18 +65,18 @@ writing from named files. It uses a `basic_filebuf<charT, traits>`
65
  object to control the associated sequences. For the sake of exposition,
66
  the maintained data is presented here as:
67
 
68
  - `sb`, the `basic_filebuf` object.
69
 
70
- #### `basic_fstream` constructors <a id="fstream.cons">[[fstream.cons]]</a>
71
 
72
  ``` cpp
73
  basic_fstream();
74
  ```
75
 
76
- *Effects:* Constructs an object of class `basic_fstream<charT, traits>`,
77
- initializing the base class with `basic_iostream(&sb)` and initializing
78
  `sb` with `basic_filebuf<charT, traits>()`.
79
 
80
  ``` cpp
81
  explicit basic_fstream(
82
  const char* s,
@@ -84,12 +84,12 @@ explicit basic_fstream(
84
  explicit basic_fstream(
85
  const filesystem::path::value_type* s,
86
  ios_base::openmode mode = ios_base::in | ios_base::out); // wide systems only; see [fstream.syn]
87
  ```
88
 
89
- *Effects:* Constructs an object of class `basic_fstream<charT, traits>`,
90
- initializing the base class with `basic_iostream(&sb)` and initializing
91
  `sb` with `basic_filebuf<charT, traits>()`. Then calls
92
  `rdbuf()->open(s, mode)`. If that function returns a null pointer, calls
93
  `setstate(failbit)`.
94
 
95
  ``` cpp
@@ -99,31 +99,22 @@ explicit basic_fstream(
99
  explicit basic_fstream(
100
  const filesystem::path& s,
101
  ios_base::openmode mode = ios_base::in | ios_base::out);
102
  ```
103
 
104
- *Effects:* The same as `basic_fstream(s.c_str(), mode)`.
105
 
106
  ``` cpp
107
  basic_fstream(basic_fstream&& rhs);
108
  ```
109
 
110
- *Effects:* Move constructs from the rvalue `rhs`. This is accomplished
111
- by move constructing the base class, and the contained `basic_filebuf`.
112
- Next `basic_istream<charT, traits>::set_rdbuf(&sb)` is called to install
113
- the contained `basic_filebuf`.
114
 
115
- #### Assign and swap <a id="fstream.assign">[[fstream.assign]]</a>
116
-
117
- ``` cpp
118
- basic_fstream& operator=(basic_fstream&& rhs);
119
- ```
120
-
121
- *Effects:* Move assigns the base and members of `*this` from the base
122
- and corresponding members of `rhs`.
123
-
124
- *Returns:* `*this`.
125
 
126
  ``` cpp
127
  void swap(basic_fstream& rhs);
128
  ```
129
 
@@ -134,19 +125,19 @@ void swap(basic_fstream& rhs);
134
  template<class charT, class traits>
135
  void swap(basic_fstream<charT, traits>& x,
136
  basic_fstream<charT, traits>& y);
137
  ```
138
 
139
- *Effects:* As if by `x.swap(y)`.
140
 
141
  #### Member functions <a id="fstream.members">[[fstream.members]]</a>
142
 
143
  ``` cpp
144
  basic_filebuf<charT, traits>* rdbuf() const;
145
  ```
146
 
147
- *Returns:* `const_cast<basic_filebuf<charT, traits>*>(&sb)`.
148
 
149
  ``` cpp
150
  bool is_open() const;
151
  ```
152
 
@@ -162,11 +153,11 @@ void open(
162
  ```
163
 
164
  *Effects:* Calls `rdbuf()->open(s, mode)`. If that function does not
165
  return a null pointer calls `clear()`, otherwise calls
166
  `setstate(failbit)` (which may throw
167
- `ios_base::failure`) ([[iostate.flags]]).
168
 
169
  ``` cpp
170
  void open(
171
  const string& s,
172
  ios_base::openmode mode = ios_base::in | ios_base::out);
@@ -181,7 +172,7 @@ void open(
181
  void close();
182
  ```
183
 
184
  *Effects:* Calls `rdbuf()->close()` and, if that function returns a null
185
  pointer, calls `setstate(failbit)` (which may throw
186
- `ios_base::failure`) ([[iostate.flags]]).
187
 
 
15
  basic_fstream();
16
  explicit basic_fstream(
17
  const char* s,
18
  ios_base::openmode mode = ios_base::in | ios_base::out);
19
  explicit basic_fstream(
20
+ const filesystem::path::value_type* s,
21
  ios_base::openmode mode = ios_base::in|ios_base::out); // wide systems only; see [fstream.syn]
22
  explicit basic_fstream(
23
  const string& s,
24
  ios_base::openmode mode = ios_base::in | ios_base::out);
25
  explicit basic_fstream(
26
  const filesystem::path& s,
27
  ios_base::openmode mode = ios_base::in | ios_base::out);
28
+ basic_fstream(const basic_fstream&) = delete;
29
  basic_fstream(basic_fstream&& rhs);
30
 
31
  // [fstream.assign], assign and swap
32
+ basic_fstream& operator=(const basic_fstream&) = delete;
33
  basic_fstream& operator=(basic_fstream&& rhs);
34
  void swap(basic_fstream& rhs);
35
 
36
  // [fstream.members], members
37
  basic_filebuf<charT, traits>* rdbuf() const;
38
  bool is_open() const;
39
  void open(
40
  const char* s,
41
  ios_base::openmode mode = ios_base::in | ios_base::out);
42
  void open(
43
+ const filesystem::path::value_type* s,
44
  ios_base::openmode mode = ios_base::in|ios_base::out); // wide systems only; see [fstream.syn]
45
  void open(
46
  const string& s,
47
  ios_base::openmode mode = ios_base::in | ios_base::out);
48
  void open(
 
65
  object to control the associated sequences. For the sake of exposition,
66
  the maintained data is presented here as:
67
 
68
  - `sb`, the `basic_filebuf` object.
69
 
70
+ #### Constructors <a id="fstream.cons">[[fstream.cons]]</a>
71
 
72
  ``` cpp
73
  basic_fstream();
74
  ```
75
 
76
+ *Effects:* Initializes the base class with
77
+ `basic_iostream<charT, traits>(addressof(sb))` [[iostream.cons]] and
78
  `sb` with `basic_filebuf<charT, traits>()`.
79
 
80
  ``` cpp
81
  explicit basic_fstream(
82
  const char* s,
 
84
  explicit basic_fstream(
85
  const filesystem::path::value_type* s,
86
  ios_base::openmode mode = ios_base::in | ios_base::out); // wide systems only; see [fstream.syn]
87
  ```
88
 
89
+ *Effects:* Initializes the base class with
90
+ `basic_iostream<charT, traits>(addressof(sb))` [[iostream.cons]] and
91
  `sb` with `basic_filebuf<charT, traits>()`. Then calls
92
  `rdbuf()->open(s, mode)`. If that function returns a null pointer, calls
93
  `setstate(failbit)`.
94
 
95
  ``` cpp
 
99
  explicit basic_fstream(
100
  const filesystem::path& s,
101
  ios_base::openmode mode = ios_base::in | ios_base::out);
102
  ```
103
 
104
+ *Effects:* Equivalent to: `basic_fstream(s.c_str(), mode)`.
105
 
106
  ``` cpp
107
  basic_fstream(basic_fstream&& rhs);
108
  ```
109
 
110
+ *Effects:* Move constructs the base class, and the contained
111
+ `basic_filebuf`. Then calls
112
+ `basic_istream<charT, traits>::set_rdbuf(addressof(sb))` to install the
113
+ contained `basic_filebuf`.
114
 
115
+ #### Assignment and swap <a id="fstream.assign">[[fstream.assign]]</a>
 
 
 
 
 
 
 
 
 
116
 
117
  ``` cpp
118
  void swap(basic_fstream& rhs);
119
  ```
120
 
 
125
  template<class charT, class traits>
126
  void swap(basic_fstream<charT, traits>& x,
127
  basic_fstream<charT, traits>& y);
128
  ```
129
 
130
+ *Effects:* Equivalent to: `x.swap(y)`.
131
 
132
  #### Member functions <a id="fstream.members">[[fstream.members]]</a>
133
 
134
  ``` cpp
135
  basic_filebuf<charT, traits>* rdbuf() const;
136
  ```
137
 
138
+ *Returns:* `const_cast<basic_filebuf<charT, traits>*>(addressof(sb))`.
139
 
140
  ``` cpp
141
  bool is_open() const;
142
  ```
143
 
 
153
  ```
154
 
155
  *Effects:* Calls `rdbuf()->open(s, mode)`. If that function does not
156
  return a null pointer calls `clear()`, otherwise calls
157
  `setstate(failbit)` (which may throw
158
+ `ios_base::failure`) [[iostate.flags]].
159
 
160
  ``` cpp
161
  void open(
162
  const string& s,
163
  ios_base::openmode mode = ios_base::in | ios_base::out);
 
172
  void close();
173
  ```
174
 
175
  *Effects:* Calls `rdbuf()->close()` and, if that function returns a null
176
  pointer, calls `setstate(failbit)` (which may throw
177
+ `ios_base::failure`) [[iostate.flags]].
178