Bond 0.9
C++ Bond Runtime Library API Documentation
Loading...
Searching...
No Matches
Bond::InputStreamAdaptor Class Reference

A wrapper around an InputStream that adds formatted input operations used within the Bond Standard Library. More...

#include <bond/io/inputstreamadaptor.h>

Public Member Functions

 InputStreamAdaptor (InputStream *stream)
 Constructs an InputStreamAdaptor object.
InputStreamGetStream () const
 Returns the wrapped InputStream.
void ScanStr (char *str, uint32_t bufferSize)
 Scans a string from the wrapped InputStream.
bool ScanBool ()
 Scans a boolean value from the wrapped InputStream.
int8_t ScanChar ()
 Scans a signed character value from the wrapped InputStream.
int32_t ScanInt ()
 Scans a signed 32-bit integer value from the wrapped InputStream.
uint32_t ScanUInt ()
 Scans an unsigned 32-bit integer value from the wrapped InputStream.
int64_t ScanLong ()
 Scans a signed 64-bit integer value from the wrapped InputStream.
uint64_t ScanULong ()
 Scans an unsigned 64-bit integer value from the wrapped InputStream.
double ScanDouble ()
 Scans a floating-point value from the wrapped InputStream.
int GetFlags () const
 Returns the current formatting flags.
void SetFlags (int flags)
 Sets the specified formatting flags.
void UnsetFlags (int flags)
 Unsets the specified formatting flags.
void ClearFlags ()
 Clears all formatting flags.

Detailed Description

A wrapper around an InputStream that adds formatted input operations used within the Bond Standard Library.

Constructor & Destructor Documentation

◆ InputStreamAdaptor()

Bond::InputStreamAdaptor::InputStreamAdaptor ( InputStream * stream)
inlineexplicit

Constructs an InputStreamAdaptor object.

Parameters
streamThe stream from which formatted input is read.

Member Function Documentation

◆ ClearFlags()

void Bond::InputStreamAdaptor::ClearFlags ( )
inline

Clears all formatting flags.

This clears any bitfield values previously set from the IO::Flags enum.

◆ 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

Returns the wrapped InputStream.

◆ 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 string from the wrapped InputStream.

Parameters
strBuffer where the scanned string is written.
bufferSizeThe size of the destination buffer, in bytes.

◆ 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
flagsThe flags to set.

◆ UnsetFlags()

void Bond::InputStreamAdaptor::UnsetFlags ( int flags)
inline

Unsets the specified formatting flags.

The flags are bitfields defined by the IO::Flags enum.

Parameters
flagsThe flags to unset.

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