diff --git a/src/common/scripting/interface/stringformat.cpp b/src/common/scripting/interface/stringformat.cpp index b5b88a695..9e6433f53 100644 --- a/src/common/scripting/interface/stringformat.cpp +++ b/src/common/scripting/interface/stringformat.cpp @@ -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) { diff --git a/wadsrc/static/zscript/engine/base.zs b/wadsrc/static/zscript/engine/base.zs index 5abd62422..b7e95b1ba 100644 --- a/wadsrc/static/zscript/engine/base.zs +++ b/wadsrc/static/zscript/engine/base.zs @@ -975,8 +975,12 @@ struct StringStruct native unsafe(internal) native String MakeLower() const; native static int CharUpper(int ch); native static int CharLower(int ch); + + native bool IsInt() const; + native bool IsDouble() const; native int ToInt(int base = 0) const; native double ToDouble() const; + native void Split(out Array tokens, String delimiter, EmptyTokenType keepEmpty = TOK_KEEPEMPTY) const; native void AppendCharacter(int c); native void DeleteLastCharacter();