A buffer input/output stream based on std::string.
#include <AUI/IO/AStringStream.h>
|
| AStringStream (std::string string) |
|
| AStringStream (const AString &string) |
|
void | seekRead (size_t position) |
|
size_t | read (char *dst, size_t size) override |
| Reads up to size bytes from stream. Blocking (waiting for new data) is allowed.
|
|
void | write (const char *src, size_t size) override |
| Writes exact size bytes to stream. Blocking (waiting for write all data) is allowed.
|
|
const std::string & | str () const noexcept |
|
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> |
T | deserialize () |
|
template<typename T> |
IInputStream & | operator>> (T &dst) |
|
template<typename T> |
IInputStream & | operator>> (T &&dst) |
|
template<typename T> |
void | write (const T &t) |
|
template<typename T> |
IOutputStream & | operator<< (const T &t) |
|
◆ read()#
size_t AStringStream::read |
( |
char * | dst, |
|
|
size_t | size ) |
|
overridevirtual |
- Sneaky exceptions
- An implementation can throw any exception that subclasses AIOException.
- Parameters
-
dst | destination buffer |
size | destination buffer's size. > 0 |
- Returns
- number of read bytes (including 0)
Implements IInputStream.
◆ write()#
void AStringStream::write |
( |
const char * | src, |
|
|
size_t | size ) |
|
overridevirtual |
- Sneaky exceptions
- An implementation can throw any exception that subclasses AIOException.
- Parameters
-
src | source buffer |
size | source buffer's size. > 0 |
Implements IOutputStream.