.TH "__gnu_cxx::enc_filebuf< _CharT >" 3cxx "Thu Aug 2 2012" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME __gnu_cxx::enc_filebuf< _CharT > \- .SH SYNOPSIS .br .PP .PP Inherits \fBstd::basic_filebuf< _CharT, encoding_char_traits< _CharT > >\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "typedef codecvt< char_type, .br char, __state_type > \fB__codecvt_type\fP" .br .ti -1c .RI "typedef __basic_file< char > \fB__file_type\fP" .br .ti -1c .RI "typedef \fBbasic_filebuf\fP .br < char_type, \fBtraits_type\fP > \fB__filebuf_type\fP" .br .ti -1c .RI "typedef \fBtraits_type::state_type\fP \fB__state_type\fP" .br .ti -1c .RI "typedef \fBbasic_streambuf\fP .br < char_type, \fBtraits_type\fP > \fB__streambuf_type\fP" .br .ti -1c .RI "typedef _CharT \fBchar_type\fP" .br .ti -1c .RI "typedef traits_type::int_type \fBint_type\fP" .br .ti -1c .RI "typedef traits_type::off_type \fBoff_type\fP" .br .ti -1c .RI "typedef \fBtraits_type::pos_type\fP \fBpos_type\fP" .br .ti -1c .RI "typedef \fBtraits_type::state_type\fP \fBstate_type\fP" .br .ti -1c .RI "typedef \fBencoding_char_traits\fP .br < _CharT > \fBtraits_type\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fB__filebuf_type\fP * \fBclose\fP ()" .br .ti -1c .RI "\fBenc_filebuf\fP (\fBstate_type\fP &__state)" .br .ti -1c .RI "streamsize \fBin_avail\fP ()" .br .ti -1c .RI "bool \fBis_open\fP () const throw ()" .br .ti -1c .RI "\fB__filebuf_type\fP * \fBopen\fP (const char *__s, ios_base::openmode __mode)" .br .ti -1c .RI "\fB__filebuf_type\fP * \fBopen\fP (const \fBstd::string\fP &__s, ios_base::openmode __mode)" .br .ti -1c .RI "int_type \fBsbumpc\fP ()" .br .ti -1c .RI "int_type \fBsgetc\fP ()" .br .ti -1c .RI "streamsize \fBsgetn\fP (char_type *__s, streamsize __n)" .br .ti -1c .RI "int_type \fBsnextc\fP ()" .br .ti -1c .RI "int_type \fBsputbackc\fP (char_type __c)" .br .ti -1c .RI "int_type \fBsputc\fP (char_type __c)" .br .ti -1c .RI "streamsize \fBsputn\fP (const char_type *__s, streamsize __n)" .br .ti -1c .RI "void \fBstossc\fP ()" .br .ti -1c .RI "int_type \fBsungetc\fP ()" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "void \fB_M_allocate_internal_buffer\fP ()" .br .ti -1c .RI "bool \fB_M_convert_to_external\fP (char_type *, streamsize)" .br .ti -1c .RI "void \fB_M_create_pback\fP ()" .br .ti -1c .RI "void \fB_M_destroy_internal_buffer\fP () throw ()" .br .ti -1c .RI "void \fB_M_destroy_pback\fP () throw ()" .br .ti -1c .RI "\fBpos_type\fP \fB_M_seek\fP (off_type __off, ios_base::seekdir __way, __state_type __state)" .br .ti -1c .RI "void \fB_M_set_buffer\fP (streamsize __off)" .br .ti -1c .RI "bool \fB_M_terminate_output\fP ()" .br .ti -1c .RI "void \fBgbump\fP (int __n)" .br .ti -1c .RI "virtual void \fBimbue\fP (const locale &__loc)" .br .ti -1c .RI "virtual int_type \fBoverflow\fP (int_type __c=\fBencoding_char_traits\fP< _CharT >::eof())" .br .ti -1c .RI "virtual int_type \fBpbackfail\fP (int_type __c=\fBencoding_char_traits\fP< _CharT >::eof())" .br .ti -1c .RI "void \fBpbump\fP (int __n)" .br .ti -1c .RI "virtual \fBpos_type\fP \fBseekoff\fP (off_type __off, ios_base::seekdir __way, ios_base::openmode __mode=ios_base::in|ios_base::out)" .br .ti -1c .RI "virtual \fBpos_type\fP \fBseekpos\fP (\fBpos_type\fP __pos, ios_base::openmode __mode=ios_base::in|ios_base::out)" .br .ti -1c .RI "virtual \fB__streambuf_type\fP * \fBsetbuf\fP (char_type *__s, streamsize __n)" .br .ti -1c .RI "void \fBsetg\fP (char_type *__gbeg, char_type *__gnext, char_type *__gend)" .br .ti -1c .RI "void \fBsetp\fP (char_type *__pbeg, char_type *__pend)" .br .ti -1c .RI "virtual streamsize \fBshowmanyc\fP ()" .br .ti -1c .RI "virtual int \fBsync\fP ()" .br .ti -1c .RI "virtual int_type \fBuflow\fP ()" .br .ti -1c .RI "virtual int_type \fBunderflow\fP ()" .br .ti -1c .RI "virtual streamsize \fBxsgetn\fP (char_type *__s, streamsize __n)" .br .ti -1c .RI "virtual streamsize \fBxsputn\fP (const char_type *__s, streamsize __n)" .br .in -1c .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "char_type * \fBeback\fP () const" .br .ti -1c .RI "char_type * \fBgptr\fP () const" .br .ti -1c .RI "char_type * \fBegptr\fP () const" .br .in -1c .in -1c .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "char_type * \fBpbase\fP () const" .br .ti -1c .RI "char_type * \fBpptr\fP () const" .br .ti -1c .RI "char_type * \fBepptr\fP () const" .br .in -1c .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "char_type * \fB_M_buf\fP" .br .ti -1c .RI "bool \fB_M_buf_allocated\fP" .br .ti -1c .RI "size_t \fB_M_buf_size\fP" .br .ti -1c .RI "const \fB__codecvt_type\fP * \fB_M_codecvt\fP" .br .ti -1c .RI "char * \fB_M_ext_buf\fP" .br .ti -1c .RI "streamsize \fB_M_ext_buf_size\fP" .br .ti -1c .RI "char * \fB_M_ext_end\fP" .br .ti -1c .RI "const char * \fB_M_ext_next\fP" .br .ti -1c .RI "__file_type \fB_M_file\fP" .br .ti -1c .RI "__c_lock \fB_M_lock\fP" .br .ti -1c .RI "ios_base::openmode \fB_M_mode\fP" .br .ti -1c .RI "bool \fB_M_reading\fP" .br .ti -1c .RI "__state_type \fB_M_state_beg\fP" .br .ti -1c .RI "__state_type \fB_M_state_cur\fP" .br .ti -1c .RI "__state_type \fB_M_state_last\fP" .br .ti -1c .RI "bool \fB_M_writing\fP" .br .in -1c .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "char_type \fB_M_pback\fP" .br .ti -1c .RI "char_type * \fB_M_pback_cur_save\fP" .br .ti -1c .RI "char_type * \fB_M_pback_end_save\fP" .br .ti -1c .RI "bool \fB_M_pback_init\fP" .br .in -1c .in -1c .in +1c .ti -1c .RI "locale \fBpubimbue\fP (const locale &__loc)" .br .ti -1c .RI "locale \fBgetloc\fP () const" .br .ti -1c .RI "\fB__streambuf_type\fP * \fBpubsetbuf\fP (char_type *__s, streamsize __n)" .br .ti -1c .RI "\fBpos_type\fP \fBpubseekoff\fP (off_type __off, ios_base::seekdir __way, ios_base::openmode __mode=ios_base::in|ios_base::out)" .br .ti -1c .RI "\fBpos_type\fP \fBpubseekpos\fP (\fBpos_type\fP __sp, ios_base::openmode __mode=ios_base::in|ios_base::out)" .br .ti -1c .RI "int \fBpubsync\fP ()" .br .ti -1c .RI "char_type * \fB_M_in_beg\fP" .br .ti -1c .RI "char_type * \fB_M_in_cur\fP" .br .ti -1c .RI "char_type * \fB_M_in_end\fP" .br .ti -1c .RI "char_type * \fB_M_out_beg\fP" .br .ti -1c .RI "char_type * \fB_M_out_cur\fP" .br .ti -1c .RI "char_type * \fB_M_out_end\fP" .br .ti -1c .RI "locale \fB_M_buf_locale\fP" .br .in -1c .SH "Detailed Description" .PP .SS "templateclass __gnu_cxx::enc_filebuf< _CharT >" class \fBenc_filebuf\fP\&. .PP Definition at line 40 of file enc_filebuf\&.h\&. .SH "Member Function Documentation" .PP .SS "void \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_create_pback ()\fC [inline]\fP, \fC [protected]\fP, \fC [inherited]\fP" Initializes pback buffers, and moves normal buffers to safety\&. Assumptions: _M_in_cur has already been moved back .PP Definition at line 172 of file fstream\&. .SS "void \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_destroy_pback () throw ()\fC [inline]\fP, \fC [protected]\fP, \fC [inherited]\fP" Deactivates pback buffer contents, and restores normal buffer\&. Assumptions: The pback buffer has only moved forward\&. .PP Definition at line 189 of file fstream\&. .SS "void \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_set_buffer (\fBstreamsize\fP__off)\fC [inline]\fP, \fC [protected]\fP, \fC [inherited]\fP" This function sets the pointers of the internal buffer, both get and put areas\&. Typically: .PP __off == egptr() - eback() upon underflow/uflow ('read' mode); __off == 0 upon overflow ('write' mode); __off == -1 upon open, setbuf, seekoff/pos ('uncommitted' mode)\&. .PP NB: epptr() - pbase() == _M_buf_size - 1, since _M_buf_size reflects the actual allocated memory and the last cell is reserved for the overflow char of a full put area\&. .PP Definition at line 386 of file fstream\&. .SS "\fB__filebuf_type\fP* \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::close ()\fC [inherited]\fP" .PP Closes the currently associated file\&. \fBReturns:\fP .RS 4 \fCthis\fP on success, NULL on failure .RE .PP If no file is currently open, this function immediately fails\&. .PP If a 'put buffer area' exists, \fCoverflow(eof)\fP is called to flush all the characters\&. The file is then closed\&. .PP If any operations fail, this function also fails\&. .SS "char_type* \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::eback () const\fC [inline]\fP, \fC [protected]\fP, \fC [inherited]\fP" .PP Access to the get area\&. These functions are only available to other protected functions, including derived classes\&. .PP .IP "\(bu" 2 eback() returns the beginning pointer for the input sequence .IP "\(bu" 2 gptr() returns the next pointer for the input sequence .IP "\(bu" 2 egptr() returns the end pointer for the input sequence .PP .PP Definition at line 458 of file streambuf\&. .SS "char_type* \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::egptr () const\fC [inline]\fP, \fC [protected]\fP, \fC [inherited]\fP" .PP Access to the get area\&. These functions are only available to other protected functions, including derived classes\&. .PP .IP "\(bu" 2 eback() returns the beginning pointer for the input sequence .IP "\(bu" 2 gptr() returns the next pointer for the input sequence .IP "\(bu" 2 egptr() returns the end pointer for the input sequence .PP .PP Definition at line 464 of file streambuf\&. .SS "char_type* \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::epptr () const\fC [inline]\fP, \fC [protected]\fP, \fC [inherited]\fP" .PP Access to the put area\&. These functions are only available to other protected functions, including derived classes\&. .PP .IP "\(bu" 2 pbase() returns the beginning pointer for the output sequence .IP "\(bu" 2 pptr() returns the next pointer for the output sequence .IP "\(bu" 2 epptr() returns the end pointer for the output sequence .PP .PP Definition at line 511 of file streambuf\&. .SS "void \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::gbump (int__n)\fC [inline]\fP, \fC [protected]\fP, \fC [inherited]\fP" .PP Moving the read position\&. \fBParameters:\fP .RS 4 \fIn\fP The delta by which to move\&. .RE .PP This just advances the read position without returning any data\&. .PP Definition at line 474 of file streambuf\&. .SS "locale \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::getloc () const\fC [inline]\fP, \fC [inherited]\fP" .PP Locale access\&. \fBReturns:\fP .RS 4 The current locale in effect\&. .RE .PP If pubimbue(loc) has been called, then the most recent \fCloc\fP is returned\&. Otherwise the global locale in effect at the time of construction is returned\&. .PP Definition at line 221 of file streambuf\&. .SS "char_type* \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::gptr () const\fC [inline]\fP, \fC [protected]\fP, \fC [inherited]\fP" .PP Access to the get area\&. These functions are only available to other protected functions, including derived classes\&. .PP .IP "\(bu" 2 eback() returns the beginning pointer for the input sequence .IP "\(bu" 2 gptr() returns the next pointer for the input sequence .IP "\(bu" 2 egptr() returns the end pointer for the input sequence .PP .PP Definition at line 461 of file streambuf\&. .SS "virtual void \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::imbue (const \fBlocale\fP &)\fC [protected]\fP, \fC [virtual]\fP, \fC [inherited]\fP" .PP Changes translations\&. \fBParameters:\fP .RS 4 \fIloc\fP A new locale\&. .RE .PP 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\&." .PP \fBNote:\fP .RS 4 Base class version does nothing\&. .RE .PP .PP Reimplemented from \fBstd::basic_streambuf< _CharT, encoding_char_traits< _CharT > >\fP\&. .SS "streamsize \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::in_avail ()\fC [inline]\fP, \fC [inherited]\fP" .PP Looking ahead into the stream\&. \fBReturns:\fP .RS 4 The number of characters available\&. .RE .PP If a read position is available, returns the number of characters available for reading before the buffer must be refilled\&. Otherwise returns the derived \fCshowmanyc()\fP\&. .PP Definition at line 261 of file streambuf\&. .SS "bool \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::is_open () const throw ()\fC [inline]\fP, \fC [inherited]\fP" .PP Returns true if the external file is open\&. .PP Definition at line 222 of file fstream\&. .SS "\fB__filebuf_type\fP* \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::open (const char *__s, ios_base::openmode__mode)\fC [inherited]\fP" .PP Opens an external file\&. \fBParameters:\fP .RS 4 \fIs\fP The name of the file\&. .br \fImode\fP The open mode flags\&. .RE .PP \fBReturns:\fP .RS 4 \fCthis\fP on success, NULL on failure .RE .PP If a file is already open, this function immediately fails\&. Otherwise it tries to open the file named \fIs\fP using the flags given in \fImode\fP\&. .PP 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' | +---------------------------------------------------------+ .SS "\fB__filebuf_type\fP* \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::open (const \fBstd::string\fP &__s, ios_base::openmode__mode)\fC [inline]\fP, \fC [inherited]\fP" .PP Opens an external file\&. \fBParameters:\fP .RS 4 \fIs\fP The name of the file\&. .br \fImode\fP The open mode flags\&. .RE .PP \fBReturns:\fP .RS 4 \fCthis\fP on success, NULL on failure .RE .PP .PP Definition at line 275 of file fstream\&. .SS "virtual int_type \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::overflow (int_type = \fC_Traits::eof()\fP)\fC [protected]\fP, \fC [virtual]\fP, \fC [inherited]\fP" .PP Consumes data from the buffer; writes to the controlled sequence\&. \fBParameters:\fP .RS 4 \fIc\fP An additional character to consume\&. .RE .PP \fBReturns:\fP .RS 4 eof() to indicate failure, something else (usually \fIc\fP, or not_eof()) .RE .PP 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 \fIc\fP is also written out, if \fIc\fP is not \fCeof()\fP\&. .PP For a formal definition of this function, see a good text such as Langer & Kreft, or [27\&.5\&.2\&.4\&.5]/3-7\&. .PP A functioning output streambuf can be created by overriding only this function (no buffer area will be used)\&. .PP \fBNote:\fP .RS 4 Base class version does nothing, returns eof()\&. .RE .PP .PP Reimplemented from \fBstd::basic_streambuf< _CharT, encoding_char_traits< _CharT > >\fP\&. .SS "virtual int_type \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::pbackfail (int_type = \fC_Traits::eof()\fP)\fC [protected]\fP, \fC [virtual]\fP, \fC [inherited]\fP" .PP Tries to back up the input sequence\&. \fBParameters:\fP .RS 4 \fIc\fP The character to be inserted back into the sequence\&. .RE .PP \fBReturns:\fP .RS 4 eof() on failure, 'some other value' on success .RE .PP \fBPostcondition:\fP .RS 4 The constraints of \fCgptr()\fP, \fCeback()\fP, and \fCpptr()\fP are the same as for \fCunderflow()\fP\&. .RE .PP \fBNote:\fP .RS 4 Base class version does nothing, returns eof()\&. .RE .PP .PP Reimplemented from \fBstd::basic_streambuf< _CharT, encoding_char_traits< _CharT > >\fP\&. .SS "char_type* \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::pbase () const\fC [inline]\fP, \fC [protected]\fP, \fC [inherited]\fP" .PP Access to the put area\&. These functions are only available to other protected functions, including derived classes\&. .PP .IP "\(bu" 2 pbase() returns the beginning pointer for the output sequence .IP "\(bu" 2 pptr() returns the next pointer for the output sequence .IP "\(bu" 2 epptr() returns the end pointer for the output sequence .PP .PP Definition at line 505 of file streambuf\&. .SS "void \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::pbump (int__n)\fC [inline]\fP, \fC [protected]\fP, \fC [inherited]\fP" .PP Moving the write position\&. \fBParameters:\fP .RS 4 \fIn\fP The delta by which to move\&. .RE .PP This just advances the write position without returning any data\&. .PP Definition at line 521 of file streambuf\&. .SS "char_type* \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::pptr () const\fC [inline]\fP, \fC [protected]\fP, \fC [inherited]\fP" .PP Access to the put area\&. These functions are only available to other protected functions, including derived classes\&. .PP .IP "\(bu" 2 pbase() returns the beginning pointer for the output sequence .IP "\(bu" 2 pptr() returns the next pointer for the output sequence .IP "\(bu" 2 epptr() returns the end pointer for the output sequence .PP .PP Definition at line 508 of file streambuf\&. .SS "locale \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::pubimbue (const \fBlocale\fP &__loc)\fC [inline]\fP, \fC [inherited]\fP" .PP Entry point for imbue()\&. \fBParameters:\fP .RS 4 \fIloc\fP The new locale\&. .RE .PP \fBReturns:\fP .RS 4 The previous locale\&. .RE .PP Calls the derived imbue(loc)\&. .PP Definition at line 204 of file streambuf\&. .SS "\fBpos_type\fP \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::pubseekoff (\fBoff_type\fP__off, ios_base::seekdir__way, ios_base::openmode__mode = \fCios_base::in | ios_base::out\fP)\fC [inline]\fP, \fC [inherited]\fP" .PP Entry point for imbue()\&. \fBParameters:\fP .RS 4 \fIloc\fP The new locale\&. .RE .PP \fBReturns:\fP .RS 4 The previous locale\&. .RE .PP Calls the derived imbue(loc)\&. .PP Definition at line 238 of file streambuf\&. .SS "\fBpos_type\fP \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::pubseekpos (\fBpos_type\fP__sp, ios_base::openmode__mode = \fCios_base::in | ios_base::out\fP)\fC [inline]\fP, \fC [inherited]\fP" .PP Entry point for imbue()\&. \fBParameters:\fP .RS 4 \fIloc\fP The new locale\&. .RE .PP \fBReturns:\fP .RS 4 The previous locale\&. .RE .PP Calls the derived imbue(loc)\&. .PP Definition at line 243 of file streambuf\&. .SS "\fB__streambuf_type\fP* \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::pubsetbuf (\fBchar_type\fP *__s, \fBstreamsize\fP__n)\fC [inline]\fP, \fC [inherited]\fP" .PP Entry points for derived buffer functions\&. The public versions of \fCpubfoo\fP dispatch to the protected derived \fCfoo\fP member functions, passing the arguments (if any) and returning the result unchanged\&. .PP Definition at line 234 of file streambuf\&. .SS "int \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::pubsync ()\fC [inline]\fP, \fC [inherited]\fP" .PP Entry point for imbue()\&. \fBParameters:\fP .RS 4 \fIloc\fP The new locale\&. .RE .PP \fBReturns:\fP .RS 4 The previous locale\&. .RE .PP Calls the derived imbue(loc)\&. .PP Definition at line 248 of file streambuf\&. .SS "int_type \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::sbumpc ()\fC [inline]\fP, \fC [inherited]\fP" .PP Getting the next character\&. \fBReturns:\fP .RS 4 The next character, or eof\&. .RE .PP If the input read position is available, returns that character and increments the read pointer, otherwise calls and returns \fCuflow()\fP\&. .PP Definition at line 293 of file streambuf\&. .SS "virtual \fBpos_type\fP \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::seekoff (off_type, ios_base::seekdir, ios_base::openmode = \fCios_base::in | ios_base::out\fP)\fC [protected]\fP, \fC [virtual]\fP, \fC [inherited]\fP" .PP Alters the stream positions\&. Each derived class provides its own appropriate behavior\&. .PP \fBNote:\fP .RS 4 Base class version does nothing, returns a \fCpos_type\fP that represents an invalid stream position\&. .RE .PP .PP Reimplemented from \fBstd::basic_streambuf< _CharT, encoding_char_traits< _CharT > >\fP\&. .SS "virtual \fBpos_type\fP \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::seekpos (pos_type, ios_base::openmode = \fCios_base::in | ios_base::out\fP)\fC [protected]\fP, \fC [virtual]\fP, \fC [inherited]\fP" .PP Alters the stream positions\&. Each derived class provides its own appropriate behavior\&. .PP \fBNote:\fP .RS 4 Base class version does nothing, returns a \fCpos_type\fP that represents an invalid stream position\&. .RE .PP .PP Reimplemented from \fBstd::basic_streambuf< _CharT, encoding_char_traits< _CharT > >\fP\&. .SS "virtual \fB__streambuf_type\fP* \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::setbuf (char_type *__s, \fBstreamsize\fP__n)\fC [protected]\fP, \fC [virtual]\fP, \fC [inherited]\fP" .PP Manipulates the buffer\&. \fBParameters:\fP .RS 4 \fIs\fP Pointer to a buffer area\&. .br \fIn\fP Size of \fIs\fP\&. .RE .PP \fBReturns:\fP .RS 4 \fCthis\fP .RE .PP If no file has been opened, and both \fIs\fP and \fIn\fP are zero, then the stream becomes unbuffered\&. Otherwise, \fCs\fP is used as a buffer; see http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch25s02.html for more\&. .PP Reimplemented from \fBstd::basic_streambuf< _CharT, encoding_char_traits< _CharT > >\fP\&. .SS "void \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::setg (\fBchar_type\fP *__gbeg, \fBchar_type\fP *__gnext, \fBchar_type\fP *__gend)\fC [inline]\fP, \fC [protected]\fP, \fC [inherited]\fP" .PP Setting the three read area pointers\&. \fBParameters:\fP .RS 4 \fIgbeg\fP A pointer\&. .br \fIgnext\fP A pointer\&. .br \fIgend\fP A pointer\&. .RE .PP \fBPostcondition:\fP .RS 4 \fIgbeg\fP == \fCeback()\fP, \fIgnext\fP == \fCgptr()\fP, and \fIgend\fP == \fCegptr()\fP .RE .PP .PP Definition at line 485 of file streambuf\&. .SS "void \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::setp (\fBchar_type\fP *__pbeg, \fBchar_type\fP *__pend)\fC [inline]\fP, \fC [protected]\fP, \fC [inherited]\fP" .PP Setting the three write area pointers\&. \fBParameters:\fP .RS 4 \fIpbeg\fP A pointer\&. .br \fIpend\fP A pointer\&. .RE .PP \fBPostcondition:\fP .RS 4 \fIpbeg\fP == \fCpbase()\fP, \fIpbeg\fP == \fCpptr()\fP, and \fIpend\fP == \fCepptr()\fP .RE .PP .PP Definition at line 531 of file streambuf\&. .SS "int_type \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::sgetc ()\fC [inline]\fP, \fC [inherited]\fP" .PP Getting the next character\&. \fBReturns:\fP .RS 4 The next character, or eof\&. .RE .PP If the input read position is available, returns that character, otherwise calls and returns \fCunderflow()\fP\&. Does not move the read position after fetching the character\&. .PP Definition at line 315 of file streambuf\&. .SS "streamsize \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::sgetn (\fBchar_type\fP *__s, \fBstreamsize\fP__n)\fC [inline]\fP, \fC [inherited]\fP" .PP Entry point for xsgetn\&. \fBParameters:\fP .RS 4 \fIs\fP A buffer area\&. .br \fIn\fP A count\&. .RE .PP Returns xsgetn(s,n)\&. The effect is to fill \fIs\fP[0] through \fIs\fP[n-1] with characters from the input sequence, if possible\&. .PP Definition at line 334 of file streambuf\&. .SS "virtual streamsize \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::showmanyc ()\fC [protected]\fP, \fC [virtual]\fP, \fC [inherited]\fP" .PP Investigating the data available\&. \fBReturns:\fP .RS 4 An estimate of the number of characters available in the input sequence, or -1\&. .RE .PP "If it returns a positive value, then successive calls to \fCunderflow()\fP will not return \fCtraits::eof()\fP until at least that number of characters have been supplied\&. If \fCshowmanyc()\fP returns -1, then calls to \fCunderflow()\fP or \fCuflow()\fP will fail\&." [27\&.5\&.2\&.4\&.3]/1 .PP \fBNote:\fP .RS 4 Base class version does nothing, returns zero\&. .PP The standard adds that "the intention is not only that the calls [to underflow or uflow] will not return \fCeof()\fP but that they will return 'immediately'\&. .PP The standard adds that 'the morphemes of @c showmanyc are 'es-how-many-see', not 'show-manic"\&. .RE .PP .PP Reimplemented from \fBstd::basic_streambuf< _CharT, encoding_char_traits< _CharT > >\fP\&. .SS "int_type \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::snextc ()\fC [inline]\fP, \fC [inherited]\fP" .PP Getting the next character\&. \fBReturns:\fP .RS 4 The next character, or eof\&. .RE .PP Calls \fCsbumpc()\fP, and if that function returns \fCtraits::eof()\fP, so does this function\&. Otherwise, \fCsgetc()\fP\&. .PP Definition at line 275 of file streambuf\&. .SS "int_type \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::sputbackc (\fBchar_type\fP__c)\fC [inline]\fP, \fC [inherited]\fP" .PP Pushing characters back into the input stream\&. \fBParameters:\fP .RS 4 \fIc\fP The character to push back\&. .RE .PP \fBReturns:\fP .RS 4 The previous character, if possible\&. .RE .PP Similar to sungetc(), but \fIc\fP is pushed onto the stream instead of 'the previous character'\&. If successful, the next character fetched from the input stream will be \fIc\fP\&. .PP Definition at line 348 of file streambuf\&. .SS "int_type \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::sputc (\fBchar_type\fP__c)\fC [inline]\fP, \fC [inherited]\fP" .PP Entry point for all single-character output functions\&. \fBParameters:\fP .RS 4 \fIc\fP A character to output\&. .RE .PP \fBReturns:\fP .RS 4 \fIc\fP, if possible\&. .RE .PP One of two public output functions\&. .PP If a write position is available for the output sequence (i\&.e\&., the buffer is not full), stores \fIc\fP in that position, increments the position, and returns \fCtraits::to_int_type(c)\fP\&. If a write position is not available, returns \fCoverflow(c)\fP\&. .PP Definition at line 400 of file streambuf\&. .SS "streamsize \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::sputn (const \fBchar_type\fP *__s, \fBstreamsize\fP__n)\fC [inline]\fP, \fC [inherited]\fP" .PP Entry point for all single-character output functions\&. \fBParameters:\fP .RS 4 \fIs\fP A buffer read area\&. .br \fIn\fP A count\&. .RE .PP One of two public output functions\&. .PP Returns xsputn(s,n)\&. The effect is to write \fIs\fP[0] through \fIs\fP[n-1] to the output sequence, if possible\&. .PP Definition at line 426 of file streambuf\&. .SS "void \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::stossc ()\fC [inline]\fP, \fC [inherited]\fP" .PP Tosses a character\&. Advances the read pointer, ignoring the character that would have been read\&. .PP See http://gcc.gnu.org/ml/libstdc++/2002-05/msg00168.html .PP Definition at line 758 of file streambuf\&. .SS "int_type \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::sungetc ()\fC [inline]\fP, \fC [inherited]\fP" .PP Moving backwards in the input stream\&. \fBReturns:\fP .RS 4 The previous character, if possible\&. .RE .PP If a putback position is available, this function decrements the input pointer and returns that character\&. Otherwise, calls and returns pbackfail()\&. The effect is to 'unget' the last character 'gotten'\&. .PP Definition at line 373 of file streambuf\&. .SS "virtual int \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::sync (void)\fC [protected]\fP, \fC [virtual]\fP, \fC [inherited]\fP" .PP Synchronizes the buffer arrays with the controlled sequences\&. \fBReturns:\fP .RS 4 -1 on failure\&. .RE .PP Each derived class provides its own appropriate behavior, including the definition of 'failure'\&. .PP \fBNote:\fP .RS 4 Base class version does nothing, returns zero\&. .RE .PP .PP Reimplemented from \fBstd::basic_streambuf< _CharT, encoding_char_traits< _CharT > >\fP\&. .SS "virtual int_type \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::uflow ()\fC [inline]\fP, \fC [protected]\fP, \fC [virtual]\fP, \fC [inherited]\fP" .PP Fetches more data from the controlled sequence\&. \fBReturns:\fP .RS 4 The first character from the \fIpending sequence\fP\&. .RE .PP Informally, this function does the same thing as \fCunderflow()\fP, and in fact is required to call that function\&. It also returns the new character, like \fCunderflow()\fP does\&. However, this function also moves the read position forward by one\&. .PP Definition at line 676 of file streambuf\&. .SS "virtual int_type \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::underflow ()\fC [protected]\fP, \fC [virtual]\fP, \fC [inherited]\fP" .PP Fetches more data from the controlled sequence\&. \fBReturns:\fP .RS 4 The first character from the \fIpending sequence\fP\&. .RE .PP 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 \fCtraits::eof()\fP to indicate a null pending sequence\&. .PP For a formal definition of the pending sequence, see a good text such as Langer & Kreft, or [27\&.5\&.2\&.4\&.3]/7-14\&. .PP A functioning input streambuf can be created by overriding only this function (no buffer area will be used)\&. For an example, see http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch25.html .PP \fBNote:\fP .RS 4 Base class version does nothing, returns eof()\&. .RE .PP .PP Reimplemented from \fBstd::basic_streambuf< _CharT, encoding_char_traits< _CharT > >\fP\&. .SS "virtual streamsize \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::xsgetn (char_type *__s, \fBstreamsize\fP__n)\fC [protected]\fP, \fC [virtual]\fP, \fC [inherited]\fP" .PP Multiple character extraction\&. \fBParameters:\fP .RS 4 \fIs\fP A buffer area\&. .br \fIn\fP Maximum number of characters to assign\&. .RE .PP \fBReturns:\fP .RS 4 The number of characters assigned\&. .RE .PP Fills \fIs\fP[0] through \fIs\fP[n-1] with characters from the input sequence, as if by \fCsbumpc()\fP\&. Stops when either \fIn\fP characters have been copied, or when \fCtraits::eof()\fP would be copied\&. .PP It is expected that derived classes provide a more efficient implementation by overriding this definition\&. .PP Reimplemented from \fBstd::basic_streambuf< _CharT, encoding_char_traits< _CharT > >\fP\&. .SS "virtual streamsize \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::xsputn (const char_type *__s, \fBstreamsize\fP__n)\fC [protected]\fP, \fC [virtual]\fP, \fC [inherited]\fP" .PP Multiple character insertion\&. \fBParameters:\fP .RS 4 \fIs\fP A buffer area\&. .br \fIn\fP Maximum number of characters to write\&. .RE .PP \fBReturns:\fP .RS 4 The number of characters written\&. .RE .PP Writes \fIs\fP[0] through \fIs\fP[n-1] to the output sequence, as if by \fCsputc()\fP\&. Stops when either \fIn\fP characters have been copied, or when \fCsputc()\fP would return \fCtraits::eof()\fP\&. .PP It is expected that derived classes provide a more efficient implementation by overriding this definition\&. .PP Reimplemented from \fBstd::basic_streambuf< _CharT, encoding_char_traits< _CharT > >\fP\&. .SH "Member Data Documentation" .PP .SS "char_type* \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_buf\fC [protected]\fP, \fC [inherited]\fP" .PP Pointer to the beginning of internal buffer\&. .PP Definition at line 109 of file fstream\&. .SS "locale \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_buf_locale\fC [protected]\fP, \fC [inherited]\fP" .PP Current locale setting\&. .PP Definition at line 187 of file streambuf\&. .SS "size_t \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_buf_size\fC [protected]\fP, \fC [inherited]\fP" 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\&. .PP Definition at line 116 of file fstream\&. .SS "char* \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_ext_buf\fC [protected]\fP, \fC [inherited]\fP" Buffer for external characters\&. Used for input when codecvt::always_noconv() == false\&. When valid, this corresponds to eback()\&. .PP Definition at line 151 of file fstream\&. .SS "streamsize \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_ext_buf_size\fC [protected]\fP, \fC [inherited]\fP" Size of buffer held by _M_ext_buf\&. .PP Definition at line 156 of file fstream\&. .SS "const char* \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_ext_next\fC [protected]\fP, \fC [inherited]\fP" 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()\&. .PP Definition at line 163 of file fstream\&. .SS "char_type* \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_in_beg\fC [protected]\fP, \fC [inherited]\fP" This is based on _IO_FILE, just reordered to be more consistent, and is intended to be the most minimal abstraction for an internal buffer\&. .IP "\(bu" 2 get == input == read .IP "\(bu" 2 put == output == write .PP .PP Definition at line 179 of file streambuf\&. .SS "char_type* \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_in_cur\fC [protected]\fP, \fC [inherited]\fP" .PP Entry point for imbue()\&. \fBParameters:\fP .RS 4 \fIloc\fP The new locale\&. .RE .PP \fBReturns:\fP .RS 4 The previous locale\&. .RE .PP Calls the derived imbue(loc)\&. .PP Definition at line 180 of file streambuf\&. .SS "char_type* \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_in_end\fC [protected]\fP, \fC [inherited]\fP" .PP Entry point for imbue()\&. \fBParameters:\fP .RS 4 \fIloc\fP The new locale\&. .RE .PP \fBReturns:\fP .RS 4 The previous locale\&. .RE .PP Calls the derived imbue(loc)\&. .PP Definition at line 181 of file streambuf\&. .SS "ios_base::openmode \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_mode\fC [protected]\fP, \fC [inherited]\fP" .PP Place to stash in || out || in | out settings for current filebuf\&. .PP Definition at line 94 of file fstream\&. .SS "char_type* \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_out_beg\fC [protected]\fP, \fC [inherited]\fP" .PP Entry point for imbue()\&. \fBParameters:\fP .RS 4 \fIloc\fP The new locale\&. .RE .PP \fBReturns:\fP .RS 4 The previous locale\&. .RE .PP Calls the derived imbue(loc)\&. .PP Definition at line 182 of file streambuf\&. .SS "char_type* \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_out_cur\fC [protected]\fP, \fC [inherited]\fP" .PP Entry point for imbue()\&. \fBParameters:\fP .RS 4 \fIloc\fP The new locale\&. .RE .PP \fBReturns:\fP .RS 4 The previous locale\&. .RE .PP Calls the derived imbue(loc)\&. .PP Definition at line 183 of file streambuf\&. .SS "char_type* \fBstd::basic_streambuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_out_end\fC [protected]\fP, \fC [inherited]\fP" .PP Entry point for imbue()\&. \fBParameters:\fP .RS 4 \fIloc\fP The new locale\&. .RE .PP \fBReturns:\fP .RS 4 The previous locale\&. .RE .PP Calls the derived imbue(loc)\&. .PP Definition at line 184 of file streambuf\&. .SS "char_type \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_pback\fC [protected]\fP, \fC [inherited]\fP" Necessary bits for putback buffer management\&. .PP \fBNote:\fP .RS 4 pbacks of over one character are not currently supported\&. .RE .PP .PP Definition at line 137 of file fstream\&. .SS "char_type* \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_pback_cur_save\fC [protected]\fP, \fC [inherited]\fP" Necessary bits for putback buffer management\&. .PP \fBNote:\fP .RS 4 pbacks of over one character are not currently supported\&. .RE .PP .PP Definition at line 138 of file fstream\&. .SS "char_type* \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_pback_end_save\fC [protected]\fP, \fC [inherited]\fP" Necessary bits for putback buffer management\&. .PP \fBNote:\fP .RS 4 pbacks of over one character are not currently supported\&. .RE .PP .PP Definition at line 139 of file fstream\&. .SS "bool \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_pback_init\fC [protected]\fP, \fC [inherited]\fP" Necessary bits for putback buffer management\&. .PP \fBNote:\fP .RS 4 pbacks of over one character are not currently supported\&. .RE .PP .PP Definition at line 140 of file fstream\&. .SS "bool \fBstd::basic_filebuf\fP< _CharT, \fBencoding_char_traits\fP< _CharT > >::_M_reading\fC [protected]\fP, \fC [inherited]\fP" _M_reading == false && _M_writing == false for 'uncommitted' mode; _M_reading == true for 'read' mode; _M_writing == true for 'write' mode; .PP NB: _M_reading == true && _M_writing == true is unused\&. .PP Definition at line 128 of file fstream\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.