#include <StdPStreamBuf.h>
Inheritance diagram for PLearn::StdPStreamBuf:
Public Member Functions | |
StdPStreamBuf () | |
StdPStreamBuf (istream *pin_, bool own_pin_=false) | |
ctor. from an istream (I) | |
StdPStreamBuf (ostream *pout_, bool own_pout_=false) | |
ctor. from an ostream (O) | |
StdPStreamBuf (iostream *pios_, bool own_pios_=false) | |
ctor. from an iostream (IO) | |
StdPStreamBuf (istream *pin_, ostream *pout_, bool own_pin_=false, bool own_pout_=false) | |
ctor. from an istream and an ostream (IO) | |
virtual | ~StdPStreamBuf () |
void | setIn (istream *pin_, bool own_pin_=false) |
void | setOut (ostream *pout_, bool own_pout_=false) |
void | attach (int fd) |
attach: "attach" to a POSIX file descriptor. | |
istream * | rawin () |
ostream * | rawout () |
pl_streambuf * | pl_rdbuf () |
returns the markable input buffer DEPRECATED: TO BE REMOVED SOON, DO NOT USE! | |
Protected Member Functions | |
void | initInBuf () |
initInBuf: called by ctors. to ensure that pin's buffer is markable | |
virtual streamsize | read_ (char *p, streamsize n) |
reads up to n characters into p You should override this call in subclasses. | |
virtual void | write_ (const char *p, streamsize n) |
writes exactly n characters from p (unbuffered, must flush) | |
Protected Attributes | |
istream * | pin |
ostream * | pout |
bool | own_pin |
bool | own_pout |
PP< pl_streambuf > | the_inbuf |
PP< pl_fdstreambuf > | the_fdbuf |
streambuf * | original_bufin |
ptrs. | |
streambuf * | original_bufout |
Private Types | |
typedef PStreamBuf | inherited |
|
Reimplemented from PLearn::PStreamBuf. Definition at line 64 of file StdPStreamBuf.h. |
|
Definition at line 50 of file StdPStreamBuf.cc. References if(), and STREAMBUFVER. |
|
ctor. from an istream (I)
Definition at line 58 of file StdPStreamBuf.cc. References if(), initInBuf(), and STREAMBUFVER. |
|
ctor. from an ostream (O)
Definition at line 70 of file StdPStreamBuf.cc. References if(), and STREAMBUFVER. |
|
ctor. from an iostream (IO)
Definition at line 78 of file StdPStreamBuf.cc. References if(), initInBuf(), and STREAMBUFVER. |
|
ctor. from an istream and an ostream (IO)
Definition at line 90 of file StdPStreamBuf.cc. References if(), initInBuf(), and STREAMBUFVER. |
|
Definition at line 101 of file StdPStreamBuf.cc. References original_bufin, original_bufout, own_pin, own_pout, pin, pout, and the_inbuf. |
|
attach: "attach" to a POSIX file descriptor.
Definition at line 160 of file StdPStreamBuf.cc. References own_pin, own_pout, pin, PLearn::pl_dftbuflen, pout, the_fdbuf, and the_inbuf. |
|
initInBuf: called by ctors. to ensure that pin's buffer is markable
Definition at line 116 of file StdPStreamBuf.cc. References PLearn::PP< pl_streambuf >::isNull(), pin, and the_inbuf. Referenced by setIn(), and StdPStreamBuf(). |
|
returns the markable input buffer DEPRECATED: TO BE REMOVED SOON, DO NOT USE!
Definition at line 134 of file StdPStreamBuf.h. |
|
Definition at line 128 of file StdPStreamBuf.h. References pin. |
|
Definition at line 129 of file StdPStreamBuf.h. References pout. |
|
reads up to n characters into p You should override this call in subclasses. On success, the number of bytes read is returned. Zero indicates end of file. If we are not at end of file, at least one character should be returned (the call must block until at least one char is available). It is not an error if the number returned is smaller than the number of bytes requested; this may happen for example because fewer bytes are actually available right now (maybe because we were close to end-of-file, or because we are reading from a pipe, or from a terminal). If an error occurs, an exception should be thrown. Reimplemented from PLearn::PStreamBuf. Definition at line 180 of file StdPStreamBuf.cc. |
|
Definition at line 129 of file StdPStreamBuf.cc. References initInBuf(), original_bufin, own_pin, pin, and the_fdbuf. |
|
Definition at line 147 of file StdPStreamBuf.cc. References original_bufout, own_pout, and pout. |
|
writes exactly n characters from p (unbuffered, must flush)
Reimplemented from PLearn::PStreamBuf. Definition at line 188 of file StdPStreamBuf.cc. |
|
ptrs. to the original buffers; used to 'reset' the underlying streams to a valid state when the PStream is destroyed. Definition at line 80 of file StdPStreamBuf.h. Referenced by setIn(), and ~StdPStreamBuf(). |
|
Definition at line 81 of file StdPStreamBuf.h. Referenced by setOut(), and ~StdPStreamBuf(). |
|
Definition at line 72 of file StdPStreamBuf.h. Referenced by attach(), setIn(), and ~StdPStreamBuf(). |
|
Definition at line 72 of file StdPStreamBuf.h. Referenced by attach(), setOut(), and ~StdPStreamBuf(). |
|
Definition at line 70 of file StdPStreamBuf.h. Referenced by attach(), initInBuf(), rawin(), read_(), setIn(), and ~StdPStreamBuf(). |
|
Definition at line 71 of file StdPStreamBuf.h. Referenced by attach(), rawout(), setOut(), write_(), and ~StdPStreamBuf(). |
|
Definition at line 76 of file StdPStreamBuf.h. |
|
Definition at line 75 of file StdPStreamBuf.h. Referenced by attach(), initInBuf(), and ~StdPStreamBuf(). |