A wrapper around an InputStream that adds formatted input operations used within the Bond Standard Library.
More...
#include <bond/io/inputstreamadaptor.h>
A wrapper around an InputStream that adds formatted input operations used within the Bond Standard Library.
The scanning functions must only be called while the adaptor wraps a stream. A value that cannot be scanned is returned as 0.
◆ InputStreamAdaptor()
| Bond::InputStreamAdaptor::InputStreamAdaptor |
( |
InputStream * | stream | ) |
|
|
inlineexplicit |
Constructs an InputStreamAdaptor object with no formatting flags.
- Parameters
-
| stream | The stream from which formatted input is read, or null. The stream is not owned by the adaptor. |
◆ ClearFlags()
| void Bond::InputStreamAdaptor::ClearFlags |
( |
| ) |
|
|
inline |
Clears all formatting flags.
This clears any bitfield values previously set from the IO::Flags enum.
◆ Close()
| void Bond::InputStreamAdaptor::Close |
( |
| ) |
|
Closes the wrapped InputStream and detaches from it, after which GetStream returns null. Does nothing if there is no wrapped InputStream.
◆ GetFlags()
| int Bond::InputStreamAdaptor::GetFlags |
( |
| ) |
const |
|
inline |
Returns the current formatting flags.
The flags are bitfields defined by the IO::Flags enum.
◆ GetStream()
| InputStream * Bond::InputStreamAdaptor::GetStream |
( |
| ) |
const |
|
inline |
◆ ScanBool()
| bool Bond::InputStreamAdaptor::ScanBool |
( |
| ) |
|
Scans a boolean value from the wrapped InputStream.
- Returns
- The scanned boolean value.
◆ ScanChar()
| int8_t Bond::InputStreamAdaptor::ScanChar |
( |
| ) |
|
Scans a signed character value from the wrapped InputStream.
- Returns
- The scanned character value.
◆ ScanDouble()
| double Bond::InputStreamAdaptor::ScanDouble |
( |
| ) |
|
Scans a floating-point value from the wrapped InputStream.
- Returns
- The scanned floating-point value.
◆ ScanInt()
| int32_t Bond::InputStreamAdaptor::ScanInt |
( |
| ) |
|
Scans a signed 32-bit integer value from the wrapped InputStream.
- Returns
- The scanned integer value.
◆ ScanLong()
| int64_t Bond::InputStreamAdaptor::ScanLong |
( |
| ) |
|
Scans a signed 64-bit integer value from the wrapped InputStream.
- Returns
- The scanned long integer value.
◆ ScanStr()
| void Bond::InputStreamAdaptor::ScanStr |
( |
char * | str, |
|
|
uint32_t | bufferSize ) |
Scans a whitespace-delimited string from the wrapped InputStream.
- Parameters
-
| str | Buffer where the scanned string is written, followed by a null terminator. |
| bufferSize | The size of the destination buffer, in bytes. At most bufferSize - 1 characters are scanned. |
◆ ScanUInt()
| uint32_t Bond::InputStreamAdaptor::ScanUInt |
( |
| ) |
|
Scans an unsigned 32-bit integer value from the wrapped InputStream.
- Returns
- The scanned unsigned integer value.
◆ ScanULong()
| uint64_t Bond::InputStreamAdaptor::ScanULong |
( |
| ) |
|
Scans an unsigned 64-bit integer value from the wrapped InputStream.
- Returns
- The scanned unsigned long integer value.
◆ SetFlags()
| void Bond::InputStreamAdaptor::SetFlags |
( |
int | flags | ) |
|
|
inline |
Sets the specified formatting flags.
The flags are bitfields defined by the IO::Flags enum.
- Parameters
-
◆ UnsetFlags()
| void Bond::InputStreamAdaptor::UnsetFlags |
( |
int | flags | ) |
|
|
inline |
Unsets the specified formatting flags.
The flags are bitfields defined by the IO::Flags enum.
- Parameters
-
The documentation for this class was generated from the following file:
- include/bond/io/inputstreamadaptor.h