"L. Spiro Engine"
|
Allows treating an external array of bytes as a stream. More...
#include <LSSTDExternalByteStream.h>
Public Member Functions | |
LSE_CALLCTOR | CExternalByteStream (LSUINT8 *_pui8Buffer, LSUINTPTR _uiptrLen) |
LSE_CALLCTOR | CExternalByteStream (const LSUINT8 *_pui8Buffer, LSUINTPTR _uiptrLen) |
virtual LSUINT32 LSE_CALL | ReadBytes (LSUINT8 *_pui8Buffer, LSUINT32 _ui32BytesToRead) const |
virtual LSUINT64 LSE_CALL | ReadUInt64 () const |
virtual LSUINT32 LSE_CALL | ReadUInt32 () const |
virtual LSUINT16 LSE_CALL | ReadUInt16 () const |
virtual LSUINT8 LSE_CALL | ReadUInt8 () const |
virtual LSFLOAT LSE_CALL | ReadFloat () const |
virtual LSDOUBLE LSE_CALL | ReadDouble () const |
virtual LSUINT32 LSE_CALL | WriteBytes (const LSUINT8 *_pui8Buffer, LSUINT32 _ui32BytesToWrite) |
virtual LSBOOL LSE_CALL | WriteUInt64 (const LSUINT64 &_ui64Value) |
virtual LSBOOL LSE_CALL | WriteUInt32 (LSUINT32 _ui32Value) |
virtual LSBOOL LSE_CALL | WriteUInt16 (LSUINT16 _ui16Value) |
virtual LSBOOL LSE_CALL | WriteUInt8 (LSUINT8 _ui8Value) |
virtual LSBOOL LSE_CALL | WriteFloat (LSFLOAT _fValue) |
virtual LSBOOL LSE_CALL | WriteDouble (const LSDOUBLE &_dValue) |
LSVOID LSE_CALL | SetPos (LSUINTPTR _uiptrPos) const |
LSUINTPTR LSE_CALL | GetPos () const |
LSUINTPTR LSE_CALL | Length () const |
const LSUINT8 *LSE_CALL | GetBuffer () const |
Protected Attributes | |
LSUINT8 * | m_pui8Stream |
LSUINTPTR | m_uiptrCurPos |
LSUINTPTR | m_uiptrLength |
LSBOOL | m_bReadOnly |
Allows treating an external array of bytes as a stream.
Class CExternalByteStream Description: Allows treating an external array of bytes as a stream. Allows modifying the array but not beyond the actual length of the array. This is useful for situations when you have a file image loaded to memory and you wish to read from it in the fashion of a byte stream.
const LSUINT8* LSE_CALL lsstd::CExternalByteStream::GetBuffer | ( | ) | const |
Get a pointer to the start of the buffer.
LSUINTPTR LSE_CALL lsstd::CExternalByteStream::GetPos | ( | ) | const |
Get the current position of the stream pointer.
LSUINTPTR LSE_CALL lsstd::CExternalByteStream::Length | ( | ) | const |
Get the length of the stream.
virtual LSUINT32 LSE_CALL lsstd::CExternalByteStream::ReadBytes | ( | LSUINT8 * | _pui8Buffer, |
LSUINT32 | _ui32BytesToRead | ||
) | const [virtual] |
Read bytes from the stream. Stream position is advanced by the amount read.
_pui8Buffer | Buffer to hold the bytes read from the stream. |
_ui32BytesToRead | Number of bytes to read. |
Implements lsstd::IStream.
virtual LSDOUBLE LSE_CALL lsstd::CExternalByteStream::ReadDouble | ( | ) | const [virtual] |
Reads a 64-bit double from the stream and advances the stream position.
Implements lsstd::IStream.
virtual LSFLOAT LSE_CALL lsstd::CExternalByteStream::ReadFloat | ( | ) | const [virtual] |
Reads a 32-bit float from the stream and advances the stream position.
Implements lsstd::IStream.
virtual LSUINT16 LSE_CALL lsstd::CExternalByteStream::ReadUInt16 | ( | ) | const [virtual] |
Reads a 16-bit unsigned integer from the stream and advances the stream position.
Implements lsstd::IStream.
virtual LSUINT32 LSE_CALL lsstd::CExternalByteStream::ReadUInt32 | ( | ) | const [virtual] |
Reads a 32-bit unsigned integer from the stream and advances the stream position.
Implements lsstd::IStream.
virtual LSUINT64 LSE_CALL lsstd::CExternalByteStream::ReadUInt64 | ( | ) | const [virtual] |
Reads a 64-bit unsigned integer from the stream and advances the stream position.
Implements lsstd::IStream.
virtual LSUINT8 LSE_CALL lsstd::CExternalByteStream::ReadUInt8 | ( | ) | const [virtual] |
Reads an 8-bit unsigned integer from the stream and advances the stream position.
Implements lsstd::IStream.
LSVOID LSE_CALL lsstd::CExternalByteStream::SetPos | ( | LSUINTPTR | _uiptrPos | ) | const |
Set the stream position. Actual position set is clamped between 0 and the length of the stream.
_uiptrPos | New position of the stream. |
virtual LSUINT32 LSE_CALL lsstd::CExternalByteStream::WriteBytes | ( | const LSUINT8 * | _pui8Buffer, |
LSUINT32 | _ui32BytesToWrite | ||
) | [virtual] |
Write bytes to the stream. Stream position is advanced by the amount written.
_pui8Buffer | Buffer containing the bytes to write to the stream. |
_ui32BytesToWrite | Number of bytes to write. |
Implements lsstd::IStream.
virtual LSBOOL LSE_CALL lsstd::CExternalByteStream::WriteDouble | ( | const LSDOUBLE & | _dValue | ) | [virtual] |
Writes a 64-bit double from the stream and advances the stream position.
Implements lsstd::IStream.
virtual LSBOOL LSE_CALL lsstd::CExternalByteStream::WriteFloat | ( | LSFLOAT | _fValue | ) | [virtual] |
Writes a 32-bit float from the stream and advances the stream position.
Implements lsstd::IStream.
virtual LSBOOL LSE_CALL lsstd::CExternalByteStream::WriteUInt16 | ( | LSUINT16 | _ui16Value | ) | [virtual] |
Writes a 16-bit unsigned integer to the stream and advances the stream position.
Implements lsstd::IStream.
virtual LSBOOL LSE_CALL lsstd::CExternalByteStream::WriteUInt32 | ( | LSUINT32 | _ui32Value | ) | [virtual] |
Writes a 32-bit unsigned integer to the stream and advances the stream position.
Implements lsstd::IStream.
virtual LSBOOL LSE_CALL lsstd::CExternalByteStream::WriteUInt64 | ( | const LSUINT64 & | _ui64Value | ) | [virtual] |
Writes a 64-bit unsigned integer to the stream and advances the stream position.
Implements lsstd::IStream.
virtual LSBOOL LSE_CALL lsstd::CExternalByteStream::WriteUInt8 | ( | LSUINT8 | _ui8Value | ) | [virtual] |
Writes an 8-bit unsigned integer from the stream and advances the stream position.
Implements lsstd::IStream.
LSBOOL lsstd::CExternalByteStream::m_bReadOnly [protected] |
Are we read-only?
LSUINT8* lsstd::CExternalByteStream::m_pui8Stream [protected] |
Pointer to the stream of bytes.
LSUINTPTR lsstd::CExternalByteStream::m_uiptrCurPos [mutable, protected] |
Current position in the stream.
LSUINTPTR lsstd::CExternalByteStream::m_uiptrLength [protected] |
Length of the stream.