From Jason Turner

[streambuf.virtuals]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpvnphs721/{from.md → to.md} +27 -26
tmp/tmpvnphs721/{from.md → to.md} RENAMED
@@ -21,11 +21,11 @@ functions and to members of facets so obtained.
21
  basic_streambuf* setbuf(char_type* s, streamsize n);
22
  ```
23
 
24
  *Effects:* Influences stream buffering in a way that is defined
25
  separately for each class derived from `basic_streambuf` in this
26
- Clause ([[stringbuf.virtuals]], [[filebuf.virtuals]]).
27
 
28
  *Default behavior:* Does nothing. Returns `this`.
29
 
30
  ``` cpp
31
  pos_type seekoff(off_type off, ios_base::seekdir way,
@@ -33,12 +33,12 @@ pos_type seekoff(off_type off, ios_base::seekdir way,
33
  = ios_base::in | ios_base::out);
34
  ```
35
 
36
  *Effects:* Alters the stream positions within one or more of the
37
  controlled sequences in a way that is defined separately for each class
38
- derived from `basic_streambuf` in this Clause ([[stringbuf.virtuals]],
39
- [[filebuf.virtuals]]).
40
 
41
  *Default behavior:* Returns `pos_type(off_type(-1))`.
42
 
43
  ``` cpp
44
  pos_type seekpos(pos_type sp,
@@ -46,12 +46,12 @@ pos_type seekpos(pos_type sp,
46
  = ios_base::in | ios_base::out);
47
  ```
48
 
49
  *Effects:* Alters the stream positions within one or more of the
50
  controlled sequences in a way that is defined separately for each class
51
- derived from `basic_streambuf` in this Clause ([[stringbuf]],
52
- [[filebuf]]).
53
 
54
  *Default behavior:* Returns `pos_type(off_type(-1))`.
55
 
56
  ``` cpp
57
  int sync();
@@ -68,14 +68,15 @@ each derived class [[filebuf.virtuals]].
68
  *Default behavior:* Returns zero.
69
 
70
  ##### Get area <a id="streambuf.virt.get">[[streambuf.virt.get]]</a>
71
 
72
  ``` cpp
73
- streamsize showmanyc();\footnote{The morphemes of showmanyc\
74
- are ``es-how-many-see'', not ``show-manic''.}
75
  ```
76
 
 
 
77
  *Returns:* An estimate of the number of characters available in the
78
  sequence, or -1. If it returns a positive value, then successive calls
79
  to `underflow()` will not return `traits::eof()` until at least that
80
  number of characters have been extracted from the stream. If
81
  `showmanyc()` returns -1, then calls to `underflow()` or `uflow()` will
@@ -101,18 +102,10 @@ to `sbumpc()` would return `traits::eof()`.
101
 
102
  ``` cpp
103
  int_type underflow();
104
  ```
105
 
106
- *Remarks:* The public members of `basic_streambuf` call this virtual
107
- function only if `gptr()` is null or `gptr() >= egptr()`.
108
-
109
- *Returns:* `traits::to_int_type(c)`, where `c` is the first *character*
110
- of the *pending sequence*, without moving the input sequence position
111
- past it. If the pending sequence is null then the function returns
112
- `traits::eof()` to indicate failure.
113
-
114
  The *pending sequence* of characters is defined as the concatenation of
115
 
116
  - the empty sequence if `gptr()` is null, otherwise the characters in
117
  \[`gptr()`, `egptr()`), followed by
118
  - some (possibly empty) sequence of characters read from the input
@@ -138,12 +131,20 @@ that either
138
  in which case the characters in \[`eback()`, `gptr()`) agree with the
139
  last `gptr() - eback()` characters of the backup sequence, or
140
  - the characters in \[`gptr() - n`, `gptr()`) agree with the backup
141
  sequence (where `n` is the length of the backup sequence).
142
 
 
 
 
 
 
143
  *Default behavior:* Returns `traits::eof()`.
144
 
 
 
 
145
  ``` cpp
146
  int_type uflow();
147
  ```
148
 
149
  *Preconditions:* The constraints are the same as for `underflow()`,
@@ -151,26 +152,21 @@ except that the result character is transferred from the pending
151
  sequence to the backup sequence, and the pending sequence is not empty
152
  before the transfer.
153
 
154
  *Default behavior:* Calls `underflow()`. If `underflow()` returns
155
  `traits::eof()`, returns `traits::eof()`. Otherwise, returns the value
156
- of `traits::to_int_type(*gptr())` and increment the value of the next
157
  pointer for the input sequence.
158
 
159
  *Returns:* `traits::eof()` to indicate failure.
160
 
161
  ##### Putback <a id="streambuf.virt.pback">[[streambuf.virt.pback]]</a>
162
 
163
  ``` cpp
164
  int_type pbackfail(int_type c = traits::eof());
165
  ```
166
 
167
- *Remarks:* The public functions of `basic_streambuf` call this virtual
168
- function only when `gptr()` is null, `gptr() == eback()`, or
169
- `traits::eq(traits::to_char_type(c), gptr()[-1])` returns `false`. Other
170
- calls shall also satisfy that constraint.
171
-
172
  The *pending sequence* is defined as for `underflow()`, with the
173
  modifications that
174
 
175
  - If `traits::eq_int_type(c, traits::eof())` returns `true`, then the
176
  input sequence is backed up one character before the pending sequence
@@ -182,17 +178,22 @@ modifications that
182
  *Ensures:* On return, the constraints of `gptr()`, `eback()`, and
183
  `pptr()` are the same as for `underflow()`.
184
 
185
  *Returns:* `traits::eof()` to indicate failure. Failure may occur
186
  because the input sequence could not be backed up, or if for some other
187
- reason the pointers could not be set consistent with the constraints.
188
  `pbackfail()` is called only when put back has really failed.
189
 
190
  Returns some value other than `traits::eof()` to indicate success.
191
 
192
  *Default behavior:* Returns `traits::eof()`.
193
 
 
 
 
 
 
194
  ##### Put area <a id="streambuf.virt.put">[[streambuf.virt.put]]</a>
195
 
196
  ``` cpp
197
  streamsize xsputn(const char_type* s, streamsize n);
198
  ```
@@ -218,14 +219,10 @@ of
218
  - the empty sequence if `pbase()` is null, otherwise the
219
  `pptr() - pbase()` characters beginning at `pbase()`, followed by
220
  - the empty sequence if `traits::eq_int_type(c, traits::eof())` returns
221
  `true`, otherwise the sequence consisting of `c`.
222
 
223
- *Remarks:* The member functions `sputc()` and `sputn()` call this
224
- function in case that no room can be found in the put buffer enough to
225
- accommodate the argument character sequence.
226
-
227
  *Preconditions:* Every overriding definition of this virtual function
228
  obeys the following constraints:
229
 
230
  - The effect of consuming a character on the associated output sequence
231
  is specified.[^16]
@@ -245,5 +242,9 @@ obeys the following constraints:
245
  Otherwise, returns some value other than `traits::eof()` to indicate
246
  success.[^17]
247
 
248
  *Default behavior:* Returns `traits::eof()`.
249
 
 
 
 
 
 
21
  basic_streambuf* setbuf(char_type* s, streamsize n);
22
  ```
23
 
24
  *Effects:* Influences stream buffering in a way that is defined
25
  separately for each class derived from `basic_streambuf` in this
26
+ Clause [[stringbuf.virtuals]], [[filebuf.virtuals]].
27
 
28
  *Default behavior:* Does nothing. Returns `this`.
29
 
30
  ``` cpp
31
  pos_type seekoff(off_type off, ios_base::seekdir way,
 
33
  = ios_base::in | ios_base::out);
34
  ```
35
 
36
  *Effects:* Alters the stream positions within one or more of the
37
  controlled sequences in a way that is defined separately for each class
38
+ derived from `basic_streambuf` in this
39
+ Clause [[stringbuf.virtuals]], [[filebuf.virtuals]].
40
 
41
  *Default behavior:* Returns `pos_type(off_type(-1))`.
42
 
43
  ``` cpp
44
  pos_type seekpos(pos_type sp,
 
46
  = ios_base::in | ios_base::out);
47
  ```
48
 
49
  *Effects:* Alters the stream positions within one or more of the
50
  controlled sequences in a way that is defined separately for each class
51
+ derived from `basic_streambuf` in this
52
+ Clause [[stringbuf]], [[filebuf]].
53
 
54
  *Default behavior:* Returns `pos_type(off_type(-1))`.
55
 
56
  ``` cpp
57
  int sync();
 
68
  *Default behavior:* Returns zero.
69
 
70
  ##### Get area <a id="streambuf.virt.get">[[streambuf.virt.get]]</a>
71
 
72
  ``` cpp
73
+ streamsize showmanyc();
 
74
  ```
75
 
76
+ [^13]
77
+
78
  *Returns:* An estimate of the number of characters available in the
79
  sequence, or -1. If it returns a positive value, then successive calls
80
  to `underflow()` will not return `traits::eof()` until at least that
81
  number of characters have been extracted from the stream. If
82
  `showmanyc()` returns -1, then calls to `underflow()` or `uflow()` will
 
102
 
103
  ``` cpp
104
  int_type underflow();
105
  ```
106
 
 
 
 
 
 
 
 
 
107
  The *pending sequence* of characters is defined as the concatenation of
108
 
109
  - the empty sequence if `gptr()` is null, otherwise the characters in
110
  \[`gptr()`, `egptr()`), followed by
111
  - some (possibly empty) sequence of characters read from the input
 
131
  in which case the characters in \[`eback()`, `gptr()`) agree with the
132
  last `gptr() - eback()` characters of the backup sequence, or
133
  - the characters in \[`gptr() - n`, `gptr()`) agree with the backup
134
  sequence (where `n` is the length of the backup sequence).
135
 
136
+ *Returns:* `traits::to_int_type(c)`, where `c` is the first *character*
137
+ of the *pending sequence*, without moving the input sequence position
138
+ past it. If the pending sequence is null then the function returns
139
+ `traits::eof()` to indicate failure.
140
+
141
  *Default behavior:* Returns `traits::eof()`.
142
 
143
+ *Remarks:* The public members of `basic_streambuf` call this virtual
144
+ function only if `gptr()` is null or `gptr() >= egptr()`.
145
+
146
  ``` cpp
147
  int_type uflow();
148
  ```
149
 
150
  *Preconditions:* The constraints are the same as for `underflow()`,
 
152
  sequence to the backup sequence, and the pending sequence is not empty
153
  before the transfer.
154
 
155
  *Default behavior:* Calls `underflow()`. If `underflow()` returns
156
  `traits::eof()`, returns `traits::eof()`. Otherwise, returns the value
157
+ of `traits::to_int_type(*gptr())` and increments the value of the next
158
  pointer for the input sequence.
159
 
160
  *Returns:* `traits::eof()` to indicate failure.
161
 
162
  ##### Putback <a id="streambuf.virt.pback">[[streambuf.virt.pback]]</a>
163
 
164
  ``` cpp
165
  int_type pbackfail(int_type c = traits::eof());
166
  ```
167
 
 
 
 
 
 
168
  The *pending sequence* is defined as for `underflow()`, with the
169
  modifications that
170
 
171
  - If `traits::eq_int_type(c, traits::eof())` returns `true`, then the
172
  input sequence is backed up one character before the pending sequence
 
178
  *Ensures:* On return, the constraints of `gptr()`, `eback()`, and
179
  `pptr()` are the same as for `underflow()`.
180
 
181
  *Returns:* `traits::eof()` to indicate failure. Failure may occur
182
  because the input sequence could not be backed up, or if for some other
183
+ reason the pointers cannot be set consistent with the constraints.
184
  `pbackfail()` is called only when put back has really failed.
185
 
186
  Returns some value other than `traits::eof()` to indicate success.
187
 
188
  *Default behavior:* Returns `traits::eof()`.
189
 
190
+ *Remarks:* The public functions of `basic_streambuf` call this virtual
191
+ function only when `gptr()` is null, `gptr() == eback()`, or
192
+ `traits::eq(traits::to_char_type(c), gptr()[-1])` returns `false`. Other
193
+ calls shall also satisfy that constraint.
194
+
195
  ##### Put area <a id="streambuf.virt.put">[[streambuf.virt.put]]</a>
196
 
197
  ``` cpp
198
  streamsize xsputn(const char_type* s, streamsize n);
199
  ```
 
219
  - the empty sequence if `pbase()` is null, otherwise the
220
  `pptr() - pbase()` characters beginning at `pbase()`, followed by
221
  - the empty sequence if `traits::eq_int_type(c, traits::eof())` returns
222
  `true`, otherwise the sequence consisting of `c`.
223
 
 
 
 
 
224
  *Preconditions:* Every overriding definition of this virtual function
225
  obeys the following constraints:
226
 
227
  - The effect of consuming a character on the associated output sequence
228
  is specified.[^16]
 
242
  Otherwise, returns some value other than `traits::eof()` to indicate
243
  success.[^17]
244
 
245
  *Default behavior:* Returns `traits::eof()`.
246
 
247
+ *Remarks:* The member functions `sputc()` and `sputn()` call this
248
+ function in case that no room can be found in the put buffer enough to
249
+ accommodate the argument character sequence.
250
+