Update spcomp and includes to latest 1.10-fork
disable warning 241: Array-based enum structs will be removed in 1.11
This commit is contained in:
Vendored
+72
-70
@@ -124,9 +124,11 @@ methodmap StringMap < Handle
|
||||
}
|
||||
};
|
||||
|
||||
// A StringMapSnapshot is created via StringMap.Snapshot(). It captures the
|
||||
// keys on a map so they can be read. Snapshots must be freed with delete or
|
||||
// CloseHandle().
|
||||
/**
|
||||
* A StringMapSnapshot is created via StringMap.Snapshot(). It captures the
|
||||
* keys on a map so they can be read. Snapshots must be freed with delete or
|
||||
* CloseHandle().
|
||||
*/
|
||||
methodmap StringMapSnapshot < Handle
|
||||
{
|
||||
// Returns the number of keys in the map snapshot.
|
||||
@@ -164,111 +166,111 @@ methodmap StringMapSnapshot < Handle
|
||||
* been internally replaced with hash tables, which have O(1) insertion time
|
||||
* instead of O(n).
|
||||
*
|
||||
* @return New Map Handle, which must be freed via CloseHandle().
|
||||
* @return New Map Handle, which must be freed via CloseHandle().
|
||||
*/
|
||||
native StringMap CreateTrie();
|
||||
|
||||
/**
|
||||
* Sets a value in a hash map, either inserting a new entry or replacing an old one.
|
||||
*
|
||||
* @param map Map Handle.
|
||||
* @param key Key string.
|
||||
* @param value Value to store at this key.
|
||||
* @param replace If false, operation will fail if the key is already set.
|
||||
* @return True on success, false on failure.
|
||||
* @error Invalid Handle.
|
||||
* @param map Map Handle.
|
||||
* @param key Key string.
|
||||
* @param value Value to store at this key.
|
||||
* @param replace If false, operation will fail if the key is already set.
|
||||
* @return True on success, false on failure.
|
||||
* @error Invalid Handle.
|
||||
*/
|
||||
native bool SetTrieValue(Handle map, const char[] key, any value, bool replace=true);
|
||||
|
||||
/**
|
||||
* Sets an array value in a Map, either inserting a new entry or replacing an old one.
|
||||
*
|
||||
* @param map Map Handle.
|
||||
* @param key Key string.
|
||||
* @param array Array to store.
|
||||
* @param num_items Number of items in the array.
|
||||
* @param replace If false, operation will fail if the key is already set.
|
||||
* @return True on success, false on failure.
|
||||
* @error Invalid Handle.
|
||||
* @param map Map Handle.
|
||||
* @param key Key string.
|
||||
* @param array Array to store.
|
||||
* @param num_items Number of items in the array.
|
||||
* @param replace If false, operation will fail if the key is already set.
|
||||
* @return True on success, false on failure.
|
||||
* @error Invalid Handle.
|
||||
*/
|
||||
native bool SetTrieArray(Handle map, const char[] key, const any[] array, int num_items, bool replace=true);
|
||||
|
||||
/**
|
||||
* Sets a string value in a Map, either inserting a new entry or replacing an old one.
|
||||
*
|
||||
* @param map Map Handle.
|
||||
* @param key Key string.
|
||||
* @param value String to store.
|
||||
* @param replace If false, operation will fail if the key is already set.
|
||||
* @return True on success, false on failure.
|
||||
* @error Invalid Handle.
|
||||
* @param map Map Handle.
|
||||
* @param key Key string.
|
||||
* @param value String to store.
|
||||
* @param replace If false, operation will fail if the key is already set.
|
||||
* @return True on success, false on failure.
|
||||
* @error Invalid Handle.
|
||||
*/
|
||||
native bool SetTrieString(Handle map, const char[] key, const char[] value, bool replace=true);
|
||||
|
||||
/**
|
||||
* Retrieves a value in a Map.
|
||||
*
|
||||
* @param map Map Handle.
|
||||
* @param key Key string.
|
||||
* @param value Variable to store value.
|
||||
* @return True on success. False if the key is not set, or the key is set
|
||||
* as an array or string (not a value).
|
||||
* @error Invalid Handle.
|
||||
* @param map Map Handle.
|
||||
* @param key Key string.
|
||||
* @param value Variable to store value.
|
||||
* @return True on success. False if the key is not set, or the key is set
|
||||
* as an array or string (not a value).
|
||||
* @error Invalid Handle.
|
||||
*/
|
||||
native bool GetTrieValue(Handle map, const char[] key, any &value);
|
||||
|
||||
/**
|
||||
* Retrieves an array in a Map.
|
||||
*
|
||||
* @param map Map Handle.
|
||||
* @param key Key string.
|
||||
* @param array Buffer to store array.
|
||||
* @param max_size Maximum size of array buffer.
|
||||
* @param size Optional parameter to store the number of elements written to the buffer.
|
||||
* @return True on success. False if the key is not set, or the key is set
|
||||
* as a value or string (not an array).
|
||||
* @error Invalid Handle.
|
||||
* @param map Map Handle.
|
||||
* @param key Key string.
|
||||
* @param array Buffer to store array.
|
||||
* @param max_size Maximum size of array buffer.
|
||||
* @param size Optional parameter to store the number of elements written to the buffer.
|
||||
* @return True on success. False if the key is not set, or the key is set
|
||||
* as a value or string (not an array).
|
||||
* @error Invalid Handle.
|
||||
*/
|
||||
native bool GetTrieArray(Handle map, const char[] key, any[] array, int max_size, int &size=0);
|
||||
|
||||
/**
|
||||
* Retrieves a string in a Map.
|
||||
*
|
||||
* @param map Map Handle.
|
||||
* @param key Key string.
|
||||
* @param value Buffer to store value.
|
||||
* @param max_size Maximum size of string buffer.
|
||||
* @param size Optional parameter to store the number of bytes written to the buffer.
|
||||
* @return True on success. False if the key is not set, or the key is set
|
||||
* as a value or array (not a string).
|
||||
* @error Invalid Handle.
|
||||
* @param map Map Handle.
|
||||
* @param key Key string.
|
||||
* @param value Buffer to store value.
|
||||
* @param max_size Maximum size of string buffer.
|
||||
* @param size Optional parameter to store the number of bytes written to the buffer.
|
||||
* @return True on success. False if the key is not set, or the key is set
|
||||
* as a value or array (not a string).
|
||||
* @error Invalid Handle.
|
||||
*/
|
||||
native bool GetTrieString(Handle map, const char[] key, char[] value, int max_size, int &size=0);
|
||||
|
||||
/**
|
||||
* Removes a key entry from a Map.
|
||||
*
|
||||
* @param map Map Handle.
|
||||
* @param key Key string.
|
||||
* @return True on success, false if the value was never set.
|
||||
* @error Invalid Handle.
|
||||
* @param map Map Handle.
|
||||
* @param key Key string.
|
||||
* @return True on success, false if the value was never set.
|
||||
* @error Invalid Handle.
|
||||
*/
|
||||
native bool RemoveFromTrie(Handle map, const char[] key);
|
||||
|
||||
/**
|
||||
* Clears all entries from a Map.
|
||||
*
|
||||
* @param map Map Handle.
|
||||
* @error Invalid Handle.
|
||||
* @param map Map Handle.
|
||||
* @error Invalid Handle.
|
||||
*/
|
||||
native void ClearTrie(Handle map);
|
||||
|
||||
/**
|
||||
* Retrieves the number of elements in a map.
|
||||
*
|
||||
* @param map Map Handle.
|
||||
* @return Number of elements in the trie.
|
||||
* @error Invalid Handle.
|
||||
* @param map Map Handle.
|
||||
* @return Number of elements in the trie.
|
||||
* @error Invalid Handle.
|
||||
*/
|
||||
native int GetTrieSize(Handle map);
|
||||
|
||||
@@ -276,9 +278,9 @@ native int GetTrieSize(Handle map);
|
||||
* Creates a snapshot of all keys in the map. If the map is changed after this
|
||||
* call, the changes are not reflected in the snapshot. Keys are not sorted.
|
||||
*
|
||||
* @param map Map Handle.
|
||||
* @return New Map Snapshot Handle, which must be closed via CloseHandle().
|
||||
* @error Invalid Handle.
|
||||
* @param map Map Handle.
|
||||
* @return New Map Snapshot Handle, which must be closed via CloseHandle().
|
||||
* @error Invalid Handle.
|
||||
*/
|
||||
native Handle CreateTrieSnapshot(Handle map);
|
||||
|
||||
@@ -287,9 +289,9 @@ native Handle CreateTrieSnapshot(Handle map);
|
||||
* different from the size of the map, since the map can change after the
|
||||
* snapshot of its keys was taken.
|
||||
*
|
||||
* @param snapshot Map snapshot.
|
||||
* @return Number of keys.
|
||||
* @error Invalid Handle.
|
||||
* @param snapshot Map snapshot.
|
||||
* @return Number of keys.
|
||||
* @error Invalid Handle.
|
||||
*/
|
||||
native int TrieSnapshotLength(Handle snapshot);
|
||||
|
||||
@@ -297,21 +299,21 @@ native int TrieSnapshotLength(Handle snapshot);
|
||||
* Returns the buffer size required to store a given key. That is, it returns
|
||||
* the length of the key plus one.
|
||||
*
|
||||
* @param snapshot Map snapshot.
|
||||
* @param index Key index (starting from 0).
|
||||
* @return Buffer size required to store the key string.
|
||||
* @error Invalid Handle or index out of range.
|
||||
* @param snapshot Map snapshot.
|
||||
* @param index Key index (starting from 0).
|
||||
* @return Buffer size required to store the key string.
|
||||
* @error Invalid Handle or index out of range.
|
||||
*/
|
||||
native int TrieSnapshotKeyBufferSize(Handle snapshot, int index);
|
||||
|
||||
/**
|
||||
* Retrieves the key string of a given key in a map snapshot.
|
||||
*
|
||||
* @param snapshot Map snapshot.
|
||||
* @param index Key index (starting from 0).
|
||||
* @param buffer String buffer.
|
||||
* @param maxlength Maximum buffer length.
|
||||
* @return Number of bytes written to the buffer.
|
||||
* @error Invalid Handle or index out of range.
|
||||
* @param snapshot Map snapshot.
|
||||
* @param index Key index (starting from 0).
|
||||
* @param buffer String buffer.
|
||||
* @param maxlength Maximum buffer length.
|
||||
* @return Number of bytes written to the buffer.
|
||||
* @error Invalid Handle or index out of range.
|
||||
*/
|
||||
native int GetTrieSnapshotKey(Handle snapshot, int index, char[] buffer, int maxlength);
|
||||
|
||||
Reference in New Issue
Block a user