CRM64Pro GDK v0.18.0
A free cross-platform game development kit built on top of SDL 3.0
Loading...
Searching...
No Matches
CRM64Pro::Archive::BlockStreamfinal

Archive raw block stream. More...

Detailed Description

Archive raw block stream.

Opens an independent stream over one raw, uncompressed and unencrypted block. Each opened BlockStream owns its own cursor and keeps the source Archive alive until close(). ArchiveMgr::close(idCDC) releases archive ownership, but the Archive stays alive while streams remain open.

Public Member Functions

Sint32 close ()
 Close the stream.
Sint64 read (void *pDst, Uint64 iSize)
 Read bytes from the stream.
Sint32 seek (Uint64 iPosition)
 Seek the stream.
Uint64 tell () const
 Get the current byte position from the start of the block.
Uint64 size () const
 Get the stream size in bytes.
bool eof () const
 Check end-of-stream state.
bool isOpen () const
 Check if the stream is open.

Member Function Documentation

◆ close()

Sint32 CRM64Pro::Archive::BlockStream::close ( )

Close the stream.

Returns
0 on success, or a negative error code on failure.

◆ read()

Sint64 CRM64Pro::Archive::BlockStream::read ( void * pDst,
Uint64 iSize )

Read bytes from the stream.

Parameters
pDstdestination buffer.
iSizemaximum bytes to read.
Returns
number of bytes read, or a negative error code on failure.

◆ seek()

Sint32 CRM64Pro::Archive::BlockStream::seek ( Uint64 iPosition)

Seek the stream.

Parameters
iPositionbyte position from the start of the block.
Returns
0 on success, or a negative error code on failure.

◆ tell()

Uint64 CRM64Pro::Archive::BlockStream::tell ( ) const

Get the current byte position from the start of the block.

Returns
Current byte offset from the beginning of the stream.

◆ size()

Uint64 CRM64Pro::Archive::BlockStream::size ( ) const

Get the stream size in bytes.

Returns
Total stream size in bytes.

◆ eof()

bool CRM64Pro::Archive::BlockStream::eof ( ) const

Check end-of-stream state.

Returns
true if the current byte position is at or past the end of the stream, false otherwise.

◆ isOpen()

bool CRM64Pro::Archive::BlockStream::isOpen ( ) const

Check if the stream is open.

Returns
true if the stream is open, or false otherwise.