Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::pl_streambuf Class Reference

#include <pl_streambuf.h>

Inheritance diagram for PLearn::pl_streambuf:

Inheritance graph
[legend]
Collaboration diagram for PLearn::pl_streambuf:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 pl_streambuf (streambuf &_original_buf, int_type _inbuflen=0)
 ctor: needs a stream buffer

virtual ~pl_streambuf ()
 destructor: delete the allocated input buffer

void seekmark (const pl_streammarker &mark)

Protected Member Functions

virtual int_type underflow ()
 underflow: If no mark, get from underlying buffer.

virtual int_type uflow ()
virtual streamsize xsgetn (char *s, streamsize n)
virtual streamsize xsputn (const char *s, streamsize n)
virtual int_type overflow (int_type meta=pl_streambuf::eof)
virtual int_type sync ()
virtual int_type pbackfail (int_type c=eof)
int curpos () const

Protected Attributes

streambuforiginal_buf
char * inbuf
int inbuflen
pl_streammarkerfirst_marker

Static Protected Attributes

const int pback_size = 4
const int min_buf_size = 16

Private Types

typedef int int_type
typedef char char_type
typedef streambuf inherited

Static Private Attributes

const int_type eof = EOF

Detailed Description

pl_streambuf: stream buffer that allows marking. This buffer makes a second layer of buffering over another stream buffer.

Definition at line 63 of file pl_streambuf.h.


Member Typedef Documentation

typedef char PLearn::pl_streambuf::char_type [private]
 

Definition at line 67 of file pl_streambuf.h.

typedef streambuf PLearn::pl_streambuf::inherited [private]
 

Definition at line 76 of file pl_streambuf.h.

typedef int PLearn::pl_streambuf::int_type [private]
 

Definition at line 66 of file pl_streambuf.h.

Referenced by underflow().


Constructor & Destructor Documentation

PLearn::pl_streambuf::pl_streambuf streambuf _original_buf,
int_type  _inbuflen = 0
 

ctor: needs a stream buffer

pl_streambuf::~pl_streambuf  )  [virtual]
 

destructor: delete the allocated input buffer

Definition at line 59 of file pl_streambuf.cc.

References inbuf.


Member Function Documentation

int PLearn::pl_streambuf::curpos  )  const [inline, protected]
 

Definition at line 102 of file pl_streambuf.h.

References inbuf.

Referenced by PLearn::pl_streammarker::pl_streammarker().

pl_streambuf::int_type pl_streambuf::overflow int_type  meta = pl_streambuf::eof  )  [protected, virtual]
 

Definition at line 163 of file pl_streambuf.cc.

References original_buf.

pl_streambuf::int_type pl_streambuf::pbackfail int_type  c = eof  )  [protected, virtual]
 

Definition at line 178 of file pl_streambuf.cc.

References original_buf.

void pl_streambuf::seekmark const pl_streammarker mark  ) 
 

Definition at line 166 of file pl_streambuf.cc.

References inbuf, and PLearn::pl_streammarker::pos.

Referenced by PLearn::readFieldName(), and PLearn::readObject().

pl_streambuf::int_type pl_streambuf::sync  )  [protected, virtual]
 

Definition at line 169 of file pl_streambuf.cc.

References original_buf.

pl_streambuf::int_type pl_streambuf::uflow  )  [protected, virtual]
 

Definition at line 131 of file pl_streambuf.cc.

References first_marker, original_buf, and underflow().

pl_streambuf::int_type pl_streambuf::underflow  )  [protected, virtual]
 

underflow: If no mark, get from underlying buffer.

If buffer is marked, grow/fill buffer as necessary and return next char.

Definition at line 67 of file pl_streambuf.cc.

References first_marker, inbuf, inbuflen, int_type, min_buf_size, original_buf, and pback_size.

Referenced by uflow().

virtual streamsize PLearn::pl_streambuf::xsgetn char *  s,
streamsize  n
[protected, virtual]
 

virtual streamsize PLearn::pl_streambuf::xsputn const char *  s,
streamsize  n
[protected, virtual]
 


Member Data Documentation

const int_type PLearn::pl_streambuf::eof = EOF [static, private]
 

Definition at line 70 of file pl_streambuf.h.

pl_streammarker* PLearn::pl_streambuf::first_marker [protected]
 

Definition at line 86 of file pl_streambuf.h.

Referenced by PLearn::pl_streammarker::pl_streammarker(), uflow(), underflow(), and PLearn::pl_streammarker::~pl_streammarker().

char* PLearn::pl_streambuf::inbuf [protected]
 

Definition at line 81 of file pl_streambuf.h.

Referenced by curpos(), seekmark(), underflow(), and ~pl_streambuf().

int PLearn::pl_streambuf::inbuflen [protected]
 

Definition at line 82 of file pl_streambuf.h.

Referenced by underflow().

const int PLearn::pl_streambuf::min_buf_size = 16 [static, protected]
 

Definition at line 84 of file pl_streambuf.h.

Referenced by underflow().

streambuf& PLearn::pl_streambuf::original_buf [protected]
 

Definition at line 80 of file pl_streambuf.h.

Referenced by overflow(), pbackfail(), sync(), uflow(), and underflow().

const int PLearn::pl_streambuf::pback_size = 4 [static, protected]
 

Definition at line 83 of file pl_streambuf.h.

Referenced by underflow().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:23:12 2004 for PLearn by doxygen 1.3.7