AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
AStrongByteBufferInputStream Class Reference

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

#include <AUI/IO/AStrongByteBufferInputStream.h>

Public Member Functions

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

Static Public Member Functions

static _< AStrongByteBufferInputStreamfromUrl (const AUrl &url)
 

Detailed Description

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

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.


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