mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 07:12:36 +00:00
add Dictionary.Remove(String key) function
This commit is contained in:
parent
2dc9837078
commit
bd1892120d
2 changed files with 14 additions and 0 deletions
|
@ -68,3 +68,16 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Dictionary, FromString, DictFromString)
|
||||||
PARAM_STRING(string);
|
PARAM_STRING(string);
|
||||||
ACTION_RETURN_POINTER(DictFromString(string));
|
ACTION_RETURN_POINTER(DictFromString(string));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void DictRemove(Dictionary *dict, const FString &key)
|
||||||
|
{
|
||||||
|
dict->Remove(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION_NATIVE(_Dictionary, Remove, DictRemove)
|
||||||
|
{
|
||||||
|
PARAM_SELF_STRUCT_PROLOGUE(Dictionary);
|
||||||
|
PARAM_STRING(key);
|
||||||
|
DictRemove(self, key);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ struct Dictionary native
|
||||||
native static Dictionary FromString(String s);
|
native static Dictionary FromString(String s);
|
||||||
|
|
||||||
native void Insert(String key, String value);
|
native void Insert(String key, String value);
|
||||||
|
native void Remove(String key);
|
||||||
native String At(String key) const;
|
native String At(String key) const;
|
||||||
|
|
||||||
native String ToString() const;
|
native String ToString() const;
|
||||||
|
|
Loading…
Reference in a new issue