Previous fileTop of DocumentContentsIndex pageNext file
Apache C++ Standard Library Reference Guide

basic_streambuf

Library:  Input/output


Does not inherit

Local Index

Members

Non-Members

Summary

Abstract base class for deriving various stream buffers to facilitate control of character sequences

Synopsis

#include <streambuf>

namespace std {
  template<class charT, class traits = char_traits<charT> >
  class basic_streambuf;
}

Description

The class template basic_streambuf serves as an abstract base class for deriving various stream buffers to facilitate control of character sequences such as:

Each sequence is associated with three pointers (as described below), which, if non-null, all point into the same charT array object. The array object represents, at any moment, a segment of characters from the sequence. Operations performed on a sequence alter the values pointed to by these pointers, perform reads and writes directly to or from associated sequences, and alter the stream position and conversion state as needed to maintain this segment to sequence relationship. The three pointers are:

Stream buffers can impose various constraints on the sequences they control, including:

Interface

Member Types

char_type
int_type
off_type
pos_type
traits_type

Nonmember Types

streambuf
wstreambuf

Constructor

basic_streambuf();

Destructor

virtual ~basic_streambuf();

Public Member Functions

locale 
getloc() const; 
streamsize 
in_avail();
locale 
pubimbue(const locale& loc); 
pos_type 
pubseekoff(off_type off, ios_base::seekdir way,
           ios_base::openmode which =
           ios_base::in | ios_base::out); 
pos_type 
pubseekpos(pos_type sp, ios_base::openmode which=
           ios_base::in | ios_base::out ); 
basic_streambuf* 
pubsetbuf(char_type* s,streamsize n); 
int 
pubsync();
int_type 
sbumpc();
int_type 
sgetc();
streamsize 
sgetn(char_type* s, streamsize n); 
int_type 
snextc();
int_type 
sputbackc(char_type c); 
int_type 
sputc(char_type c);
streamsize 
sputn(const char_type* s, streamsize n); 
int_type 
sungetc();

Protected Member Functions

char_type* 
eback() const; 
char_type* 
egptr() const; 
char_type* 
epptr() const; 
void 
gbump(int n); 
char_type* 
gptr() const; 
void 
imbue(const locale&);
int_type 
overflow(int_type c = traits::eof() ); 
int_type 
pbackfail(int_type c = traits::eof()); 
char_type* 
pbase() const; 
void 
pbump(int n); 
char_type* 
pptr() const; 
pos_type 
seekoff(off_type off, ios_base::seekdir way,
        ios_base::openmode which =
        ios_base::in | ios_base::out ); 
pos_type 
seekpos(pos_type sp, ios_base::openmode which=
        ios_base::in | ios_base::out ); 
basic_streambuf* 
setbuf(char_type* s, streamsize n); 
void 
setg(char_type* gbeg, char_type* gnext, char_type* gend); 
void 
setp(char_type* pbeg, char_type* pend); 
streamsize 
showmanyc();
int 
sync();
int_type 
underflow();
int_type 
uflow();
streamsize 
xsgetn(char_type* s, streamsize n); 
streamsize 
xsputn(const char_type* s, streamsize n); 

See Also

char_traits, basic_filebuf, basic_stringbuf, strstreambuf

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems --Programming Language C++, Section 27.5.2



Previous fileTop of DocumentContentsIndex pageNext file