.TH "std::basic_stringbuf< _CharT, _Traits, _Alloc >" 3cxx "Sun Jan 6 2013" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::basic_stringbuf< _CharT, _Traits, _Alloc > \- .SH SYNOPSIS .br .PP .PP Inherits \fBstd::basic_streambuf< _CharT, _Traits >\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "typedef __string_type::size_type \fB__size_type\fP" .br .ti -1c .RI "typedef \fBbasic_streambuf\fP .br < char_type, traits_type > \fB__streambuf_type\fP" .br .ti -1c .RI "typedef \fBbasic_string\fP .br < char_type, _Traits, _Alloc > \fB__string_type\fP" .br .ti -1c .RI "typedef _Alloc \fBallocator_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 traits_type::pos_type \fBpos_type\fP" .br .ti -1c .RI "typedef _Traits \fBtraits_type\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBbasic_stringbuf\fP (\fBios_base::openmode\fP __mode=\fBios_base::in\fP|\fBios_base::out\fP)" .br .ti -1c .RI "\fBbasic_stringbuf\fP (const \fB__string_type\fP &__str, \fBios_base::openmode\fP __mode=\fBios_base::in\fP|\fBios_base::out\fP)" .br .ti -1c .RI "\fBstreamsize\fP \fBin_avail\fP ()" .br .ti -1c .RI "int_type \fBsbumpc\fP ()" .br .ti -1c .RI "int_type \fBsgetc\fP ()" .br .ti -1c .RI "\fBstreamsize\fP \fBsgetn\fP (char_type *__s, \fBstreamsize\fP __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 "\fBstreamsize\fP \fBsputn\fP (const char_type *__s, \fBstreamsize\fP __n)" .br .ti -1c .RI "\fB__string_type\fP \fBstr\fP () const " .br .ti -1c .RI "void \fBstr\fP (const \fB__string_type\fP &__s)" .br .ti -1c .RI "int_type \fBsungetc\fP ()" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "void \fB__safe_gbump\fP (\fBstreamsize\fP __n)" .br .ti -1c .RI "void \fB__safe_pbump\fP (\fBstreamsize\fP __n)" .br .ti -1c .RI "void \fB_M_pbump\fP (char_type *__pbeg, char_type *__pend, off_type __off)" .br .ti -1c .RI "void \fB_M_stringbuf_init\fP (\fBios_base::openmode\fP __mode)" .br .ti -1c .RI "void \fB_M_sync\fP (char_type *__base, __size_type __i, __size_type __o)" .br .ti -1c .RI "void \fB_M_update_egptr\fP ()" .br .ti -1c .RI "void \fBgbump\fP (int __n)" .br .ti -1c .RI "virtual void \fBimbue\fP (const \fBlocale\fP &__loc)" .br .ti -1c .RI "virtual int_type \fBoverflow\fP (int_type __c=traits_type::eof())" .br .ti -1c .RI "virtual int_type \fBpbackfail\fP (int_type __c=traits_type::eof())" .br .ti -1c .RI "void \fBpbump\fP (int __n)" .br .ti -1c .RI "virtual pos_type \fBseekoff\fP (off_type __off, \fBios_base::seekdir\fP __way, \fBios_base::openmode\fP __mode=\fBios_base::in\fP|\fBios_base::out\fP)" .br .ti -1c .RI "virtual pos_type \fBseekpos\fP (pos_type __sp, \fBios_base::openmode\fP __mode=\fBios_base::in\fP|\fBios_base::out\fP)" .br .ti -1c .RI "virtual \fB__streambuf_type\fP * \fBsetbuf\fP (char_type *__s, \fBstreamsize\fP __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 \fBstreamsize\fP \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 \fBstreamsize\fP \fBxsgetn\fP (char_type *__s, \fBstreamsize\fP __n)" .br .ti -1c .RI "virtual \fBstreamsize\fP \fBxsputn\fP (const char_type *__s, \fBstreamsize\fP __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 "\fBios_base::openmode\fP \fB_M_mode\fP" .br .ti -1c .RI "\fB__string_type\fP \fB_M_string\fP" .br .in -1c .in +1c .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 "\fBlocale\fP \fB_M_buf_locale\fP" .br .ti -1c .RI "\fBlocale\fP \fBpubimbue\fP (const \fBlocale\fP &__loc)" .br .ti -1c .RI "\fBlocale\fP \fBgetloc\fP () const " .br .ti -1c .RI "\fB__streambuf_type\fP * \fBpubsetbuf\fP (char_type *__s, \fBstreamsize\fP __n)" .br .ti -1c .RI "pos_type \fBpubseekoff\fP (off_type __off, \fBios_base::seekdir\fP __way, \fBios_base::openmode\fP __mode=\fBios_base::in\fP|\fBios_base::out\fP)" .br .ti -1c .RI "pos_type \fBpubseekpos\fP (pos_type __sp, \fBios_base::openmode\fP __mode=\fBios_base::in\fP|\fBios_base::out\fP)" .br .ti -1c .RI "int \fBpubsync\fP ()" .br .in -1c .SH "Detailed Description" .PP .SS "templateclass std::basic_stringbuf< _CharT, _Traits, _Alloc >" The actual work of input and output (for std::string)\&. .PP This class associates either or both of its input and output sequences with a sequence of characters, which can be initialized from, or made available as, a \fC\fBstd::basic_string\fP\fP\&. (Paraphrased from [27\&.7\&.1]/1\&.) For this class, open modes (of type \fC\fBios_base::openmode\fP\fP) have \fCin\fP set if the input sequence can be read, and \fCout\fP set if the output sequence can be written\&. .PP Definition at line 60 of file sstream\&. .SH "Constructor & Destructor Documentation" .PP .SS "template \fBstd::basic_stringbuf\fP< _CharT, _Traits, _Alloc >::\fBbasic_stringbuf\fP (\fBios_base::openmode\fP__mode = \fC\fBios_base::in\fP | \fBios_base::out\fP\fP)\fC [inline]\fP, \fC [explicit]\fP" .PP Starts with an empty string buffer\&. \fBParameters:\fP .RS 4 \fI__mode\fP Whether the buffer can read, or write, or both\&. .RE .PP The default constructor initializes the parent class using its own default ctor\&. .PP Definition at line 94 of file sstream\&. .SS "template \fBstd::basic_stringbuf\fP< _CharT, _Traits, _Alloc >::\fBbasic_stringbuf\fP (const \fB__string_type\fP &__str, \fBios_base::openmode\fP__mode = \fC\fBios_base::in\fP | \fBios_base::out\fP\fP)\fC [inline]\fP, \fC [explicit]\fP" .PP Starts with an existing string buffer\&. \fBParameters:\fP .RS 4 \fI__str\fP A string to copy as a starting buffer\&. .br \fI__mode\fP Whether the buffer can read, or write, or both\&. .RE .PP This constructor initializes the parent class using its own default ctor\&. .PP Definition at line 107 of file sstream\&. .SH "Member Function Documentation" .PP .SS "template char_type* \fBstd::basic_streambuf\fP< _CharT, _Traits >::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 \fBeback()\fP returns the beginning pointer for the input sequence .IP "\(bu" 2 \fBgptr()\fP returns the next pointer for the input sequence .IP "\(bu" 2 \fBegptr()\fP returns the end pointer for the input sequence .PP .PP Definition at line 480 of file streambuf\&. .PP Referenced by std::basic_filebuf< char_type, traits_type >::_M_destroy_pback(), std::basic_streambuf< char_type, traits_type >::sputbackc(), and std::basic_streambuf< char_type, traits_type >::sungetc()\&. .SS "template char_type* \fBstd::basic_streambuf\fP< _CharT, _Traits >::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 \fBeback()\fP returns the beginning pointer for the input sequence .IP "\(bu" 2 \fBgptr()\fP returns the next pointer for the input sequence .IP "\(bu" 2 \fBegptr()\fP returns the end pointer for the input sequence .PP .PP Definition at line 486 of file streambuf\&. .PP Referenced by std::basic_filebuf< char_type, traits_type >::_M_create_pback(), std::basic_streambuf< char_type, traits_type >::in_avail(), std::basic_streambuf< char_type, traits_type >::sbumpc(), std::basic_streambuf< char_type, traits_type >::sgetc(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::showmanyc(), and std::basic_stringbuf< _CharT, _Traits, _Alloc >::str()\&. .SS "template char_type* \fBstd::basic_streambuf\fP< _CharT, _Traits >::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 \fBpbase()\fP returns the beginning pointer for the output sequence .IP "\(bu" 2 \fBpptr()\fP returns the next pointer for the output sequence .IP "\(bu" 2 \fBepptr()\fP returns the end pointer for the output sequence .PP .PP Definition at line 533 of file streambuf\&. .PP Referenced by std::basic_streambuf< char_type, traits_type >::sputc()\&. .SS "template void \fBstd::basic_streambuf\fP< _CharT, _Traits >::gbump (int__n)\fC [inline]\fP, \fC [protected]\fP, \fC [inherited]\fP" .PP Moving the read position\&. \fBParameters:\fP .RS 4 \fI__n\fP The delta by which to move\&. .RE .PP This just advances the read position without returning any data\&. .PP Definition at line 496 of file streambuf\&. .PP Referenced by std::basic_streambuf< char_type, traits_type >::sbumpc(), std::basic_streambuf< char_type, traits_type >::sputbackc(), std::basic_streambuf< char_type, traits_type >::sungetc(), and std::basic_streambuf< char_type, traits_type >::uflow()\&. .SS "template \fBlocale\fP \fBstd::basic_streambuf\fP< _CharT, _Traits >::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 224 of file streambuf\&. .PP Referenced by std::basic_streambuf< char_type, traits_type >::pubimbue()\&. .SS "template char_type* \fBstd::basic_streambuf\fP< _CharT, _Traits >::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 \fBeback()\fP returns the beginning pointer for the input sequence .IP "\(bu" 2 \fBgptr()\fP returns the next pointer for the input sequence .IP "\(bu" 2 \fBegptr()\fP returns the end pointer for the input sequence .PP .PP Definition at line 483 of file streambuf\&. .PP Referenced by std::basic_filebuf< char_type, traits_type >::_M_create_pback(), std::basic_filebuf< char_type, traits_type >::_M_destroy_pback(), std::basic_streambuf< char_type, traits_type >::in_avail(), std::basic_streambuf< char_type, traits_type >::sbumpc(), std::basic_streambuf< char_type, traits_type >::sgetc(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::showmanyc(), std::basic_streambuf< char_type, traits_type >::sputbackc(), std::basic_streambuf< char_type, traits_type >::sungetc(), and std::basic_streambuf< char_type, traits_type >::uflow()\&. .SS "template virtual void \fBstd::basic_streambuf\fP< _CharT, _Traits >::imbue (const \fBlocale\fP &__loc)\fC [inline]\fP, \fC [protected]\fP, \fC [virtual]\fP, \fC [inherited]\fP" .PP Changes translations\&. \fBParameters:\fP .RS 4 \fI__loc\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, \fIBetween 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\&.\fP .PP \fBNote:\fP .RS 4 Base class version does nothing\&. .RE .PP .PP Reimplemented in \fBstd::basic_filebuf< _CharT, _Traits >\fP, \fBstd::basic_filebuf< _CharT, encoding_char_traits< _CharT > >\fP, and \fBstd::basic_filebuf< char_type, traits_type >\fP\&. .PP Definition at line 574 of file streambuf\&. .PP Referenced by std::basic_streambuf< char_type, traits_type >::pubimbue()\&. .SS "template \fBstreamsize\fP \fBstd::basic_streambuf\fP< _CharT, _Traits >::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 \fC\fBshowmanyc()\fP\fP\&. .PP Definition at line 282 of file streambuf\&. .SS "template \fBbasic_stringbuf\fP< _CharT, _Traits, _Alloc >::int_type \fBbasic_stringbuf\fP< _CharT, _Traits, _Alloc >::overflow (int_type__c = \fCtraits_type::eof()\fP)\fC [protected]\fP, \fC [virtual]\fP" .PP Consumes data from the buffer; writes to the controlled sequence\&. \fBParameters:\fP .RS 4 \fI__c\fP An additional character to consume\&. .RE .PP \fBReturns:\fP .RS 4 eof() to indicate failure, something else (usually \fI__c\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 \fIconsumed\fP, with \fIsome effect\fP 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 \fI__c\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, _Traits >\fP\&. .PP Definition at line 82 of file sstream\&.tcc\&. .PP References std::basic_string< _CharT, _Traits, _Alloc >::assign(), std::max(), std::min(), std::ios_base::out, std::basic_string< _CharT, _Traits, _Alloc >::push_back(), and std::basic_string< _CharT, _Traits, _Alloc >::reserve()\&. .SS "template \fBbasic_stringbuf\fP< _CharT, _Traits, _Alloc >::int_type \fBbasic_stringbuf\fP< _CharT, _Traits, _Alloc >::pbackfail (int_type__c = \fCtraits_type::eof()\fP)\fC [protected]\fP, \fC [virtual]\fP" .PP Tries to back up the input sequence\&. \fBParameters:\fP .RS 4 \fI__c\fP The character to be inserted back into the sequence\&. .RE .PP \fBReturns:\fP .RS 4 eof() on failure, \fIsome other value\fP on success .RE .PP \fBPostcondition:\fP .RS 4 The constraints of \fC\fBgptr()\fP\fP, \fC\fBeback()\fP\fP, and \fC\fBpptr()\fP\fP are the same as for \fC\fBunderflow()\fP\fP\&. .RE .PP \fBNote:\fP .RS 4 Base class version does nothing, returns eof()\&. .RE .PP .PP Reimplemented from \fBstd::basic_streambuf< _CharT, _Traits >\fP\&. .PP Definition at line 48 of file sstream\&.tcc\&. .PP References std::ios_base::out\&. .SS "template char_type* \fBstd::basic_streambuf\fP< _CharT, _Traits >::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 \fBpbase()\fP returns the beginning pointer for the output sequence .IP "\(bu" 2 \fBpptr()\fP returns the next pointer for the output sequence .IP "\(bu" 2 \fBepptr()\fP returns the end pointer for the output sequence .PP .PP Definition at line 527 of file streambuf\&. .PP Referenced by std::basic_stringbuf< _CharT, _Traits, _Alloc >::str()\&. .SS "template void \fBstd::basic_streambuf\fP< _CharT, _Traits >::pbump (int__n)\fC [inline]\fP, \fC [protected]\fP, \fC [inherited]\fP" .PP Moving the write position\&. \fBParameters:\fP .RS 4 \fI__n\fP The delta by which to move\&. .RE .PP This just advances the write position without returning any data\&. .PP Definition at line 543 of file streambuf\&. .PP Referenced by std::basic_streambuf< char_type, traits_type >::sputc()\&. .SS "template char_type* \fBstd::basic_streambuf\fP< _CharT, _Traits >::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 \fBpbase()\fP returns the beginning pointer for the output sequence .IP "\(bu" 2 \fBpptr()\fP returns the next pointer for the output sequence .IP "\(bu" 2 \fBepptr()\fP returns the end pointer for the output sequence .PP .PP Definition at line 530 of file streambuf\&. .PP Referenced by std::basic_streambuf< char_type, traits_type >::sputc(), and std::basic_stringbuf< _CharT, _Traits, _Alloc >::str()\&. .SS "template \fBlocale\fP \fBstd::basic_streambuf\fP< _CharT, _Traits >::pubimbue (const \fBlocale\fP &__loc)\fC [inline]\fP, \fC [inherited]\fP" .PP Entry point for \fBimbue()\fP\&. \fBParameters:\fP .RS 4 \fI__loc\fP The new locale\&. .RE .PP \fBReturns:\fP .RS 4 The previous locale\&. .RE .PP Calls the derived imbue(__loc)\&. .PP Definition at line 207 of file streambuf\&. .SS "template pos_type \fBstd::basic_streambuf\fP< _CharT, _Traits >::pubseekoff (\fBoff_type\fP__off, \fBios_base::seekdir\fP__way, \fBios_base::openmode\fP__mode = \fC\fBios_base::in\fP | \fBios_base::out\fP\fP)\fC [inline]\fP, \fC [inherited]\fP" .PP Alters the stream position\&. \fBParameters:\fP .RS 4 \fI__off\fP Offset\&. .br \fI__way\fP Value for \fBios_base::seekdir\fP\&. .br \fI__mode\fP Value for \fBios_base::openmode\fP\&. .RE .PP Calls virtual seekoff function\&. .PP Definition at line 249 of file streambuf\&. .SS "template pos_type \fBstd::basic_streambuf\fP< _CharT, _Traits >::pubseekpos (\fBpos_type\fP__sp, \fBios_base::openmode\fP__mode = \fC\fBios_base::in\fP | \fBios_base::out\fP\fP)\fC [inline]\fP, \fC [inherited]\fP" .PP Alters the stream position\&. \fBParameters:\fP .RS 4 \fI__sp\fP Position .br \fI__mode\fP Value for \fBios_base::openmode\fP\&. .RE .PP Calls virtual seekpos function\&. .PP Definition at line 261 of file streambuf\&. .SS "template \fB__streambuf_type\fP* \fBstd::basic_streambuf\fP< _CharT, _Traits >::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 237 of file streambuf\&. .SS "template int \fBstd::basic_streambuf\fP< _CharT, _Traits >::pubsync ()\fC [inline]\fP, \fC [inherited]\fP" .PP Calls virtual sync function\&. .PP Definition at line 269 of file streambuf\&. .PP Referenced by std::basic_istream< _CharT, _Traits >::sync()\&. .SS "template int_type \fBstd::basic_streambuf\fP< _CharT, _Traits >::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 \fC\fBuflow()\fP\fP\&. .PP Definition at line 314 of file streambuf\&. .PP Referenced by std::basic_istream< _CharT, _Traits >::getline(), std::basic_istream< _CharT, _Traits >::ignore(), std::istreambuf_iterator< _CharT, _Traits >::operator++(), and std::basic_streambuf< char_type, traits_type >::snextc()\&. .SS "template \fBbasic_stringbuf\fP< _CharT, _Traits, _Alloc >::pos_type \fBbasic_stringbuf\fP< _CharT, _Traits, _Alloc >::seekoff (off_type, \fBios_base::seekdir\fP, \fBios_base::openmode\fP = \fC\fBios_base::in\fP | \fBios_base::out\fP\fP)\fC [protected]\fP, \fC [virtual]\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, _Traits >\fP\&. .PP Definition at line 151 of file sstream\&.tcc\&. .PP References std::ios_base::cur, std::ios_base::end, std::ios_base::in, and std::ios_base::out\&. .SS "template \fBbasic_stringbuf\fP< _CharT, _Traits, _Alloc >::pos_type \fBbasic_stringbuf\fP< _CharT, _Traits, _Alloc >::seekpos (pos_type, \fBios_base::openmode\fP = \fC\fBios_base::in\fP | \fBios_base::out\fP\fP)\fC [protected]\fP, \fC [virtual]\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, _Traits >\fP\&. .PP Definition at line 199 of file sstream\&.tcc\&. .PP References std::ios_base::in, and std::ios_base::out\&. .SS "template virtual \fB__streambuf_type\fP* \fBstd::basic_stringbuf\fP< _CharT, _Traits, _Alloc >::setbuf (char_type *__s, \fBstreamsize\fP__n)\fC [inline]\fP, \fC [protected]\fP, \fC [virtual]\fP" .PP Manipulates the buffer\&. \fBParameters:\fP .RS 4 \fI__s\fP Pointer to a buffer area\&. .br \fI__n\fP Size of \fI__s\fP\&. .RE .PP \fBReturns:\fP .RS 4 \fCthis\fP .RE .PP If no buffer has already been created, and both \fI__s\fP and \fI__n\fP are non-zero, then \fC__s\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, _Traits >\fP\&. .PP Definition at line 198 of file sstream\&. .PP References std::basic_string< _CharT, _Traits, _Alloc >::clear()\&. .SS "template void \fBstd::basic_streambuf\fP< _CharT, _Traits >::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 \fI__gbeg\fP A pointer\&. .br \fI__gnext\fP A pointer\&. .br \fI__gend\fP A pointer\&. .RE .PP \fBPostcondition:\fP .RS 4 \fI__gbeg\fP == \fC\fBeback()\fP\fP, \fI__gnext\fP == \fC\fBgptr()\fP\fP, and \fI__gend\fP == \fC\fBegptr()\fP\fP .RE .PP .PP Definition at line 507 of file streambuf\&. .PP Referenced by std::basic_filebuf< char_type, traits_type >::_M_create_pback(), std::basic_filebuf< char_type, traits_type >::_M_destroy_pback(), and std::basic_filebuf< char_type, traits_type >::_M_set_buffer()\&. .SS "template void \fBstd::basic_streambuf\fP< _CharT, _Traits >::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 \fI__pbeg\fP A pointer\&. .br \fI__pend\fP A pointer\&. .RE .PP \fBPostcondition:\fP .RS 4 \fI__pbeg\fP == \fC\fBpbase()\fP\fP, \fI__pbeg\fP == \fC\fBpptr()\fP\fP, and \fI__pend\fP == \fC\fBepptr()\fP\fP .RE .PP .PP Definition at line 553 of file streambuf\&. .PP Referenced by std::basic_filebuf< char_type, traits_type >::_M_set_buffer()\&. .SS "template int_type \fBstd::basic_streambuf\fP< _CharT, _Traits >::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 \fC\fBunderflow()\fP\fP\&. Does not move the read position after fetching the character\&. .PP Definition at line 336 of file streambuf\&. .PP Referenced by std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::getline(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::sentry::sentry(), and std::basic_streambuf< char_type, traits_type >::snextc()\&. .SS "template \fBstreamsize\fP \fBstd::basic_streambuf\fP< _CharT, _Traits >::sgetn (\fBchar_type\fP *__s, \fBstreamsize\fP__n)\fC [inline]\fP, \fC [inherited]\fP" .PP Entry point for xsgetn\&. \fBParameters:\fP .RS 4 \fI__s\fP A buffer area\&. .br \fI__n\fP A count\&. .RE .PP Returns xsgetn(\fBs,\fPn)\&. The effect is to fill \fI__s\fP[0] through \fI__s\fP[__n-1] with characters from the input sequence, if possible\&. .PP Definition at line 355 of file streambuf\&. .SS "template virtual \fBstreamsize\fP \fBstd::basic_stringbuf\fP< _CharT, _Traits, _Alloc >::showmanyc ()\fC [inline]\fP, \fC [protected]\fP, \fC [virtual]\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 \fIIf it returns a positive value, then successive calls to \fC\fBunderflow()\fP\fP will not return \fCtraits::eof()\fP until at least that number of characters have been supplied\&. If \fC\fBshowmanyc()\fP\fP returns -1, then calls to \fC\fBunderflow()\fP\fP or \fC\fBuflow()\fP\fP will fail\&.\fP [27\&.5\&.2\&.4\&.3]/1 .PP \fBNote:\fP .RS 4 Base class version does nothing, returns zero\&. .PP The standard adds that \fIthe intention is not only that the calls [to underflow or uflow] will not return \fCeof()\fP but that they will return immediately\&.\fP .PP The standard adds that \fIthe morphemes of \fCshowmanyc\fP are \fBes-how-many-see\fP, not \fBshow-manic\fP\&.\fP .RE .PP .PP Reimplemented from \fBstd::basic_streambuf< _CharT, _Traits >\fP\&. .PP Definition at line 166 of file sstream\&. .PP References std::basic_stringbuf< _CharT, _Traits, _Alloc >::_M_mode, std::basic_streambuf< _CharT, _Traits >::egptr(), std::basic_streambuf< _CharT, _Traits >::gptr(), and std::ios_base::in\&. .SS "template int_type \fBstd::basic_streambuf\fP< _CharT, _Traits >::snextc ()\fC [inline]\fP, \fC [inherited]\fP" .PP Getting the next character\&. \fBReturns:\fP .RS 4 The next character, or eof\&. .RE .PP Calls \fC\fBsbumpc()\fP\fP, and if that function returns \fCtraits::eof()\fP, so does this function\&. Otherwise, \fC\fBsgetc()\fP\fP\&. .PP Definition at line 296 of file streambuf\&. .PP Referenced by std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::getline(), std::basic_istream< _CharT, _Traits >::ignore(), and std::basic_istream< _CharT, _Traits >::sentry::sentry()\&. .SS "template int_type \fBstd::basic_streambuf\fP< _CharT, _Traits >::sputbackc (\fBchar_type\fP__c)\fC [inline]\fP, \fC [inherited]\fP" .PP Pushing characters back into the input stream\&. \fBParameters:\fP .RS 4 \fI__c\fP The character to push back\&. .RE .PP \fBReturns:\fP .RS 4 The previous character, if possible\&. .RE .PP Similar to \fBsungetc()\fP, but \fI__c\fP is pushed onto the stream instead of \fIthe previous character\&.\fP If successful, the next character fetched from the input stream will be \fI__c\fP\&. .PP Definition at line 370 of file streambuf\&. .PP Referenced by std::basic_istream< _CharT, _Traits >::putback()\&. .SS "template int_type \fBstd::basic_streambuf\fP< _CharT, _Traits >::sputc (\fBchar_type\fP__c)\fC [inline]\fP, \fC [inherited]\fP" .PP Entry point for all single-character output functions\&. \fBParameters:\fP .RS 4 \fI__c\fP A character to output\&. .RE .PP \fBReturns:\fP .RS 4 \fI__c\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 \fI__c\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 422 of file streambuf\&. .PP Referenced by std::basic_istream< _CharT, _Traits >::get(), and std::ostreambuf_iterator< _CharT, _Traits >::operator=()\&. .SS "template \fBstreamsize\fP \fBstd::basic_streambuf\fP< _CharT, _Traits >::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 \fI__s\fP A buffer read area\&. .br \fI__n\fP A count\&. .RE .PP One of two public output functions\&. .PP Returns xsputn(\fBs,\fPn)\&. The effect is to write \fI__s\fP[0] through \fI__s\fP[__n-1] to the output sequence, if possible\&. .PP Definition at line 448 of file streambuf\&. .SS "template \fB__string_type\fP \fBstd::basic_stringbuf\fP< _CharT, _Traits, _Alloc >::str () const\fC [inline]\fP" .PP Copying out the string buffer\&. \fBReturns:\fP .RS 4 A copy of one of the underlying sequences\&. .RE .PP \fIIf the buffer is only created in input mode, the underlying character sequence is equal to the input sequence; otherwise, it is equal to the output sequence\&.\fP [27\&.7\&.1\&.2]/1 .PP Definition at line 122 of file sstream\&. .PP References std::basic_streambuf< _CharT, _Traits >::egptr(), std::basic_streambuf< _CharT, _Traits >::pbase(), and std::basic_streambuf< _CharT, _Traits >::pptr()\&. .SS "template void \fBstd::basic_stringbuf\fP< _CharT, _Traits, _Alloc >::str (const \fB__string_type\fP &__s)\fC [inline]\fP" .PP Setting a new buffer\&. \fBParameters:\fP .RS 4 \fI__s\fP The string to use as a new sequence\&. .RE .PP Deallocates any previous stored sequence, then copies \fIs\fP to use as a new one\&. .PP Definition at line 146 of file sstream\&. .PP References std::basic_stringbuf< _CharT, _Traits, _Alloc >::_M_mode, std::basic_string< _CharT, _Traits, _Alloc >::assign(), std::basic_string< _CharT, _Traits, _Alloc >::data(), and std::basic_string< _CharT, _Traits, _Alloc >::size()\&. .SS "template int_type \fBstd::basic_streambuf\fP< _CharT, _Traits >::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 \fBpbackfail()\fP\&. The effect is to \fIunget\fP the last character \fIgotten\fP\&. .PP Definition at line 395 of file streambuf\&. .PP Referenced by std::basic_istream< _CharT, _Traits >::unget()\&. .SS "template virtual int \fBstd::basic_streambuf\fP< _CharT, _Traits >::sync (void)\fC [inline]\fP, \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 \fIfailure\fP\&. .PP \fBNote:\fP .RS 4 Base class version does nothing, returns zero\&. .RE .PP .PP Reimplemented in \fBstd::basic_filebuf< _CharT, _Traits >\fP, \fBstd::basic_filebuf< _CharT, encoding_char_traits< _CharT > >\fP, \fBstd::basic_filebuf< char_type, traits_type >\fP, and \fB__gnu_cxx::stdio_sync_filebuf< _CharT, _Traits >\fP\&. .PP Definition at line 625 of file streambuf\&. .PP Referenced by std::basic_streambuf< char_type, traits_type >::pubsync()\&. .SS "template virtual int_type \fBstd::basic_streambuf\fP< _CharT, _Traits >::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 \fC\fBunderflow()\fP\fP, and in fact is required to call that function\&. It also returns the new character, like \fC\fBunderflow()\fP\fP does\&. However, this function also moves the read position forward by one\&. .PP Reimplemented in \fB__gnu_cxx::stdio_sync_filebuf< _CharT, _Traits >\fP\&. .PP Definition at line 698 of file streambuf\&. .PP Referenced by std::basic_streambuf< char_type, traits_type >::sbumpc()\&. .SS "template \fBbasic_stringbuf\fP< _CharT, _Traits, _Alloc >::int_type \fBbasic_stringbuf\fP< _CharT, _Traits, _Alloc >::underflow ()\fC [protected]\fP, \fC [virtual]\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 \fIrefilled\fP\&. 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, _Traits >\fP\&. .PP Definition at line 133 of file sstream\&.tcc\&. .PP References std::ios_base::in\&. .SS "template \fBstreamsize\fP \fBbasic_streambuf\fP< _CharT, _Traits >::xsgetn (\fBchar_type\fP *__s, \fBstreamsize\fP__n)\fC [protected]\fP, \fC [virtual]\fP, \fC [inherited]\fP" .PP Multiple character extraction\&. \fBParameters:\fP .RS 4 \fI__s\fP A buffer area\&. .br \fI__n\fP Maximum number of characters to assign\&. .RE .PP \fBReturns:\fP .RS 4 The number of characters assigned\&. .RE .PP Fills \fI__s\fP[0] through \fI__s\fP[__n-1] with characters from the input sequence, as if by \fC\fBsbumpc()\fP\fP\&. Stops when either \fI__n\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 in \fBstd::basic_filebuf< _CharT, _Traits >\fP, \fBstd::basic_filebuf< _CharT, encoding_char_traits< _CharT > >\fP, and \fBstd::basic_filebuf< char_type, traits_type >\fP\&. .PP Definition at line 47 of file streambuf\&.tcc\&. .PP References std::min()\&. .PP Referenced by std::basic_streambuf< char_type, traits_type >::sgetn()\&. .SS "template \fBstreamsize\fP \fBbasic_streambuf\fP< _CharT, _Traits >::xsputn (const \fBchar_type\fP *__s, \fBstreamsize\fP__n)\fC [protected]\fP, \fC [virtual]\fP, \fC [inherited]\fP" .PP Multiple character insertion\&. \fBParameters:\fP .RS 4 \fI__s\fP A buffer area\&. .br \fI__n\fP Maximum number of characters to write\&. .RE .PP \fBReturns:\fP .RS 4 The number of characters written\&. .RE .PP Writes \fI__s\fP[0] through \fI__s\fP[__n-1] to the output sequence, as if by \fC\fBsputc()\fP\fP\&. Stops when either \fIn\fP characters have been copied, or when \fC\fBsputc()\fP\fP would return \fCtraits::eof()\fP\&. .PP It is expected that derived classes provide a more efficient implementation by overriding this definition\&. .PP Reimplemented in \fBstd::basic_filebuf< _CharT, _Traits >\fP, \fBstd::basic_filebuf< _CharT, encoding_char_traits< _CharT > >\fP, and \fBstd::basic_filebuf< char_type, traits_type >\fP\&. .PP Definition at line 81 of file streambuf\&.tcc\&. .PP References std::min()\&. .PP Referenced by std::basic_streambuf< char_type, traits_type >::sputn()\&. .SH "Member Data Documentation" .PP .SS "template \fBlocale\fP \fBstd::basic_streambuf\fP< _CharT, _Traits >::_M_buf_locale\fC [protected]\fP, \fC [inherited]\fP" .PP Current locale setting\&. .PP Definition at line 190 of file streambuf\&. .PP Referenced by std::basic_filebuf< _CharT, _Traits >::basic_filebuf(), std::basic_streambuf< char_type, traits_type >::getloc(), and std::basic_streambuf< char_type, traits_type >::pubimbue()\&. .SS "template char_type* \fBstd::basic_streambuf\fP< _CharT, _Traits >::_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 182 of file streambuf\&. .PP Referenced by std::basic_streambuf< char_type, traits_type >::eback(), and std::basic_streambuf< char_type, traits_type >::setg()\&. .SS "template char_type* \fBstd::basic_streambuf\fP< _CharT, _Traits >::_M_in_cur\fC [protected]\fP, \fC [inherited]\fP" .PP Entry point for \fBimbue()\fP\&. \fBParameters:\fP .RS 4 \fI__loc\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\&. .PP Referenced by std::basic_streambuf< char_type, traits_type >::gbump(), std::basic_streambuf< char_type, traits_type >::gptr(), and std::basic_streambuf< char_type, traits_type >::setg()\&. .SS "template char_type* \fBstd::basic_streambuf\fP< _CharT, _Traits >::_M_in_end\fC [protected]\fP, \fC [inherited]\fP" .PP Entry point for \fBimbue()\fP\&. \fBParameters:\fP .RS 4 \fI__loc\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\&. .PP Referenced by std::basic_streambuf< char_type, traits_type >::egptr(), and std::basic_streambuf< char_type, traits_type >::setg()\&. .SS "template \fBios_base::openmode\fP \fBstd::basic_stringbuf\fP< _CharT, _Traits, _Alloc >::_M_mode\fC [protected]\fP" .PP Place to stash in || out || in | out settings for current stringbuf\&. .PP Definition at line 79 of file sstream\&. .PP Referenced by std::basic_stringbuf< _CharT, _Traits, _Alloc >::showmanyc(), and std::basic_stringbuf< _CharT, _Traits, _Alloc >::str()\&. .SS "template char_type* \fBstd::basic_streambuf\fP< _CharT, _Traits >::_M_out_beg\fC [protected]\fP, \fC [inherited]\fP" .PP Entry point for \fBimbue()\fP\&. \fBParameters:\fP .RS 4 \fI__loc\fP The new locale\&. .RE .PP \fBReturns:\fP .RS 4 The previous locale\&. .RE .PP Calls the derived imbue(__loc)\&. .PP Definition at line 185 of file streambuf\&. .PP Referenced by std::basic_streambuf< char_type, traits_type >::pbase(), and std::basic_streambuf< char_type, traits_type >::setp()\&. .SS "template char_type* \fBstd::basic_streambuf\fP< _CharT, _Traits >::_M_out_cur\fC [protected]\fP, \fC [inherited]\fP" .PP Entry point for \fBimbue()\fP\&. \fBParameters:\fP .RS 4 \fI__loc\fP The new locale\&. .RE .PP \fBReturns:\fP .RS 4 The previous locale\&. .RE .PP Calls the derived imbue(__loc)\&. .PP Definition at line 186 of file streambuf\&. .PP Referenced by std::basic_streambuf< char_type, traits_type >::pbump(), std::basic_streambuf< char_type, traits_type >::pptr(), and std::basic_streambuf< char_type, traits_type >::setp()\&. .SS "template char_type* \fBstd::basic_streambuf\fP< _CharT, _Traits >::_M_out_end\fC [protected]\fP, \fC [inherited]\fP" .PP Entry point for \fBimbue()\fP\&. \fBParameters:\fP .RS 4 \fI__loc\fP The new locale\&. .RE .PP \fBReturns:\fP .RS 4 The previous locale\&. .RE .PP Calls the derived imbue(__loc)\&. .PP Definition at line 187 of file streambuf\&. .PP Referenced by std::basic_streambuf< char_type, traits_type >::epptr(), and std::basic_streambuf< char_type, traits_type >::setp()\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.