tmp/tmphybyie1k/{from.md → to.md}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
#### `strstreambuf` overridden virtual functions <a id="depr.strstreambuf.virtuals">[[depr.strstreambuf.virtuals]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
-
int_type overflow(int_type c = EOF);
|
| 5 |
```
|
| 6 |
|
| 7 |
*Effects:* Appends the character designated by `c` to the output
|
| 8 |
sequence, if possible, in one of two ways:
|
| 9 |
|
|
@@ -21,36 +21,36 @@ available as a result of any call.
|
|
| 21 |
|
| 22 |
To make a write position available, the function reallocates (or
|
| 23 |
initially allocates) an array object with a sufficient number of
|
| 24 |
elements `n` to hold the current array object (if any), plus at least
|
| 25 |
one additional write position. How many additional write positions are
|
| 26 |
-
made available is otherwise unspecified. [^
|
| 27 |
pointer, the function calls `(*palloc)(n)` to allocate the new dynamic
|
| 28 |
array object. Otherwise, it evaluates the expression `new charT[n]`. In
|
| 29 |
either case, if the allocation fails, the function returns `EOF`.
|
| 30 |
Otherwise, it sets `allocated` in `strmode`.
|
| 31 |
|
| 32 |
To free a previously existing dynamic array object whose first element
|
| 33 |
address is `p`: If `pfree` is not a null pointer, the function calls
|
| 34 |
`(*pfree)(p)`. Otherwise, it evaluates the expression `delete[]p`.
|
| 35 |
|
| 36 |
-
If `strmode & dynamic == 0`, or if `strmode & frozen != 0`, the
|
| 37 |
-
cannot extend the array (reallocate it with greater length) to
|
| 38 |
-
write position available.
|
| 39 |
|
| 40 |
``` cpp
|
| 41 |
-
int_type pbackfail(int_type c = EOF);
|
| 42 |
```
|
| 43 |
|
| 44 |
Puts back the character designated by `c` to the input sequence, if
|
| 45 |
possible, in one of three ways:
|
| 46 |
|
| 47 |
- If `c != EOF`, if the input sequence has a putback position available,
|
| 48 |
and if `(char)c == gnext[-1]`, assigns `gnext - 1` to `gnext`. Returns
|
| 49 |
`c`.
|
| 50 |
- If `c != EOF`, if the input sequence has a putback position available,
|
| 51 |
-
and if `strmode
|
| 52 |
Returns `c`.
|
| 53 |
- If `c == EOF` and if the input sequence has a putback position
|
| 54 |
available, assigns `gnext - 1` to `gnext`. Returns a value other than
|
| 55 |
`EOF`.
|
| 56 |
|
|
@@ -59,11 +59,11 @@ Returns `EOF` to indicate failure.
|
|
| 59 |
*Remarks:* If the function can succeed in more than one of these ways,
|
| 60 |
it is unspecified which way is chosen. The function can alter the number
|
| 61 |
of putback positions available as a result of any call.
|
| 62 |
|
| 63 |
``` cpp
|
| 64 |
-
int_type underflow();
|
| 65 |
```
|
| 66 |
|
| 67 |
*Effects:* Reads a character from the *input sequence*, if possible,
|
| 68 |
without moving the stream position past it, as follows:
|
| 69 |
|
|
@@ -71,19 +71,19 @@ without moving the stream position past it, as follows:
|
|
| 71 |
signals success by returning `(unsigned char)*gnext`.
|
| 72 |
- Otherwise, if the current write next pointer `pnext` is not a null
|
| 73 |
pointer and is greater than the current read end pointer `gend`, makes
|
| 74 |
a *read position* available by assigning to `gend` a value greater
|
| 75 |
than `gnext` and no greater than `pnext`. Returns
|
| 76 |
-
`(unsigned char
|
| 77 |
|
| 78 |
Returns `EOF` to indicate failure.
|
| 79 |
|
| 80 |
*Remarks:* The function can alter the number of read positions available
|
| 81 |
as a result of any call.
|
| 82 |
|
| 83 |
``` cpp
|
| 84 |
-
pos_type seekoff(off_type off, seekdir way, openmode which = in | out);
|
| 85 |
```
|
| 86 |
|
| 87 |
*Effects:* Alters the stream position within one of the controlled
|
| 88 |
sequences, if possible, as indicated in
|
| 89 |
Table [[tab:future.seekoff.positioning]].
|
|
@@ -122,11 +122,11 @@ position, if possible. If the positioning operation fails, or if the
|
|
| 122 |
constructed object cannot represent the resultant stream position, the
|
| 123 |
return value is `pos_type(off_type(-1))`.
|
| 124 |
|
| 125 |
``` cpp
|
| 126 |
pos_type seekpos(pos_type sp, ios_base::openmode which
|
| 127 |
-
= ios_base::in | ios_base::out);
|
| 128 |
```
|
| 129 |
|
| 130 |
*Effects:* Alters the stream position within one of the controlled
|
| 131 |
sequences, if possible, to correspond to the stream position stored in
|
| 132 |
`sp` (as described below).
|
|
@@ -139,11 +139,11 @@ sequences, if possible, to correspond to the stream position stored in
|
|
| 139 |
For a sequence to be positioned, if its next pointer is a null pointer,
|
| 140 |
the positioning operation fails. Otherwise, the function determines
|
| 141 |
`newoff` from `sp.offset()`:
|
| 142 |
|
| 143 |
- If `newoff` is an invalid stream position, has a negative value, or
|
| 144 |
-
has a value greater than (`seekhigh
|
| 145 |
operation fails
|
| 146 |
- Otherwise, the function adds `newoff` to the beginning pointer `xbeg`
|
| 147 |
and stores the result in the next pointer `xnext`.
|
| 148 |
|
| 149 |
*Returns:* `pos_type(newoff)`, constructed from the resultant offset
|
|
@@ -151,11 +151,11 @@ the positioning operation fails. Otherwise, the function determines
|
|
| 151 |
position, if possible. If the positioning operation fails, or if the
|
| 152 |
constructed object cannot represent the resultant stream position, the
|
| 153 |
return value is `pos_type(off_type(-1))`.
|
| 154 |
|
| 155 |
``` cpp
|
| 156 |
-
streambuf<char>* setbuf(char* s, streamsize n);
|
| 157 |
```
|
| 158 |
|
| 159 |
*Effects:* Implementation defined, except that `setbuf(0, 0)` has no
|
| 160 |
effect.
|
| 161 |
|
|
|
|
| 1 |
#### `strstreambuf` overridden virtual functions <a id="depr.strstreambuf.virtuals">[[depr.strstreambuf.virtuals]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
+
int_type overflow(int_type c = EOF) override;
|
| 5 |
```
|
| 6 |
|
| 7 |
*Effects:* Appends the character designated by `c` to the output
|
| 8 |
sequence, if possible, in one of two ways:
|
| 9 |
|
|
|
|
| 21 |
|
| 22 |
To make a write position available, the function reallocates (or
|
| 23 |
initially allocates) an array object with a sufficient number of
|
| 24 |
elements `n` to hold the current array object (if any), plus at least
|
| 25 |
one additional write position. How many additional write positions are
|
| 26 |
+
made available is otherwise unspecified. [^2] If `palloc` is not a null
|
| 27 |
pointer, the function calls `(*palloc)(n)` to allocate the new dynamic
|
| 28 |
array object. Otherwise, it evaluates the expression `new charT[n]`. In
|
| 29 |
either case, if the allocation fails, the function returns `EOF`.
|
| 30 |
Otherwise, it sets `allocated` in `strmode`.
|
| 31 |
|
| 32 |
To free a previously existing dynamic array object whose first element
|
| 33 |
address is `p`: If `pfree` is not a null pointer, the function calls
|
| 34 |
`(*pfree)(p)`. Otherwise, it evaluates the expression `delete[]p`.
|
| 35 |
|
| 36 |
+
If `(strmode & dynamic) == 0`, or if `(strmode & frozen) != 0`, the
|
| 37 |
+
function cannot extend the array (reallocate it with greater length) to
|
| 38 |
+
make a write position available.
|
| 39 |
|
| 40 |
``` cpp
|
| 41 |
+
int_type pbackfail(int_type c = EOF) override;
|
| 42 |
```
|
| 43 |
|
| 44 |
Puts back the character designated by `c` to the input sequence, if
|
| 45 |
possible, in one of three ways:
|
| 46 |
|
| 47 |
- If `c != EOF`, if the input sequence has a putback position available,
|
| 48 |
and if `(char)c == gnext[-1]`, assigns `gnext - 1` to `gnext`. Returns
|
| 49 |
`c`.
|
| 50 |
- If `c != EOF`, if the input sequence has a putback position available,
|
| 51 |
+
and if `strmode & constant` is zero, assigns `c` to `*`\dcr`gnext`.
|
| 52 |
Returns `c`.
|
| 53 |
- If `c == EOF` and if the input sequence has a putback position
|
| 54 |
available, assigns `gnext - 1` to `gnext`. Returns a value other than
|
| 55 |
`EOF`.
|
| 56 |
|
|
|
|
| 59 |
*Remarks:* If the function can succeed in more than one of these ways,
|
| 60 |
it is unspecified which way is chosen. The function can alter the number
|
| 61 |
of putback positions available as a result of any call.
|
| 62 |
|
| 63 |
``` cpp
|
| 64 |
+
int_type underflow() override;
|
| 65 |
```
|
| 66 |
|
| 67 |
*Effects:* Reads a character from the *input sequence*, if possible,
|
| 68 |
without moving the stream position past it, as follows:
|
| 69 |
|
|
|
|
| 71 |
signals success by returning `(unsigned char)*gnext`.
|
| 72 |
- Otherwise, if the current write next pointer `pnext` is not a null
|
| 73 |
pointer and is greater than the current read end pointer `gend`, makes
|
| 74 |
a *read position* available by assigning to `gend` a value greater
|
| 75 |
than `gnext` and no greater than `pnext`. Returns
|
| 76 |
+
`(unsigned char)*gnext`.
|
| 77 |
|
| 78 |
Returns `EOF` to indicate failure.
|
| 79 |
|
| 80 |
*Remarks:* The function can alter the number of read positions available
|
| 81 |
as a result of any call.
|
| 82 |
|
| 83 |
``` cpp
|
| 84 |
+
pos_type seekoff(off_type off, seekdir way, openmode which = in | out) override;
|
| 85 |
```
|
| 86 |
|
| 87 |
*Effects:* Alters the stream position within one of the controlled
|
| 88 |
sequences, if possible, as indicated in
|
| 89 |
Table [[tab:future.seekoff.positioning]].
|
|
|
|
| 122 |
constructed object cannot represent the resultant stream position, the
|
| 123 |
return value is `pos_type(off_type(-1))`.
|
| 124 |
|
| 125 |
``` cpp
|
| 126 |
pos_type seekpos(pos_type sp, ios_base::openmode which
|
| 127 |
+
= ios_base::in | ios_base::out) override;
|
| 128 |
```
|
| 129 |
|
| 130 |
*Effects:* Alters the stream position within one of the controlled
|
| 131 |
sequences, if possible, to correspond to the stream position stored in
|
| 132 |
`sp` (as described below).
|
|
|
|
| 139 |
For a sequence to be positioned, if its next pointer is a null pointer,
|
| 140 |
the positioning operation fails. Otherwise, the function determines
|
| 141 |
`newoff` from `sp.offset()`:
|
| 142 |
|
| 143 |
- If `newoff` is an invalid stream position, has a negative value, or
|
| 144 |
+
has a value greater than (`seekhigh - seeklow`), the positioning
|
| 145 |
operation fails
|
| 146 |
- Otherwise, the function adds `newoff` to the beginning pointer `xbeg`
|
| 147 |
and stores the result in the next pointer `xnext`.
|
| 148 |
|
| 149 |
*Returns:* `pos_type(newoff)`, constructed from the resultant offset
|
|
|
|
| 151 |
position, if possible. If the positioning operation fails, or if the
|
| 152 |
constructed object cannot represent the resultant stream position, the
|
| 153 |
return value is `pos_type(off_type(-1))`.
|
| 154 |
|
| 155 |
``` cpp
|
| 156 |
+
streambuf<char>* setbuf(char* s, streamsize n) override;
|
| 157 |
```
|
| 158 |
|
| 159 |
*Effects:* Implementation defined, except that `setbuf(0, 0)` has no
|
| 160 |
effect.
|
| 161 |
|