tmp/tmpo2xbzx4s/{from.md → to.md}
RENAMED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
### Class template `basic_fstream` <a id="fstream">[[fstream]]</a>
|
| 2 |
|
|
|
|
|
|
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
template<class charT, class traits = char_traits<charT>>
|
| 6 |
class basic_fstream : public basic_iostream<charT, traits> {
|
| 7 |
public:
|
|
@@ -20,19 +22,19 @@ namespace std {
|
|
| 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 |
-
|
| 26 |
-
const
|
| 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;
|
|
@@ -51,14 +53,10 @@ namespace std {
|
|
| 51 |
void close();
|
| 52 |
|
| 53 |
private:
|
| 54 |
basic_filebuf<charT, traits> sb; // exposition only
|
| 55 |
};
|
| 56 |
-
|
| 57 |
-
template<class charT, class traits>
|
| 58 |
-
void swap(basic_fstream<charT, traits>& x,
|
| 59 |
-
basic_fstream<charT, traits>& y);
|
| 60 |
}
|
| 61 |
```
|
| 62 |
|
| 63 |
The class template `basic_fstream<charT, traits>` supports reading and
|
| 64 |
writing from named files. It uses a `basic_filebuf<charT, traits>`
|
|
@@ -94,27 +92,33 @@ explicit basic_fstream(
|
|
| 94 |
|
| 95 |
``` cpp
|
| 96 |
explicit basic_fstream(
|
| 97 |
const string& s,
|
| 98 |
ios_base::openmode mode = ios_base::in | ios_base::out);
|
| 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 |
-
####
|
| 116 |
|
| 117 |
``` cpp
|
| 118 |
void swap(basic_fstream& rhs);
|
| 119 |
```
|
| 120 |
|
|
|
|
| 1 |
### Class template `basic_fstream` <a id="fstream">[[fstream]]</a>
|
| 2 |
|
| 3 |
+
#### General <a id="fstream.general">[[fstream.general]]</a>
|
| 4 |
+
|
| 5 |
``` cpp
|
| 6 |
namespace std {
|
| 7 |
template<class charT, class traits = char_traits<charT>>
|
| 8 |
class basic_fstream : public basic_iostream<charT, traits> {
|
| 9 |
public:
|
|
|
|
| 22 |
const filesystem::path::value_type* s,
|
| 23 |
ios_base::openmode mode = ios_base::in|ios_base::out); // wide systems only; see [fstream.syn]
|
| 24 |
explicit basic_fstream(
|
| 25 |
const string& s,
|
| 26 |
ios_base::openmode mode = ios_base::in | ios_base::out);
|
| 27 |
+
template<class T>
|
| 28 |
+
explicit basic_fstream(const T& s, ios_base::openmode mode = ios_base::in | ios_base::out);
|
|
|
|
| 29 |
basic_fstream(const basic_fstream&) = delete;
|
| 30 |
basic_fstream(basic_fstream&& rhs);
|
| 31 |
|
|
|
|
| 32 |
basic_fstream& operator=(const basic_fstream&) = delete;
|
| 33 |
basic_fstream& operator=(basic_fstream&& rhs);
|
| 34 |
+
|
| 35 |
+
// [fstream.swap], swap
|
| 36 |
void swap(basic_fstream& rhs);
|
| 37 |
|
| 38 |
// [fstream.members], members
|
| 39 |
basic_filebuf<charT, traits>* rdbuf() const;
|
| 40 |
bool is_open() const;
|
|
|
|
| 53 |
void close();
|
| 54 |
|
| 55 |
private:
|
| 56 |
basic_filebuf<charT, traits> sb; // exposition only
|
| 57 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
}
|
| 59 |
```
|
| 60 |
|
| 61 |
The class template `basic_fstream<charT, traits>` supports reading and
|
| 62 |
writing from named files. It uses a `basic_filebuf<charT, traits>`
|
|
|
|
| 92 |
|
| 93 |
``` cpp
|
| 94 |
explicit basic_fstream(
|
| 95 |
const string& s,
|
| 96 |
ios_base::openmode mode = ios_base::in | ios_base::out);
|
|
|
|
|
|
|
|
|
|
| 97 |
```
|
| 98 |
|
| 99 |
*Effects:* Equivalent to: `basic_fstream(s.c_str(), mode)`.
|
| 100 |
|
| 101 |
+
``` cpp
|
| 102 |
+
template<class T>
|
| 103 |
+
explicit basic_fstream(const T& s, ios_base::openmode mode = ios_base::in | ios_base::out);
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
*Constraints:* `is_same_v<T, filesystem::path>` is `true`.
|
| 107 |
+
|
| 108 |
+
*Effects:* Equivalent to: `basic_fstream(s.c_str(), mode)`.
|
| 109 |
+
|
| 110 |
``` cpp
|
| 111 |
basic_fstream(basic_fstream&& rhs);
|
| 112 |
```
|
| 113 |
|
| 114 |
*Effects:* Move constructs the base class, and the contained
|
| 115 |
`basic_filebuf`. Then calls
|
| 116 |
`basic_istream<charT, traits>::set_rdbuf(addressof(sb))` to install the
|
| 117 |
contained `basic_filebuf`.
|
| 118 |
|
| 119 |
+
#### Swap <a id="fstream.swap">[[fstream.swap]]</a>
|
| 120 |
|
| 121 |
``` cpp
|
| 122 |
void swap(basic_fstream& rhs);
|
| 123 |
```
|
| 124 |
|