#include <c4d_file.h>
Hyper files are used to save plugin data that cannot be stored in a BaseContainer.
Cinema 4D creates it and pass it to dedicated Load and Save overrides when needed (see NodeData and CustomDataTypeClass).
Access to the hyper file's data is like a FIFO (first in, first out) buffer; the values must be written and read in the same order.
Private Member Functions | |
HyperFile () | |
~HyperFile () | |
Alloc/Free | |
static HyperFile * | Alloc (void) |
static void | Free (HyperFile *&fl) |
Open/Close | |
Bool | Open (Int32 ident, const Filename &filename, FILEOPEN mode, FILEDIALOG error_dialog) |
Bool | Close () |
Read | |
Bool | ReadChar (Char *v) |
Bool | ReadUChar (UChar *v) |
Bool | ReadInt16 (Int16 *v) |
Bool | ReadUInt16 (UInt16 *v) |
Bool | ReadInt32 (Int32 *v) |
Bool | ReadUInt32 (UInt32 *v) |
Bool | ReadInt64 (Int64 *v) |
Bool | ReadUInt64 (UInt64 *v) |
Bool | ReadFloat (Float *v) |
Bool | ReadFloat32 (Float32 *v) |
Bool | ReadFloat64 (Float64 *v) |
Bool | ReadBool (Bool *v) |
Bool | ReadTime (BaseTime *v) |
Bool | ReadVector (Vector *v) |
Bool | ReadVector32 (Vector32 *v) |
Bool | ReadVector64 (Vector64 *v) |
Bool | ReadMatrix (Matrix *v) |
Bool | ReadMatrix32 (Matrix32 *v) |
Bool | ReadMatrix64 (Matrix64 *v) |
Bool | ReadString (maxon::String *v) |
Bool | ReadFilename (Filename *v) |
Bool | ReadImage (BaseBitmap *v) |
Bool | ReadGeData (GeData *v) |
Bool | ReadContainer (BaseContainer *v, Bool flush) |
Bool | ReadMemory (void **data, Int *size) |
Bool | ReadChannelConvert (GeListNode *node, Int32 link_id) |
Bool | ReadArray (void *data, HYPERFILEARRAY type, Int32 structure_increment, Int32 count) |
Bool | ReadUuid (C4DUuid *v) |
Error | |
FILEERROR | GetError () const |
void | SetError (FILEERROR err) |
HyperFile Value | |
Bool | ReadValueHeader (HYPERFILEVALUE *h) |
Bool | SkipValue (HYPERFILEVALUE h) |
Chunk Start/End | |
Bool | WriteChunkStart (Int32 id, Int32 level) |
Bool | WriteChunkEnd (void) |
Bool | ReadChunkStart (Int32 *id, Int32 *level) |
Bool | ReadChunkEnd (void) |
Bool | SkipToEndChunk (void) |
File Version | |
Int32 | GetFileVersion () const |
void | SetFileVersion (Int32 val) |
Miscellaneous | |
BaseDocument * | GetDocument () const |
LOCATION | GetLocation (void) const |
SCENEFILTER | GetFilterFlags () const |
|
private |
|
private |
|
static |
|
static |
Bool Open | ( | Int32 | ident, |
const Filename & | filename, | ||
FILEOPEN | mode, | ||
FILEDIALOG | error_dialog | ||
) |
Opens the hyper file.
[in] | ident | The file identification. |
[in] | filename | The name of the file to open. |
[in] | mode | The file mode: FILEOPEN |
[in] | error_dialog | The file error dialog: FILEDIALOG |
Bool Close | ( | ) |
Closes the hyper file.
Reads a Char value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a UChar value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a Int16 value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a UInt16 value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a Int32 value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a UInt32 value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a Int64 value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a UInt64 value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a Float value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a Float32 value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a Float64 value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a Bool value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a BaseTime value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a Vector value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a Vector32 value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a Vector64 value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a Matrix value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a Matrix32 value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a Matrix64 value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Bool ReadString | ( | maxon::String * | v | ) |
Reads a String value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a Filename value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Bool ReadImage | ( | BaseBitmap * | v | ) |
Reads a BaseBitmap value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Reads a GeData value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Bool ReadContainer | ( | BaseContainer * | v, |
Bool | flush | ||
) |
Reads a container from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
[in] | flush | Specify if the container should be cleared before reading the new values. Passing false will merge the container with the one read from the file. |
Reads a block of memory from the hyper file.
[out] | data | A pointer to the start of the memory block to read. |
[out] | size | Assigned the byte size of the memory data read. |
Bool ReadChannelConvert | ( | GeListNode * | node, |
Int32 | link_id | ||
) |
Deprecated.
Bool ReadArray | ( | void * | data, |
HYPERFILEARRAY | type, | ||
Int32 | structure_increment, | ||
Int32 | count | ||
) |
Reads an array of the specified type from the hyper file.
[out] | data | A pointer to an array to be filled. The caller owns the pointed array. |
[in] | type | The data type: HYPERFILEARRAY |
[in] | structure_increment | The size of the data type (sizeof()). |
[in] | count | The umber of elements in data. |
Reads a C4DUuid value from the hyper file.
[out] | v | Assigned the value read from the hyper file. |
Writes a Char value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a UChar value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a Int16 value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a UInt16 value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a Int32 value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a UInt32 value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a Int64 value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a UInt64 value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a Float value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a Float32 value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a Float64 value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a Bool value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a BaseTime value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a Vector value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a Vector32 value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a Vector64 value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a Matrix value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a Matrix32 value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a Matrix64 value to the hyper file.
[in] | v | The value to write to the hyper file. |
Bool WriteString | ( | const maxon::String & | v | ) |
Writes a String value to the hyper file.
[in] | v | The value to write to the hyper file. |
Writes a Filename value to the hyper file.
[in] | v | The value to write to the hyper file. |
Bool WriteImage | ( | BaseBitmap * | bmp, |
Int32 | format, | ||
BaseContainer * | data, | ||
SAVEBIT | savebits = SAVEBIT::ALPHA |
||
) |
Writes a Char value to the hyper file.
[in] | v | The value to write to the hyper file. |
Bool WriteContainer | ( | const BaseContainer & | v | ) |
Writes a container to the hyper file.
[in] | v | The container to write to the hyper file. |
Writes a block of memory to the hyper file.
[in] | data | The start of the memory block to write to the hyper file. |
[in] | count | The size in bytes of the memory data to write. |
Bool WriteArray | ( | const void * | data, |
HYPERFILEARRAY | datatype, | ||
Int32 | structure_increment, | ||
Int32 | count | ||
) |
Writes an array of the specified datatype to the hyper file.
[in] | data | The pointer to the array. The caller owns the pointed array. |
[in] | datatype | The array data type: HYPERFILEARRAY |
[in] | structure_increment | Size of the data type (sizeof()). |
[in] | count | The number of elements in data. |
Writes a C4DUuid value to the hyper file.
[in] | v | The value to write to the hyper file. |
FILEERROR GetError | ( | ) | const |
Gets the error from the last hyper file operation.
void SetError | ( | FILEERROR | err | ) |
Sets the error for the hyper file.
[in] | err | The error to set: FILEERROR |
Bool ReadValueHeader | ( | HYPERFILEVALUE * | h | ) |
Reads the value header from the hyper file.
This is only necessary in combination with loops.
For example:
[in] | h | A pointer to a HYPERFILEVALUE to take the header value: HYPERFILEVALUE |
Bool SkipValue | ( | HYPERFILEVALUE | h | ) |
Skips a given type of value.
[in] | h | The hyper file value to skip: HYPERFILEVALUE |
Writes a chunk marker into the file indicating the beginning of a new chunk of data.
[in] | id | The ID for the chunk. |
[in] | level | To write additional information, increase this level to save/read new values. |
Bool WriteChunkEnd | ( | void | ) |
Writes a chunk ending marker into the hyper file.
Reads a chunks identification from the hyper file.
[out] | id | Assigned the chunk ID. |
[out] | level | Assigned the chunk level. |
Bool ReadChunkEnd | ( | void | ) |
Reads a chunk end marker from the hyper file.
Bool SkipToEndChunk | ( | void | ) |
Moves the file pointer to the end of the chunk.
Int32 GetFileVersion | ( | ) | const |
Gets the version of Cinema 4D that wrote the file. (Only valid while reading a Cinema 4D scene, object, material etc.)
void SetFileVersion | ( | Int32 | val | ) |
Private.
BaseDocument* GetDocument | ( | ) | const |
Gets the active document for the hyper file operation.
Can be nullptr, for instance when saving layouts.
LOCATION GetLocation | ( | void | ) | const |
Gets the hyper file location.
SCENEFILTER GetFilterFlags | ( | ) | const |
Gets the filter flags, the value is valid only during a Load or a Merge.