PLearn 0.1
|
#include <NullPStreamBuf.h>
Public Member Functions | |
NullPStreamBuf () | |
Protected Member Functions | |
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) | |
Private Types | |
typedef PStreamBuf | inherited |
Definition at line 53 of file NullPStreamBuf.h.
typedef PStreamBuf PLearn::NullPStreamBuf::inherited [private] |
Reimplemented from PLearn::PStreamBuf.
Definition at line 58 of file NullPStreamBuf.h.
PLearn::NullPStreamBuf::NullPStreamBuf | ( | ) |
Definition at line 49 of file NullPStreamBuf.cc.
:PStreamBuf(true,true) {}
NullPStreamBuf::streamsize PLearn::NullPStreamBuf::read_ | ( | char * | p, |
streamsize | n | ||
) | [protected, virtual] |
reads up to n characters into p You should override this call in subclasses.
Default version issues a PLERROR
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 54 of file NullPStreamBuf.cc.
{ return 0; }
void PLearn::NullPStreamBuf::write_ | ( | const char * | p, |
streamsize | n | ||
) | [protected, virtual] |
writes exactly n characters from p (unbuffered, must flush)
Reimplemented from PLearn::PStreamBuf.
Definition at line 58 of file NullPStreamBuf.cc.
{}