AUI Framework  master
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
AByteBufferInputStream Class Referencefinal

Converts a AByteBuffer to an IInputStream.

#include <AUI/IO/AByteBufferInputStream.h>

Public Member Functions#

 AByteBufferInputStream (AByteBufferView buffer)
 
void seek (std::streamoff offset, ASeekDir seekDir) override
 change reading position, a way of changing depends on seekDir parameter
 
std::streampos tell () noexcept override
 return current reading position
 
bool isEof () override
 returns true if end of stream has been reached
 
size_t read (char *dst, size_t size) override
 Reads up to size bytes from stream. Blocking (waiting for new data) is allowed.
 
size_t available () const
 
- Public Member Functions inherited from ISeekableInputStream
size_t fileSize ()
 return size of the stream
 
- Public Member Functions inherited from IInputStream
size_t read (std::span< std::byte > destination)
 Reads up to destination.size() bytes from stream. Blocking (waiting for new data) is allowed.
 
void readExact (char *dst, size_t size)
 Reads exact size bytes from stream. Blocking (waiting for new data) is allowed.
 
template<typename T>
deserialize ()
 
template<typename T>
IInputStreamoperator>> (T &dst)
 
template<typename T>
IInputStreamoperator>> (T &&dst)
 

Member Function Documentation#

◆ isEof()#

bool AByteBufferInputStream::isEof ( )
overridevirtual
Returns
true if end of stream has been reached

Implements ISeekableInputStream.

◆ read()#

size_t AByteBufferInputStream::read ( char * dst,
size_t size )
overridevirtual
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)

Implements IInputStream.

◆ seek()#

void AByteBufferInputStream::seek ( std::streamoff offset,
ASeekDir seekDir )
overridevirtual

Implements ISeekableInputStream.

◆ tell()#

std::streampos AByteBufferInputStream::tell ( )
nodiscardoverridevirtualnoexcept
Returns
current reading pos

Implements ISeekableInputStream.