| I/O manipulators | ||||
| Print functions(C++23) | ||||
| C-style I/O | ||||
| Buffers | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++20) | ||||
| Streams | ||||
| Abstractions | ||||
| File I/O | ||||
| String I/O | ||||
| Array I/O | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
| Synchronized Output | ||||
(C++20) | ||||
| Types | ||||
| Error category interface | ||||
(C++11) | ||||
(C++11) |
| Public member functions | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
| Protected member functions | ||||
basic_spanbuf::setbuf (C++23) | ||||
(C++23) | ||||
(C++23) | ||||
| Non-member functions | ||||
(C++23) |
protected: std::basic_streambuf<CharT, Traits>* setbuf( CharT*s,std::streamsize n) override; | (since C++23) | |
Makes thebasic_spanbuf perform I/O on the buffer[s, s+ n). Equivalently callsthis->span(std::span<CharT>(s, n)) and then returnsthis.
| Set bits in open mode (affecting pointers to get area) | Return value after setting | ||
|---|---|---|---|
| eback() | gptr() | egptr() | |
| std::ios_base::in | s | s | s+ n |
| Set bits in open mode (affecting pointers to put area) | Return value after setting | ||
| pbase() | pptr() | epptr() | |
| std::ios_base::out&&!std::ios_base::ate | s | s | s+ n |
| std::ios_base::out&&std::ios_base::ate | s | s+ n | s+ n |
This function is protected virtual, it may only be called throughpubsetbuf() or from member functions of a user-defined class derived fromstd::basic_spanbuf.
Contents |
| s | - | pointer to the firstCharT in the user-provided buffer |
| n | - | the number ofCharT elements in the user-provided buffer |
this
The deprecated stream bufferstd::strstreambuf or the boost.IOStreams deviceboost::basic_array can also implement I/O buffering over a user-providedchar array.
| This section is incomplete Reason: no example |
| invokessetbuf() (public member function of std::basic_streambuf<CharT,Traits>)[edit] | |
[virtual] | attempts to replace the controlled character sequence with an array (virtual protected member function of std::basic_stringbuf<CharT,Traits,Allocator>)[edit] |
[virtual] | attempts to replace the controlled character sequence with an array (virtual protected member function of std::strstreambuf)[edit] |