tmp/tmp7_tqxwal/{from.md → to.md}
RENAMED
|
@@ -5,18 +5,17 @@
|
|
| 5 |
``` cpp
|
| 6 |
namespace std {
|
| 7 |
template <class charT, class traits = char_traits<charT>>
|
| 8 |
class basic_ios : public ios_base {
|
| 9 |
public:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
//
|
| 12 |
-
typedef charT char_type;
|
| 13 |
-
typedef typename traits::int_type int_type;
|
| 14 |
-
typedef typename traits::pos_type pos_type;
|
| 15 |
-
typedef typename traits::off_type off_type;
|
| 16 |
-
typedef traits traits_type;
|
| 17 |
-
|
| 18 |
explicit operator bool() const;
|
| 19 |
bool operator!() const;
|
| 20 |
iostate rdstate() const;
|
| 21 |
void clear(iostate state = goodbit);
|
| 22 |
void setstate(iostate state);
|
|
@@ -26,15 +25,15 @@ namespace std {
|
|
| 26 |
bool bad() const;
|
| 27 |
|
| 28 |
iostate exceptions() const;
|
| 29 |
void exceptions(iostate except);
|
| 30 |
|
| 31 |
-
// [basic.ios.cons]
|
| 32 |
explicit basic_ios(basic_streambuf<charT, traits>* sb);
|
| 33 |
virtual ~basic_ios();
|
| 34 |
|
| 35 |
-
// [basic.ios.members]
|
| 36 |
basic_ostream<charT, traits>* tie() const;
|
| 37 |
basic_ostream<charT, traits>* tie(basic_ostream<charT, traits>* tiestr);
|
| 38 |
|
| 39 |
basic_streambuf<charT, traits>* rdbuf() const;
|
| 40 |
basic_streambuf<charT, traits>* rdbuf(basic_streambuf<charT, traits>* sb);
|
|
@@ -105,11 +104,11 @@ Table [[tab:iostreams.basicios.init.effects]].
|
|
| 105 |
| `rdstate()` | `goodbit` if `sb` is not a null pointer, otherwise `badbit`. |
|
| 106 |
| `exceptions()` | `goodbit` |
|
| 107 |
| `flags()` | `skipws | dec` |
|
| 108 |
| `width()` | `0` |
|
| 109 |
| `precision()` | `6` |
|
| 110 |
-
| `fill()` | `widen(' ')
|
| 111 |
| `getloc()` | a copy of the value returned by `locale()` |
|
| 112 |
| `iarray` | a null pointer |
|
| 113 |
| `parray` | a null pointer |
|
| 114 |
|
| 115 |
|
|
@@ -128,11 +127,11 @@ basic_ostream<charT,traits>* tie(basic_ostream<charT,traits>* tiestr);
|
|
| 128 |
|
| 129 |
*Requires:* If `tiestr` is not null, `tiestr` must not be reachable by
|
| 130 |
traversing the linked list of tied stream objects starting from
|
| 131 |
`tiestr->tie()`.
|
| 132 |
|
| 133 |
-
`tiestr == tie()`.
|
| 134 |
|
| 135 |
*Returns:* The previous value of `tie()`.
|
| 136 |
|
| 137 |
``` cpp
|
| 138 |
basic_streambuf<charT, traits>* rdbuf() const;
|
|
@@ -142,11 +141,11 @@ basic_streambuf<charT,traits>* rdbuf() const;
|
|
| 142 |
|
| 143 |
``` cpp
|
| 144 |
basic_streambuf<charT, traits>* rdbuf(basic_streambuf<charT, traits>* sb);
|
| 145 |
```
|
| 146 |
|
| 147 |
-
`sb == rdbuf()`.
|
| 148 |
|
| 149 |
*Effects:* Calls `clear()`.
|
| 150 |
|
| 151 |
*Returns:* The previous value of `rdbuf()`.
|
| 152 |
|
|
@@ -180,11 +179,11 @@ specified field width.
|
|
| 180 |
|
| 181 |
``` cpp
|
| 182 |
char_type fill(char_type fillch);
|
| 183 |
```
|
| 184 |
|
| 185 |
-
`traits::eq(fillch, fill())`
|
| 186 |
|
| 187 |
*Returns:* The previous value of `fill()`.
|
| 188 |
|
| 189 |
``` cpp
|
| 190 |
basic_ios& copyfmt(const basic_ios& rhs);
|
|
@@ -205,15 +204,15 @@ follows:
|
|
| 205 |
stored outside the object `rhs` and those objects are destroyed
|
| 206 |
when `rhs` is destroyed, the newly stored pointer values are
|
| 207 |
altered to point at newly constructed copies of the objects;
|
| 208 |
3. calls each callback pair that was copied from `rhs` as
|
| 209 |
`(*fn)(copyfmt_event, *this, index)`;
|
| 210 |
-
4. calls `exceptions(rhs.
|
| 211 |
|
| 212 |
-
*Note
|
| 213 |
`pword` value to be zeroed, or to have its referent deep copied or
|
| 214 |
-
reference counted, or to have other special action taken.
|
| 215 |
|
| 216 |
*Postconditions:* The postconditions of this function are indicated in
|
| 217 |
Table [[tab:iostreams.copyfmt.effects]].
|
| 218 |
|
| 219 |
**Table: `basic_ios::copyfmt()` effects** <a id="tab:iostreams.copyfmt.effects">[tab:iostreams.copyfmt.effects]</a>
|
|
@@ -288,16 +287,16 @@ iostate rdstate() const;
|
|
| 288 |
|
| 289 |
``` cpp
|
| 290 |
void clear(iostate state = goodbit);
|
| 291 |
```
|
| 292 |
|
| 293 |
-
If `rdbuf()!=0` then `state == rdstate()`; otherwise
|
| 294 |
`rdstate() == (state | ios_base::badbit)`.
|
| 295 |
|
| 296 |
*Effects:* If
|
| 297 |
`((state | (rdbuf() ? goodbit : badbit)) & exceptions()) == 0`, returns.
|
| 298 |
-
Otherwise, the function throws an object
|
| 299 |
`basic_ios::failure` ([[ios::failure]]), constructed with
|
| 300 |
*implementation-defined* argument values.
|
| 301 |
|
| 302 |
``` cpp
|
| 303 |
void setstate(iostate state);
|
|
@@ -339,9 +338,9 @@ exceptions to be thrown.
|
|
| 339 |
|
| 340 |
``` cpp
|
| 341 |
void exceptions(iostate except);
|
| 342 |
```
|
| 343 |
|
| 344 |
-
`except == exceptions()`.
|
| 345 |
|
| 346 |
*Effects:* Calls `clear(rdstate())`.
|
| 347 |
|
|
|
|
| 5 |
``` cpp
|
| 6 |
namespace std {
|
| 7 |
template <class charT, class traits = char_traits<charT>>
|
| 8 |
class basic_ios : public ios_base {
|
| 9 |
public:
|
| 10 |
+
using char_type = charT;
|
| 11 |
+
using int_type = typename traits::int_type;
|
| 12 |
+
using pos_type = typename traits::pos_type;
|
| 13 |
+
using off_type = typename traits::off_type;
|
| 14 |
+
using traits_type = traits;
|
| 15 |
|
| 16 |
+
// [iostate.flags], flags functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
explicit operator bool() const;
|
| 18 |
bool operator!() const;
|
| 19 |
iostate rdstate() const;
|
| 20 |
void clear(iostate state = goodbit);
|
| 21 |
void setstate(iostate state);
|
|
|
|
| 25 |
bool bad() const;
|
| 26 |
|
| 27 |
iostate exceptions() const;
|
| 28 |
void exceptions(iostate except);
|
| 29 |
|
| 30 |
+
// [basic.ios.cons], constructor/destructor
|
| 31 |
explicit basic_ios(basic_streambuf<charT, traits>* sb);
|
| 32 |
virtual ~basic_ios();
|
| 33 |
|
| 34 |
+
// [basic.ios.members], members
|
| 35 |
basic_ostream<charT, traits>* tie() const;
|
| 36 |
basic_ostream<charT, traits>* tie(basic_ostream<charT, traits>* tiestr);
|
| 37 |
|
| 38 |
basic_streambuf<charT, traits>* rdbuf() const;
|
| 39 |
basic_streambuf<charT, traits>* rdbuf(basic_streambuf<charT, traits>* sb);
|
|
|
|
| 104 |
| `rdstate()` | `goodbit` if `sb` is not a null pointer, otherwise `badbit`. |
|
| 105 |
| `exceptions()` | `goodbit` |
|
| 106 |
| `flags()` | `skipws | dec` |
|
| 107 |
| `width()` | `0` |
|
| 108 |
| `precision()` | `6` |
|
| 109 |
+
| `fill()` | `widen(' ')` |
|
| 110 |
| `getloc()` | a copy of the value returned by `locale()` |
|
| 111 |
| `iarray` | a null pointer |
|
| 112 |
| `parray` | a null pointer |
|
| 113 |
|
| 114 |
|
|
|
|
| 127 |
|
| 128 |
*Requires:* If `tiestr` is not null, `tiestr` must not be reachable by
|
| 129 |
traversing the linked list of tied stream objects starting from
|
| 130 |
`tiestr->tie()`.
|
| 131 |
|
| 132 |
+
*Postconditions:* `tiestr == tie()`.
|
| 133 |
|
| 134 |
*Returns:* The previous value of `tie()`.
|
| 135 |
|
| 136 |
``` cpp
|
| 137 |
basic_streambuf<charT, traits>* rdbuf() const;
|
|
|
|
| 141 |
|
| 142 |
``` cpp
|
| 143 |
basic_streambuf<charT, traits>* rdbuf(basic_streambuf<charT, traits>* sb);
|
| 144 |
```
|
| 145 |
|
| 146 |
+
*Postconditions:* `sb == rdbuf()`.
|
| 147 |
|
| 148 |
*Effects:* Calls `clear()`.
|
| 149 |
|
| 150 |
*Returns:* The previous value of `rdbuf()`.
|
| 151 |
|
|
|
|
| 179 |
|
| 180 |
``` cpp
|
| 181 |
char_type fill(char_type fillch);
|
| 182 |
```
|
| 183 |
|
| 184 |
+
*Postconditions:* `traits::eq(fillch, fill())`.
|
| 185 |
|
| 186 |
*Returns:* The previous value of `fill()`.
|
| 187 |
|
| 188 |
``` cpp
|
| 189 |
basic_ios& copyfmt(const basic_ios& rhs);
|
|
|
|
| 204 |
stored outside the object `rhs` and those objects are destroyed
|
| 205 |
when `rhs` is destroyed, the newly stored pointer values are
|
| 206 |
altered to point at newly constructed copies of the objects;
|
| 207 |
3. calls each callback pair that was copied from `rhs` as
|
| 208 |
`(*fn)(copyfmt_event, *this, index)`;
|
| 209 |
+
4. calls `exceptions(rhs.exceptions())`.
|
| 210 |
|
| 211 |
+
[*Note 1*: The second pass through the callback pairs permits a copied
|
| 212 |
`pword` value to be zeroed, or to have its referent deep copied or
|
| 213 |
+
reference counted, or to have other special action taken. — *end note*]
|
| 214 |
|
| 215 |
*Postconditions:* The postconditions of this function are indicated in
|
| 216 |
Table [[tab:iostreams.copyfmt.effects]].
|
| 217 |
|
| 218 |
**Table: `basic_ios::copyfmt()` effects** <a id="tab:iostreams.copyfmt.effects">[tab:iostreams.copyfmt.effects]</a>
|
|
|
|
| 287 |
|
| 288 |
``` cpp
|
| 289 |
void clear(iostate state = goodbit);
|
| 290 |
```
|
| 291 |
|
| 292 |
+
*Postconditions:* If `rdbuf() != 0` then `state == rdstate()`; otherwise
|
| 293 |
`rdstate() == (state | ios_base::badbit)`.
|
| 294 |
|
| 295 |
*Effects:* If
|
| 296 |
`((state | (rdbuf() ? goodbit : badbit)) & exceptions()) == 0`, returns.
|
| 297 |
+
Otherwise, the function throws an object of class
|
| 298 |
`basic_ios::failure` ([[ios::failure]]), constructed with
|
| 299 |
*implementation-defined* argument values.
|
| 300 |
|
| 301 |
``` cpp
|
| 302 |
void setstate(iostate state);
|
|
|
|
| 338 |
|
| 339 |
``` cpp
|
| 340 |
void exceptions(iostate except);
|
| 341 |
```
|
| 342 |
|
| 343 |
+
*Postconditions:* `except == exceptions()`.
|
| 344 |
|
| 345 |
*Effects:* Calls `clear(rdstate())`.
|
| 346 |
|