StringMap < Handle

Last Updated2021-04-04
Created At2014-07-13

Object-oriented wrapper for maps.

Methods12
SymbolDescription
ClearClears all entries from a Map.
CloneClones a string map, returning a new handle with the same size and data. This should NOT be confused with CloneHandle. This is a completely new handle with the same data but no relation to the original. It should be closed when no longer needed with delete or CloseHandle().
ContainsKeyChecks whether a key is present in a Map.
GetArrayRetrieves an array in a Map.
GetStringRetrieves a string in a Map.
GetValueRetrieves a value in a Map.
RemoveRemoves a key entry from a Map.
SetArraySets an array value in a Map, either inserting a new entry or replacing an old one.
SetStringSets a string value in a Map, either inserting a new entry or replacing an old one.
SetValueSets a value in a hash map, either inserting a new entry or replacing an old one.
SnapshotCreate a snapshot of the map's keys. See StringMapSnapshot.
StringMapCreates a hash map. A hash map is a container that can map strings (called "keys") to arbitrary values (cells, arrays, or strings). Keys in a hash map are unique. That is, there is at most one entry in the map for a given key. Insertion, deletion, and lookup in a hash map are all considered to be fast operations, amortized to O(1), or constant time. The word "Trie" in this API is historical. As of SourceMod 1.6, tries have been internally replaced with hash tables, which have O(1) insertion time instead of O(n). The StringMap must be freed via delete or CloseHandle().
Properties1
SymbolTypeDescription
SizeintRetrieves the number of elements in a map.