PLCnext API Documentation 25.0.2.69
NullStream.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/Base/Core/PimplPtr.hxx"
9#include "Arp/Base/Commons/Io/Stream.hpp"
10
11namespace Arp::Base::Commons::Io
12{
13
20class ARP_EXPORT NullStream : public Stream
21{
22public: // Impl forward declaration
23 class Impl;
24
25public: // construction
27
28 // canonical construction/destruction/assignment
30 NullStream(NullStream&& arg)noexcept;
34
35public: // final setter/getter operations
36 bool CanRead(void)final;
37 bool CanWrite(void)final;
38 bool CanSeek(void)final;
39 void SetPosition(size_t value)final;
40 size_t GetPosition(void)final;
41
42public: // final operations
43 size_t Seek(size_t offset, SeekOrigin origin)final;
44 size_t Read(byte* pBuffer, size_t bufferSize, size_t offset, size_t count)final;
45 void Write(const byte* pBuffer, size_t bufferSize, size_t offset, size_t count)final;
46 void WriteByte(byte value)final;
47 byte ReadByte(void)final;
48 void WriteTo(Stream& other)final;
49 void ReadFrom(Stream& other)final;
50 void Flush(void)final;
51};
52
53} // end of namespace Arp::Base::Commons::Io
This class represents a stream without any data.
Definition: NullStream.hpp:21
NullStream(void)
Default constructor.
NullStream(const NullStream &arg)
Default copy constructor.
NullStream & operator=(const NullStream &arg)
Default copy-assignment operator.
~NullStream(void)
Default destructor.
NullStream & operator=(NullStream &&arg) noexcept
Default move-assignment operator.
NullStream(NullStream &&arg) noexcept
Default move constructor.
This abstract class shall be the base class of all stream implementations.
Definition: Stream.hpp:20
@ 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....