AUI Framework  master
Cross-platform module-based framework for developing C++20 desktop applications
IInputStream Class Referenceabstract

Represents an input stream. More...

Detailed Description

Represents an input stream.

Public Member Functions

virtual size_t read (char *dst, size_t size)=0
 Reads up to size bytes from stream. Blocking (waiting for new data) is allowed. More...
 
size_t read (std::span< std::byte > destination)
 Reads up to destination.size() bytes from stream. Blocking (waiting for new data) is allowed. More...
 
void readExact (char *dst, size_t size)
 Reads exact size bytes from stream. Blocking (waiting for new data) is allowed. More...
 
template<typename T >
deserialize ()
 
template<typename T >
IInputStreamoperator>> (T &dst)
 
template<typename T >
IInputStreamoperator>> (T &&dst)
 

Member Function Documentation

◆ deserialize()

template<typename T >
T IInputStream::deserialize
inline

Reads data using AUI serialization (see AUI/Traits/serializable.h)

Parameters
tvalue to write

◆ operator>>() [1/2]

template<typename T >
IInputStream & IInputStream::operator>> ( T &&  dst)

Reads data using AUI serialization (see AUI/Traits/serializable.h)

Parameters
tvalue to write

◆ operator>>() [2/2]

template<typename T >
IInputStream & IInputStream::operator>> ( T &  dst)

Reads data using AUI serialization (see AUI/Traits/serializable.h)

Parameters
tvalue to write

◆ read() [1/2]

virtual size_t IInputStream::read ( char *  dst,
size_t  size 
)
pure virtual

Reads up to size bytes from stream. Blocking (waiting for new data) is allowed.

Sneaky exceptions
An implementation can throw any exception that subclasses AIOException.
Parameters
dstdestination buffer
sizedestination buffer's size. > 0
Returns
number of read bytes (including 0)

Implemented in AByteBufferInputStream, AConcatInputStream, ADynamicPipe, AFileInputStream, ALimitedInputStream, APipe, ARandomInputStream, AStringStream, AStrongByteBufferInputStream, PipeInputStream, and ATcpSocket.

◆ read() [2/2]

size_t IInputStream::read ( std::span< std::byte >  destination)
inline

Reads up to destination.size() bytes from stream. Blocking (waiting for new data) is allowed.

Sneaky exceptions
An implementation can throw any exception that subclasses AIOException.
Parameters
dstdestination buffer
sizedestination buffer's size. > 0
Returns
number of read bytes (including 0)

◆ readExact()

void IInputStream::readExact ( char *  dst,
size_t  size 
)
inline

Reads exact size bytes from stream. Blocking (waiting for new data) is allowed.

Sneaky exceptions
An implementation can throw any exception that subclasses AIOException.
Exceptions
ThrowsAEOFException when could not read EXACT size bytes.
Parameters
dstdestination buffer.
sizedestination buffer's size.

#include <AUI/IO/IInputStream.h>


The documentation for this class was generated from the following file:
Inheritance diagram for IInputStream: