From 64b468d612496ad8bc5cd94138129dafb4e96b67 Mon Sep 17 00:00:00 2001 From: Redstone1024 <2824517378@qq.com> Date: Sun, 3 Nov 2024 15:56:38 +0800 Subject: [PATCH] feat(string): add macros such as TEXT_VIEW to create string view text literals --- Redcraft.Utility/Source/Public/String/StringView.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Redcraft.Utility/Source/Public/String/StringView.h b/Redcraft.Utility/Source/Public/String/StringView.h index 1465d9d..27339e7 100644 --- a/Redcraft.Utility/Source/Public/String/StringView.h +++ b/Redcraft.Utility/Source/Public/String/StringView.h @@ -395,6 +395,15 @@ using FU16StringView = TStringView; using FU32StringView = TStringView; using FUnicodeStringView = TStringView; +#define TEXT_VIEW(X) TStringView(TEXT(X)) +#define WTEXT_VIEW(X) TStringView(WTEXT(X)) +#define U8TEXT_VIEW(X) TStringView(U8TEXT(X)) +#define U16TEXT_VIEW(X) TStringView(U16TEXT(X)) +#define U32TEXT_VIEW(X) TStringView(U32TEXT(X)) +#define UNICODETEXT_VIEW(X) TStringView(UNICODETEXT(X)) + +#define LITERAL_VIEW(T, X) TStringView(LITERAL(T, X)) + NAMESPACE_MODULE_END(Utility) NAMESPACE_MODULE_END(Redcraft) NAMESPACE_REDCRAFT_END