Add an array operations to CDataPack (#1219)

This commit is contained in:
Deathreus
2020-05-08 15:23:48 -07:00
committed by GitHub
parent bc89e54f6d
commit 13621a1274
4 changed files with 291 additions and 1 deletions
+26
View File
@@ -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.