Add ADT array blocksize getter (#578)

Add GetArrayBlockSize and GetStackBlockSize and equivalent properties to
the methodmaps to get the blocksize the array or stack was created with.

Useful when getting array handles from other plugins you didn't create
yourself.
This commit is contained in:
peace-maker
2017-02-09 19:26:14 +00:00
committed by Asher Baker
parent 23feb54f6a
commit 86363dd3ec
4 changed files with 62 additions and 0 deletions
+14
View File
@@ -212,6 +212,11 @@ methodmap ArrayList < Handle {
property int Length {
public native get();
}
// Retrieve the blocksize the array was created with.
property int BlockSize {
public native get();
}
};
/**
@@ -439,3 +444,12 @@ native int FindStringInArray(Handle array, const char[] item);
* @error Invalid Handle or invalid block
*/
native int FindValueInArray(Handle array, any item, int block=0);
/**
* Returns the blocksize the array was created with.
*
* @param array Array Handle.
* @return The blocksize of the array.
* @error Invalid Handle
*/
native int GetArrayBlockSize(Handle array);
+14
View File
@@ -109,6 +109,11 @@ methodmap ArrayStack < Handle
property bool Empty {
public native get();
}
// Retrieve the blocksize the stack was created with.
property int BlockSize {
public native get();
}
};
/**
@@ -224,3 +229,12 @@ stock bool PopStack(Handle stack)
int value;
return PopStackCell(stack, value);
}
/**
* Returns the blocksize the stack was created with.
*
* @param stack Stack Handle.
* @return The blocksize of the stack.
* @error Invalid Handle
*/
native int GetStackBlockSize(Handle stack);