MCRO
C++23 utilities for Unreal Engine.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages Concepts
Text.h File Reference
#include <string>
#include "CoreMinimal.h"
#include "Text.h"
#include "Mcro/Concepts.h"
#include "Mcro/FunctionTraits.h"
#include "Mcro/TypeName.h"

Go to the source code of this file.

Data Structures

struct  Mcro::Text::TAsFormatArgument< T >
 
struct  Mcro::Text::TAsFormatArgument< Operand >
 Convert Unreal/STL/Range-V3 tuples to string the following way: (Item0, Item1, Item2, ...) More...
 
struct  Mcro::Text::TAsFormatArgument< TStdString< CharType > >
 
struct  Mcro::Text::TAsFormatArgument< FStdStringView >
 

Namespaces

namespace  Mcro
 
namespace  Mcro::Text
 Mixed text utilities and type traits.
 
namespace  Mcro::Text::Detail
 

Concepts

concept  Mcro::Text::CStringViewInvariant
 Concept constraining given type to a string view of any character type.
 
concept  Mcro::Text::CStringInvariant
 Concept constraining given type to a string of any character type.
 
concept  Mcro::Text::CStringOrView
 Concept constraining given type to a string or a a view of TCHAR.
 
concept  Mcro::Text::CStringOrViewInvariant
 Concept constraining given type to a string or a a view of any character type.
 
concept  Mcro::Text::CStringOrViewOrName
 Concept constraining given type to a string, a view or an FName of TCHAR.
 
concept  Mcro::Text::CStdStringOrView
 Concept constraining given type to a std::string or a view of TCHAR.
 
concept  Mcro::Text::CStdStringOrViewTyped
 Concept constraining given type to a std::string or a view of given character type.
 
concept  Mcro::Text::CStdStringInvariant
 Concept constraining given type to only a std::string of any character type.
 
concept  Mcro::Text::CStdStringViewInvariant
 Concept constraining given type to only a std::string_view of any character type.
 
concept  Mcro::Text::CStdStringOrViewInvariant
 Concept constraining given type to a std::string or a view of any character type.
 
concept  Mcro::Text::CDirectStringFormatArgument
 A type which is directly convertible to FStringFormatArg.
 
concept  Mcro::Text::CHasToString
 A type which which provides a ToString() member method.
 
concept  Mcro::Text::CHasPtrToString
 A type which which provides a ToString() member method.
 
concept  Mcro::Text::CHasStringFormatArgumentConversion
 A type which can be used with FStringFormatArg via a TAsFormatArgument specialization.
 
concept  Mcro::Text::CStringFormatArgument
 A type which can be converted to FStringFormatArg via any method.
 

Typedefs

template<class CharT , class Traits = std::char_traits<CharT>, class Allocator = std::allocator<CharT>>
using Mcro::Text::TStdString = std::basic_string<CharT, Traits, Allocator>
 Unreal style alias for STL strings.
 
template<class CharT , class Traits = std::char_traits<CharT>>
using Mcro::Text::TStdStringView = std::basic_string_view<CharT, Traits>
 Unreal style alias for STL string views.
 
using Mcro::Text::FUtf16StringView = TStringView<UTF16CHAR>
 
using Mcro::Text::FUtf32StringView = TStringView<UTF32CHAR>
 
using Mcro::Text::FStdString = TStdString<TCHAR>
 cross-TCHAR alias for std::[w]string
 
using Mcro::Text::FStdStringView = TStdStringView<TCHAR>
 cross-TCHAR alias for std::[w]string_view
 

Functions

template<typename CharFrom , typename CharOutput , typename StringFrom , CFunctionLike PtrGetter, CFunctionLike LengthGetter, CFunctionLike Constructor, typename StringTo = TFunction_Return<Constructor>>
StringTo Mcro::Text::Detail::HighLevelStringCast (const StringFrom &strIn, PtrGetter &&getPtr, LengthGetter &&getLength, Constructor &&construct)
 
template<typename CharType >
constexpr auto Mcro::Text::UnrealView (TStdStringView< CharType > const &stdStr)
 View an STL string object via an Unreal TStringView
 
template<CStringViewInvariant T>
constexpr auto Mcro::Text::StdView (T const &unrealStr)
 View an Unreal TStringView via an STL string view.
 
template<CConvertibleToDecayed< FString > T>
auto Mcro::Text::StdView (T const &unrealStr)
 View an Unreal string via an STL string view.
 
MCRO_API FString Mcro::Text::UnrealCopy (FStdStringView const &stdStr)
 Create a copy of an input STL string.
 
template<CStdStringOrViewInvariant T>
FString Mcro::Text::UnrealConvert (T const &stdStr)
 Create a copy and convert an input STL string to TCHAR.
 
MCRO_API FName Mcro::Text::UnrealNameCopy (FStdStringView const &stdStr)
 Create a copy of an input STL string as an FName.
 
template<CStdStringOrViewInvariant T>
FName Mcro::Text::UnrealNameConvert (T const &stdStr)
 Create a copy and convert an input STL string to TCHAR as an FName.
 
MCRO_API FStdString Mcro::Text::StdCopy (FStringView const &unrealStr)
 Create an Stl copy of an input Unreal string view.
 
MCRO_API FStdString Mcro::Text::StdCopy (FName const &unrealStr)
 Create an Stl copy of an input Unreal string.
 
template<typename ConvertTo >
auto Mcro::Text::StdConvert (FStringView const &unrealStr) -> TStdString< ConvertTo >
 Create a copy and convert an input Unreal string to the given character type.
 
template<typename ConvertTo >
auto Mcro::Text::StdConvert (FStdStringView const &stdStr) -> TStdString< ConvertTo >
 Create a copy and convert an input STL string of TCHAR to the given character type.
 
template<typename ConvertTo >
auto Mcro::Text::StdConvert (FName const &name) -> TStdString< ConvertTo >
 Create a copy and convert an input FName to the given character type.
 
template<CStringOrView... Args>
FString Mcro::Text::Join (const TCHAR *separator, Args... args)
 Join the given string arguments with a delimiter and skip empty entries.
 
MCRO_API FString Mcro::Text::DynamicPrintf (const TCHAR *fmt,...)
 Copy of FString::PrintfImpl but not private so it can work with strings which were not literals.
 
template<CStringFormatArgument T>
auto Mcro::Text::AsFormatArgument (T &&input)
 
template<CStringFormatArgument T>
FString Mcro::Text::AsString (T &&input)
 Attempt to convert anything to string which can tell via some method how to do so.
 
template<CStringFormatArgument... Args>
FStringFormatOrderedArguments Mcro::Text::OrderedArguments (Args &&... args)
 Create an ordered argument list for a string format from input arguments.
 
template<CStringFormatArgument... Args>
FStringFormatNamedArguments Mcro::Text::NamedArguments (TTuple< FString, Args >... args)
 Create a named argument list for a string format from input argument tuples.
 

Detailed Description

Author
David Mórász
Date
2025

Definition in file Text.h.