8#include "Arp/Base/Core/PimplPtr.hxx"
9#include "Arp/Base/Commons/Io/SeekOrigin.hpp"
11namespace Arp::Base::Commons::Io
25 Stream(
bool canRead =
false,
bool canWrite =
false,
bool canSeek =
false);
35 static Stream& GetEmpty(
void);
38 virtual bool CanRead(
void);
39 virtual bool CanWrite(
void);
40 virtual bool CanSeek(
void);
41 virtual void SetPosition(
size_t value);
42 virtual size_t GetPosition(
void);
45 virtual size_t Seek(
size_t offset, SeekOrigin origin) = 0;
46 virtual size_t Read(
byte* pBuffer,
size_t bufferSize,
size_t bufferOffset,
size_t count) = 0;
47 virtual void Write(
const byte* pBuffer,
size_t bufferSize,
size_t bufferOffset,
size_t count) = 0;
48 virtual void Flush(
void) = 0;
51 virtual byte ReadByte(
void);
52 virtual void WriteByte(
byte value);
53 virtual void WriteTo(
Stream& other);
54 virtual void ReadFrom(
Stream& other);
58 const Impl& GetImpl(
void)
const;
This abstract class shall be the base class of all stream implementations.
Definition: Stream.hpp:20
Stream(const Stream &arg)
Default copy constructor.
virtual ~Stream(void)
Default destructor.
Stream & operator=(const Stream &arg)
Default copy-assignment operator.
Stream & operator=(Stream &&arg) noexcept
Default move-assignment operator.
Stream(Stream &&arg) noexcept
Default move constructor.
Adapter class to implement PImpl idiom.
Definition: PimplPtr.hxx:15
@ Write
Specifies write access to the file. Data can be written to the file and the file pointer can be moved...
@ Read
Specifies read access to the file. Data can be read from the file and the file pointer can be moved....