From 6f94639a3f5e20e1c635b2d8676086464d7cba2e Mon Sep 17 00:00:00 2001 From: David Date: Mon, 18 Jun 2007 20:45:45 +0000 Subject: david - did more documenting --- src/stream.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'src/stream.h') diff --git a/src/stream.h b/src/stream.h index ba070d3..056de0c 100644 --- a/src/stream.h +++ b/src/stream.h @@ -22,17 +22,66 @@ namespace Bu Stream(); virtual ~Stream(); + /** + * Close the stream. + */ virtual void close() = 0; + + /** + * Read data from the stream into a buffer. + *@param pBuf (void *) Buffer which will be filled. + *@param nBytes (size_t) Max data to read. + *@returns (size_t) Amount of data read. + */ virtual size_t read( void *pBuf, size_t nBytes ) = 0; + + /** + * Write data to the stream. + *@param pBuf (const void *) The data to be written. + *@param nBytes (size_t) Amount of data to write from pBuf. + *@returns (size_t) Amount of data actually written. + */ virtual size_t write( const void *pBuf, size_t nBytes ) = 0; + /** + * Get the current position in the stream. + *@returns (long) The current position in the stream. + */ virtual long tell() = 0; + + /** + * Seek to a position in the stream relative to the current position. + *@param offset (long) Offset from current position to seek to. + */ virtual void seek( long offset ) = 0; + + /** + * Set position in the stream relative to the start of the stream. + *@param pos (long) The position. + */ virtual void setPos( long pos ) = 0; + + /** + * Set position in the stream relative to the end of the stream. + *@param pos (long) The position. + */ virtual void setPosEnd( long pos ) = 0; + + /** + * Are we at the end of the stream? + *@returns (bool) Are we at the end of the stream? + */ virtual bool isEOS() = 0; + + /** + * Is the stream open? + *@returns (bool) Is the stream open? + */ virtual bool isOpen() = 0; + /** + * Flush any data still held in buffers. + */ virtual void flush() = 0; /** @@ -71,7 +120,16 @@ namespace Bu */ virtual bool isSeekable() = 0; + /** + * Are we currently set to block mode? + *@returns (bool) + */ virtual bool isBlocking() = 0; + + /** + * Set stream to blocking or non-blocking mode. + *@param bBlocking (bool) Whether we should block or not. + */ virtual void setBlocking( bool bBlocking=true ) = 0; public: // Filters -- cgit v1.2.3