-
Couldn't load subscription status.
- Fork 19
Map natives
native Map:map_new();
native Map:map_new_args(AnyTag:...);
native Map:map_new_args_str(AnyTag:...);
native Map:map_new_args_var(AnyTag:...);
native Map:map_new_str_args(AnyTag:...);
native Map:map_new_str_args_str(...);
native Map:map_new_str_args_var({_,VariantTags}:...);
native Map:map_new_var_args(AnyTag:...);
native Map:map_new_var_args_str({_,VariantTags}:...);
native Map:map_new_var_args_var(VariantTag:...);Creates a new map, optionally from the argument list, each key followed by its value. Only the tag of the first element can be correctly obtained.
native bool:map_delete(Map:map);Deletes a map and frees its memory. Must be called when you are done with the object.
native bool:map_delete_deep(Map:map);Deletes a map and frees its memory, together with the resources it may contain.
native Map:map_clone(Map:map);Clones a map and all the data it contains (deep copy).
native bool:map_valid(Map:map);Returns true if the map pointer is valid.
native map_size(Map:map);Returns the number of pairings in a map.
native bool:map_add(Map:map, AnyTag:key, AnyTag:value, key_tag_id=tagof(key), value_tag_id=tagof(value));
native bool:map_add_arr(Map:map, AnyTag:key, const AnyTag:value[], value_size=sizeof(value), key_tag_id=tagof(key), value_tag_id=tagof(value));
native bool:map_add_str(Map:map, AnyTag:key, const value[], key_tag_id=tagof(key));
native bool:map_add_var(Map:map, AnyTag:key, VariantTag:value, key_tag_id=tagof(key));
native bool:map_arr_add(Map:map, const AnyTag:key[], AnyTag:value, key_size=sizeof(key), key_tag_id=tagof(key), value_tag_id=tagof(value));
native bool:map_arr_add_arr(Map:map, const AnyTag:key[], const AnyTag:value[], key_size=sizeof(key), value_size=sizeof(value), key_tag_id=tagof(key), value_tag_id=tagof(value));
native bool:map_arr_add_str(Map:map, const AnyTag:key[], const value[], key_size=sizeof(key), key_tag_id=tagof(key));
native bool:map_arr_add_var(Map:map, const AnyTag:key[], VariantTag:value, key_size=sizeof(key), key_tag_id=tagof(key));
native bool:map_str_add(Map:map, const key[], AnyTag:value, value_tag_id=tagof(value));
native bool:map_str_add_arr(Map:map, const key[], const AnyTag:value[], value_size=sizeof(value), value_tag_id=tagof(value));
native bool:map_str_add_str(Map:map, const key[], const value[]);
native bool:map_str_add_var(Map:map, const key[], VariantTag:value);
native bool:map_var_add(Map:map, VariantTag:key, AnyTag:value, value_tag_id=tagof(value));
native bool:map_var_add_arr(Map:map, VariantTag:key, const AnyTag:value[], value_size=sizeof(value), value_tag_id=tagof(value));
native bool:map_var_add_str(Map:map, VariantTag:key, const value[]);
native bool:map_var_add_var(Map:map, VariantTag:key, VariantTag:value);Creates a new pairing the map, specifying the key and the value. Returns true if the insertion was successful (i.e. no pairing with the same key was present). The key and the value can be constructed from a single cell, an array, a string, or a variant.
native map_add_map(Map:map, Map:other, bool:overwrite);Copies the pairings from other to map. If overwrite is true, it will overwrite the values if they are paired with a key from other. Returns the number of newly added pairs.
native bool:map_remove(Map:map, AnyTag:key, key_tag_id=tagof(key));
native bool:map_arr_remove(Map:map, const AnyTag:key[], key_size=sizeof(key), key_tag_id=tagof(key));
native bool:map_str_remove(Map:map, const key[]);
native bool:map_var_remove(Map:map, VariantTag:key);Removes a pairing from a map, specified by its key.
native bool:map_has_key(Map:map, AnyTag:key, key_tag_id=tagof(key));
native bool:map_has_arr_key(Map:map, const AnyTag:key[], key_size=sizeof(key), key_tag_id=tagof(key));
native bool:map_has_str_key(Map:map, const key[]);
native bool:map_has_var_key(Map:map, VariantTag:key);Determines whether a pairing specified by its key exists in a map.
native map_get(Map:map, AnyTag:key, offset=0, key_tag_id=tagof(key));
native map_get_arr(Map:map, AnyTag:key, AnyTag:value[], value_size=sizeof(value), key_tag_id=tagof(key));
native Variant:map_get_var(Map:map, AnyTag:key, key_tag_id=tagof(key));
native bool:map_get_safe(Map:map, AnyTag:key, &AnyTag:value, offset=0, key_tag_id=tagof(key), value_tag_id=tagof(value));
native map_get_arr_safe(Map:map, AnyTag:key, AnyTag:value[], value_size=sizeof(value), key_tag_id=tagof(key), value_tag_id=tagof(value));
native map_arr_get(Map:map, const AnyTag:key[], offset=0, key_size=sizeof(key), key_tag_id=tagof(key));
native map_arr_get_arr(Map:map, const AnyTag:key[], AnyTag:value[], value_size=sizeof(value), key_size=sizeof(key), key_tag_id=tagof(key));
native Variant:map_arr_get_var(Map:map, const AnyTag:key[], key_size=sizeof(key), key_tag_id=tagof(key));
native bool:map_arr_get_safe(Map:map, const AnyTag:key[], &AnyTag:value, offset=0, key_size=sizeof(key), key_tag_id=tagof(key), value_tag_id=tagof(value));
native map_arr_get_arr_safe(Map:map, const AnyTag:key[], AnyTag:value[], value_size=sizeof(value), key_size=sizeof(key), key_tag_id=tagof(key), value_tag_id=tagof(value));
native map_str_get(Map:map, const key[], offset=0);
native map_str_get_arr(Map:map, const key[], AnyTag:value[], value_size=sizeof(value));
native Variant:map_str_get_var(Map:map, const key[]);
native bool:map_str_get_safe(Map:map, const key[], &AnyTag:value, offset=0, value_tag_id=tagof(value));
native map_str_get_arr_safe(Map:map, const key[], AnyTag:value[], value_size=sizeof(value), value_tag_id=tagof(value));
native map_var_get(Map:map, VariantTag:key, offset=0);
native map_var_get_arr(Map:map, VariantTag:key, AnyTag:value[], value_size=sizeof(value));
native Variant:map_var_get_var(Map:map, VariantTag:key);
native bool:map_var_get_safe(Map:map, VariantTag:key, &AnyTag:value, offset=0, value_tag_id=tagof(value));
native map_var_get_arr_safe(Map:map, VariantTag:key, AnyTag:value[], value_size=sizeof(value), value_tag_id=tagof(value));Obtains the value specified by its key from a map.
native bool:map_set(Map:map, AnyTag:key, AnyTag:value, key_tag_id=tagof(key), value_tag_id=tagof(value));
native bool:map_set_arr(Map:map, AnyTag:key, const AnyTag:value[], value_size=sizeof(value), key_tag_id=tagof(key), value_tag_id=tagof(value));
native bool:map_set_str(Map:map, AnyTag:key, const value[], key_tag_id=tagof(key));
native bool:map_set_var(Map:map, AnyTag:key, VariantTag:value, key_tag_id=tagof(key));
native bool:map_arr_set(Map:map, const AnyTag:key[], AnyTag:value, key_size=sizeof(key), key_tag_id=tagof(key), value_tag_id=tagof(value));
native bool:map_arr_set_arr(Map:map, const AnyTag:key[], const AnyTag:value[], value_size=sizeof(value), key_size=sizeof(key), key_tag_id=tagof(key), value_tag_id=tagof(value));
native bool:map_arr_set_str(Map:map, const AnyTag:key[], const value[], key_size=sizeof(key), key_tag_id=tagof(key));
native bool:map_arr_set_var(Map:map, const AnyTag:key[], VariantTag:value, key_size=sizeof(key), key_tag_id=tagof(key));
native bool:map_str_set(Map:map, const key[], AnyTag:value, value_tag_id=tagof(value));
native bool:map_str_set_arr(Map:map, const key[], const AnyTag:value[], value_size=sizeof(value), value_tag_id=tagof(value));
native bool:map_str_set_str(Map:map, const key[], const value[]);
native bool:map_str_set_var(Map:map, const key[], VariantTag:value);
native bool:map_var_set(Map:map, VariantTag:key, AnyTag:value, value_tag_id=tagof(value));
native bool:map_var_set_arr(Map:map, VariantTag:key, const AnyTag:value[], value_size=sizeof(value), value_tag_id=tagof(value));
native bool:map_var_set_str(Map:map, VariantTag:key, const value[]);
native bool:map_var_set_var(Map:map, VariantTag:key, VariantTag:value);Sets the value for a specific key in a map, or adds a new one if it doesn't exist.
native bool:map_set_cell(Map:map, AnyTag:key, offset, AnyTag:value, key_tag_id=tagof(key));
native bool:map_set_cell_safe(Map:map, AnyTag:key, offset, AnyTag:value, key_tag_id=tagof(key), value_tag_id=tagof(value));
native bool:map_arr_set_cell(Map:map, const AnyTag:key[], offset, AnyTag:value, key_size=sizeof(key), key_tag_id=tagof(key));
native bool:map_arr_set_cell_safe(Map:map, const AnyTag:key[], offset, AnyTag:value, key_size=sizeof(key), key_tag_id=tagof(key), value_tag_id=tagof(value));
native bool:map_str_set_cell(Map:map, const key[], offset, AnyTag:value);
native bool:map_str_set_cell_safe(Map:map, const key[], offset, AnyTag:value, value_tag_id=tagof(value));
native bool:map_var_set_cell(Map:map, VariantTag:key, offset, AnyTag:value);
native bool:map_var_set_cell_safe(Map:map, VariantTag:key, offset, AnyTag:value, value_tag_id=tagof(value));Sets the value of a single cell in an array specified by its key in a map.
native map_key_at(Map:map, index, offset=0);
native map_arr_key_at(Map:map, index, AnyTag:key[], key_size=sizeof(key));
native Variant:map_var_key_at(Map:map, index);
native bool:map_key_at_safe(Map:map, index, &AnyTag:key, offset=0, key_tag_id=tagof(key));
native map_arr_key_at_safe(Map:map, index, AnyTag:key[], key_size=sizeof(key), key_tag_id=tagof(key));Returns the key located at a specific numerical index in a map. Not very good for enumerating.
native map_value_at(Map:map, index, offset=0);
native map_arr_value_at(Map:map, index, AnyTag:value[], value_size=sizeof(value));
native Variant:map_var_value_at(Map:map, index);
native bool:map_value_at_safe(Map:map, index, &AnyTag:value, offset=0, value_tag_id=tagof(value));
native map_arr_value_at_safe(Map:map, index, AnyTag:value[], value_size=sizeof(value), key_tag_id=tagof(value));Returns the value located at a specific numerical index in a map.
native map_tagof(Map:map, AnyTag:key, key_tag_id=tagof(key));
native map_arr_tagof(Map:map, const AnyTag:key[], key_size=sizeof(key), key_tag_id=tagof(key));
native map_str_tagof(Map:map, const key[]);
native map_var_tagof(Map:map, VariantTag:key);Returns the tag of a value specified by its key in a map.
native map_sizeof(Map:map, AnyTag:key, key_tag_id=tagof(key));
native map_arr_sizeof(Map:map, const AnyTag:key[], key_size=sizeof(key), key_tag_id=tagof(key));
native map_str_sizeof(Map:map, const key[]);
native map_var_sizeof(Map:map, VariantTag:key);Returns the size of a value specified by its key in a map.
native MapIterator:map_iter(Map:map);Creates a new iterator pointing at the first key-value pair in the map (unordered).
native MapIterator:map_next(MapIterator:iter);Advances the map iterator by 1 (usable as the ++ operator).
native bool:map_iter_valid(Map:map, MapIterator:iter);Checks if the iterator points to a valid pair in the map.
native iter_get_key(MapIterator:iter, offset=0);
native iter_get_key_arr(MapIterator:iter, AnyTag:value[], size=sizeof(value));
native Variant:iter_get_key_var(MapIterator:iter);
native bool:iter_get_key_safe(MapIterator:iter, &AnyTag:value, offset=0, tag_id=tagof(value));
native iter_get_key_arr_safe(MapIterator:iter, AnyTag:value[], size=sizeof(value), tag_id=tagof(value));Returns the key specified by an iterator in the map. Similar to map_key_at.
native iter_get_value(MapIterator:iter, offset=0);
native iter_get_value_arr(MapIterator:iter, AnyTag:value[], size=sizeof(value));
native Variant:iter_get_value_var(MapIterator:iter);
native bool:iter_get_value_safe(MapIterator:iter, &AnyTag:value, offset=0, tag_id=tagof(value));
native iter_get_value_arr_safe(MapIterator:iter, AnyTag:value[], size=sizeof(value), tag_id=tagof(value));Returns the value specified by an iterator in the map. Similar to map_value_at.
native bool:iter_set_value(MapIterator:iter, AnyTag:value, value_tag_id=tagof(value));
native bool:iter_set_value_arr(MapIterator:iter, const AnyTag:value[], size=sizeof(value), value_tag_id=tagof(value));
native bool:iter_set_value_str(MapIterator:iter, const value[]);
native bool:iter_set_value_var(MapIterator:iter, VariantTag:value);Sets the value in a pair pointed to by the iterator.
native bool:iter_set_value_cell(MapIterator:iter, offset, AnyTag:value);
native bool:iter_set_value_cell_safe(MapIterator:iter, offset, AnyTag:value, value_tag_id=tagof(value));Sets a single cell in an array value for a pair pointed to by the iterator.