std::strstreambuf Class Reference

Inheritance diagram for std::strstreambuf:

std::basic_streambuf< char, char_traits< char > > List of all members.

Public Types

typedef char_traits< char > _Traits
typedef basic_streambuf< char,
_Traits
_Base

Public Member Functions

 strstreambuf (streamsize __initial_capacity=0)
 strstreambuf (void *(*__alloc)(size_t), void(*__free)(void *))
 strstreambuf (char *__get, streamsize __n, char *__put=0)
 strstreambuf (signed char *__get, streamsize __n, signed char *__put=0)
 strstreambuf (unsigned char *__get, streamsize __n, unsigned char *__put=0)
 strstreambuf (const char *__get, streamsize __n)
 strstreambuf (const signed char *__get, streamsize __n)
 strstreambuf (const unsigned char *__get, streamsize __n)
virtual ~strstreambuf ()
void freeze (bool=true)
char * str ()
int pcount () const

Protected Member Functions

virtual int_type overflow (int_type __c=_Traits::eof())
 Consumes data from the buffer; writes to the controlled sequence.

virtual int_type pbackfail (int_type __c=_Traits::eof())
 Tries to back up the input sequence.

virtual int_type underflow ()
 Fetches more data from the controlled sequence.

virtual _Basesetbuf (char *__buf, streamsize __n)
virtual pos_type seekoff (off_type __off, ios_base::seekdir __dir, 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.


Private Member Functions

strstreambufoperator= (const strstreambuf &)
 strstreambuf (const strstreambuf &)
char * _M_alloc (size_t)
void _M_free (char *)
void _M_setup (char *__get, char *__put, streamsize __n)

Private Attributes

void *(* _M_alloc_fun )(size_t)
void(* _M_free_fun )(void *)
bool _M_dynamic: 1
bool _M_frozen: 1
bool _M_constant: 1

Member Typedef Documentation

typedef basic_streambuf<char, _Traits> std::strstreambuf::_Base
 

Definition at line 67 of file strstream.

typedef char_traits<char> std::strstreambuf::_Traits
 

Definition at line 66 of file strstream.


Constructor & Destructor Documentation

std::strstreambuf::strstreambuf streamsize  __initial_capacity = 0  )  [explicit]
 

std::strstreambuf::strstreambuf void *(*  __alloc)(size_t),
void(*  __free)(void *)
 

std::strstreambuf::strstreambuf char *  __get,
streamsize  __n,
char *  __put = 0
 

std::strstreambuf::strstreambuf signed char *  __get,
streamsize  __n,
signed char *  __put = 0
 

std::strstreambuf::strstreambuf unsigned char *  __get,
streamsize  __n,
unsigned char *  __put = 0
 

std::strstreambuf::strstreambuf const char *  __get,
streamsize  __n
 

std::strstreambuf::strstreambuf const signed char *  __get,
streamsize  __n
 

std::strstreambuf::strstreambuf const unsigned char *  __get,
streamsize  __n
 

virtual std::strstreambuf::~strstreambuf  )  [virtual]
 

std::strstreambuf::strstreambuf const strstreambuf  )  [private]
 


Member Function Documentation

char* std::strstreambuf::_M_alloc size_t   )  [private]
 

void std::strstreambuf::_M_free char *   )  [private]
 

void std::strstreambuf::_M_setup char *  __get,
char *  __put,
streamsize  __n
[private]
 

void std::strstreambuf::freeze bool  = true  ) 
 

strstreambuf& std::strstreambuf::operator= const strstreambuf  )  [private]
 

virtual int_type std::strstreambuf::overflow int_type  __c = _Traits::eof()  )  [protected, virtual]
 

Consumes data from the buffer; writes to the controlled sequence.

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 definiton of this function, see a good text such as Langer & Kreft, or [27.5.2.4.5]/3-7.

A functioning output streambuf can be created by overriding only this function (no buffer area will be used).

Note:
Base class version does nothing, returns eof().

Reimplemented from std::basic_streambuf< char, char_traits< char > >.

virtual int_type std::strstreambuf::pbackfail int_type  __c = _Traits::eof()  )  [protected, virtual]
 

Tries to back up the input sequence.

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< char, char_traits< char > >.

int std::strstreambuf::pcount  )  const
 

virtual pos_type std::strstreambuf::seekoff off_type  __off,
ios_base::seekdir  __dir,
ios_base::openmode  __mode = ios_base::in | ios_base::out
[protected, virtual]
 

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< char, char_traits< char > >.

virtual pos_type std::strstreambuf::seekpos pos_type  __pos,
ios_base::openmode  __mode = ios_base::in | ios_base::out
[protected, virtual]
 

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< char, char_traits< char > >.

virtual _Base* std::strstreambuf::setbuf char *  __buf,
streamsize  __n
[protected, virtual]
 

char* std::strstreambuf::str  ) 
 

virtual int_type std::strstreambuf::underflow  )  [protected, virtual]
 

Fetches more data from the controlled sequence.

Returns:
The first character from the pending sequence.
Informally, this function is called when the input buffer is exhausted (or does not exist, as buffering need not actually be done). If a buffer exists, it is "refilled". In either case, the next available character is returned, or traits::eof() to indicate a null pending sequence.

For a formal definiton 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 http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#6

Note:
Base class version does nothing, returns eof().

Reimplemented from std::basic_streambuf< char, char_traits< char > >.


Member Data Documentation

void*(* std::strstreambuf::_M_alloc_fun)(size_t) [private]
 

bool std::strstreambuf::_M_constant [private]
 

Definition at line 120 of file strstream.

bool std::strstreambuf::_M_dynamic [private]
 

Definition at line 118 of file strstream.

void(* std::strstreambuf::_M_free_fun)(void*) [private]
 

bool std::strstreambuf::_M_frozen [private]
 

Definition at line 119 of file strstream.


The documentation for this class was generated from the following file:
Generated on Tue Jan 30 17:32:11 2007 for GNU C++ STL by doxygen 1.3.6