A concrete implementation of OutputStream that performs output operations to a stdio FILE*.
More...
#include <bond/io/stdiooutputstream.h>
|
| 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.
|
A concrete implementation of OutputStream that performs output operations to a stdio FILE*.
StdioOutputStream adapts a C stdio FILE object to the OutputStream interface. The stream may be bound either to an existing FILE pointer or to a file opened and owned through a StdioFileHandle.
- See also
- OutputStream, StdioInputStream
◆ StdioOutputStream() [1/5]
| Bond::StdioOutputStream::StdioOutputStream |
( |
FILE * | file | ) |
|
|
inlineexplicit |
Constructs a StdioOutputStream object.
- Parameters
-
| file | The stdio FILE object to which output will be written. The file is not owned by the StdioOutputStream unless it is later replaced by an owning handle. |
◆ StdioOutputStream() [2/5]
| Bond::StdioOutputStream::StdioOutputStream |
( |
const char * | fileName | ) |
|
|
explicit |
Constructs a StdioOutputStream object.
- Parameters
-
| fileName | The name of the file to open for writing. |
◆ StdioOutputStream() [3/5]
Constructs a StdioOutputStream object.
- Parameters
-
| handle | An owning file handle whose FILE object will be used for output operations. |
◆ StdioOutputStream() [4/5]
| Bond::StdioOutputStream::StdioOutputStream |
( |
StdioOutputStream && | other | ) |
|
|
inline |
◆ ~StdioOutputStream()
| virtual Bond::StdioOutputStream::~StdioOutputStream |
( |
| ) |
|
|
inlinevirtual |
◆ StdioOutputStream() [5/5]
| Bond::StdioOutputStream::StdioOutputStream |
( |
const StdioOutputStream & | other | ) |
|
|
delete |
◆ AddOffset()
| virtual void Bond::StdioOutputStream::AddOffset |
( |
off_t | offset | ) |
|
|
inlineoverridevirtual |
Advances the current position by the given offset.
- Parameters
-
| offset | The signed amount by which the current position should be adjusted. |
Implements Bond::Stream.
◆ ClearError()
| virtual void Bond::StdioOutputStream::ClearError |
( |
| ) |
|
|
inlineoverridevirtual |
Clears the current error state of the stream.
Implements Bond::Stream.
◆ Close()
| virtual void Bond::StdioOutputStream::Close |
( |
| ) |
|
|
overridevirtual |
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 from Bond::Stream.
◆ Flush()
| virtual void Bond::StdioOutputStream::Flush |
( |
| ) |
|
|
inlineoverridevirtual |
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 from Bond::OutputStream.
◆ GetEndPosition()
| virtual pos_t Bond::StdioOutputStream::GetEndPosition |
( |
| ) |
const |
|
overridevirtual |
Returns the end position of the stream.
- Returns
- The absolute position one past the last byte in the stream.
Implements Bond::Stream.
◆ GetPosition()
| virtual pos_t Bond::StdioOutputStream::GetPosition |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns the current position within the stream.
- Returns
- The current absolute stream position.
Implements Bond::Stream.
◆ HasError()
| virtual bool Bond::StdioOutputStream::HasError |
( |
| ) |
const |
|
inlineoverridevirtual |
Tests whether the stream is currently in an error state.
- Returns
- True if an error has occurred on the underlying stream.
Implements Bond::Stream.
◆ IsBound()
| bool Bond::StdioOutputStream::IsBound |
( |
| ) |
const |
|
inline |
Tests whether this stream is currently bound to a FILE object.
- Returns
- True if this stream is bound to a FILE object.
◆ IsEof()
| virtual bool Bond::StdioOutputStream::IsEof |
( |
| ) |
const |
|
inlineoverridevirtual |
Tests whether the current position is at or beyond the end of the stream.
- Returns
- True if no more data can be read or written at the current position.
Implements Bond::Stream.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ SetPosition()
| virtual void Bond::StdioOutputStream::SetPosition |
( |
off_t | offset | ) |
|
|
inlineoverridevirtual |
Sets the current position within the stream.
- Parameters
-
| offset | The absolute position to which the stream should be moved. |
Implements Bond::Stream.
◆ SetPositionFromEnd()
| virtual void Bond::StdioOutputStream::SetPositionFromEnd |
( |
off_t | offset | ) |
|
|
inlineoverridevirtual |
Sets the current position relative to the end of the stream.
- Parameters
-
| offset | The offset from the end position to which the stream should be moved. |
Implements Bond::Stream.
◆ VPrint()
| virtual void Bond::StdioOutputStream::VPrint |
( |
const char * | format, |
|
|
va_list | argList ) |
|
inlineoverridevirtual |
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. |
Implements Bond::OutputStream.
◆ Write() [1/2]
| virtual void Bond::StdioOutputStream::Write |
( |
const uint8_t * | bytes, |
|
|
size_t | numBytes ) |
|
inlineoverridevirtual |
Writes a sequence of bytes to the stream.
- Parameters
-
| bytes | The buffer containing the bytes to be written. |
| numBytes | The number of bytes to write. |
Reimplemented from Bond::OutputStream.
◆ Write() [2/2]
| virtual void Bond::StdioOutputStream::Write |
( |
uint8_t | byte | ) |
|
|
inlineoverridevirtual |
The documentation for this class was generated from the following file:
- include/bond/io/stdiooutputstream.h