Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Burger::InputRezStream Class Reference

InputMemoryStream for RezFile. More...

Inheritance diagram for Burger::InputRezStream:
Inheritance graph
[legend]
Collaboration diagram for Burger::InputRezStream:
Collaboration graph
[legend]

Public Member Functions

 InputRezStream ()
 Default constructor for InputRezStream.
 
 InputRezStream (RezFile *pRezFile, uint_t uRezNum)
 Loading constructor for InputRezStream.
 
 ~InputRezStream ()
 Default destructor for InputRezStream.
 
uint_t Open (RezFile *pRezFile, uint_t uRezNum)
 Load a resource and set the stream to it.
 
void Release (void)
 Release any held resource.
 
RezFileGetRezFile (void) const
 Return the cached RezFile.
 
uint_t GetRezNum (void) const
 Return the cache RezFile entry number.
 
- Public Member Functions inherited from Burger::InputMemoryStream
 InputMemoryStream () noexcept
 Constructor.
 
 InputMemoryStream (const char *pFilename) noexcept
 Constructor with a data file.
 
 InputMemoryStream (Filename *pFilename) noexcept
 Constructor with a data file.
 
 InputMemoryStream (const void *pBuffer, uintptr_t uBufferSize, uint_t bDontFree=0) noexcept
 Constructor with a input data buffer.
 
 ~InputMemoryStream ()
 Destructor.
 
uint_t Open (const char *pFilename) noexcept
 Load data from a file.
 
uint_t Open (Filename *pFilename) noexcept
 Load data from a file.
 
void Open (const void *pBuffer, uintptr_t uBufferSize, uint_t bDontFree=0) noexcept
 Use data from a application supplied buffer.
 
void Clear (void) noexcept
 Release all allocated memory.
 
void SkipForward (uintptr_t uOffset) noexcept
 Move the read pointer forward in the stream.
 
void SkipBack (uintptr_t uOffset) noexcept
 Move the read pointer backward in the stream.
 
void SetMark (uintptr_t uOffset) noexcept
 Move the read pointer to a location in the stream.
 
const uint8_t * GetPtr (void) const noexcept
 Return the current pointer into the data stream.
 
uintptr_t GetMark (void) const noexcept
 Return the current offset into the data stream.
 
uintptr_t GetSize (void) const noexcept
 Return the amount of data stored in the stream.
 
uint_t IsEmpty (void) const noexcept
 Return TRUE if there is no data remaining to parse in the stream.
 
uintptr_t BytesRemaining (void) const noexcept
 Return the amount of data remaining to parse in the stream.
 
void GetString (char *pOutput, uintptr_t uOutputSize) noexcept
 Parse a UTF-8 "C" string from the data stream.
 
void GetString (String *pOutput) noexcept
 Parse a UTF-8 "C" string from the data stream.
 
void GetCString (char *pOutput, uintptr_t uOutputSize) noexcept
 Parse a UTF-8 "C" string from the data stream.
 
void GetPString (char *pOutput, uintptr_t uOutputSize) noexcept
 Parse a UTF-8 "P" string from the data stream.
 
uint8_t GetByte (void) noexcept
 Return an 8 bit value from the data stream.
 
uint16_t GetShort (void) noexcept
 Return a 16 bit little endian value from the data stream.
 
uint16_t GetBigShort (void) noexcept
 Return a 16 bit big endian value from the data stream.
 
uint32_t GetWord32 (void) noexcept
 Return a 32 bit little endian value from the data stream.
 
uint32_t GetBigWord32 (void) noexcept
 Return a 32 bit big endian value from the data stream.
 
uint64_t GetWord64 (void) noexcept
 Return a 64 bit little endian value from the data stream.
 
uint64_t GetBigWord64 (void) noexcept
 Return a 64 bit big endian value from the data stream.
 
float GetFloat (void) noexcept
 Return a 32 bit little endian float from the data stream.
 
float GetBigFloat (void) noexcept
 Return a 32 bit big endian float from the data stream.
 
double GetDouble (void) noexcept
 Return a 64 bit little endian float from the data stream.
 
double GetBigDouble (void) noexcept
 Return a 64 bit big endian float from the data stream.
 
uintptr_t Get (void *pOutput, uintptr_t uOutputSize) noexcept
 Return an unmodified array of bytes from the input stream.
 
uint_t Get (RGBWord8_t *pOutput) noexcept
 Extract an R,G,B color from the input stream.
 
uint_t Get (RGBAWord8_t *pOutput) noexcept
 Extract an R,G,B,A color from the input stream.
 
uint_t Get (Vector2D_t *pOutput) noexcept
 Extract a Vector2D_t from the input stream.
 
uint_t Get (Vector3D_t *pOutput) noexcept
 Extract a Vector3D_t from the input stream.
 
uint_t Get (Vector4D_t *pOutput) noexcept
 Extract a Vector4D_t from the input stream.
 
uint_t Get (RGBFloat_t *pOutput) noexcept
 
uint_t Get (RGBAFloat_t *pOutput) noexcept
 
void ParseBeyondWhiteSpace (void) noexcept
 Skip past white space in the input stream.
 
uint_t IsStringMatch (const char *pInput) noexcept
 Test if the next bytes in the stream match.
 
uint_t IsStringMatchCase (const char *pInput) noexcept
 Case insensitive test if the next bytes in the stream match.
 
uint_t IsDataMatch (const uint8_t *pInput, uintptr_t uLength) noexcept
 Test if the next bytes in the stream match.
 

Protected Attributes

RezFilem_pRezFile
 Pointer to the resource file this stream came from.
 
uint_t m_uRezNum
 Which resource entry is being streamed?
 
- Protected Attributes inherited from Burger::InputMemoryStream
const uint8_t * m_pWork
 Pointer to the input.
 
const uint8_tm_pEndOfBuffer
 Pointer to the end of the buffer.
 
const uint8_tm_pData
 Pointer to the first data buffer.
 
uintptr_t m_uBufferSize
 Size of the buffer.
 
uint_t m_bDontFree
 TRUE if the memory isn't released on Clear()
 

Detailed Description

InputMemoryStream for RezFile.


To get the best of both worlds and to simplify the use of InputMemoryStream class instances with the use of RezFile, this class derived from InputMemoryStream will load in a resource, connect the data without any memory copying or transferring into an InputMemoryStream and release the resource when the class goes out of scope or if it's explicity released with a call to InputRezStream::Release(void)

See also
InputMemoryStream or RezFile

Constructor & Destructor Documentation

◆ InputRezStream() [1/2]

Burger::InputRezStream::InputRezStream ( )

Default constructor for InputRezStream.


All members are initialized to NULL. Use a call to Open(RezFile *,uint_t) to allow this class to begin streaming

See also
InputRezStream(RezFile *,uint_t), Open(RezFile *,uint_t) or Release(void)

◆ InputRezStream() [2/2]

Burger::InputRezStream::InputRezStream ( RezFile * pRezFile,
uint_t uRezNum )

Loading constructor for InputRezStream.


Load in the resource, set the InputMemoryStream and exit. On failure, the InputMemoryStream will be empty and can be checked with a call to IsEmpty(void) const

Parameters
pRezFilePointer to a valid resource file
uRezNumNumber of the resource to load
See also
InputRezStream(), Open(RezFile *,uint_t) or Release(void)

◆ ~InputRezStream()

Burger::InputRezStream::~InputRezStream ( )

Default destructor for InputRezStream.


If a resource is held, release it.

See also
InputRezStream() or Release(void)

Member Function Documentation

◆ GetRezFile()

RezFile * Burger::InputRezStream::GetRezFile ( void ) const
inline

Return the cached RezFile.


Note
If this value is NULL, there is no resource file chunk being streamed. Either this class had no data loaded into it or there was an error in loading data.
See also
GetRezNum(void) const

◆ GetRezNum()

uint_t Burger::InputRezStream::GetRezNum ( void ) const
inline

Return the cache RezFile entry number.


See also
GetRezFile(void) const

◆ Open()

uint_t BURGER_API Burger::InputRezStream::Open ( RezFile * pRezFile,
uint_t uRezNum )

Load a resource and set the stream to it.


Release any previous stream data and then load in the new resource and set the stream to point to it.

Parameters
pRezFilePointer to a valid resource file
uRezNumNumber of the resource to load
Returns
Zero on success, non-zero (Error code) on failure
See also
InputRezStream(RezFile *,uint_t) or Release(void)

◆ Release()

void BURGER_API Burger::InputRezStream::Release ( void )

Release any held resource.


If a resource is held, release it and shut down the parent InputMemorySteam

See also
Open(RezFile *,uint_t) or Release(void)

Member Data Documentation

◆ m_pRezFile

RezFile* Burger::InputRezStream::m_pRezFile
protected

Pointer to the resource file this stream came from.

◆ m_uRezNum

uint_t Burger::InputRezStream::m_uRezNum
protected

Which resource entry is being streamed?