MemoryFileStruct Class Reference

#include <c4d_file.h>

详细描述

Used with Filename::SetMemoryWriteMode() to make a BaseFile write to a memory buffer instead of a file.

注意
Has to be created with Alloc() and destroyed with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

私有成员函数

  MemoryFileStruct ()
  ~MemoryFileStruct ()

Alloc/Free

static MemoryFileStruct Alloc ()
static void  Free ( MemoryFileStruct *&mfs)

Get Data

void  GetData (void *&data, Int &size) const
void  GetData (void *&data, Int &size, Bool release=false)

构造函数 & 析构函数文档编制

◆  MemoryFileStruct()

MemoryFileStruct () private

◆  ~MemoryFileStruct()

~ MemoryFileStruct () private

成员函数文档编制

◆  Alloc()

static MemoryFileStruct * Alloc ( )
static

Allocates a memory file. Destroy the allocated memory file with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

返回
The allocated memory file, or nullptr if the allocation failed.

◆  Free()

static void Free ( MemoryFileStruct *&  mfs )
static

Destructs memory files allocated with Alloc() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

参数
[in,out] mfs The memory file to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  GetData() [1/2]

void GetData ( void *&  data ,
Int size  
) const

Gets the data written to the memory file.

由于
R16
参数
[out] data Assigned a pointer to the data written.
[out] size Assigned the size of the data written.

◆  GetData() [2/2]

void GetData ( void *&  data ,
Int size ,
Bool   release = false  
)

Gets the data written to the memory file.

参数
[out] data Assigned a pointer to the data written.
[out] size Assigned the size of the data written.
[in] release true the ownership of the memory block is transfered to the caller, who then needs to free the memory with DeleteMem.
Otherwise the memory block will be freed when the MemoryFileStruct is destructed.