#include <c4d_hyperfile.h>
Public Member Functions | |
| Int32 | GetFileVersion () |
| Bool | CheckIt (HYPERFILEVALUE type) |
Protected Member Functions | |
| Bool | WriteVReal (Float v) |
| Bool | ReadVReal (Float *v) |
| CINEMA4D_VERSION | GetCinema4DVersion () |
| void | SetCinema4DVersion (CINEMA4D_VERSION version) |
Protected Attributes | |
| AliasTrans * | aliastrans |
Private Member Functions | |
| void | ReadStatus () |
| void | WriteStatus () |
| Bool | ReadDummy (Int64 n) |
| void | SetFileVersion (Int32 version) |
| Bool | ReadContainerV7 (BaseContainer *v, Bool flush) |
| Bool | ReadContainerV8 (BaseContainer *v, Bool flush) |
Private Attributes | |
| BaseFile | file |
| FILEERROR | error |
| Bool | ascii |
| Bool | singleprecision |
| FILEOPEN | mode |
| Int64 | flen |
| Int32 | last_b |
| void * | data |
| BaseDocument * | doc |
| Int32 | fileversion |
| Int32 | chunkdepth |
| LoadStatusCallback * | callbackloadstatus |
| SaveStatusCallback * | callbacksavestatus |
| void * | callbackUserDataAtLoad |
| void * | callbackUserDataAtSave |
| CINEMA4D_VERSION | cinema4dSaveVersion |
Friends | |
| class | BaseLink |
| class | GeAliasGoal |
| class | BaseDocument |
| class | IpCommunicationThread |
| class | Material |
Constructor/Destructor | |
| HyperFile (BaseDocument *t_doc=nullptr) | |
| virtual | ~HyperFile () |
Document | |
| BaseDocument * | GetDocument () |
Length/Position | |
| Int64 | GetLength () |
| Int64 | GetPosition () |
Open/Close | |
| Bool | Open (Int32 ident, const Filename &name, FILEOPEN mod, FILEDIALOG error_dialog=FILEDIALOG_NONE) |
| Bool | Close () |
Value | |
| Bool | ReadValueHeader (HYPERFILEVALUE *h) |
| Bool | SkipValue (HYPERFILEVALUE h) |
Start/End Chunk | |
| Bool | ReadChunkStart (Int32 *id, Int32 *level) |
| Bool | ReadChunkEnd () |
| Bool | WriteChunkStart (Int32 id, Int32 level) |
| Bool | WriteChunkEnd () |
| Bool | SkipToEndChunk () |
Error | |
| FILEERROR | GetError () |
| void | SetError (FILEERROR err) |
LoadStatus Callback | |
| void | SetLoadStatusCallback (LoadStatusCallback cb, void *ud) |
| void | SetSaveStatusCallback (SaveStatusCallback cb, void *ud) |
Private | |
| void * | GetPrivateData () |
| void | SetPrivateData (void *t_data) |
| Bool | Before8 () |
| Bool | Before12 () |
Hyper files are used to save plugin data that cannot be stored in a BaseContainer.
Access to the hyper file's data is like a FIFO (first in, first out) buffer; the values must written and read in the same order.
| HyperFile | ( | BaseDocument * | t_doc = nullptr | ) |
Constructs a hyper file for a Cinema 4D document.
| [in] | t_doc | The document for the hyper file. |
|
virtual |
Default destructor.
|
private |
|
private |
|
private |
|
private |
|
private |
|
protected |
|
protected |
| BaseDocument* GetDocument | ( | ) |
Gets the active document for the hyper file operation. Can be nullptr, for example when saving layouts.
| Int64 GetLength | ( | ) |
Gets the length of the file in bytes.
| Int64 GetPosition | ( | ) |
Gets the position of the current file pointer.
| Bool Open | ( | Int32 | ident, |
| const Filename & | name, | ||
| FILEOPEN | mod, | ||
| FILEDIALOG | error_dialog = FILEDIALOG_NONE |
||
| ) |
Opens the hyper file.
| [in] | ident | File identification. |
| [in] | name | File to open. |
| [in] | mod | File mode. |
| [in] | error_dialog | File error dialog. |
| Bool Close | ( | ) |
Closes the hyper file.
| Int32 GetFileVersion | ( | ) |
Gets the version of Cinema 4D that wrote the file. (Only valid during reading a Cinema 4D scene, object, material etc.)
| Bool CheckIt | ( | HYPERFILEVALUE | type | ) |
Checks the data type in the hyper file at the current file position.
| [in] | type | The type to check. |
| Bool ReadValueHeader | ( | HYPERFILEVALUE * | h | ) |
Reads the value header from the file. This is only necessary in combination with loops.
For example:
| [in] | h | A pointer to a HYPERFILEVALUE. |
| Bool SkipValue | ( | HYPERFILEVALUE | h | ) |
Skips a given type of value.
| [in] | h | The hyper file value to skip. |
Reads a chunk identification from the hyper file.
| [out] | id | Assigned the chunk ID. |
| [out] | level | Assigned the chunk level. |
| Bool ReadChunkEnd | ( | ) |
Reads a chunk end marker from the hyper file.
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 | Increase this level to save/read new values. |
| Bool WriteChunkEnd | ( | ) |
Writes a chunk ending marker into the hyper file.
| Bool SkipToEndChunk | ( | ) |
Moves the file pointer to the end of the chunk.
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 an 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 an 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 an 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. |
| Bool ReadVector32 | ( | Vector32 * | v | ) |
Reads a Vector32 value from the hyper file.
| [out] | v | Assigned the value read from the hyper file. |
| Bool ReadVector64 | ( | Vector64 * | v | ) |
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. |
| Bool ReadMatrix32 | ( | Matrix32 * | v | ) |
Reads a Matrix32 value from the hyper file.
| [out] | v | Assigned the value read from the hyper file. |
| Bool ReadMatrix64 | ( | Matrix64 * | v | ) |
Reads a Matrix64 value from the hyper file.
| [out] | v | Assigned the value read from the hyper file. |
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 BaseContainer value 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. Using false will merge the container with the one read from the file. |
| Bool ReadArray | ( | void * | data, |
| HYPERFILEARRAY | datatype, | ||
| Int32 | structure_increment, | ||
| Int32 | count | ||
| ) |
Reads an array of the specified datatype from the hyper file.
| [out] | data | Array to be filled. The caller owns the pointed array. |
| [in] | datatype | Data type. |
| [in] | structure_increment | Size of the data type (sizeof()). |
| [in] | count | Number of elements in data. |
Reads a block of memory from the hyper file.
| [out] | data | Pointer to the start of the memory block to read. |
| [out] | size | Assigned the byte size of the memory data read. |
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 an 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 an Int32 value to the hyper file.
| [in] | v | The value to write to the hyper file. |
Writes an UInt32 value to the hyper file.
| [in] | v | The value to write to the hyper file. |
Writes an Int64 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 Float 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. |
| Bool WriteVector32 | ( | const Vector32 & | v | ) |
Writes a Vector32 value to the hyper file.
| [in] | v | The value to write to the hyper file. |
| Bool WriteVector64 | ( | const Vector64 & | v | ) |
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. |
| Bool WriteMatrix32 | ( | const Matrix32 & | v | ) |
Writes a Matrix32 value to the hyper file.
| [in] | v | The value to write to the hyper file. |
| Bool WriteMatrix64 | ( | const Matrix64 & | v | ) |
Writes a Matrix64 value to the hyper file.
| [in] | v | The value to write to the hyper file. |
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. |
Writes a GeData value to the hyper file.
| [in] | v | The value to write to the hyper file. |
| Bool WriteContainer | ( | const BaseContainer & | v | ) |
Writes a BaseContainer value to the hyper file.
| [in] | v | The value to write to the hyper file. |
| Bool WriteImage | ( | BaseBitmap * | bmp, |
| Int32 | type, | ||
| BaseContainer * | data, | ||
| SAVEBIT | savebits = SAVEBIT_ALPHA |
||
| ) |
Writes a bitmap image to the hyper file.
| [in] | bmp | Bitmap to write to the hyperfile. The caller owns the pointed bitmap. |
| [in] | type | Image type. |
| [in] | data | Container with additional format settings, or nullptr |
| [in] | savebits | Save bits. |
| Bool WriteArray | ( | const void * | data, |
| HYPERFILEARRAY | datatype, | ||
| Int32 | structure_increment, | ||
| Int32 | count | ||
| ) |
Writes an array of the specified type datatype to the hyper file.
| [in] | data | Pointer to the array. The caller owns the pointed array. |
| [in] | datatype | Array data type. |
| [in] | structure_increment | Size of the data type (sizeof()). |
| [in] | count | Number of elements in data. |
Writes a block of memory to the hyper file.
| [in] | data | Start of the memory block to write to the hyper file. |
| [in] | count | Size in bytes of the memory data to write. |
| FILEERROR GetError | ( | ) |
Gets the error from the last hyper file operation.
| void SetError | ( | FILEERROR | err | ) |
Sets the error value for the hyper file.
| [in] | err | The error. |
| void SetLoadStatusCallback | ( | LoadStatusCallback | cb, |
| void * | ud | ||
| ) |
Sets the status for the loading of hyper files.
| [in] | cb | Load status callback. |
| [in] | ud | User data. |
| void SetSaveStatusCallback | ( | SaveStatusCallback | cb, |
| void * | ud | ||
| ) |
Sets the status for the saving of hyper files.
| [in] | cb | Save status callback. |
| [in] | ud | User data. |
| void* GetPrivateData | ( | ) |
Private.
| void SetPrivateData | ( | void * | t_data | ) |
Private.
| Bool Before8 | ( | ) |
Private.
| Bool Before12 | ( | ) |
Private.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protected |