4#include "system/io/stream.h"
5#include "system/reflection.h"
7namespace System {
namespace IO {
29 virtual ASPOSECPP_SHARED_API
int ReadByte()
override;
32 virtual ASPOSECPP_SHARED_API
void WriteByte(uint8_t value)
override;
38 virtual ASPOSECPP_SHARED_API int32_t
Read(
const ArrayPtr<uint8_t>& buffer, int32_t offset, int32_t count)
override;
44 virtual ASPOSECPP_SHARED_API int32_t
Read(
const System::Details::ArrayView<uint8_t>& buffer, int32_t offset, int32_t count)
override;
54 virtual ASPOSECPP_SHARED_API
void Write(
const System::Details::ArrayView<uint8_t>& buffer, int32_t offset, int32_t count)
override;
59 virtual ASPOSECPP_SHARED_API int64_t
Seek(int64_t offset,
SeekOrigin origin)
override;
62 virtual ASPOSECPP_SHARED_API
void SetLength(int64_t value)
override;
64 virtual ASPOSECPP_SHARED_API
void Flush()
override;
69 virtual ASPOSECPP_SHARED_API
void set_Position(int64_t value)
override;
71 virtual ASPOSECPP_SHARED_API int64_t
get_Position()
const override;
73 virtual ASPOSECPP_SHARED_API int64_t
get_Length()
const override;
76 virtual ASPOSECPP_SHARED_API
bool get_CanRead()
const override;
79 virtual ASPOSECPP_SHARED_API
bool get_CanSeek()
const override;
86 template<
template<
typename T>
class ArrT> int32_t _Read(
const ArrT<uint8_t> & buffer, int32_t offset, int32_t count);
87 template<
template<
typename T>
class ArrT>
void _Write(
const ArrT<uint8_t>& buffer, int32_t offset, int32_t count);
97 int m_buffer_read_ahead;
99 bool m_buffer_reading;
Adds a buffering layer on top of another stream. Objects of this class should only be allocated using...
Definition: buffered_stream.h:13
virtual bool get_CanRead() const override
Determines if the stream is readable.
virtual void Write(const ArrayPtr< uint8_t > &buffer, int32_t offset, int32_t count) override
Writes the specified subrange of bytes from the specified byte array to the underlying stream.
BufferedStream(const SharedPtr< Stream > &stream)
Constructs an BufferedStream object that wraps the specified stream and uses a 4096 bytes long buffer...
virtual ~BufferedStream()
Destructor.
virtual void set_Position(int64_t value) override
Flushes the buffer to the underlying stream and then sets the stream's position.
virtual void Flush() override
Writes the content of the buffer to the underlying stream.
virtual int32_t Read(const System::Details::ArrayView< uint8_t > &buffer, int32_t offset, int32_t count) override
Reads the specified number of bytes from the underlying stream and writes them to the specified byte ...
BufferedStream(const SharedPtr< Stream > &stream, int bufferSize)
Constructs an BufferedStream object that wraps the specified stream and uses a buffer of the specifie...
virtual void WriteByte(uint8_t value) override
Writes the specified unsigned 8-bit integer value to the underlying stream.
virtual bool get_CanWrite() const override
Determines if the stream is writable.
virtual void SetLength(int64_t value) override
Sets the length of the stream represented by the current object.
virtual int64_t get_Position() const override
Returns the current position of the stream.
virtual int ReadByte() override
Reads a single byte from the underlying stream and returns a 32-bit integer value equivalent to the v...
virtual int64_t get_Length() const override
Returns the length of the stream.
virtual bool get_CanSeek() const override
Determines if the stream supports seeking.
virtual void Write(const System::Details::ArrayView< uint8_t > &buffer, int32_t offset, int32_t count) override
Writes the specified subrange of bytes from the specified byte array to the underlying stream.
virtual int64_t Seek(int64_t offset, SeekOrigin origin) override
Sets the position of the stream represented by the current object.
virtual int32_t Read(const ArrayPtr< uint8_t > &buffer, int32_t offset, int32_t count) override
Reads the specified number of bytes from the underlying stream and writes them to the specified byte ...
A base class for a variety of stream implementations. Objects of this class should only be allocated ...
Definition: stream.h:24
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
SeekOrigin
Specifies the reference position in the stream relative to which the position to seek to is specified...
Definition: seekorigin.h:11
Definition: db_command.h:9