expose ToInt and ToFloat from FString as ToInt and ToDouble
This commit is contained in:
parent
5408e243a9
commit
655d01ba4d
2 changed files with 25 additions and 0 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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<String> tokens, String delimiter, EmptyTokenType keepEmpty = TOK_KEEPEMPTY) const;
|
||||
native void AppendCharacter(int c);
|
||||
native void DeleteLastCharacter();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue