From 8ab6747d77fb44423fb605908de52d3aa6e55d5c Mon Sep 17 00:00:00 2001 From: Player701 Date: Sat, 13 Apr 2019 22:18:47 +0300 Subject: [PATCH] - Added "const" qualifiers to the new UTF-8-aware string methods --- src/utility/zstring.cpp | 4 ++-- src/utility/zstring.h | 4 ++-- wadsrc/static/zscript/base.zs | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/utility/zstring.cpp b/src/utility/zstring.cpp index efb79a460..0f7a0bd10 100644 --- a/src/utility/zstring.cpp +++ b/src/utility/zstring.cpp @@ -681,7 +681,7 @@ void FString::ToLower () UnlockBuffer(); } -FString FString::MakeLower() +FString FString::MakeLower() const { TArray builder(Len()); int pos = 0; @@ -694,7 +694,7 @@ FString FString::MakeLower() return FString(builder); } -FString FString::MakeUpper() +FString FString::MakeUpper() const { TArray builder(Len()); int pos = 0; diff --git a/src/utility/zstring.h b/src/utility/zstring.h index 9c7a2ffd1..d7a9417ef 100644 --- a/src/utility/zstring.h +++ b/src/utility/zstring.h @@ -238,8 +238,8 @@ public: void ToUpper (); void ToLower (); - FString MakeUpper(); - FString MakeLower(); + FString MakeUpper() const; + FString MakeLower() const; void StripLeft (); void StripLeft (const FString &charset); diff --git a/wadsrc/static/zscript/base.zs b/wadsrc/static/zscript/base.zs index 2a9295d67..fe929e41e 100644 --- a/wadsrc/static/zscript/base.zs +++ b/wadsrc/static/zscript/base.zs @@ -909,8 +909,8 @@ struct StringStruct native native int RightIndexOf(String substr, int endIndex = 2147483647) const; deprecated("4.1") native void ToUpper(); deprecated("4.1") native void ToLower(); - native String MakeUpper(); - native String MakeLower(); + native String MakeUpper() const; + native String MakeLower() const; native static int CharUpper(int ch); native static int CharLower(int ch); native int ToInt(int base = 0) const; @@ -918,8 +918,8 @@ struct StringStruct native native void Split(out Array tokens, String delimiter, EmptyTokenType keepEmpty = TOK_KEEPEMPTY) const; native void AppendCharacter(int c); native void DeleteLastCharacter(); - native int CodePointCount(); - native int, int GetNextCodePoint(int position); + native int CodePointCount() const; + native int, int GetNextCodePoint(int position) const; } class SectorEffect : Thinker native