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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user