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

Input stream based on AByteBuffer with memory control, clears byte buffer on destruction. More...

Detailed Description

Input stream based on AByteBuffer with memory control, clears byte buffer on destruction.

Public Member Functions

 AStrongByteBufferInputStream (AByteBuffer buffer) noexcept
 
 AStrongByteBufferInputStream (_< AByteBuffer > buffer) noexcept
 
bool isEof () override
 returns true if end of stream has been reached More...
 
void seek (std::streamoff offset, std::ios::seekdir seekDir) override
 change reading position, a way of changing depends on seekDir parameter More...
 
size_t tell () override
 return current reading position More...
 
size_t read (char *dst, size_t size) override
 Reads up to size bytes from stream. Blocking (waiting for new data) is allowed. More...
 
AByteBufferbuffer () noexcept
 
- Public Member Functions inherited from ISeekableInputStream
size_t fileSize ()
 return size of the stream More...
 
- 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. 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)
 

Static Public Member Functions

static _< AStrongByteBufferInputStreamfromUrl (const AUrl &url)
 

Member Function Documentation

◆ isEof()

bool AStrongByteBufferInputStream::isEof ( )
overridevirtual

returns true if end of stream has been reached

Returns
true if end of stream has been reached

Implements ISeekableInputStream.

◆ read()

size_t AStrongByteBufferInputStream::read ( char *  dst,
size_t  size 
)
overridevirtual

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)

Implements IInputStream.

◆ seek()

void AStrongByteBufferInputStream::seek ( std::streamoff  offset,
std::ios::seekdir  seekDir 
)
overridevirtual

change reading position, a way of changing depends on seekDir parameter

Implements ISeekableInputStream.

◆ tell()

size_t AStrongByteBufferInputStream::tell ( )
overridevirtual

return current reading position

Returns
current reading pos

Implements ISeekableInputStream.

#include <AUI/IO/AStrongByteBufferInputStream.h>


The documentation for this class was generated from the following files:
Inheritance diagram for AStrongByteBufferInputStream:
Collaboration diagram for AStrongByteBufferInputStream: