RLib  5.7
RLib - an opensource, lightweight and multi-platform framework for cpp programming
System::IO::UnmanagedMemoryStream Class Reference

Provides access to unmanaged blocks of memory More...

Inheritance diagram for System::IO::UnmanagedMemoryStream:
System::IO::MemoryStream System::IO::Stream

Public Member Functions

 UnmanagedMemoryStream ()
 Initializes a new instance of the UnmanagedMemoryStream class More...
 
 UnmanagedMemoryStream (LPVOID lpbuffer, intptr_t size, intptr_t len)
 Initializes a new instance of the UnmanagedMemoryStream class in a safe buffer with a specified size and length More...
 
 UnmanagedMemoryStream (LPCVOID lpbuffer, intptr_t len)
 Initializes a new instance of the UnmanagedMemoryStream class using the specified location and memory length More...
 
virtual void SetSize (intptr_t size) override
 Sets the size of a stream to a specified value More...
 
virtual void SetLength (intptr_t len) override
 Sets the length of a stream to a specified value More...
 
virtual intptr_t Write (LPCVOID buffer, intptr_t count) override
 Writes a block of bytes to the current stream using data from a buffer More...
 
virtual bool InheritFromBufferedStream () const overridefinal
 Identifies whether current class is a derived class of (or the same class as) BufferedStream More...
 
virtual void Close () override
 Overrides the Close method so that no action is performed More...
 
 RLIB_PROPERTY_GET_SET (intptr_t Length, GetLength, SetLength)
 Gets or sets the length in bytes of the stream More...
 
 RLIB_PROPERTY_GET_SET (intptr_t Position, GetPos, SetPos)
 Gets or sets the position within the current stream More...
 
void SetObjectData (LPVOID pData)
 Sets the pointer to an unmanaged memory location More...
 
 RLIB_PROPERTY_GET_SET (LPVOID ObjectData, GetObjectData, SetObjectData)
 Gets or sets the pointer to an unmanaged memory location More...
 
void ExChange (UnmanagedMemoryStream &)
 Swaps two UnmanagedMemoryStream instance(shallow move) More...
 
void Move (intptr_t offsetTo, intptr_t offsetFrom, intptr_t bytes)
 Copies the bytes(<=size) from the location offsetTo to offsetFrom, and may change the length of stream. Copying takes place as if an intermediate buffer were used, allowing the destination and source to overlap. More...
 
- Public Member Functions inherited from System::IO::MemoryStream
virtual intptr_t GetSize () const override
 Gets the capacity in bytes of the stream More...
 
virtual intptr_t GetLength () const override
 Gets the length in bytes of the stream More...
 
virtual intptr_t GetPos () const override
 Gets the position within the current stream More...
 
virtual void SetPos (intptr_t Pos) override
 Sets the position within the current stream More...
 
virtual intptr_t Read (LPVOID buffer, intptr_t count) const override
 Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read More...
 
virtual bool InheritFromMemoryStream () const overridefinal
 identifies whether current class is a derived class of (or the same class as) MemoryStream More...
 
LPVOID GetObjectData () const
 Gets the pointer of bytes from which this stream was created More...
 
 RLIB_PROPERTY_GET (LPVOID ObjectData, GetObjectData)
 Gets the pointer of bytes from which this stream was created More...
 
void * GetCurrentPtr () const
 Gets the pointer of bytes at the current position More...
 
 RLIB_PROPERTY_GET (void *CurrentPtr, GetCurrentPtr)
 Gets the pointer of bytes at the current position More...
 
 RLIB_PROPERTY_GET_SET (intptr_t Capacity, GetSize, SetSize)
 Gets or sets the number of bytes allocated for this object More...
 
- Public Member Functions inherited from System::IO::Stream
 RLIB_PROPERTY_GET_SET (intptr_t Position, GetPos, SetPos)
 When overridden in a derived class, gets or sets the position within the current stream More...
 
 RLIB_PROPERTY_GET_SET (intptr_t Size, GetSize, SetSize)
 When overridden in a derived class, gets or sets the capacity in bytes of the stream More...
 
 RLIB_PROPERTY_GET_SET (intptr_t Length, GetLength, SetLength)
 When overridden in a derived class, gets or sets the length in bytes of the stream More...
 
intptr_t GetMaxReadSize () const
 Gets the maximum bytes of readable data from current position More...
 
 RLIB_PROPERTY_GET (intptr_t MaxReadSize, GetMaxReadSize)
 Gets the maximum bytes of readable data from current position More...
 
intptr_t GetMaxWriteSize () const
 Gets the maximum writeable bytes from current position, based on current capacity More...
 
 RLIB_PROPERTY_GET (intptr_t MaxWriteSize, GetMaxWriteSize)
 Gets the maximum writeable bytes from current position, based on current capacity More...
 
void CopyTo (Stream *destination, intptr_t bufferSize=RLIB_DEFAULT_BUFFER_SIZE) const
 Reads the bytes from the current stream and writes them to another stream, using a specified buffer size More...
 

Static Public Member Functions

static UnmanagedMemoryStreamOpen_memstream (LPCVOID buf, intptr_t size)
 The function shall associate the buffer given by the buf and size arguments with a stream(read only) More...
 
static UnmanagedMemoryStreamOpen_wmemstream (LPVOID buf, intptr_t size)
 The function shall associate the buffer given by the buf and size arguments with a stream(read-write) More...
 

Public Attributes

 RLIB_DECLARE_DYNCREATE
 

Additional Inherited Members

- Protected Member Functions inherited from System::IO::MemoryStream
intptr_t stream_move (intptr_t offsetTo, intptr_t offsetFrom, intptr_t bytes)
 
- Protected Attributes inherited from System::IO::MemoryStream
LPVOID m_buffer
 
intptr_t m_pos
 
intptr_t m_length
 
union {
   intptr_t   m_size
 
   intptr_t   m_capacity
 
}; 
 

Detailed Description

Provides access to unmanaged blocks of memory

Constructor & Destructor Documentation

System::IO::UnmanagedMemoryStream::UnmanagedMemoryStream ( )
inline

Initializes a new instance of the UnmanagedMemoryStream class

System::IO::UnmanagedMemoryStream::UnmanagedMemoryStream ( LPVOID  lpbuffer,
intptr_t  size,
intptr_t  len 
)
inline

Initializes a new instance of the UnmanagedMemoryStream class in a safe buffer with a specified size and length

System::IO::UnmanagedMemoryStream::UnmanagedMemoryStream ( LPCVOID  lpbuffer,
intptr_t  len 
)
inline

Initializes a new instance of the UnmanagedMemoryStream class using the specified location and memory length

Member Function Documentation

virtual void System::IO::UnmanagedMemoryStream::Close ( )
inlineoverridevirtual

Overrides the Close method so that no action is performed

Implements System::IO::Stream.

void UnmanagedMemoryStream::ExChange ( UnmanagedMemoryStream obj)

Swaps two UnmanagedMemoryStream instance(shallow move)

virtual bool System::IO::UnmanagedMemoryStream::InheritFromBufferedStream ( ) const
inlinefinaloverridevirtual

Identifies whether current class is a derived class of (or the same class as) BufferedStream

Implements System::IO::Stream.

void UnmanagedMemoryStream::Move ( intptr_t  offsetTo,
intptr_t  offsetFrom,
intptr_t  bytes 
)

Copies the bytes(<=size) from the location offsetTo to offsetFrom, and may change the length of stream. Copying takes place as if an intermediate buffer were used, allowing the destination and source to overlap.

static UnmanagedMemoryStream* System::IO::UnmanagedMemoryStream::Open_memstream ( LPCVOID  buf,
intptr_t  size 
)
inlinestatic

The function shall associate the buffer given by the buf and size arguments with a stream(read only)

static UnmanagedMemoryStream* System::IO::UnmanagedMemoryStream::Open_wmemstream ( LPVOID  buf,
intptr_t  size 
)
inlinestatic

The function shall associate the buffer given by the buf and size arguments with a stream(read-write)

System::IO::UnmanagedMemoryStream::RLIB_PROPERTY_GET_SET ( intptr_t  Length,
GetLength  ,
SetLength   
)

Gets or sets the length in bytes of the stream

System::IO::UnmanagedMemoryStream::RLIB_PROPERTY_GET_SET ( intptr_t  Position,
GetPos  ,
SetPos   
)

Gets or sets the position within the current stream

System::IO::UnmanagedMemoryStream::RLIB_PROPERTY_GET_SET ( LPVOID  ObjectData,
GetObjectData  ,
SetObjectData   
)

Gets or sets the pointer to an unmanaged memory location

virtual void System::IO::UnmanagedMemoryStream::SetLength ( intptr_t  len)
inlineoverridevirtual

Sets the length of a stream to a specified value

Implements System::IO::Stream.

void System::IO::UnmanagedMemoryStream::SetObjectData ( LPVOID  pData)
inline

Sets the pointer to an unmanaged memory location

virtual void System::IO::UnmanagedMemoryStream::SetSize ( intptr_t  size)
inlineoverridevirtual

Sets the size of a stream to a specified value

Implements System::IO::Stream.

intptr_t UnmanagedMemoryStream::Write ( LPCVOID  buffer,
intptr_t  count 
)
overridevirtual

Writes a block of bytes to the current stream using data from a buffer

Implements System::IO::Stream.


The documentation for this class was generated from the following files: