An abstract interface for performing both unformatted and formatted output operations.
More...
#include <bond/io/outputstream.h>
|
| virtual | ~OutputStream () |
| | Destroys an OutputStream object.
|
| virtual void | Flush () |
| | Flushes any buffered output.
|
| virtual void | Print (const char *format,...) |
| | Writes formatted output to the stream.
|
| virtual void | VPrint (const char *format, va_list argList)=0 |
| | Writes formatted output to the stream using a variable argument list.
|
| virtual void | Write (const uint8_t *bytes, size_t numBytes) |
| | Writes a sequence of bytes to the stream.
|
| virtual void | Write (uint8_t byte)=0 |
| | Writes a single byte to the stream.
|
| 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.
|
|
| 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.
|
| static const int | Eof = -1 |
| | A special value returned by single-byte input functions to indicate end of stream.
|
An abstract interface for performing both unformatted and formatted output operations.
OutputStream extends Stream with functions for writing data either as raw bytes or according to a printf-style format string.
- See also
- InputStream, Stream
◆ ~OutputStream()
| virtual Bond::OutputStream::~OutputStream |
( |
| ) |
|
|
inlinevirtual |
◆ Flush()
| virtual void Bond::OutputStream::Flush |
( |
| ) |
|
|
inlinevirtual |
Flushes any buffered output.
The default implementation does nothing. Concrete stream implementations may override this function when they buffer output internally or depend on an underlying buffered API.
Reimplemented in Bond::StdioOutputStream.
◆ Print()
| virtual void Bond::OutputStream::Print |
( |
const char * | format, |
|
|
| ... ) |
|
virtual |
Writes formatted output to the stream.
- Parameters
-
| format | A printf-style format string describing the text to be written. |
| ... | Values to be formatted and written to the stream. |
◆ VPrint()
| virtual void Bond::OutputStream::VPrint |
( |
const char * | format, |
|
|
va_list | argList ) |
|
pure virtual |
Writes formatted output to the stream using a variable argument list.
- Parameters
-
| format | A printf-style format string describing the text to be written. |
| argList | A variable argument list containing the values to be formatted. |
Implemented in Bond::MemoryOutputStream, and Bond::StdioOutputStream.
◆ Write() [1/2]
| virtual void Bond::OutputStream::Write |
( |
const uint8_t * | bytes, |
|
|
size_t | numBytes ) |
|
virtual |
◆ Write() [2/2]
| virtual void Bond::OutputStream::Write |
( |
uint8_t | byte | ) |
|
|
pure virtual |
The documentation for this class was generated from the following file:
- include/bond/io/outputstream.h