An abstract interface for performing both unformatted and formatted input operations.
More...
#include <bond/io/inputstream.h>
|
| virtual | ~InputStream () |
| | Destroys an InputStream object.
|
| virtual void | Scan (const char *format,...) |
| | Reads formatted input from the stream.
|
| virtual void | VScan (const char *format, va_list argList)=0 |
| | Reads formatted input from the stream using a variable argument list.
|
| size_t | Read (char *bytes, size_t numBytes) |
| | Reads a sequence of bytes from the stream into a character buffer.
|
| virtual size_t | Read (uint8_t *bytes, size_t numBytes) |
| | Reads a sequence of bytes from the stream.
|
| virtual int | Read ()=0 |
| | Reads a single byte from 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 input operations.
InputStream extends Stream with functions for reading data either as raw bytes or according to a scanf-style format string.
- See also
- OutputStream, Stream
◆ ~InputStream()
| virtual Bond::InputStream::~InputStream |
( |
| ) |
|
|
inlinevirtual |
◆ Read() [1/3]
| virtual int Bond::InputStream::Read |
( |
| ) |
|
|
pure virtual |
◆ Read() [2/3]
| size_t Bond::InputStream::Read |
( |
char * | bytes, |
|
|
size_t | numBytes ) |
|
inline |
Reads a sequence of bytes from the stream into a character buffer.
- Parameters
-
| bytes | The destination buffer where the bytes will be written. |
| numBytes | The maximum number of bytes to read. |
- Returns
- The number of bytes actually read from the stream.
◆ Read() [3/3]
| virtual size_t Bond::InputStream::Read |
( |
uint8_t * | bytes, |
|
|
size_t | numBytes ) |
|
virtual |
Reads a sequence of bytes from the stream.
- Parameters
-
| bytes | The destination buffer where the bytes will be written. |
| numBytes | The maximum number of bytes to read. |
- Returns
- The number of bytes actually read from the stream.
Reimplemented in Bond::MemoryInputStream, and Bond::StdioInputStream.
◆ Scan()
| virtual void Bond::InputStream::Scan |
( |
const char * | format, |
|
|
| ... ) |
|
virtual |
Reads formatted input from the stream.
- Parameters
-
| format | A scanf-style format string describing the values to be read. |
| ... | Pointers to locations where the parsed values will be stored. |
◆ VScan()
| virtual void Bond::InputStream::VScan |
( |
const char * | format, |
|
|
va_list | argList ) |
|
pure virtual |
Reads formatted input from the stream using a variable argument list.
- Parameters
-
| format | A scanf-style format string describing the values to be read. |
| argList | A variable argument list containing pointers to storage for the parsed values. |
Implemented in Bond::MemoryInputStream, and Bond::StdioInputStream.
The documentation for this class was generated from the following file:
- include/bond/io/inputstream.h