Files
cppdraft_translate/cppdraft/streambuf/virt/buffer.md
2025-10-25 03:02:53 +03:00

3.7 KiB

[streambuf.virt.buffer]

31 Input/output library [input.output]

31.6 Stream buffers [stream.buffers]

31.6.3 Class template basic_streambuf [streambuf]

31.6.3.5 Virtual functions [streambuf.virtuals]

31.6.3.5.2 Buffer management and positioning [streambuf.virt.buffer]

🔗

basic_streambuf* setbuf(char_type* s, streamsize n);

1

#

Effects: Influences stream buffering in a way that is defined separately for each class derived frombasic_streambuf in this Clause ([stringbuf.virtuals], [filebuf.virtuals]).

2

#

Default behavior: Does nothing.

Returnsthis.

🔗

pos_type seekoff(off_type off, ios_base::seekdir way, ios_base::openmode which = ios_base::in | ios_base::out);

3

#

Effects: Alters the stream positions within one or more of the controlled sequences in a way that is defined separately for each class derived frombasic_streambuf in this Clause ([stringbuf.virtuals], [filebuf.virtuals]).

4

#

Default behavior: Returnspos_type(off_type(-1)).

🔗

pos_type seekpos(pos_type sp, ios_base::openmode which = ios_base::in | ios_base::out);

5

#

Effects: Alters the stream positions within one or more of the controlled sequences in a way that is defined separately for each class derived frombasic_streambuf in this Clause ([stringbuf], [filebuf]).

6

#

Default behavior: Returnspos_type(off_type(-1)).

🔗

int sync();

7

#

Effects: Synchronizes the controlled sequences with the arrays.

That is, ifpbase() is non-null the characters betweenpbase() andpptr() are written to the controlled sequence.

The pointers may then be reset as appropriate.

8

#

Returns: -1 on failure.

What constitutes failure is determined by each derived class ([filebuf.virtuals]).

9

#

Default behavior: Returns zero.