#include <StreamInterface.h>
Considerations 1. Readable streams ARE NOT flushable, that is since they are considered input devices there is no input to push down the pipe. 2. When subclassing sometimes is enough to just implement the UInt32 ReadableStream::read(void *data, UInt32 size) method. 3. Also you must provide an open method which takes a String as a parameter which specifies the stream "address", that address can be a filesystem path or any other address which your implmentation is meant to handle.
Definition at line 56 of file StreamInterface.h.
Public Member Functions | |
ReadableStream () | |
virtual ReadableStream & | operator>> (UInt32 n) |
virtual ReadableStream & | operator>> (double n) |
virtual ReadableStream & | operator>> (UInt64 n) |
UInt32 | read (UInt32 n) |
UInt32 | read (double n) |
UInt32 | read (UInt64 n) |
virtual UInt32 | read (void *data, UInt32 size)=0 |
virtual UInt32 | read (Buffer &data, UInt32 size) |
virtual ReadableStream & | read (Buffer &b) |
Reads all data starting from the current position to the end of the file and returns it in a Buffer object. | |
virtual ReadableStream & | readAll (Buffer &b) |
Loads the full contents and returns it in a Buffer. | |
virtual void | flush () |
virtual void | setTimeout (int millisecs) |
virtual void | open (const String &path)=0 |
virtual void | close ()=0 |
virtual bool | opened ()=0 |
virtual FileSizeT | size ()=0 |
virtual FileOffsetT | tell ()=0 |
virtual void | seek (FileOffsetT _pos)=0 |
virtual void | seekEnd ()=0 |
virtual void | seekBegin ()=0 |
virtual void | seekStep (FileOffsetT _step)=0 |
virtual bool | eof ()=0 |
virtual const char * | getClassName () |
Returns the name of the current class. | |
virtual std::string | toString () |
Static Public Member Functions | |
static void | debugmsg (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__) |
Will print a debug message to the screen. | |
static void | debugmsgln (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__) |
Protected Attributes | |
bool | handles_timeouts |
int | timeout_msecs |
std::string | __cls_name |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const Object &s) |
xvr2::ReadableStream::ReadableStream | ( | ) | [inline] |
virtual ReadableStream& xvr2::ReadableStream::operator>> | ( | UInt32 | n | ) | [virtual] |
virtual ReadableStream& xvr2::ReadableStream::operator>> | ( | double | n | ) | [virtual] |
virtual ReadableStream& xvr2::ReadableStream::operator>> | ( | UInt64 | n | ) | [virtual] |
UInt32 xvr2::ReadableStream::read | ( | double | n | ) |
Implemented in xvr2::RawInputStream, xvr2::StdioInputFile, and xvr2::Net::RawSocketInputStream.
Reimplemented in xvr2::StdioInputFile.
virtual ReadableStream& xvr2::ReadableStream::read | ( | Buffer & | b | ) | [virtual] |
Reads all data starting from the current position to the end of the file and returns it in a Buffer object.
Reimplemented in xvr2::StdioInputFile.
virtual ReadableStream& xvr2::ReadableStream::readAll | ( | Buffer & | b | ) | [virtual] |
virtual void xvr2::ReadableStream::flush | ( | ) | [virtual] |
virtual void xvr2::ReadableStream::setTimeout | ( | int | millisecs | ) | [inline, virtual] |
virtual void xvr2::StreamInterface::open | ( | const String & | path | ) | [pure virtual, inherited] |
virtual void xvr2::StreamInterface::close | ( | ) | [pure virtual, inherited] |
virtual bool xvr2::StreamInterface::opened | ( | ) | [pure virtual, inherited] |
Implemented in xvr2::RawStreamInterface, xvr2::StdioInputFile, and xvr2::StdioOutputFile.
virtual FileSizeT xvr2::StreamInterface::size | ( | ) | [pure virtual, inherited] |
Implemented in xvr2::RawOutputStream, xvr2::RawStreamInterface, xvr2::StdioInterface, and xvr2::Net::RawSocketOutputStream.
virtual FileOffsetT xvr2::StreamInterface::tell | ( | ) | [pure virtual, inherited] |
Implemented in xvr2::RawStreamInterface, and xvr2::StdioInterface.
virtual void xvr2::StreamInterface::seek | ( | FileOffsetT | _pos | ) | [pure virtual, inherited] |
virtual void xvr2::StreamInterface::seekEnd | ( | ) | [pure virtual, inherited] |
virtual void xvr2::StreamInterface::seekBegin | ( | ) | [pure virtual, inherited] |
virtual void xvr2::StreamInterface::seekStep | ( | FileOffsetT | _step | ) | [pure virtual, inherited] |
virtual bool xvr2::StreamInterface::eof | ( | ) | [pure virtual, inherited] |
virtual const char* xvr2::Object::getClassName | ( | ) | [virtual, inherited] |
Returns the name of the current class.
static void xvr2::Object::debugmsg | ( | Object * | obj, | |
const char * | msg, | |||
int | linenumber = __LINE__ , |
|||
const char * | srcfile = __FILE__ | |||
) | [static, inherited] |
Will print a debug message to the screen.
static void xvr2::Object::debugmsgln | ( | Object * | obj, | |
const char * | msg, | |||
int | linenumber = __LINE__ , |
|||
const char * | srcfile = __FILE__ | |||
) | [static, inherited] |
virtual std::string xvr2::Object::toString | ( | ) | [virtual, inherited] |
std::ostream& operator<< | ( | std::ostream & | stream, | |
const Object & | s | |||
) | [friend, inherited] |
bool xvr2::ReadableStream::handles_timeouts [protected] |
int xvr2::ReadableStream::timeout_msecs [protected] |
std::string xvr2::Object::__cls_name [protected, inherited] |