mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-08 16:52:01 +00:00
Expose StripLeft and StripLeftRight to ZScript
This commit is contained in:
parent
3ffbda5526
commit
43880bbbe1
2 changed files with 30 additions and 0 deletions
|
@ -578,6 +578,34 @@ DEFINE_ACTION_FUNCTION_NATIVE(FStringStruct, StripRight, StringStripRight)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void StringStripLeft(FString* self, const FString& junk)
|
||||||
|
{
|
||||||
|
if (junk.IsNotEmpty()) self->StripLeft(junk);
|
||||||
|
else self->StripLeft();
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION_NATIVE(FStringStruct, StripLeft, StringStripLeft)
|
||||||
|
{
|
||||||
|
PARAM_SELF_STRUCT_PROLOGUE(FString);
|
||||||
|
PARAM_STRING(junk);
|
||||||
|
StringStripLeft(self, junk);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void StringStripLeftRight(FString* self, const FString& junk)
|
||||||
|
{
|
||||||
|
if (junk.IsNotEmpty()) self->StripLeftRight(junk);
|
||||||
|
else self->StripLeftRight();
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION_NATIVE(FStringStruct, StripLeftRight, StringStripLeftRight)
|
||||||
|
{
|
||||||
|
PARAM_SELF_STRUCT_PROLOGUE(FString);
|
||||||
|
PARAM_STRING(junk);
|
||||||
|
StringStripLeftRight(self, junk);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static void StringSplit(FString* self, TArray<FString>* tokens, const FString& delimiter, int keepEmpty)
|
static void StringSplit(FString* self, TArray<FString>* tokens, const FString& delimiter, int keepEmpty)
|
||||||
{
|
{
|
||||||
self->Split(*tokens, delimiter, static_cast<FString::EmptyTokenType>(keepEmpty));
|
self->Split(*tokens, delimiter, static_cast<FString::EmptyTokenType>(keepEmpty));
|
||||||
|
|
|
@ -881,7 +881,9 @@ struct StringStruct native
|
||||||
native int CodePointCount() const;
|
native int CodePointCount() const;
|
||||||
native int, int GetNextCodePoint(int position) const;
|
native int, int GetNextCodePoint(int position) const;
|
||||||
native void Substitute(String str, String replace);
|
native void Substitute(String str, String replace);
|
||||||
|
native void StripLeft(String junk = "");
|
||||||
native void StripRight(String junk = "");
|
native void StripRight(String junk = "");
|
||||||
|
native void StripLeftRight(String junk = "");
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Translation version("2.4")
|
struct Translation version("2.4")
|
||||||
|
|
Loading…
Reference in a new issue