|
Bond 0.9
C++ Bond Runtime Library API Documentation
|
A base interface for performing IO operations. More...
#include <bond/io/stream.h>
Public Types | |
| typedef long | pos_t |
| A type used to represent absolute positions within a stream. | |
| typedef long | off_t |
| A type used to represent relative offsets within a stream. | |
Public Member Functions | |
| virtual | ~Stream () |
| Destroys a Stream object. | |
| virtual void | Close () |
| Closes the stream. | |
| virtual pos_t | GetPosition () const =0 |
| Returns the current position within the stream. | |
| virtual pos_t | GetEndPosition () const =0 |
| Returns the end position of the stream. | |
| virtual void | SetPosition (off_t offset)=0 |
| Sets the current position within the stream. | |
| virtual void | SetPositionFromEnd (off_t offset)=0 |
| Sets the current position relative to the end of the stream. | |
| virtual void | AddOffset (off_t offset)=0 |
| Advances the current position by the given offset. | |
| virtual bool | IsEof () const =0 |
| Tests whether the current position is at or beyond the end of the stream. | |
| virtual bool | HasError () const =0 |
| Tests whether the stream is currently in an error state. | |
| virtual void | ClearError ()=0 |
| Clears the current error state of the stream. | |
Static Public Attributes | |
| static const int | Eof = -1 |
| A special value returned by single-byte input functions to indicate end of stream. | |
A base interface for performing IO operations.
Stream provides the common positioning and status operations shared by all Bond input and output streams. Concrete implementations may be backed by memory buffers, stdio FILE objects, or other storage mechanisms.
| typedef long Bond::Stream::off_t |
A type used to represent relative offsets within a stream.
| typedef long Bond::Stream::pos_t |
A type used to represent absolute positions within a stream.
|
inlinevirtual |
Destroys a Stream object.
|
pure virtual |
Advances the current position by the given offset.
| offset | The signed amount by which the current position should be adjusted. |
Implemented in Bond::MemoryInputStream, Bond::MemoryOutputStream, Bond::StdioInputStream, and Bond::StdioOutputStream.
|
pure virtual |
Clears the current error state of the stream.
Implemented in Bond::MemoryInputStream, Bond::MemoryOutputStream, Bond::StdioInputStream, and Bond::StdioOutputStream.
|
inlinevirtual |
Closes the stream.
The default implementation does nothing. Concrete stream implementations may override this function to release owned resources or detach from the underlying data source or sink.
Reimplemented in Bond::StdioInputStream, and Bond::StdioOutputStream.
|
pure virtual |
Returns the end position of the stream.
Implemented in Bond::MemoryInputStream, Bond::MemoryOutputStream, Bond::StdioInputStream, and Bond::StdioOutputStream.
|
pure virtual |
Returns the current position within the stream.
Implemented in Bond::MemoryInputStream, Bond::MemoryOutputStream, Bond::StdioInputStream, and Bond::StdioOutputStream.
|
pure virtual |
Tests whether the stream is currently in an error state.
Implemented in Bond::MemoryInputStream, Bond::MemoryOutputStream, Bond::StdioInputStream, and Bond::StdioOutputStream.
|
pure virtual |
Tests whether the current position is at or beyond the end of the stream.
Implemented in Bond::MemoryInputStream, Bond::MemoryOutputStream, Bond::StdioInputStream, and Bond::StdioOutputStream.
|
pure virtual |
Sets the current position within the stream.
| offset | The absolute position to which the stream should be moved. |
Implemented in Bond::MemoryInputStream, Bond::MemoryOutputStream, Bond::StdioInputStream, and Bond::StdioOutputStream.
|
pure virtual |
Sets the current position relative to the end of the stream.
| offset | The offset from the end position to which the stream should be moved. |
Implemented in Bond::MemoryInputStream, Bond::MemoryOutputStream, Bond::StdioInputStream, and Bond::StdioOutputStream.
|
static |
A special value returned by single-byte input functions to indicate end of stream.