__GNU_CXX::STDIO_FILEBUF(3)
โจ NAME โจ</p>
__gnu_cxx::stdio_filebuf< _CharT, _Traits > โ bestie, this one is literally the compatibility layer for C/POSIX. That's it, that's the whole vibe. ๐ซถ
This is page __gnu_cxx:..., _Traits >(3) from the Library Functions Manual. ๐
๐ธ SYNOPSIS ๐ธ
#include <stdio_filebuf.h>
Inherits std::basic_filebuf< _CharT, _Traits >. Yes, it's giving nepo baby energy but make it โจlegitimate inheritanceโจ.
๐ Public Types
typedef codecvt< char_type, char, __state_type > __codecvt_typetypedef __basic_file< char > __file_typetypedef basic_filebuf< char_type, traits_type > __filebuf_typetypedef traits_type::state_type __state_typetypedef basic_streambuf< char_type, traits_type > __streambuf_typetypedef _CharT char_typetypedef traits_type::int_type int_typetypedef traits_type::off_type off_typetypedef traits_type::pos_type pos_typetypedef std::size_t size_ttypedef _Traits traits_type
๐ฆ Public Member Functions
stdio_filebuf ()stdio_filebuf (int __fd, std::ios_base::openmode __mode, size_t __size=static_cast< size_t >(BUFSIZ))stdio_filebuf (std::__c_file *__f, std::ios_base::openmode __mode, size_t __size=static_cast< size_t >(BUFSIZ))stdio_filebuf (stdio_filebuf &&)=defaultvirtual ~stdio_filebuf ()__filebuf_type * close ()โ closes the currently associated file. bye bestie ๐int fd ()std::__c_file * file ()locale getloc () constโ locale access. the way it just tells you the localeโฆ iconic.streamsize in_avail ()โ looking ahead into the stream. it's giving psychic ๐ฎbool is_open () const throw ()โ returnstrueif the external file is open.template<typename _Path> _If_fs_path< _Path, __filebuf_type * > open (const _Path &__s, ios_base::openmode __mode)โ opens an external file.__filebuf_type * open (const char *__s, ios_base::openmode __mode)โ opens an external file.__filebuf_type * open (const std::string &__s, ios_base::openmode __mode)โ opens an external file.stdio_filebuf & operator= (stdio_filebuf &&)=defaultlocale pubimbue (const locale &__loc)โ entry point forimbue().int_type sbumpc ()โ getting the next character.int_type sgetc ()โ getting the next character.streamsize sgetn (char_type *__s, streamsize __n)โ entry point forxsgetn.int_type snextc ()โ getting the next character.int_type sputbackc (char_type __c)โ pushing characters back into the input stream.int_type sputc (char_type __c)โ entry point for all single-character output functions.streamsize sputn (const char_type *__s, streamsize __n)โ entry point for all single-character output functions.int_type sungetc ()โ moving backwards in the input stream.void swap (stdio_filebuf &__fb)void swap (basic_filebuf &)basic_streambuf * pubsetbuf (char_type *__s, streamsize __n)โ entry points for derived buffer functions.pos_type pubseekoff (off_type __off, ios_base::seekdir __way, ios_base::openmode __mode=ios_base::in|ios_base::out)โ alters the stream position.pos_type pubseekpos (pos_type __sp, ios_base::openmode __mode=ios_base::in|ios_base::out)โ alters the stream position.int pubsync ()โ calls virtual sync function.
๐ง Protected Member Functions
void __safe_gbump (streamsize __n)void __safe_pbump (streamsize __n)void _M_allocate_internal_buffer ()bool _M_convert_to_external (char_type *, streamsize)void _M_create_pback ()void _M_destroy_internal_buffer () throw ()void _M_destroy_pback () throw ()int _M_get_ext_pos (__state_type &__state)pos_type _M_seek (off_type __off, ios_base::seekdir __way, __state_type __state)void _M_set_buffer (streamsize __off)bool _M_terminate_output ()void gbump (int __n)โ moving the read position.virtual void imbue (const locale &__loc)โ changes translations.virtual int_type overflow (int_type __c=_Traits::eof())โ consumes data from the buffer; writes to the controlled sequence.virtual int_type pbackfail (int_type __c=_Traits::eof())โ tries to back up the input sequence.void pbump (int __n)โ moving the write position.virtual pos_type seekoff (off_type __off, ios_base::seekdir __way, ios_base::openmode __mode=ios_base::in|ios_base::out)โ alters the stream positions.virtual pos_type seekpos (pos_type __pos, ios_base::openmode __mode=ios_base::in|ios_base::out)โ alters the stream positions.virtual __streambuf_type * setbuf (char_type *__s, streamsize __n)โ manipulates the buffer.void setg (char_type *__gbeg, char_type *__gnext, char_type *__gend)โ setting the three read area pointers.void setp (char_type *__pbeg, char_type *__pend)โ setting the three write area pointers.virtual streamsize showmanyc ()โ investigating the data available.void swap (basic_streambuf &__sb)virtual int sync ()โ synchronizes the buffer arrays with the controlled sequences.virtual int_type uflow ()โ fetches more data from the controlled sequence.virtual int_type underflow ()โ fetches more data from the controlled sequence.virtual streamsize xsgetn (char_type *__s, streamsize __n)โ multiple character extraction.virtual streamsize xsputn (const char_type *__s, streamsize __n)โ multiple character insertion.char_type * eback () constโ access to the get area.char_type * gptr () constโ access to the get area.char_type * egptr () constโ access to the get area.char_type * pbase () constโ access to the put area.char_type * pptr () constโ access to the put area.char_type * epptr () constโ access to the put area.
๐ Protected Attributes
char_type * _M_bufโ pointer to the beginning of internal buffer.bool _M_buf_allocatedlocale _M_buf_localeโ current locale setting.size_t _M_buf_sizeconst __codecvt_type * _M_codecvtchar * _M_ext_bufstreamsize _M_ext_buf_sizechar * _M_ext_endconst char * _M_ext_next__file_type _M_filechar_type * _M_in_begโ start of get area.char_type * _M_in_curโ current read area.char_type * _M_in_endโ end of get area.__c_lock _M_lockios_base::openmode _M_modeโ place to stashin || out || in | outsettings for currentfilebuf.char_type * _M_out_begโ start of put area.char_type * _M_out_curโ current put area.char_type * _M_out_endโ end of put area.bool _M_reading__state_type _M_state_beg__state_type _M_state_cur__state_type _M_state_lastbool _M_writingchar_type _M_pbackchar_type * _M_pback_cur_savechar_type * _M_pback_end_savebool _M_pback_init
๐ Detailed Description ๐
template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
class __gnu_cxx::stdio_filebuf< _CharT, _Traits >
Provides a layer of compatibility for C/POSIX. ๐
Okay so here's the tea, bestie: this GNU extension hands you extensions for working with standard C FILE*'s and POSIX file descriptors. The catch? you have to instantiate it yourself, with the type of character used in the file stream. Like, e.g., stdio_filebuf<char>. No auto-magic, you're the main character here. ๐
๐ Constructor & Destructor Documentation ๐
stdio_filebuf () [inline]
template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
__gnu_cxx::stdio_filebuf< _CharT, _Traits >::stdio_filebuf ()
Deferred initialization. It's giving "we'll deal with it later" energy and honestly? relatable. ๐
References std::basic_filebuf< _CharT, _Traits >::basic_filebuf().
stdio_filebuf (int __fd, std::ios_base::openmode __mode, size_t __size = static_cast<size_t>( BUFSIZ ))
template<typename _CharT, typename _Traits>
__gnu_cxx::stdio_filebuf< _CharT, _Traits >::stdio_filebuf (int __fd,
std::ios_base::openmode __mode,
size_t __size = static_cast<size_t>( BUFSIZ ))
Parameters
__fdโ an open file descriptor.__modeโ same meaning as in a standardfilebuf.__sizeโ optimal or preferred size of internal buffer, in chars.
This constructor associates a file stream buffer with an open POSIX file descriptor. Heads up: the file descriptor will be automatically closed when the stdio_filebuf is closed/destroyed. So like, don't go double-closing it, that's not the vibe. ๐
References std::basic_filebuf< _CharT, _Traits >::_M_buf_size, std::basic_filebuf< _CharT, _Traits >::_M_mode, std::basic_filebuf< _CharT, _Traits >::_M_reading, std::basic_filebuf< _CharT, _Traits >::_M_set_buffer(), and std::basic_filebuf< _CharT, _Traits >::is_open().
stdio_filebuf (std::__c_file * __f, std::ios_base::openmode __mode, size_t __size = static_cast<size_t>( BUFSIZ ))
template<typename _CharT, typename _Traits>
__gnu_cxx::stdio_filebuf< _CharT, _Traits >::stdio_filebuf (std::__c_file * __f,
std::ios_base::openmode __mode,
size_t __size = static_cast<size_t>( BUFSIZ ))
Parameters
__fโ an openFILE*.__modeโ same meaning as in a standardfilebuf.__sizeโ optimal or preferred size of internal buffer, in chars. Defaults to system'sBUFSIZ.
This constructor associates a file stream buffer with an open C FILE*. And here's the plot twist, bestie: the FILE* will not be automatically closed when the stdio_filebuf is closed/destroyed. She's independent, she doesn't need you to clean up after her. ๐
References std::basic_filebuf< _CharT, _Traits >::_M_buf_size, std::basic_filebuf< _CharT, _Traits >::_M_mode, std::basic_filebuf< _CharT, _Traits >::_M_reading, std::basic_filebuf< _CharT, _Traits >::_M_set_buffer(), and std::basic_filebuf< _CharT, _Traits >::is_open().
~stdio_filebuf () [virtual]
template<typename _CharT, typename _Traits>
__gnu_cxx::stdio_filebuf< _CharT, _Traits >::~stdio_filebuf ()
Closes the external data stream if the file descriptor constructor was used. (Remember the FILE* one? Yeah, that one stays open. Different girl, different rules. โจ)
โญ Member Function Documentation โญ
_M_create_pback () [inline], [protected], [inherited]
template<typename _CharT, typename _Traits>
void std::basic_filebuf< _CharT, _Traits >::_M_create_pback ()
Initializes pback buffers, and moves normal buffers to safety.
Assumptions: _M_in_cur has already been moved back.
Referenced by pbackfail().
_M_destroy_pback () [inline], [protected], [inherited]
template<typename _CharT, typename _Traits>
void std::basic_filebuf< _CharT, _Traits >::_M_destroy_pback ()
Deactivates pback buffer contents, and restores normal buffer.
Assumptions: the pback buffer has only moved forward.
Referenced by overflow(), seekoff(), seekpos(), underflow(), and xsgetn().
_M_set_buffer (streamsize __off) [inline], [protected], [inherited]
template<typename _CharT, typename _Traits>
void std::basic_filebuf< _CharT, _Traits >::_M_set_buffer (streamsize __off)
This function sets the pointers of the internal buffer, both get and put areas. Typically:
__off == egptr() - eback() upon underflow/uflow (read mode);
__off == 0 upon overflow (write mode);
__off == -1 upon open, setbuf, seekoff/pos (uncommitted mode).
NB:epptr() - pbase() == _M_buf_size - 1, since_M_buf_sizereflects the actual allocated memory and the last cell is reserved for the overflow char of a full put area. ๐ (yes, they really do reserve a whole cell for that one dramatic moment, and honestly? iconic.)
Referenced by __gnu_cxx::stdio_filebuf< _CharT, _Traits >::stdio_filebuf(), __gnu_cxx::stdio_filebuf< _CharT, _Traits >::stdio_filebuf(), close(), imbue(), open(), overflow(), pbackfail(), underflow(), xsgetn(), and xsputn().
to be continued, bestieโฆ more parts incoming ๐
๐ธ close() โ say bye to the file, bestie
template<typename _CharT, typename _Traits>
basic_filebuf< _CharT, _Traits >::__filebuf_type *
std::basic_filebuf< _CharT, _Traits >::close()
[inherited]
Ok so this one closes the currently associated file. That's it, that's the job. ๐
Returns: this on success, NULL on failure ๐ญ
If there's no file currently open, this function immediately fails โ no file, no closing, sorry babe.
If a put buffer area exists, overflow(eof) gets called to flush all the characters out. Then the file is closed. If any of those operations fail, this function fails too.
References: basic_filebuf(), _M_mode, _M_pback_init, _M_reading, _M_set_buffer(), and is_open().
Referenced by: std::basic_filebuf< char_type, traits_type >::~basic_filebuf(), and open().
๐ฆ eback() โ where the get area begins
template<typename _CharT, typename _Traits>
char_type *
std::basic_streambuf< _CharT, _Traits >::eback() const
[inline], [protected], [inherited]
Access to the get area, bestie. These functions are only available to other protected functions, including derived classes โ so like, not for the general public, it's giving VIP section energy ๐
eback()returns the beginning pointer for the input sequencegptr()returns the next pointer for the input sequenceegptr()returns the end pointer for the input sequence
Referenced by: std::basic_filebuf< char_type, traits_type >::_M_destroy_pback(), std::basic_filebuf< _CharT, _Traits >::imbue(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(), std::basic_filebuf< _CharT, _Traits >::pbackfail(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::pbackfail(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekpos(), std::basic_streambuf< char_type, traits_type >::sputbackc(), std::basic_streambuf< char_type, traits_type >::sungetc(), std::basic_filebuf< _CharT, _Traits >::underflow(), and std::basic_filebuf< _CharT, _Traits >::xsgetn().
๐ egptr() โ where the get area ends
template<typename _CharT, typename _Traits>
char_type *
std::basic_streambuf< _CharT, _Traits >::egptr() const
[inline], [protected], [inherited]
Access to the get area again, same rules: only other protected functions and derived classes get to peek ๐
eback()returns the beginning pointer for the input sequencegptr()returns the next pointer for the input sequenceegptr()returns the end pointer for the input sequence
Referenced by: std::basic_filebuf< char_type, traits_type >::_M_create_pback(), std::basic_streambuf< char_type, traits_type >::in_avail(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(), std::basic_streambuf< char_type, traits_type >::sbumpc(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekpos(), std::basic_streambuf< char_type, traits_type >::sgetc(), std::basic_filebuf< _CharT, _Traits >::showmanyc(), std::basic_stringbuf< char >::showmanyc(), std::basic_filebuf< _CharT, _Traits >::underflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::underflow(), std::wbuffer_convert< _Codecvt, _Elem, _Tr >::underflow(), std::basic_filebuf< _CharT, _Traits >::xsgetn(), and xsgetn().
โจ epptr() โ where the put area ends
template<typename _CharT, typename _Traits>
char_type *
std::basic_streambuf< _CharT, _Traits >::epptr() const
[inline], [protected], [inherited]
Now we're on the put area (output side, main character energy ๐). Same deal โ only other protected functions and derived classes, no walk-ins.
pbase()returns the beginning pointer for the output sequencepptr()returns the next pointer for the output sequenceepptr()returns the end pointer for the output sequence
Referenced by: std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekpos(), std::basic_streambuf< char_type, traits_type >::sputc(), std::basic_filebuf< _CharT, _Traits >::xsputn(), and xsputn().
๐ fd() โ the raw file descriptor, unlocked ๐
template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
int
__gnu_cxx::stdio_filebuf< _CharT, _Traits >::fd()
[inline]
Returns: The underlying file descriptor.
Once you're associated with an external data stream, this function lets you get at the underlying POSIX file descriptor. But listen โ there is no way for the library to track what you do with the descriptor, so be careful. Fr fr. It's giving handing your bestie the aux and then leaving the room ๐
๐ง file() โ the FILE*, also unlocked
template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
std::__c_file *
__gnu_cxx::stdio_filebuf< _CharT, _Traits >::file()
[inline]
Returns: The underlying FILE*.
This one gets you the underlying "C" file pointer. And again โ there is no way for the library to track what you do with the file, so be careful. Same warning, same energy, we love a consistent queen ๐
๐ gbump() โ scoot the read position forward
template<typename _CharT, typename _Traits>
void
std::basic_streambuf< _CharT, _Traits >::gbump(int __n)
[inline], [protected], [inherited]
Moving the read position, that's the whole vibe.
Parameters:
__nโ The delta by which to move.
This just advances the read position without returning any data. Like scrolling past a post without double-tapping. No cap.
Referenced by: std::basic_filebuf< _CharT, _Traits >::pbackfail(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::pbackfail(), std::basic_streambuf< char_type, traits_type >::sbumpc(), std::basic_streambuf< char_type, traits_type >::sputbackc(), std::basic_streambuf< char_type, traits_type >::sungetc(), std::basic_streambuf< char_type, traits_type >::uflow(), and std::basic_filebuf< _CharT, _Traits >::xsgetn().
๐ getloc() โ which locale are we in rn?
template<typename _CharT, typename _Traits>
locale
std::basic_streambuf< _CharT, _Traits >::getloc() const
[inline], [inherited]
Locale access, periodt.
Returns: The current locale in effect.
If pubimbue(loc) has been called, then the most recent loc is returned. Otherwise the global locale in effect at the time of construction gets returned. So it's like, either the new vibe you set or the one you were born with ๐ฆ
Referenced by: std::basic_streambuf< char_type, traits_type >::pubimbue().
๐ธ gptr() โ the next pointer for the input sequence
template<typename _CharT, typename _Traits>
char_type *
std::basic_streambuf< _CharT, _Traits >::gptr() const
[inline], [protected], [inherited]
Get area access, third time's the charm โจ Protected-only, derived classes and other protected functions, you know the drill.
eback()returns the beginning pointer for the input sequencegptr()returns the next pointer for the input sequenceegptr()returns the end pointer for the input sequence
Referenced by: std::basic_filebuf< char_type, traits_type >::_M_create_pback(), std::basic_filebuf< char_type, traits_type >::_M_destroy_pback(), std::basic_filebuf< _CharT, _Traits >::imbue(), std::basic_streambuf< char_type, traits_type >::in_avail(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(), std::basic_filebuf< _CharT, _Traits >::pbackfail(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::pbackfail(), std::basic_streambuf< char_type, traits_type >::sbumpc(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_streambuf< char_type, traits_type >::sgetc(), std::basic_filebuf< _CharT, _Traits >::showmanyc(), std::basic_stringbuf< char >::showmanyc(), std::basic_streambuf< char_type, traits_type >::sputbackc(), std::basic_streambuf< char_type, traits_type >::sungetc(), std::basic_streambuf< char_type, traits_type >::uflow(), std::basic_filebuf< _CharT, _Traits >::underflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::underflow(), std::wbuffer_convert< _Codecvt, _Elem, _Tr >::underflow(), std::basic_filebuf< _CharT, _Traits >::xsgetn(), and xsgetn().
๐ฆ imbue() โ new locale, who dis
template<typename _CharT, typename _Traits>
void
std::basic_filebuf< _CharT, _Traits >::imbue(const locale & __loc)
[protected], [virtual], [inherited]
Changes translations. Slay.
Parameters:
__locโ A new locale.
Translations done during I/O that depend on the current locale get swapped out by this call. The standard adds: "Between invocations of this function a class derived from streambuf can safely cache results of calls to locale functions and to members of facets so obtained."
Note: Base class version does nothing. Literally nothing. It's giving "I showed up but I'm not participating" ๐
Reimplemented from: std::basic_streambuf< _CharT, _Traits >.
References: _M_ext_buf, _M_ext_next, _M_mode, _M_reading, _M_set_buffer(), std::ios_base::cur, std::basic_streambuf< _CharT, _Traits >::eback(), std::basic_streambuf< _CharT, _Traits >::gptr(), is_open(), and seekoff().
โญ in_avail() โ peeking ahead into the stream
template<typename _CharT, typename _Traits>
streamsize
std::basic_streambuf< _CharT, _Traits >::in_avail()
[inline], [inherited]
Looking ahead into the stream, lowkey the most useful thing here ๐
Returns: The number of characters available.
If a read position is available, it returns the number of characters available for reading before the buffer must be refilled. Otherwise it returns the derived showmanyc().
๐ฅ is_open() โ bestie check: is the file even open?
template<typename _CharT, typename _Traits>
bool
std::basic_filebuf< _CharT, _Traits >::is_open() const
[inline], [nodiscard], [inherited]
Returns true if the external file is open. That's it. Short, sweet, iconic.
Referenced by: __gnu_cxx::stdio_filebuf< _CharT, _Traits >::stdio_filebuf(), __gnu_cxx::stdio_filebuf< _CharT, _Traits >::stdio_filebuf(), close(), imbue(), open(), seekoff(), seekpos(), setbuf(), and showmanyc().
๐ง open() โ the filesystem::path flavour
template<typename _CharT, typename _Traits>
template<typename _Path>
_If_fs_path< _Path, __filebuf_type * >
std::basic_filebuf< _CharT, _Traits >::open(const _Path & __s, ios_base::openmode __mode)
[inline], [inherited]
Opens an external file ๐
Parameters:
__sโ The name of the file, as afilesystem::path.__modeโ The open mode flags.
Returns: this on success, NULL on failure.
๐ open() โ the const char * flavour
template<typename _CharT, typename _Traits>
basic_filebuf< _CharT, _Traits >::__filebuf_type *
std::basic_filebuf< _CharT, _Traits >::open(const char * __s, ios_base::openmode __mode)
[inherited]
Opens an external file ๐ (yes, again, different signature, don't @ me)
Parameters:
__sโ The name of the file.__modeโ The open mode flags.
Returns: this on success, NULL on failure.
If a file is already open, this function immediately fails โ one file at a time, we're monogamous here ๐ Otherwise it tries to open the file named __s using the flags given in __mode.
Table 92, adapted here, gives the relation between openmode combinations and the equivalent fopen() flags. (NB: lines app, in|out|app, in|app, binary|app, binary|in|out|app, and binary|in|app per DR 596)
That table tho โ it's the whole vibe of "which ios_base flag combo gives you which stdio mode". Read it like a little cheat sheet, bestie ๐
:
+---------------------------------------------------------+
| ios_base Flag combination stdio equivalent |
|binary in out trunc app |
+---------------------------------------------------------+
| + w |
| + + a |
| + a |
| + + w |
| + r |
| + + r+ |
| + + + w+ |
| + + + a+ |
| + + a+ |
+---------------------------------------------------------+
| + + wb |
| + + + ab |
| + + ab |
| + + + wb |
| + + rb |
| + + + r+b |
| + + + + w+b |
| + + + + a+b |
| + + + a+b |
+---------------------------------------------------------+
References _M_mode, _M_reading, _M_set_buffer(), std::ios_base::ate, close(), std::ios_base::end, is_open(), and seekoff().
Referenced by std::basic_filebuf< char_type, traits_type >::open(), and std::basic_filebuf< char_type, traits_type >::open().
๐ฆ template<typename _CharT, typename _Traits> __filebuf_type * std::basic_filebuf< _CharT, _Traits >::open (const std::string & __s, ios_base::openmode __mode) [inline], [inherited]
Opens an external file. Yes babe, it literally opens the file for you ๐ซถ
Parameters
__sโ The name of the file.__modeโ The open mode flags.
Returns
this on success, NULL on failure ๐ญ
๐ธ template<typename _CharT, typename _Traits> basic_filebuf< _CharT, _Traits >::int_type std::basic_filebuf< _CharT, _Traits >::overflow (int_type __c = _Traits::eof()) [protected], [virtual], [inherited]
Consumes data from the buffer; writes to the controlled sequence. It's giving "the buffer is full, time to flush" energy โจ
Parameters
__cโ An additional character to consume.
Returns
eof() to indicate failure, something else (usually __c, or not_eof())
Informally, this function is called when the output buffer is full (or does not exist, as buffering need not actually be done). If a buffer exists, it is consumed, with some effect on the controlled sequence. (Typically, the buffer is written out to the sequence verbatim.) In either case, the character c is also written out, if __c is not eof().
For a formal definition of this function, see a good text such as Langer & Kreft, or [27.5.2.4.5]/3-7.
A functioning output streambuf can be created by overriding only this function (no buffer area will be used).
Note โ Base class version does nothing, returns eof().
Reimplemented from std::basic_streambuf< _CharT, _Traits >.
References _M_buf_size, _M_destroy_pback(), _M_mode, _M_reading, _M_set_buffer(), std::ios_base::app, std::ios_base::cur, std::ios_base::out, std::basic_streambuf< _CharT, _Traits >::pbase(), std::basic_streambuf< _CharT, _Traits >::pbump(), and std::basic_streambuf< _CharT, _Traits >::pptr().
Referenced by pbackfail(), sync(), underflow(), and xsgetn().
๐ template<typename _CharT, typename _Traits> basic_filebuf< _CharT, _Traits >::int_type std::basic_filebuf< _CharT, _Traits >::pbackfail (int_type __c = _Traits::eof()) [protected], [virtual], [inherited]
Tries to back up the input sequence. Rewind, but make it a struggle ๐ญ
Parameters
__cโ The character to be inserted back into the sequence.
Returns
eof() on failure, some other value on success
Postcondition
The constraints of gptr(), eback(), and pptr() are the same as for underflow().
Note โ Base class version does nothing, returns eof().
Reimplemented from std::basic_streambuf< _CharT, _Traits >.
References _M_create_pback(), _M_mode, _M_pback_init, _M_reading, _M_set_buffer(), std::ios_base::cur, std::basic_streambuf< _CharT, _Traits >::eback(), std::basic_streambuf< _CharT, _Traits >::gbump(), std::basic_streambuf< _CharT, _Traits >::gptr(), std::ios_base::in, overflow(), seekoff(), and underflow().
โจ template<typename _CharT, typename _Traits> char_type * std::basic_streambuf< _CharT, _Traits >::pbase () const [inline], [protected], [inherited]
Access to the put area. These functions are only available to other protected functions, including derived classes.
pbase()returns the beginning pointer for the output sequencepptr()returns the next pointer for the output sequenceepptr()returns the end pointer for the output sequence
Referenced by std::basic_filebuf< _CharT, _Traits >::overflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(), std::basic_filebuf< _CharT, _Traits >::seekoff(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekpos(), std::basic_stringbuf< char >::str(), std::basic_filebuf< _CharT, _Traits >::sync(), and std::basic_filebuf< _CharT, _Traits >::xsputn().
๐ template<typename _CharT, typename _Traits> void std::basic_streambuf< _CharT, _Traits >::pbump (int __n) [inline], [protected], [inherited]
Moving the write position. Little scoot, no data returned ๐ฆ
Parameters
__nโ The delta by which to move.
This just advances the write position without returning any data.
Referenced by std::basic_filebuf< _CharT, _Traits >::overflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(), and std::basic_streambuf< char_type, traits_type >::sputc().
๐ template<typename _CharT, typename _Traits> char_type * std::basic_streambuf< _CharT, _Traits >::pptr () const [inline], [protected], [inherited]
Access to the put area. These functions are only available to other protected functions, including derived classes.
pbase()returns the beginning pointer for the output sequencepptr()returns the next pointer for the output sequenceepptr()returns the end pointer for the output sequence
Referenced by std::basic_filebuf< _CharT, _Traits >::overflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(), std::basic_filebuf< _CharT, _Traits >::seekoff(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_streambuf< char_type, traits_type >::sputc(), std::basic_filebuf< _CharT, _Traits >::sync(), std::basic_filebuf< _CharT, _Traits >::xsputn(), and xsputn().
๐ template<typename _CharT, typename _Traits> locale std::basic_streambuf< _CharT, _Traits >::pubimbue (const locale & __loc) [inline], [inherited]
Entry point for imbue(). The public-facing bestie that hands off to the real one ๐
Parameters
__locโ The new locale.
Returns
The previous locale.
Calls the derived imbue(__loc).
โญ template<typename _CharT, typename _Traits> pos_type std::basic_streambuf< _CharT, _Traits >::pubseekoff (off_type __off, ios_base::seekdir __way, ios_base::openmode __mode = ios_base::in | ios_base::out) [inline], [inherited]
Alters the stream position. Glow-up for the stream's location ๐
Parameters
__offโ Offset.__wayโ Value forios_base::seekdir.__modeโ Value forios_base::openmode.
Calls virtual seekoff function.
๐ template<typename _CharT, typename _Traits> pos_type std::basic_streambuf< _CharT, _Traits >::pubseekpos (pos_type __sp, ios_base::openmode __mode = ios_base::in | ios_base::out) [inline], [inherited]
Alters the stream position.
Parameters
__spโ Position__modeโ Value forios_base::openmode.
Calls virtual seekpos function.
๐ง template<typename _CharT, typename _Traits> basic_streambuf * std::basic_streambuf< _CharT, _Traits >::pubsetbuf (char_type * __s, streamsize __n) [inline], [inherited]
Entry points for derived buffer functions. The public versions of pubfoo dispatch to the protected derived foo member functions, passing the arguments (if any) and returning the result unchanged. So pub-prefixed = the front door, no cap ๐ซถ
๐ template<typename _CharT, typename _Traits> int std::basic_streambuf< _CharT, _Traits >::pubsync () [inline], [inherited]
Calls virtual sync function.
Referenced by std::basic_istream< _CharT, _Traits >::sync().
๐ฅ template<typename _CharT, typename _Traits> int_type std::basic_streambuf< _CharT, _Traits >::sbumpc () [inline], [inherited]
Getting the next character. Grab it and move on, periodt โจ
Returns
The next character, or eof.
If the input read position is available, returns that character and increments the read pointer, otherwise calls and returns uflow().
Referenced by std::basic_istream< _CharT, _Traits >::ignore(), std::basic_streambuf< char_type, traits_type >::snextc(), and std::basic_istream< _CharT, char_traits< _CharT > >::unget().
๐ template<typename _CharT, typename _Traits> basic_filebuf< _CharT, _Traits >::pos_type std::basic_filebuf< _CharT, _Traits >::seekoff (off_type , ios_base::seekdir , ios_base::openmode = ios_base::in | ios_base::out) [protected], [virtual], [inherited]
Alters the stream positions. Each derived class provides its own appropriate behavior.
Note โ Base class version does nothing, returns a pos_type that represents an invalid stream position. So lowkey it's a no-op up here, don't be fooled ๐ญ
Reimplemented from std::basic_streambuf< _CharT, _Traits >.
References _M_destroy_pback(), _M_reading, std::ios_base::cur, is_open(), std::basic_streambuf< _CharT, _Traits >::pbase(), and std::basic_streambuf< _CharT, _Traits >::pptr().
Referenced by imbue(), open(), and pbackfail().
๐ธ template<typename _CharT, typename _Traits> basic_filebuf< _CharT, _Traits >::pos_type std::basic_filebuf< _CharT, _Traits >::seekpos (pos_type , ios_base::openmode = ios_base::in | ios_base::out) [protected], [virtual], [inherited]
Alters the stream positions. Each derived class provides its own appropriate behavior.
Note โ Base class version does nothing, returns a pos_type that represents an invalid stream position. Again bestie, base class is just vibing ๐ซ
Reimplemented from std::basic_streambuf< _CharT, _Traits >.
References _M_destroy_pback(), std::ios_base::beg, and is_open().
๐ฆ template<typename _CharT, typename _Traits> basic_filebuf< _CharT, _Traits >::__streambuf_type * std::basic_filebuf< _CharT, _Traits >::setbuf (char_type * __s, streamsize __n) [protected], [virtual], [inherited]
Manipulates the buffer. You're literally choosing where the tea gets held ๐ต
Parameters
__sโ Pointer to a buffer area.__nโ Size of__s.
Returns
this
If no file has been opened, and both __s and __n are zero, then the stream becomes unbuffered. Otherwise, __s is used as a buffer; see https://gcc.gnu.org/onlinedocs/libstdc++/manual/streambufs.html#io.streambuf.buffering for more.
Reimplemented from std::basic_streambuf< _CharT, _Traits >.
References _M_buf, _M_buf_size, and is_open().
setg ๐
template<typename _CharT, typename _Traits> void std::basic_streambuf< _CharT, _Traits >::setg (char_type * __gbeg, char_type * __gnext, char_type * __gend) [inline], [protected], [inherited]
Okay bestie, this one is literally just setting the three read area pointers. That's it. That's the job. ๐
Parameters
__gbegโ A pointer.__gnextโ A pointer.__gendโ A pointer.
Postcondition
__gbeg == eback(), __gnext == gptr(), and __gend == egptr()
So yeah, after you call this, those three line up exactly like that. no cap. โจ
Referenced by std::wbuffer_convert< _Codecvt, _Elem, _Tr >::wbuffer_convert(), std::basic_filebuf< char_type, traits_type >::_M_create_pback(), std::basic_filebuf< char_type, traits_type >::_M_destroy_pback(), std::basic_filebuf< char_type, traits_type >::_M_set_buffer(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekpos(), and std::basic_filebuf< _CharT, _Traits >::xsgetn().
setp ๐
template<typename _CharT, typename _Traits> void std::basic_streambuf< _CharT, _Traits >::setp (char_type * __pbeg, char_type * __pend) [inline], [protected], [inherited]
And this is the twin flame of setg โ setting the three write area pointers. the way these two are always side by side. ๐ฆ
Parameters
__pbegโ A pointer.__pendโ A pointer.
Postcondition
__pbeg == pbase(), __pbeg == pptr(), and __pend == epptr()
Yes, the original really does say__pbeg == pptr(). Not__pbeg == pbase()twice, not__pbeg == pptr()twice โ we're reading it exactly as written, bestie. ๐
Referenced by std::wbuffer_convert< _Codecvt, _Elem, _Tr >::wbuffer_convert(), and std::basic_filebuf< char_type, traits_type >::_M_set_buffer().
sgetc ๐ธ
template<typename _CharT, typename _Traits> int_type std::basic_streambuf< _CharT, _Traits >::sgetc () [inline], [inherited]
Getting the next character. lowkey the most "peek don't touch" function in the whole building. ๐
Returns
The next character, or eof.
If the input read position is available, it returns that character, otherwise it calls and returns underflow(). And the important part โ it does not move the read position after fetching the character. it's giving window shopping. ๐๏ธ
Referenced by std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, char_traits< _CharT > >::readsome(), and std::basic_streambuf< char_type, traits_type >::snextc().
sgetn ๐ธ
template<typename _CharT, typename _Traits> streamsize std::basic_streambuf< _CharT, _Traits >::sgetn (char_type * __s, streamsize __n) [inline], [inherited]
Entry point for xsgetn. that's the whole vibe. ๐
Parameters
__sโ A buffer area.__nโ A count.
It returns xsgetn(__s,__n). The effect is to fill __s[0] through __s[__n-1] with characters from the input sequence, if possible. "if possible" doing a LOT of heavy lifting in that sentence, fr fr. ๐ญ
showmanyc ๐
template<typename _CharT, typename _Traits> streamsize std::basic_filebuf< _CharT, _Traits >::showmanyc () [protected], [virtual], [inherited]
Investigating the data available. it's the detective of the streambuf world. ๐
Returns
An estimate of the number of characters available in the input sequence, or -1.
If it returns a positive value, then successive calls to underflow() will not return traits::eof() until at least that number of characters have been supplied. If showmanyc() returns -1, then calls to underflow() or uflow() will fail. [27.5.2.4.3]/1
Note
- Base class version does nothing, returns zero.
- The standard adds that the intention is not only that the calls [to underflow or uflow] will not return eof() but that they will return immediately.
- The standard adds that the morphemes of showmanyc are es-how-many-see, not show-manic.
Not "show-manic" bestie. "es-how-many-see." the standard said it, not me. ๐๐
Reimplemented from std::basic_streambuf< _CharT, _Traits >.
References _M_mode, std::ios_base::binary, std::basic_streambuf< _CharT, _Traits >::egptr(), std::basic_streambuf< _CharT, _Traits >::gptr(), std::ios_base::in, and is_open().
snextc โจ
template<typename _CharT, typename _Traits> int_type std::basic_streambuf< _CharT, _Traits >::snextc () [inline], [inherited]
Also getting the next character โ yes, another one, they're a family. ๐ซถ
Returns
The next character, or eof.
Calls sbumpc(), and if that function returns traits::eof(), so does this function. Otherwise, sgetc(). It's giving "skip one, then peek." iconic behavior honestly. ๐
Referenced by std::basic_istream< _CharT, char_traits< _CharT > >::get(), std::basic_iostream< char_type, traits_type >::ignore(), and std::basic_istream< _CharT, char_traits< _CharT > >::readsome().
sputbackc ๐
template<typename _CharT, typename _Traits> int_type std::basic_streambuf< _CharT, _Traits >::sputbackc (char_type __c) [inline], [inherited]
Pushing characters back into the input stream. putting it back like you never took it. ๐
Parameters
__cโ The character to push back.
Returns
The previous character, if possible.
Similar to sungetc(), but __c is pushed onto the stream instead of the previous character. If successful, the next character fetched from the input stream will be __c. So yes, you literally get to choose what comes next. main character energy fr. ๐
Referenced by std::basic_istream< _CharT, _Traits >::putback().
sputc ๐
template<typename _CharT, typename _Traits> int_type std::basic_streambuf< _CharT, _Traits >::sputc (char_type __c) [inline], [inherited]
Entry point for all single-character output functions. all of them. every single one. the pressure is real. ๐ญ
Parameters
__cโ A character to output.
Returns
__c, if possible.
One of two public output functions.
If a write position is available for the output sequence (i.e., the buffer is not full), it stores __c in that position, increments the position, and returns traits::to_int_type(__c). If a write position is not available, it returns overflow(__c). so basically: room? cool. no room? overflow handles it. slay. โจ
Referenced by std::wbuffer_convert< _Codecvt, _Elem, _Tr >::overflow().
sputn ๐
template<typename _CharT, typename _Traits> streamsize std::basic_streambuf< _CharT, _Traits >::sputn (const char_type * __s, streamsize __n) [inline], [inherited]
Entry point for all single-character output functions โ and yes, it says that same line here too. not a typo on my end, bestie, that's genuinely what the page says. ๐
Parameters
__sโ A buffer read area.__nโ A count.
One of two public output functions.
Returns xsputn(__s,__n). The effect is to write __s[0] through __s[__n-1] to the output sequence, if possible. again with the "if possible." the audacity. ๐
sungetc ๐ฆ
template<typename _CharT, typename _Traits> int_type std::basic_streambuf< _CharT, _Traits >::sungetc () [inline], [inherited]
Moving backwards in the input stream. going back?? in THIS economy?? ๐ธ
Returns
The previous character, if possible.
If a putback position is available, this function decrements the input pointer and returns that character. Otherwise, it calls and returns pbackfail(). The effect is to unget the last character gotten. it's giving "undo" but for characters. ๐
Referenced by std::basic_istream< _CharT, _Traits >::unget().
sync ๐ง
template<typename _CharT, typename _Traits> int std::basic_filebuf< _CharT, _Traits >::sync () [protected], [virtual], [inherited]
Synchronizes the buffer arrays with the controlled sequences. getting everybody on the same page, literally. ๐
Returns
-1 on failure.
Each derived class provides its own appropriate behavior, including the definition of failure. so "failure" is kinda subjective here and that's on purpose. iykyk. ๐
Note
Base class version does nothing, returns zero.
Reimplemented from std::basic_streambuf< _CharT, _Traits >.
References overflow(), std::basic_streambuf< _CharT, _Traits >::pbase(), and std::basic_streambuf< _CharT, _Traits >::pptr().
uflow ๐
template<typename _CharT, typename _Traits> virtual int_type std::basic_streambuf< _CharT, _Traits >::uflow () [inline], [protected], [virtual], [inherited]
Fetches more data from the controlled sequence. ๐ซถ
Returns
The first character from the pending sequence.
Informally, this function does the same thing as underflow(), and in fact is required to call that function. It also returns the new character, like underflow() does. However, this function also moves the read position forward by one. that's the one little difference. the plot twist. ๐ญ
Reimplemented in __gnu_cxx::stdio_sync_filebuf< _CharT, _Traits >.
Referenced by std::basic_streambuf< char_type, traits_type >::sbumpc(), and xsgetn().
underflow ๐
template<typename _CharT, typename _Traits> basic_filebuf< _CharT, _Traits >::int_type std::basic_filebuf< _CharT, _Traits >::underflow () [protected], [virtual], [inherited]
Fetches more data from the controlled sequence. the icon. the legend. the moment. โญ
Returns
The first character from the pending sequence.
Informally, this function is called when the input buffer is exhausted (or does not exist, as buffering need not actually be done). If a buffer exists, it is refilled. In either case, the next available character is returned, or traits::eof() to indicate a null pending sequence.
For a formal definition of the pending sequence, see a good text such as Langer & Kreft, or [27.5.2.4.3]/7-14.
A functioning input streambuf can be created by overriding only this function (no buffer area will be used). For an example, see https://gcc.gnu.org/onlinedocs/libstdc++/manual/streambufs.html
Note
Base class version does nothing, returns eof().
Reimplemented from std::basic_streambuf< _CharT, _Traits >.
References _M_buf_size, _M_destroy_pback(), _M_mode, _M_set_buffer(), std::basic_streambuf< _CharT, _Traits >::eback(), std::basic_streambuf< _CharT, _Traits >::egptr(), std::basic_streambuf< _CharT, _Traits >::gptr(), std::ios_base::in, and overflow().
Referenced by pbackfail().
xsgetn ๐
template<typename _CharT, typename _Traits> streamsize std::basic_filebuf< _CharT, _Traits >::xsgetn (char_type * __s, streamsize __n) [protected], [virtual], [inherited]
Multiple character extraction. bulk mode. it ate. ๐ฅ
Parameters
__sโ A buffer area.__nโ Maximum number of characters to assign.
Returns
The number of characters assigned.
Fills __s[0] through __s[__n-1] with characters from the input sequence, as if by sbumpc(). Stops when either __n characters have been copied, or when traits::eof() would be copied. so it stops before it copies eof, it doesn't copy eof and then stop. very demure, very mindful. ๐
It is expected that derived classes provide a more efficient implementation by overriding this definition.
Reimplemented from std::basic_streambuf< _CharT, _Traits >.
References _M_buf_size, _M_destroy_pback(), _M_mode, _M_pback_init, _M_reading, _M_set_buffer(), std::basic_streambuf< _CharT, _Traits >::eback(), std::basic_streambuf< _CharT, _Traits >::egptr(), std::basic_streambuf< _CharT, _Traits >::gbump(), std::basic_streambuf< _CharT, _Traits >::gptr(), std::ios_base::in, overflow(), std::basic_streambuf< _CharT, _Traits >::setg(), and std::basic_streambuf< char_type, traits_type >::xsgetn().
xsputn ๐
template<typename _CharT, typename _Traits> streamsize std::basic_filebuf< _CharT, _Traits >::xsputn (const char_type * __s, streamsize __n) [protected], [virtual], [inherited]
Multiple character insertion. the writing counterpart, holding it down on the other side. ๐
Parameters
__sโ A buffer area.__nโ Maximum number of characters to write.
Returns
The number of characters written.
Writes __s[0] through __s[__n-1] to the output sequence, as if by sputc(). Stops when either n characters have been copied, or when sputc() would return traits::eof().
It is expected that derived classes provide a more efficient implementation by overriding this definition.
Reimplemented from std::basic_streambuf< _CharT, _Traits >.
Okay so the references for that last function were literally: _M_buf_size, _M_mode, _M_reading, _M_set_buffer(), std::ios_base::app, std::basic_streambuf< _CharT, _Traits >::epptr(), std::ios_base::out, std::basic_streambuf< _CharT, _Traits >::pbase(), std::basic_streambuf< _CharT, _Traits >::pptr(), and std::basic_streambuf< char_type, traits_type >::xsputn(). Periodt. ๐
๐ Member Data Documentation ๐
Okay bestie, now we're in the member data zone. These are all [protected] and [inherited], so they're like the VIP section of the class. Let's get into it. ๐
_M_buf ๐
template<typename _CharT, typename _Traits> char_type* std::basic_filebuf< _CharT, _Traits >::_M_buf
[protected], [inherited] โ This is literally the pointer to the beginning of the internal buffer. It's giving "start of the vibe". Referenced by basic_filebuf(), and setbuf().
_M_buf_locale ๐
template<typename _CharT, typename _Traits> locale std::basic_streambuf< _CharT, _Traits >::_M_buf_locale
[protected], [inherited] โ The current locale setting. So you know what language and formatting rules are in play. Referenced by std::basic_filebuf< _CharT, _Traits >::basic_filebuf().
_M_buf_size ๐
template<typename _CharT, typename _Traits> size_t std::basic_filebuf< _CharT, _Traits >::_M_buf_size
[protected], [inherited] โ The actual size of the internal buffer. This number is equal to the size of the put area + 1 position, reserved for the overflow char of a full area. So it's like the buffer's official size, plus one for the overflow char. Referenced by basic_filebuf(), __gnu_cxx::stdio_filebuf< _CharT, _Traits >::stdio_filebuf(), __gnu_cxx::stdio_filebuf< _CharT, _Traits >::stdio_filebuf(), overflow(), setbuf(), underflow(), xsgetn(), and xsputn().
_M_ext_buf ๐งณ
template<typename _CharT, typename _Traits> char* std::basic_filebuf< _CharT, _Traits >::_M_ext_buf
[protected], [inherited] โ Buffer for external characters. Used for input when codecvt::always_noconv() == false. When valid, this corresponds to eback(). So it's the external buffer, used when codecvt isn't in no-conversion mode. Referenced by basic_filebuf(), and imbue().
_M_ext_buf_size ๐
template<typename _CharT, typename _Traits> streamsize std::basic_filebuf< _CharT, _Traits >::_M_ext_buf_size
[protected], [inherited] โ Size of buffer held by _M_ext_buf. Referenced by basic_filebuf().
_M_ext_next โก๏ธ
template<typename _CharT, typename _Traits> const char* std::basic_filebuf< _CharT, _Traits >::_M_ext_next
[protected], [inherited] โ Pointers into the buffer held by _M_ext_buf that delimit a subsequence of bytes that have been read but not yet converted. When valid, _M_ext_next corresponds to egptr(). Referenced by basic_filebuf(), and imbue().
_M_in_beg ๐
template<typename _CharT, typename _Traits> char_type* std::basic_streambuf< _CharT, _Traits >::_M_in_beg
[protected], [inherited] โ Start of get area. So the beginning of the read zone.
_M_in_cur ๐
template<typename _CharT, typename _Traits> char_type* std::basic_streambuf< _CharT, _Traits >::_M_in_cur
[protected], [inherited] โ Current read area. Where you're at in the get area.
_M_in_end ๐
template<typename _CharT, typename _Traits> char_type* std::basic_streambuf< _CharT, _Traits >::_M_in_end
[protected], [inherited] โ End of get area. The finish line for reading.
_M_mode ๐๏ธ
template<typename _CharT, typename _Traits> ios_base::openmode std::basic_filebuf< _CharT, _Traits >::_M_mode
[protected], [inherited] โ Place to stash in || out || in | out settings for current filebuf. So it holds the open mode flags. Referenced by basic_filebuf(), __gnu_cxx::stdio_filebuf< _CharT, _Traits >::stdio_filebuf(), __gnu_cxx::stdio_filebuf< _CharT, _Traits >::stdio_filebuf(), close(), imbue(), open(), overflow(), pbackfail(), showmanyc(), underflow(), xsgetn(), and xsputn().
_M_out_beg ๐
template<typename _CharT, typename _Traits> char_type* std::basic_streambuf< _CharT, _Traits >::_M_out_beg
[protected], [inherited] โ Start of put area. The beginning of the write zone.
_M_out_cur โ๏ธ
template<typename _CharT, typename _Traits> char_type* std::basic_streambuf< _CharT, _Traits >::_M_out_cur
[protected], [inherited] โ Current put area. Where you're writing right now.
_M_out_end ๐
template<typename _CharT, typename _Traits> char_type* std::basic_streambuf< _CharT, _Traits >::_M_out_end
[protected], [inherited] โ End of put area. The limit of the write zone.
_M_pback โฉ๏ธ
template<typename _CharT, typename _Traits> char_type std::basic_filebuf< _CharT, _Traits >::_M_pback
[protected], [inherited] โ Necessary bits for putback buffer management.
Note: pbacks of over one character are not currently supported.
Referenced by basic_filebuf().
_M_pback_cur_save ๐พ
template<typename _CharT, typename _Traits> char_type* std::basic_filebuf< _CharT, _Traits >::_M_pback_cur_save
[protected], [inherited] โ Necessary bits for putback buffer management.
Note: pbacks of over one character are not currently supported.
Referenced by basic_filebuf().
_M_pback_end_save ๐พ
template<typename _CharT, typename _Traits> char_type* std::basic_filebuf< _CharT, _Traits >::_M_pback_end_save
[protected], [inherited] โ Necessary bits for putback buffer management.
Note: pbacks of over one character are not currently supported.
Referenced by basic_filebuf().
_M_pback_init ๐ง
template<typename _CharT, typename _Traits> bool std::basic_filebuf< _CharT, _Traits >::_M_pback_init
[protected], [inherited] โ Necessary bits for putback buffer management.
Note: pbacks of over one character are not currently supported.
Referenced by basic_filebuf(), close(), pbackfail(), and xsgetn().
_M_reading ๐
template<typename _CharT, typename _Traits> bool std::basic_filebuf< _CharT, _Traits >::_M_reading
[protected], [inherited] โ _M_reading == false && _M_writing == false for uncommitted mode; _M_reading == true for read mode; _M_writing == true for write mode;
NB: _M_reading == true && _M_writing == true is unused.
Referenced by basic_filebuf(), __gnu_cxx::stdio_filebuf< _CharT, _Traits >::stdio_filebuf(), __gnu_cxx::stdio_filebuf< _CharT, _Traits >::stdio_filebuf(), close(), imbue(), open(), overflow(), pbackfail(), seekoff(), xsgetn(), and xsputn().
โจ Author โจ
Generated automatically by Doxygen for libstdc++ from the source code. So no human wrote this, it's all machine magic. ๐คโจ
And that's the whole page, bestie! This was brought to you by libstdc++, and the page is __gnu_cxx:..., _Traits >(3). No date on this one, soz. Stay iconic! ๐โจ๐ฆ
๐ฆ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 ยท GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- fedora 44: libstdc++-docs 16.0.1-0.10.fc44 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- fedora 44: libstdc++-docs 16.2.1-3.fc44 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms