5#include <iolink/FlagSet.h>
6#include <iolink/IOLinkAPI.h>
7#include <iolink/storage/DataAccess.h>
27extern template class IOLINK_API_IMPORT FlagSet<StreamAccessCapability>;
88 virtual bool eof()
const = 0;
98 virtual bool fail()
const = 0;
120 virtual size_t read(
size_t size,
void* dst);
148 virtual size_t write(
size_t size,
const void* src);
Parent interface of interfaces used to manipulate raw bytes.
Definition: DataAccess.h:20
Template class to handle a flags system from an enum.
Definition: FlagSet.h:43
Mother interface for all stream-like data accessors.
Definition: StreamAccess.h:60
virtual size_t read(size_t size, void *dst)
Read data from cursor current position into destination buffer.
virtual bool good() const
Checks if the stream is currently valid for reading (only) Default implementation returns true if nor...
std::string toString() const
Return a string representation.
virtual uint8_t peek()
Return the current byte without moving the cursor.
virtual void flush()
Assure that all data is written to the endpoint.
virtual bool eof() const =0
Checks if the cursor is at the end of the stream for reading For writing, this status is not relevant...
virtual void * buffer()
Return a mutable pointer to the internal CPU memory buffer.
virtual StreamAccessCapabilitySet capabilities() const =0
bool support(StreamAccessCapabilitySet flags)
Checks if the StreamAccess supports the given capabilities.
Definition: StreamAccess.h:72
virtual size_t bufferSize()
Size in bytes of the internal CPU buffer.
virtual size_t write(size_t size, const void *src)
Write content of src buffer into StreamAccess.
virtual const void * bufferReadOnly() const
Return an immutable pointer to the internal CPU memory buffer.
virtual void seek(int64_t offset, SeekOrigin origin)
Move the cursor to the desired position.
virtual size_t tell()
Returns the current position of the cursor.
All IOLink symbols are enclosed in this namespace.
Definition: ArrayX.h:8
StreamAccessCapability
Capabilities of a StreamAccess.
Definition: StreamAccess.h:16
@ SEEK
Cursor for read/write can be moved.
@ READ_SEEK
combination of READ and SEEK
@ WRITE_SEEK
combination of WRITE and SEEK
SeekOrigin
Position indicator for seek method.
Definition: StreamAccess.h:39
@ BEGIN
Begining of the stream.
@ CURRENT
Current position of the stream.
@ MEMORY_ACCESS
Accessing internal CPU memory buffer.
@ WRITE
Data can be written.