expose ToInt and ToFloat from FString as ToInt and ToDouble

This commit is contained in:
Alexander Kromm 2025-09-03 19:17:51 +07:00 committed by Rachael Alexanderson
commit 655d01ba4d
2 changed files with 25 additions and 0 deletions

View file

@ -526,6 +526,27 @@ DEFINE_ACTION_FUNCTION_NATIVE(FStringStruct, CharLower, StringCharLower)
ACTION_RETURN_INT(StringCharLower(ch));
}
static int StringIsInt(FString *self)
{
return self->IsInt();
}
DEFINE_ACTION_FUNCTION_NATIVE(FStringStruct, IsInt, StringIsInt)
{
PARAM_SELF_STRUCT_PROLOGUE(FString);
ACTION_RETURN_INT(self->IsInt());
}
static int StringIsDouble(FString *self)
{
return self->IsFloat();
}
DEFINE_ACTION_FUNCTION_NATIVE(FStringStruct, IsDouble, StringIsDouble)
{
PARAM_SELF_STRUCT_PROLOGUE(FString);
ACTION_RETURN_INT(self->IsFloat());
}
static int StringToInt(FString *self, int base)
{