Add an array operations to CDataPack (#1219)
This commit is contained in:
@@ -71,6 +71,20 @@ methodmap DataPack < Handle
|
||||
// @param insert Determines whether mid-pack writes will insert instead of overwrite.
|
||||
public native void WriteFunction(Function fktptr, bool insert = false);
|
||||
|
||||
// Packs an array of cells into a data pack.
|
||||
//
|
||||
// @param array Array to add.
|
||||
// @param count Number of elements
|
||||
// @param insert Determines whether mid-pack writes will insert instead of overwrite.
|
||||
public native void WriteCellArray(const any[] array, int count, bool insert = false);
|
||||
|
||||
// Packs an array of floats into a data pack.
|
||||
//
|
||||
// @param array Array to add.
|
||||
// @param count Number of elements
|
||||
// @param insert Determines whether mid-pack writes will insert instead of overwrite.
|
||||
public native void WriteFloatArray(const float[] array, int count, bool insert = false);
|
||||
|
||||
// Reads a cell from a data pack.
|
||||
//
|
||||
// @return A cell at this position
|
||||
@@ -92,6 +106,18 @@ methodmap DataPack < Handle
|
||||
// @return Function pointer.
|
||||
public native Function ReadFunction();
|
||||
|
||||
// Reads an array of cells a data pack.
|
||||
//
|
||||
// @param buffer Destination buffer.
|
||||
// @param count Maximum length of output buffer.
|
||||
public native void ReadCellArray(any[] buffer, int count);
|
||||
|
||||
// Reads an array of floats from a data pack.
|
||||
//
|
||||
// @param buffer Destination buffer.
|
||||
// @param count Maximum length of output buffer.
|
||||
public native void ReadFloatArray(float[] buffer, int count);
|
||||
|
||||
// Resets the position in a data pack.
|
||||
//
|
||||
// @param clear If true, clears the contained data.
|
||||
|
||||
Reference in New Issue
Block a user