tmp/tmpppvus039/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Overridden virtual functions <a id="spanbuf.virtuals">[[spanbuf.virtuals]]</a>
|
| 2 |
+
|
| 3 |
+
[*Note 1*: Because the underlying buffer is of fixed size, neither
|
| 4 |
+
`overflow`, `underflow`, nor `pbackfail` can provide useful
|
| 5 |
+
behavior. — *end note*]
|
| 6 |
+
|
| 7 |
+
``` cpp
|
| 8 |
+
pos_type seekoff(off_type off, ios_base::seekdir way,
|
| 9 |
+
ios_base::openmode which = ios_base::in | ios_base::out) override;
|
| 10 |
+
```
|
| 11 |
+
|
| 12 |
+
*Effects:* Alters the stream position within one or both of the
|
| 13 |
+
controlled sequences, if possible, as follows:
|
| 14 |
+
|
| 15 |
+
- If `ios_base::in` is set in `which`, positions the input sequence;
|
| 16 |
+
`xnext` is `gptr()`, `xbeg` is `eback()`.
|
| 17 |
+
- If `ios_base::out` is set in `which`, positions the output sequence;
|
| 18 |
+
`xnext` is `pptr()`, `xbeg` is `pbase()`.
|
| 19 |
+
|
| 20 |
+
If both `ios_base::in` and `ios_base::out` are set in `which` and `way`
|
| 21 |
+
is `ios_base::cur`, the positioning operation fails.
|
| 22 |
+
|
| 23 |
+
For a sequence to be positioned, if its next pointer `xnext` (either
|
| 24 |
+
`gptr()` or `pptr()`) is a null pointer and the new offset `newoff` as
|
| 25 |
+
computed below is nonzero, the positioning operation fails. Otherwise,
|
| 26 |
+
the function determines `baseoff` as a value of type `off_type` as
|
| 27 |
+
follows:
|
| 28 |
+
|
| 29 |
+
- `0` when `way` is `ios_base::beg`;
|
| 30 |
+
- `(pptr() - pbase())` for the output sequence, or `(gptr() - eback())`
|
| 31 |
+
for the input sequence when `way` is `ios_base::cur`;
|
| 32 |
+
- when `way` is `ios_base::end` :
|
| 33 |
+
- `(pptr() - pbase())` if `ios_base::out` is set in *mode* and
|
| 34 |
+
`ios_base::in` is not set in *mode*,
|
| 35 |
+
- `buf.size()` otherwise.
|
| 36 |
+
|
| 37 |
+
If `baseoff` + `off` would overflow, or if `baseoff` + `off` is less
|
| 38 |
+
than zero, or if `baseoff` + `off` is greater than *`buf`*`.size()`, the
|
| 39 |
+
positioning operation fails. Otherwise, the function computes
|
| 40 |
+
|
| 41 |
+
``` cpp
|
| 42 |
+
off_type newoff = baseoff + off;
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
and assigns `xbeg + newoff` to the next pointer `xnext`.
|
| 46 |
+
|
| 47 |
+
*Returns:* `pos_type(off_type(-1))` if the positioning operation fails;
|
| 48 |
+
`pos_type(newoff)` otherwise.
|
| 49 |
+
|
| 50 |
+
``` cpp
|
| 51 |
+
pos_type seekpos(pos_type sp, ios_base::openmode which = ios_base::in | ios_base::out) override;
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
*Effects:* Equivalent to:
|
| 55 |
+
|
| 56 |
+
``` cpp
|
| 57 |
+
return seekoff(off_type(sp), ios_base::beg, which);
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
``` cpp
|
| 61 |
+
basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n) override;
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
*Effects:* Equivalent to:
|
| 65 |
+
|
| 66 |
+
``` cpp
|
| 67 |
+
this->span(std::span<charT>(s, n));
|
| 68 |
+
return this;
|
| 69 |
+
```
|
| 70 |
+
|