AMXX-BG.INFO DataPacks.inc

DataPacks

These stocks are meant to mimic Sourcemod's data packs functionality, and complement CellTrie/CellArray, allowing heterogeneous data in the same container to be accessed by index. Storage is done in nested CellArrays, and there are no size limits other than those imposed by them, if any. They'll be specially usefull to pass data to/from callbacks and forwards. Changelog: ---------- 22/03/2009 - Initial Release 23/03/2009 - Fixed DataPack_GetString not returning the proper string length Fixed accidental removal of stock modifier from functions ---------- Discussion Thread: [http://forums.alliedmods.net/showthread.php?t=88304]

Constants

Name Description
__DATAPACK_INCLUDED

Stocks

Name Description
DataPack_Create Creation / Destruction functions
DataPack_Free Destroys a DataPack, freeing all of it's sub-arrays. You MUST use this instead of ArrayDestroy or you'll end up with a memory leak
DataPack_GetSize Informational functions
DataPack_GetItemType
DataPack_PushCell Pushes a single cell into an DataPack
DataPack_PushArray Pushes an array into a DataPack. The array size WILL be enforced on retrieval and MUST match the one passed on insertion, so make sure your array sizes match.
DataPack_PushString Push a string into a DataPack. Be careful with your string sizes on retrieval to avoid data loss.
DataPack_GetCell Retrieve a cell from a DataPack. Result passed byref to allow fail check.
DataPack_GetArray Retrieve an array from a DataPack. Passed size MUST match with one used for insertion, or the function will fail
DataPack_GetString Retrieve a string from a DataPack.