Bond 0.9
C++ Bond Runtime Library API Documentation
Loading...
Searching...
No Matches
Bond::OutputStream Class Referenceabstract

An abstract interface for performing both unformatted and formatted output operations. More...

#include <bond/io/outputstream.h>

Inheritance diagram for Bond::OutputStream:
Bond::Stream Bond::MemoryOutputStream Bond::StdioOutputStream Bond::StdErrOutputStream Bond::StdOutOutputStream

Public Member Functions

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.
Public Member Functions inherited from Bond::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.

Additional Inherited Members

Public Types inherited from Bond::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 Public Attributes inherited from Bond::Stream
static const int Eof = -1
 A special value returned by single-byte input functions to indicate end of stream.

Detailed Description

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

Constructor & Destructor Documentation

◆ ~OutputStream()

virtual Bond::OutputStream::~OutputStream ( )
inlinevirtual

Destroys an OutputStream object.

Member Function Documentation

◆ 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
formatA 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
formatA printf-style format string describing the text to be written.
argListA 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

Writes a sequence of bytes to the stream.

Parameters
bytesThe buffer containing the bytes to be written.
numBytesThe number of bytes to write.

Reimplemented in Bond::MemoryOutputStream, and Bond::StdioOutputStream.

◆ Write() [2/2]

virtual void Bond::OutputStream::Write ( uint8_t byte)
pure virtual

Writes a single byte to the stream.

Parameters
byteThe byte to write.

Implemented in Bond::MemoryOutputStream, and Bond::StdioOutputStream.


The documentation for this class was generated from the following file:
  • include/bond/io/outputstream.h