- added Unicode aware MakeUpper/MakeLower functions to FString and ZScript's String and deprecated ToUpper/ToLower because their semantics did not allow fixing them.

This commit is contained in:
Christoph Oelckers 2019-04-13 10:12:33 +02:00
commit f7561f25d6
4 changed files with 50 additions and 16 deletions

View file

@ -263,6 +263,28 @@ DEFINE_ACTION_FUNCTION_NATIVE(FStringStruct, ToLower, StringToLower)
return 0;
}
static void StringMakeUpper(FString *self, FString *out)
{
*out = self->MakeUpper();
}
DEFINE_ACTION_FUNCTION_NATIVE(FStringStruct, MakeUpper, StringMakeUpper)
{
PARAM_SELF_STRUCT_PROLOGUE(FString);
ACTION_RETURN_STRING(self->MakeUpper());
}
static void StringMakeLower(FString *self, FString *out)
{
*out = self->MakeLower();
}
DEFINE_ACTION_FUNCTION_NATIVE(FStringStruct, MakeLower, StringMakeLower)
{
PARAM_SELF_STRUCT_PROLOGUE(FString);
ACTION_RETURN_STRING(self->MakeLower());
}
static int StringToInt(FString *self, int base)
{
return (int)self->ToLong(base);