#include <c4d_file.h>
Used with Filename::SetMemoryWriteMode() to make a BaseFile write to a memory buffer instead of a file.
私有成员函数 |
|
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) |
|
|
|
static |
Allocates a memory file. Destroy the allocated memory file with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.
|
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. |
void GetData | ( | void *& | data , |
Int & | size | ||
) | const |
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. |
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. |