__GNU_CXX::ENC_FILEBUF(3)
okay bestie, this page comes from the Library Functions Manual and it's giving major C++ library energy. We're talking about __gnu_cxx::enc_filebuf< _CharT > β a whole class, no cap. Let's get into it. π
πΈ NAME πΈ
__gnu_cxx::enc_filebuf< _CharT >β class enc_filebuf. that's the whole vibe.
β¨ SYNOPSIS β¨
#include <enc_filebuf.h>
Inherits from std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >.
π 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 traits_type::state_type state_typetypedef encoding_char_traits< _CharT > traits_type
π Public Member Functions π
enc_filebuf (state_type &__state)__filebuf_type * close ()β Closes the currently associated file.locale getloc () constβ Locale access.streamsize in_avail ()β Looking ahead into the stream.bool is_open () const throw ()β Returns true if the external file is open.__filebuf_type * open (const char *__s, ios_base::openmode __mode)β Opens an external file.locale pubimbue (const locale &__loc)β Entry point for imbue().int_type sbumpc ()β Getting the next character.int_type sgetc ()β Getting the next character.streamsize sgetn (char_type *__s, streamsize __n)β Entry point for xsgetn.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 (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=encoding_char_traits< _CharT >::eof())β Consumes data from the buffer; writes to the controlled sequence.virtual int_type pbackfail (int_type __c=encoding_char_traits< _CharT >::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 stash in || out || in | out settings for current filebuf.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>
class __gnu_cxx::enc_filebuf< _CharT >"class enc_filebuf.
π MEMBER FUNCTION DOCUMENTATION π
π void std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::_M_create_pback () [inline], [protected], [inherited]
Initializes pback buffers, and moves normal buffers to safety.
Assumptions: _M_in_cur has already been moved back.
π void std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::_M_destroy_pback () [inline], [protected], [inherited]
Deactivates pback buffer contents, and restores normal buffer.
Assumptions: The pback buffer has only moved forward.
π void std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::_M_set_buffer (streamsize __off) [inline], [protected], [inherited]
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.
Referenced by seekpos(), and setbuf().
π basic_filebuf< _CharT, encoding_char_traits< _CharT > >::__filebuf_type * std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::close () [inherited]
Closes the currently associated file.
Returns
thison success,NULLon failure.
If no file is currently open, this function immediately fails.
If a put buffer area exists, overflow(eof) is called to flush all the characters. The file is then closed.
If any operations fail, this function also fails.
π char_type * std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::eback () const [inline], [protected], [inherited]
Access to the get area. These functions are only available to other protected functions, including derived classes.
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
π char_type * std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::egptr () const [inline], [protected], [inherited]
Access to the get area. These functions are only available to other protected functions, including derived classes.
Same bullet trio as above, bestie:
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
π char_type * std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::epptr () 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
π void std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::gbump (int __n) [inline], [protected], [inherited]
Moving the read position.
Parameters
__nβ The delta by which to move.
This just advances the read position without returning any data.
π locale std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::getloc () const [inline], [inherited]
Locale access.
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 is returned.
π char_type * std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::gptr () const [inline], [protected], [inherited]
Access to the get area. These functions are only available to other protected functions, including derived classes.
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
π void std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::imbue (const locale & __loc) [protected], [virtual], [inherited]
Changes translations.
Parameters
__locβ A new locale.
Translations done during I/O which depend on the current locale are changed 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.
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
streamsize std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::in_avail () [inline], [inherited]
bestie this one is literally just π looking ahead into the stream. That's the whole vibe.
Returns: the number of characters available.
If a read position is available, it gives you the number of characters you can read before the buffer has to be refilled. Otherwise it hands you back the derived showmanyc(). periodt.
bool std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::is_open () const [inline], [nodiscard], [inherited]
Returns true if the external file is open. that's it that's the function π
(also it's [nodiscard], so likeβ¦ actually use the answer, don't just leave it sitting there π)
basic_filebuf< _CharT, encoding_char_traits< _CharT > >::__filebuf_type * std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::open (const char * __s, ios_base::openmode __mode) [inherited]
Opens an external file. the moment we've all been waiting for β¨
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 β no second chances, no drama, it just says no. 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)
+---------------------------------------------------------+
| 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 |
+---------------------------------------------------------+
basic_filebuf< _CharT, encoding_char_traits< _CharT > >::int_type std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::overflow (int_type __c = _Traits::eof()) [protected], [virtual], [inherited]
Consumes data from the buffer; writes to the controlled sequence. main character energy fr π₯
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). lowkey iconic that one function carries the whole thing π
Note: base class version does nothing, returns eof(). π
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
References _M_ext_buf, _M_ext_next, and eback().
basic_filebuf< _CharT, encoding_char_traits< _CharT > >::int_type std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::pbackfail (int_type __c = _Traits::eof()) [protected], [virtual], [inherited]
Tries to back up the input sequence. rewinding, but make it β¨tenseβ¨
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, encoding_char_traits< _CharT > >.
References _M_ext_buf, _M_ext_next, and eback().
char_type * std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::pbase () const [inline], [protected], [inherited]
Access to the put area. These functions are only available to other protected functions, including derived classes. it's giving secret club π
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
void std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::pbump (int __n) [inline], [protected], [inherited]
Moving the write position. we love a lil nudge πΈ
Parameters:
__nβ the delta by which to move.
This just advances the write position without returning any data. no data, just vibes β¨
char_type * std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::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
locale std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::pubimbue (const locale & __loc) [inline], [inherited]
Entry point for imbue(). the public door to the protected room π¦
Parameters:
__locβ the new locale.
Returns: the previous locale.
Calls the derived imbue(__loc).
pos_type std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::pubseekoff (off_type __off, ios_base::seekdir __way, ios_base::openmode __mode = ios_base::in | ios_base::out) [inline], [inherited]
Alters the stream position. sliding around the stream like it's a group chat π«Ά
Parameters:
__offβ offset.__wayβ value forios_base::seekdir.__modeβ value forios_base::openmode.
Calls virtual seekoff function.
pos_type std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::pubseekpos (pos_type __sp, ios_base::openmode __mode = ios_base::in | ios_base::out) [inline], [inherited]
Alters the stream position. same energy, different args π
Parameters:
__spβ position__modeβ value forios_base::openmode.
Calls virtual seekpos function.
basic_streambuf * std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::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. middle-man behavior but make it official π
int std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::pubsync () [inline], [inherited]
Calls virtual sync function. that's the whole thing bestie, short and sweet π
int_type std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::sbumpc () [inline], [inherited]
Getting the next character.
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(). grab it AND move the pointer β multitasking queen π
basic_filebuf< _CharT, encoding_char_traits< _CharT > >::pos_type std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::seekoff (off_type __off, ios_base::seekdir __way, ios_base::openmode __mode = ios_base::in | ios_base::out) [protected], [virtual], [inherited]
Alters the stream positions. Each derived class provides its own appropriate behavior. you do you, derived class β¨
Note: base class version does nothing, returns a pos_type that represents an invalid stream position. π
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
References gptr().
basic_filebuf< _CharT, encoding_char_traits< _CharT > >::pos_type std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::seekpos (pos_type __pos, ios_base::openmode __mode = 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. π
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
References _M_reading, and _M_set_buffer().
basic_filebuf< _CharT, encoding_char_traits< _CharT > >::__streambuf_type * std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::setbuf (char_type * __s, streamsize __n) [protected], [virtual], [inherited]
Manipulates the buffer. π
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, encoding_char_traits< _CharT > >.
References _M_reading, and _M_set_buffer().
void std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::setg (char_type * __gbeg, char_type * __gnext, char_type * __gend) [inline], [protected], [inherited]
Setting the three read area pointers. three pointers, one glow-up π
Parameters:
__gbegβ a pointer.__gnextβ a pointer.__gendβ a pointer.
Postcondition: __gbeg == eback(), __gnext == gptr(), and __gend == egptr()
void std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::setp (char_type * __pbeg, char_type * __pend) [inline], [protected], [inherited]
Setting the three write area pointers. yes, three, from two args, it's the duality bestie π
Parameters:
__pbegβ a pointer.__pendβ a pointer.
Postcondition: __pbeg == pbase(), __pbeg == pptr(), and __pend == epptr()
int_type std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::sgetc () [inline], [inherited]
Getting the next character.
Returns: the next character, or eof.
If the input read position is available, returns that character, otherwise calls and returns underflow(). Does not move the read position after fetching the character. look but don't touch, we respect boundaries π
streamsize std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::sgetn (char_type * __s, streamsize __n) [inline], [inherited]
Entry point for xsgetn.
Parameters:
__sβ a buffer area.__nβ a count.
(still mid-entry, carrying on bestie π«)
Returns xsgetn(__s,__n). The effect is to fill __s[0] through __s[__n-1] with characters from the input sequence, if possible.
π¦ streamsize std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::showmanyc () [protected], [virtual], [inherited]
Investigating the data available. πβ¨
Returns: An estimate of the number of characters available in the input sequence, or -1.
So if it hands you back a positive value, then successive calls to underflow() will not return traits::eof() until at least that many characters have been supplied. And 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 [tounderfloworuflow] will not returneof()but that they will return immediately. β‘ The standard adds that the morphemes ofshowmanycare es-how-many-see, not show-manic. iykyk π
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
πΈ int_type std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::snextc () [inline], [inherited]
Getting the next character. π
Returns: The next character, or eof.
It calls sbumpc(), and if that function returns traits::eof(), so does this one. Otherwise, sgetc(). Simple as. π
π int_type std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::sputbackc (char_type __c) [inline], [inherited]
Pushing characters back into the input stream. π
Parameters
__cβ The character to push back.
Returns: The previous character, if possible.
Similar to sungetc(), but __c gets pushed onto the stream instead of the previous character. If it works, the next character fetched from the input stream will be __c. Rewind era πβ¨
β int_type std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::sputc (char_type __c) [inline], [inherited]
Entry point for all single-character output functions. πͺ
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). No cap, that's just the deal π―
π streamsize std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::sputn (const char_type * __s, streamsize __n) [inline], [inherited]
Entry point for all single-character output functions. πͺ (yes, same title, they said it twice, iconic behavior β¨)
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.
π int_type std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::sungetc () [inline], [inherited]
Moving backwards in the input stream. βͺ
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 time travel, lowkey π°οΈπ«
π§ int std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::sync () [protected], [virtual], [inherited]
Synchronizes the buffer arrays with the controlled sequences. πͺ
Returns: -1 on failure.
Each derived class provides its own appropriate behavior, including the definition of failure. Do your own thing, bestie, but define what "flop" means for you π
Note β Base class version does nothing, returns zero. π
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
π¦ virtual int_type std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::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. Extra step, extra slay πΆββοΈβ¨
πΈ basic_filebuf< _CharT, encoding_char_traits< _CharT > >::int_type std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::underflow () [protected], [virtual], [inherited]
Fetches more data from the controlled sequence. π₯
Returns: The first character from the pending sequence.
Informally, this function gets called when the input buffer is exhausted (or does not exist, as buffering need not actually be done). If a buffer exists, it gets refilled. Either way, 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, encoding_char_traits< _CharT > >.
β streamsize std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::xsgetn (char_type * __s, streamsize __n) [protected], [virtual], [inherited]
Multiple character extraction. π§Ί
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. β
It is expected that derived classes provide a more efficient implementation by overriding this definition. Go off, optimize it π
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
π streamsize std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::xsputn (const char_type * __s, streamsize __n) [protected], [virtual], [inherited]
Multiple character insertion. π€
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. Again, go off π
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
π Member Data Documentation π
π¦ char_type* std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::_M_buf [protected], [inherited]
Pointer to the beginning of internal buffer. π
π locale std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::_M_buf_locale [protected], [inherited]
Current locale setting. π
πΈ size_t std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::_M_buf_size [protected], [inherited]
Actual size of internal buffer. This number is equal to the size of the put area + 1 position, reserved for the overflow char of a full area. π
π§ char* std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::_M_ext_buf [protected], [inherited]
Buffer for external characters. Used for input when codecvt::always_noconv() == false. When valid, this corresponds to eback(). π€
Referenced by overflow(), and pbackfail().
β¨ streamsize std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::_M_ext_buf_size [protected], [inherited]
Size of buffer held by _M_ext_buf. π
π¦ const char* std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::_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 overflow(), and pbackfail().
π char_type* std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::_M_in_beg [protected], [inherited]
Start of get area. π
β char_type* std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::_M_in_cur [protected], [inherited]
Current read area. π
πΈ char_type* std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::_M_in_end [protected], [inherited]
End of get area. π
π ios_base::openmode std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::_M_mode [protected], [inherited]
Place to stash in || out || in | out settings for current filebuf. ποΈ
π char_type* std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::_M_out_beg [protected], [inherited]
Start of put area. π
π¦ char_type* std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::_M_out_cur [protected], [inherited]
Current put area. βοΈ
π char_type* std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::_M_out_end [protected], [inherited]
End of put area. π
π§ char_type std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::_M_pback [protected], [inherited]
Necessary bits for putback buffer management. π§©
Note β pbacks of over one character are not currently supported. π«
β¨ char_type* std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::_M_pback_cur_save [protected], [inherited]
Necessary bits for putback buffer management. π§©
Note β pbacks of over one character are not currently supported. π«
π char_type* std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::_M_pback_end_save [protected], [inherited]
Necessary bits for putback buffer management. π§©
Note β pbacks of over one character are not currently supported. π«
β bool std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::_M_pback_init [protected], [inherited]
Necessary bits for putback buffer management. π§©
Note β pbacks of over one character are not currently supported. π«
πΈ bool std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::_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 seekpos(), and setbuf().
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. π€π
And that's a wrap on the whole page, bestie π«Ά that was libstdc++ serving __gnu_cxx:...< _CharT >(3) β go read it again, you know you want to. πβ¨π
π¦ 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