Exposed string split functionality to ZScript

https://forum.zdoom.org/viewtopic.php?t=58114
This commit is contained in:
alexey.lysiuk 2017-10-28 11:26:55 +03:00
commit c4865d2bb6
2 changed files with 17 additions and 0 deletions

View file

@ -1293,3 +1293,13 @@ DEFINE_ACTION_FUNCTION(FStringStruct, ToDouble)
PARAM_SELF_STRUCT_PROLOGUE(FString);
ACTION_RETURN_FLOAT(self->ToDouble());
}
DEFINE_ACTION_FUNCTION(FStringStruct, Split)
{
PARAM_SELF_STRUCT_PROLOGUE(FString);
PARAM_POINTER(tokens, TArray<FString>);
PARAM_STRING(delimiter);
PARAM_INT_DEF(keepEmpty);
self->Split(*tokens, delimiter, static_cast<FString::EmptyTokenType>(keepEmpty));
return 0;
}