add Dictionary.Remove(String key) function

This commit is contained in:
Alexander Kromm 2019-12-30 20:33:15 +07:00 committed by Christoph Oelckers
parent 2dc9837078
commit bd1892120d
2 changed files with 14 additions and 0 deletions

View file

@ -68,3 +68,16 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Dictionary, FromString, DictFromString)
PARAM_STRING(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;
}

View file

@ -4,6 +4,7 @@ struct Dictionary native
native static Dictionary FromString(String s);
native void Insert(String key, String value);
native void Remove(String key);
native String At(String key) const;
native String ToString() const;