tmp/tmp2xuktr4g/{from.md → to.md}
RENAMED
|
@@ -9,15 +9,15 @@ sequence controlled by the stream buffer.
|
|
| 9 |
|
| 10 |
``` cpp
|
| 11 |
basic_ostream<charT, traits>* tie(basic_ostream<charT, traits>* tiestr);
|
| 12 |
```
|
| 13 |
|
| 14 |
-
*
|
| 15 |
traversing the linked list of tied stream objects starting from
|
| 16 |
`tiestr->tie()`.
|
| 17 |
|
| 18 |
-
*
|
| 19 |
|
| 20 |
*Returns:* The previous value of `tie()`.
|
| 21 |
|
| 22 |
``` cpp
|
| 23 |
basic_streambuf<charT, traits>* rdbuf() const;
|
|
@@ -27,22 +27,22 @@ basic_streambuf<charT, traits>* rdbuf() const;
|
|
| 27 |
|
| 28 |
``` cpp
|
| 29 |
basic_streambuf<charT, traits>* rdbuf(basic_streambuf<charT, traits>* sb);
|
| 30 |
```
|
| 31 |
|
| 32 |
-
*Postconditions:* `sb == rdbuf()`.
|
| 33 |
-
|
| 34 |
*Effects:* Calls `clear()`.
|
| 35 |
|
|
|
|
|
|
|
| 36 |
*Returns:* The previous value of `rdbuf()`.
|
| 37 |
|
| 38 |
``` cpp
|
| 39 |
locale imbue(const locale& loc);
|
| 40 |
```
|
| 41 |
|
| 42 |
-
*Effects:* Calls `ios_base::imbue(loc)`
|
| 43 |
-
`rdbuf() != 0` then `rdbuf()->pubimbue(loc)`
|
| 44 |
|
| 45 |
*Returns:* The prior value of `ios_base::imbue()`.
|
| 46 |
|
| 47 |
``` cpp
|
| 48 |
char narrow(char_type c, char dfault) const;
|
|
@@ -65,45 +65,45 @@ specified field width.
|
|
| 65 |
|
| 66 |
``` cpp
|
| 67 |
char_type fill(char_type fillch);
|
| 68 |
```
|
| 69 |
|
| 70 |
-
*
|
| 71 |
|
| 72 |
*Returns:* The previous value of `fill()`.
|
| 73 |
|
| 74 |
``` cpp
|
| 75 |
basic_ios& copyfmt(const basic_ios& rhs);
|
| 76 |
```
|
| 77 |
|
| 78 |
-
*Effects:* If `(this ==
|
| 79 |
-
|
| 80 |
-
follows:
|
| 81 |
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
- `rdstate()`, `rdbuf()`, and `exceptions()` are left unchanged;
|
| 87 |
-
|
| 88 |
-
|
| 89 |
- if any newly stored pointer values in `*this` point at objects
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
|
| 97 |
[*Note 1*: The second pass through the callback pairs permits a copied
|
| 98 |
`pword` value to be zeroed, or to have its referent deep copied or
|
| 99 |
reference counted, or to have other special action taken. — *end note*]
|
| 100 |
|
| 101 |
-
*
|
| 102 |
-
|
| 103 |
|
| 104 |
-
**Table: `basic_ios::copyfmt()` effects** <a id="
|
| 105 |
|
| 106 |
| Element | Value |
|
| 107 |
| -------------- | ------------------ |
|
| 108 |
| `rdbuf()` | unchanged |
|
| 109 |
| `tie()` | `rhs.tie()` |
|
|
@@ -121,33 +121,32 @@ Table [[tab:iostreams.copyfmt.effects]].
|
|
| 121 |
``` cpp
|
| 122 |
void move(basic_ios& rhs);
|
| 123 |
void move(basic_ios&& rhs);
|
| 124 |
```
|
| 125 |
|
| 126 |
-
*
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
shall return 0.
|
| 131 |
|
| 132 |
``` cpp
|
| 133 |
void swap(basic_ios& rhs) noexcept;
|
| 134 |
```
|
| 135 |
|
| 136 |
-
*Effects:* The states of `*this` and `rhs`
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
|
| 141 |
``` cpp
|
| 142 |
void set_rdbuf(basic_streambuf<charT, traits>* sb);
|
| 143 |
```
|
| 144 |
|
| 145 |
-
*
|
| 146 |
|
| 147 |
*Effects:* Associates the `basic_streambuf` object pointed to by `sb`
|
| 148 |
with this stream without calling `clear()`.
|
| 149 |
|
| 150 |
-
*
|
| 151 |
|
| 152 |
*Throws:* Nothing.
|
| 153 |
|
|
|
|
| 9 |
|
| 10 |
``` cpp
|
| 11 |
basic_ostream<charT, traits>* tie(basic_ostream<charT, traits>* tiestr);
|
| 12 |
```
|
| 13 |
|
| 14 |
+
*Preconditions:* If `tiestr` is not null, `tiestr` is not reachable by
|
| 15 |
traversing the linked list of tied stream objects starting from
|
| 16 |
`tiestr->tie()`.
|
| 17 |
|
| 18 |
+
*Ensures:* `tiestr == tie()`.
|
| 19 |
|
| 20 |
*Returns:* The previous value of `tie()`.
|
| 21 |
|
| 22 |
``` cpp
|
| 23 |
basic_streambuf<charT, traits>* rdbuf() const;
|
|
|
|
| 27 |
|
| 28 |
``` cpp
|
| 29 |
basic_streambuf<charT, traits>* rdbuf(basic_streambuf<charT, traits>* sb);
|
| 30 |
```
|
| 31 |
|
|
|
|
|
|
|
| 32 |
*Effects:* Calls `clear()`.
|
| 33 |
|
| 34 |
+
*Ensures:* `sb == rdbuf()`.
|
| 35 |
+
|
| 36 |
*Returns:* The previous value of `rdbuf()`.
|
| 37 |
|
| 38 |
``` cpp
|
| 39 |
locale imbue(const locale& loc);
|
| 40 |
```
|
| 41 |
|
| 42 |
+
*Effects:* Calls `ios_base::imbue(loc)` [[ios.base.locales]] and if
|
| 43 |
+
`rdbuf() != 0` then `rdbuf()->pubimbue(loc)` [[streambuf.locales]].
|
| 44 |
|
| 45 |
*Returns:* The prior value of `ios_base::imbue()`.
|
| 46 |
|
| 47 |
``` cpp
|
| 48 |
char narrow(char_type c, char dfault) const;
|
|
|
|
| 65 |
|
| 66 |
``` cpp
|
| 67 |
char_type fill(char_type fillch);
|
| 68 |
```
|
| 69 |
|
| 70 |
+
*Ensures:* `traits::eq(fillch, fill())`.
|
| 71 |
|
| 72 |
*Returns:* The previous value of `fill()`.
|
| 73 |
|
| 74 |
``` cpp
|
| 75 |
basic_ios& copyfmt(const basic_ios& rhs);
|
| 76 |
```
|
| 77 |
|
| 78 |
+
*Effects:* If `(this == addressof(rhs))` is `true` does nothing.
|
| 79 |
+
Otherwise assigns to the member objects of `*this` the corresponding
|
| 80 |
+
member objects of `rhs` as follows:
|
| 81 |
|
| 82 |
+
- calls each registered callback pair `(fn, idx)` as
|
| 83 |
+
`(*fn)(erase_event, *this, idx)`;
|
| 84 |
+
- then, assigns to the member objects of `*this` the corresponding
|
| 85 |
+
member objects of `rhs`, except that
|
| 86 |
- `rdstate()`, `rdbuf()`, and `exceptions()` are left unchanged;
|
| 87 |
+
- the contents of arrays pointed at by `pword` and `iword` are copied,
|
| 88 |
+
not the pointers themselves;[^10] and
|
| 89 |
- if any newly stored pointer values in `*this` point at objects
|
| 90 |
+
stored outside the object `rhs` and those objects are destroyed when
|
| 91 |
+
`rhs` is destroyed, the newly stored pointer values are altered to
|
| 92 |
+
point at newly constructed copies of the objects;
|
| 93 |
+
- then, calls each callback pair that was copied from `rhs` as
|
| 94 |
+
`(*fn)(copyfmt_event, *this, idx)`;
|
| 95 |
+
- then, calls `exceptions(rhs.exceptions())`.
|
| 96 |
|
| 97 |
[*Note 1*: The second pass through the callback pairs permits a copied
|
| 98 |
`pword` value to be zeroed, or to have its referent deep copied or
|
| 99 |
reference counted, or to have other special action taken. — *end note*]
|
| 100 |
|
| 101 |
+
*Ensures:* The postconditions of this function are indicated in
|
| 102 |
+
[[basic.ios.copyfmt]].
|
| 103 |
|
| 104 |
+
**Table: `basic_ios::copyfmt()` effects** <a id="basic.ios.copyfmt">[basic.ios.copyfmt]</a>
|
| 105 |
|
| 106 |
| Element | Value |
|
| 107 |
| -------------- | ------------------ |
|
| 108 |
| `rdbuf()` | unchanged |
|
| 109 |
| `tie()` | `rhs.tie()` |
|
|
|
|
| 121 |
``` cpp
|
| 122 |
void move(basic_ios& rhs);
|
| 123 |
void move(basic_ios&& rhs);
|
| 124 |
```
|
| 125 |
|
| 126 |
+
*Ensures:* `*this` has the state that `rhs` had before the function
|
| 127 |
+
call, except that `rdbuf()` returns `nullptr`. `rhs` is in a valid but
|
| 128 |
+
unspecified state, except that `rhs.rdbuf()` returns the same value as
|
| 129 |
+
it returned before the function call, and `rhs.tie()` returns `nullptr`.
|
|
|
|
| 130 |
|
| 131 |
``` cpp
|
| 132 |
void swap(basic_ios& rhs) noexcept;
|
| 133 |
```
|
| 134 |
|
| 135 |
+
*Effects:* The states of `*this` and `rhs` are exchanged, except that
|
| 136 |
+
`rdbuf()` returns the same value as it returned before the function
|
| 137 |
+
call, and `rhs.rdbuf()` returns the same value as it returned before the
|
| 138 |
+
function call.
|
| 139 |
|
| 140 |
``` cpp
|
| 141 |
void set_rdbuf(basic_streambuf<charT, traits>* sb);
|
| 142 |
```
|
| 143 |
|
| 144 |
+
*Preconditions:* `sb != nullptr` is `true`.
|
| 145 |
|
| 146 |
*Effects:* Associates the `basic_streambuf` object pointed to by `sb`
|
| 147 |
with this stream without calling `clear()`.
|
| 148 |
|
| 149 |
+
*Ensures:* `rdbuf() == sb` is `true`.
|
| 150 |
|
| 151 |
*Throws:* Nothing.
|
| 152 |
|