MemoryFileStruct Class Reference

#include <c4d_memoryfilestruct.h>

Public Member Functions

 MemoryFileStruct ()
 
 ~MemoryFileStruct ()
 
Int32 GetBlockCount ()
 
Bool GetBlock (Int32 index, void *&mem, Int &size)
 
Bool GetSingleBlock (void *&mem, Int &size)
 
Bool WriteBytes (const void *src, Int cnt)
 
void Free ()
 

Private Attributes

Int32 t_memmode
 
Int t_size
 
void * t_mem
 
MemoryFileWriteStructt_write
 

Friends

class BaseFile
 
class Filename
 
class HyperFile
 

Detailed Description

This class is used with Filename::SetMemoryWriteMode() to be able to make a BaseFile write to a memory buffer instead of a file.

Constructor & Destructor Documentation

◆ MemoryFileStruct()

Default constructor.

◆ ~MemoryFileStruct()

Default destructor.

Member Function Documentation

◆ GetBlockCount()

Int32 GetBlockCount ( )

Gets the number of memory blocks.

Returns
The number of memory blocks.

◆ GetBlock()

Bool GetBlock ( Int32  index,
void *&  mem,
Int size 
)

Gets the memory block specified by index.

Parameters
[in]indexThe memory block index. Must be 0 <= index < GetBlockCount().
[in]memAssigned the pointer to the memory block.
[in]sizeAssigned the size of the memory block.
Returns
true if the memory block was successfully accessed, otherwise false.

◆ GetSingleBlock()

Bool GetSingleBlock ( void *&  mem,
Int size 
)

Gets a single memory block.

Parameters
[in]memAssigned the pointer to the single memory block.
[in]sizeAssigned the size of the single memory block.
Returns
true if the single memory block was successfully accessed, otherwise false.

◆ WriteBytes()

Bool WriteBytes ( const void *  src,
Int  cnt 
)

Writes a number of bytes to the structure.

Parameters
[in]srcPointer to the buffer to write. The caller owns the pointed buffer.
[in]cntThe number of bytes to write. Must not exceed the size of the buffer.
Returns
true if the bytes were successfully written, otherwise false.

◆ Free()

void Free ( )

Frees internal data.

Friends And Related Function Documentation

◆ BaseFile

friend class BaseFile
friend

◆ Filename

friend class Filename
friend

◆ HyperFile

friend class HyperFile
friend

Member Data Documentation

◆ t_memmode

Int32 t_memmode
private

Private. Internal.

◆ t_size

Int t_size
private

Private. Internal.

◆ t_mem

void* t_mem
private

Private. Internal.

◆ t_write

MemoryFileWriteStruct* t_write
private

Private. Internal.