2#ifndef _csharptest_UnmanagedMemoryStream_h_
3#define _csharptest_UnmanagedMemoryStream_h_
18#include <system/shared_ptr.h>
19#include <system/object.h>
20#include <system/io/stream.h>
21#include <system/io/seekorigin.h>
22#include <system/io/file_access.h>
23#include <system/enum_helpers.h>
24#include <system/array.h>
98 ASPOSECPP_SHARED_RTTI_INFO_DECL();
111 virtual ASPOSECPP_SHARED_API int64_t
get_Length()
const override;
118 virtual ASPOSECPP_SHARED_API
void set_Position(int64_t value)
override;
136 virtual ASPOSECPP_SHARED_API
void Flush()
override;
147 virtual ASPOSECPP_SHARED_API int64_t
Seek(int64_t offset,
SeekOrigin loc)
override;
150 virtual ASPOSECPP_SHARED_API
void SetLength(int64_t value)
override;
159 virtual ASPOSECPP_SHARED_API int32_t
Read(
const System::Details::ArrayView<uint8_t>& buffer, int32_t offset, int32_t count)
override;
162 virtual ASPOSECPP_SHARED_API
void Write(
const System::Details::ArrayView<uint8_t>& buffer, int32_t offset, int32_t count)
override;
193 ASPOSECPP_SHARED_API
void Initialize(uint8_t* pointer, int64_t length, int64_t capacity,
FileAccess access,
bool skipSecurityCheck);
196 virtual ASPOSECPP_SHARED_API
void Dispose(
bool disposing)
override;
203 static ASPOSECPP_SHARED_API
void Memcpy(
const System::Details::ArrayView<uint8_t>& dest,
int destIndex, uint8_t* src,
int srcIndex,
int len);
207 static const int64_t UnmanagedMemStreamMaxLength;
210 uint8_t * _mem =
nullptr;
A base class for a variety of stream implementations. Objects of this class should only be allocated ...
Definition: stream.h:24
Provides access to unmanaged memory. Objects of this class should only be allocated using System::Mak...
Definition: unmanaged_memory_stream.h:92
uint8_t * get_Pointer()
NOT IMPLEMENTED.
UnmanagedMemoryStream(uint8_t *pointer, int64_t length)
Constructs a new instance of UnmanagedMemoryStream.
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
NOT IMPLEMENTED.
uint8_t * get_PositionPointer()
NOT IMPLEMENTED.
virtual bool get_CanSeek() const override
Determines if the stream supports seeking.
virtual int64_t get_Position() const override
Returns the current position of the 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 stream and writes them to the specified byte array.
static void Memcpy(const System::Details::ArrayView< uint8_t > &dest, int destIndex, uint8_t *src, int srcIndex, int len)
Copies bytes from the specified source buffer starting to the specified byte array.
void Initialize(uint8_t *pointer, int64_t length, int64_t capacity, FileAccess access, bool skipSecurityCheck)
Initializes a newly created instance of UnmanagedMemoryStream class.
void set_PositionPointer(uint8_t *value)
NOT IMPLEMENTED.
virtual int64_t get_Length() const override
Returns the length of the stream in bytes.
virtual void SetLength(int64_t value) override
NOT IMPLEMENTED.
virtual int64_t Seek(int64_t offset, SeekOrigin loc) override
Sets the position of the stream represented by the current object.
bool _isOpen
Indicates if the stream is in open state.
Definition: unmanaged_memory_stream.h:166
virtual void Flush() override
Does nothing.
virtual void Dispose(bool disposing) override
Releases all resources used by the current object and closes the stream.
virtual int64_t get_Capacity() const
Returns the current capacity of the underlying memory buffer.
virtual bool get_CanWrite() const override
Determines if the stream is writable.
UnmanagedMemoryStream(uint8_t *pointer, int64_t length, int64_t capacity, FileAccess access, bool skipSecurityCheck)
Constructs a new instance of UnmanagedMemoryStream.
virtual int32_t Read(const ArrayPtr< uint8_t > &buffer, int32_t offset, int32_t count) override
Reads the specified number of bytes from the stream and writes them to the specified byte array.
UnmanagedMemoryStream(uint8_t *pointer, int64_t length, int64_t capacity, FileAccess access)
Constructs a new instance of UnmanagedMemoryStream.
virtual void set_Position(int64_t value) override
Sets the stream's position.
virtual void Write(const System::Details::ArrayView< uint8_t > &buffer, int32_t offset, int32_t count) override
NOT IMPLEMENTED.
UnmanagedMemoryStream()
Constructs a new instnace of UnmanagedMemoryStream class.
void Initialize(uint8_t *pointer, int64_t length, int64_t capacity, FileAccess access)
Initializes a newly created instance of UnmanagedMemoryStream class.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
FileAccess
Specifies the type of access when opening the file.
Definition: file_access.h:11
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