API Guides > ConceptRT 3.x
BaseMemoryStream Class Referenceabstract

Base class for memory stream. More...

Detailed Description

Base class for memory stream.

+ Inheritance diagram for BaseMemoryStream:

Public Member Methods

bool EndOfStream () const
 Query if end of stream reached. More...
 
Char8 ReadChar ()
 Reads a character. More...
 
void WriteChar (Char8 c)
 Writes a character. More...
 
void Flush ()
 Flushes this object. More...
 
Int32 GetPosition () const
 Gets the position. More...
 
void SetPosition (Int32 position)
 Sets the position cursor. More...
 
Int32 GetSize () const
 Gets the size of current usage. More...
 
void UpdateSize (Int32 size)
 Update the size of current usage of the stream. More...
 
void Clear ()
 Clears this object to its blank/initial state. More...
 
Pointer GetMemory ()
 Gets the memory. More...
 
void UpdateCapacity (Int32 expectedSize)
 Update the capacity of the stream. More...
 
Int32 GetCapacity () const
 Gets the capacity. More...
 
bool HasSameContent (BaseMemoryStream &stream)
 Query if this stream has same content than the given stream. More...
 
- Public Member Methods inherited from Stream
virtual ~Stream ()
 Destructor. More...
 
Int32 CopyFrom (Stream &stream, Int32 count)
 Copies from. More...
 
Int32 CopyFrom (Stream &stream)
 Copies from described by stream. More...
 

Protected Member Functions

virtual void UpdateCapacity (Int32 expectedSize, Int32 &newCapacity, PChar8 &newBuffer)=0
 Update the capacity of the stream. More...
 

Methods Documentation

void Clear ( )

Clears this object to its blank/initial state.

bool EndOfStream ( ) const
virtual

Query if end of stream reached.

Returns
true if end of stream reached, false if not.

Implements Stream.

void Flush ( )
virtual

Flushes this object.

Implements Stream.

Int32 GetCapacity ( ) const
inline

Gets the capacity.

Returns
The capacity.
Pointer GetMemory ( )

Gets the memory.

Returns
The memory block address. This address may change consecutively to stream operations.
Int32 GetPosition ( ) const
virtual

Gets the position.

Returns
The position.

Implements Stream.

Int32 GetSize ( ) const

Gets the size of current usage.

Returns
The size.
bool HasSameContent ( BaseMemoryStream stream)

Query if this stream has same content than the given stream.

Parameters
stream[in,out] The stream.
Returns
true if yes, false if not.
Char8 ReadChar ( )
virtual

Reads a character.

Returns
The character.
RT Exceptions:
RT_ERROR_END_OF_STREAM_REACHED

Implements Stream.

void SetPosition ( Int32  position)

Sets the position cursor.

Parameters
positionThe position.
void UpdateCapacity ( Int32  expectedSize)

Update the capacity of the stream.

Parameters
expectedSizeThe expected capacity size.
virtual void UpdateCapacity ( Int32  expectedSize,
Int32 newCapacity,
PChar8 newBuffer 
)
protectedpure virtual

Update the capacity of the stream.

Parameters
expectedSizeThe expected capacity size.
newCapacityThe new capacity.
newBuffer[in, out] The new buffer.

Implemented in MemoryStreamDynamic, MemoryStreamDynamicFixed, MemoryStream< Capacity >, MemoryStream< Size >, and MemoryStream< MaxPersistentDataSize >.

void UpdateSize ( Int32  size)

Update the size of current usage of the stream.

Parameters
sizeThe size.
void WriteChar ( Char8  c)
virtual

Writes a character.

Parameters
cThe character.

Implements Stream.