PLCnext API Documentation 25.0.2.69
|
This abstract class shall be the base class of all stream implementations. More...
#include <Stream.hpp>
Public Member Functions | |
Stream (bool canRead=false, bool canWrite=false, bool canSeek=false) | |
This constructor is used to constructs a base stream instance. More... | |
Stream (const Stream &arg) | |
Default copy constructor. More... | |
Stream (Stream &&arg) noexcept | |
Default move constructor. More... | |
Stream & | operator= (const Stream &arg) |
Default copy-assignment operator. More... | |
Stream & | operator= (Stream &&arg) noexcept |
Default move-assignment operator. More... | |
virtual | ~Stream (void) |
Default destructor. | |
virtual bool | CanRead (void) |
Determines if the derived stream can read. More... | |
virtual bool | CanWrite (void) |
Determines if the derived stream can write. More... | |
virtual bool | CanSeek (void) |
Determines if the derived stream can seek. More... | |
virtual void | SetPosition (size_t value) |
Sets the position of the stream, if it can seek. More... | |
virtual size_t | GetPosition (void) |
Gets the position of the stream, if it can seek. More... | |
virtual size_t | Seek (size_t offset, SeekOrigin origin)=0 |
virtual size_t | Read (byte *pBuffer, size_t bufferSize, size_t bufferOffset, size_t count)=0 |
virtual void | Write (const byte *pBuffer, size_t bufferSize, size_t bufferOffset, size_t count)=0 |
virtual void | Flush (void)=0 |
virtual byte | ReadByte (void) |
Reads a single byte from the stream. More... | |
virtual void | WriteByte (byte value) |
Writes a single byte to the stream. More... | |
virtual void | WriteTo (Stream &other) |
Writes the data this stream to another stream entirely. More... | |
virtual void | ReadFrom (Stream &other) |
Reads the entire data from another stream into this stream. More... | |
Static Public Member Functions | |
static Stream & | GetEmpty (void) |
Gets an empty stream. More... | |
This abstract class shall be the base class of all stream implementations.
Derive from this class to implement a special stream, e.g. FileStream, MemoryStream or SocketStream.
Arp::Base::Commons::Io::Stream::Stream | ( | bool | canRead = false , |
bool | canWrite = false , |
||
bool | canSeek = false |
||
) |
This constructor is used to constructs a base stream instance.
canRead | Specifies if the derived stream can read. |
canWrite | Specifies if the derived stream can write. |
canSeek | Specifies if the derived stream can seek. |
|
default |
Default copy constructor.
arg | The argument to copy. |
|
defaultnoexcept |
Default move constructor.
arg | The argument to move. |
|
virtual |
Determines if the derived stream can read.
true
if the derived stream can read, otherwise false
.Reimplemented in Arp::Base::Commons::Io::NullStream, and Arp::System::Commons::Io::NullStream.
|
virtual |
Determines if the derived stream can seek.
true
if the derived stream can seek, otherwise false
.Reimplemented in Arp::Base::Commons::Io::NullStream, and Arp::System::Commons::Io::NullStream.
|
virtual |
Determines if the derived stream can write.
true
if the derived stream can write, otherwise false
.Reimplemented in Arp::Base::Commons::Io::NullStream, and Arp::System::Commons::Io::NullStream.
|
pure virtual |
Implemented in Arp::Base::Commons::Io::NullStream, and Arp::System::Commons::Io::FileStream.
|
static |
Gets an empty stream.
|
virtual |
Gets the position of the stream, if it can seek.
value | The current position of the stream. |
NotSupportedException | If this stream cannot seek. |
Reimplemented in Arp::Base::Commons::Io::NullStream, Arp::System::Commons::Io::NullStream, Arp::System::Commons::Io::FileStream, and Arp::System::Commons::Io::MemoryStream.
Default copy-assignment operator.
arg | The argument to copy. |
Default move-assignment operator.
arg | The argument to move. |
|
pure virtual |
Implemented in Arp::Base::Commons::Io::NullStream, and Arp::System::Commons::Io::FileStream.
|
virtual |
Reads a single byte
from the stream.
EndOfStreamException | If this stream is at its end. |
Reimplemented in Arp::Base::Commons::Io::NullStream, and Arp::System::Commons::Io::NullStream.
|
virtual |
Reads the entire data from another stream into this stream.
other | The other stream to read the entire data from. |
Reimplemented in Arp::Base::Commons::Io::NullStream.
|
pure virtual |
Implemented in Arp::Base::Commons::Io::NullStream.
|
virtual |
Sets the position of the stream, if it can seek.
value | The new position of the stream. |
NotSupportedException | If this stream cannot seek. |
Reimplemented in Arp::System::Commons::Io::NullStream, Arp::System::Commons::Io::FileStream, Arp::Base::Commons::Io::NullStream, and Arp::System::Commons::Io::MemoryStream.
|
pure virtual |
Implemented in Arp::Base::Commons::Io::NullStream, and Arp::System::Commons::Io::FileStream.
|
virtual |
Writes a single byte
to the stream.
value | The byte to write. |
Reimplemented in Arp::Base::Commons::Io::NullStream, and Arp::System::Commons::Io::NullStream.
|
virtual |
Writes the data this stream to another stream entirely.
other | The other stream to write this stream data to. |
Reimplemented in Arp::Base::Commons::Io::NullStream.