|
| constexpr | TStringView ()=default |
| |
| constexpr | TStringView (const CharType *InData UE_LIFETIMEBOUND) |
| |
| constexpr | TStringView (const CharType *InData UE_LIFETIMEBOUND, int32 InSize) |
| |
| template<UE::CCompatibleCharType< CharType > OtherCharType> |
| | TStringView (const OtherCharType *InData UE_LIFETIMEBOUND) |
| |
| template<UE::CCompatibleCharType< CharType > OtherCharType> |
| constexpr | TStringView (const OtherCharType *InData UE_LIFETIMEBOUND, int32 InSize) |
| |
template<UE::CNotCVRefTo< ViewType > CharRangeType>
requires (!std::is_pointer_v<std::decay_t<CharRangeType>> && UE::CCompatibleStringViewable<CharRangeType, CharType>) |
| constexpr | TStringView (const CharRangeType &InRange UE_LIFETIMEBOUND) |
| |
| const CharType & | operator[] (int32 Index) const |
| |
| constexpr const CharType * | GetData () const |
| |
| constexpr SIZE_T | NumBytes () const |
| |
| constexpr int32 | Len () const |
| |
| constexpr bool | IsEmpty () const |
| |
| void | RemovePrefix (int32 CharCount) |
| |
| void | RemoveSuffix (int32 CharCount) |
| |
| void | Reset () |
| |
| int32 | CopyString (CharType *Dest, int32 CharCount, int32 Position=0) const |
| |
| ViewType | SubStr (int32 Position, int32 CharCount) const |
| |
| ViewType | Left (int32 CharCount) const |
| |
| ViewType | LeftChop (int32 CharCount) const |
| |
| ViewType | Right (int32 CharCount) const |
| |
| ViewType | RightChop (int32 CharCount) const |
| |
| ViewType | Mid (int32 Position, int32 CharCount=MAX_int32) const |
| |
| ViewType | TrimStartAndEnd () const |
| |
| ViewType | TrimStart () const |
| |
| ViewType | TrimEnd () const |
| |
| void | LeftInline (int32 CharCount) |
| |
| void | LeftChopInline (int32 CharCount) |
| |
| void | RightInline (int32 CharCount) |
| |
| void | RightChopInline (int32 CharCount) |
| |
| void | MidInline (int32 Position, int32 CharCount=MAX_int32) |
| |
| void | TrimStartAndEndInline () |
| |
| void | TrimStartInline () |
| |
| void | TrimEndInline () |
| |
| template<UE::CCharType OtherCharType> |
| bool | Equals (TStringView< OtherCharType > OtherView, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const |
| |
| template<UE::CStringViewable OtherRangeType> |
| bool | Equals (const OtherRangeType &Other, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const |
| |
| template<UE::CCharType OtherCharType> |
| bool | Equals (const OtherCharType *Other, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const |
| |
| template<UE::CStringViewable OtherRangeType> |
| int32 | Compare (const OtherRangeType &Other, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const |
| |
| template<UE::CCharType OtherCharType> |
| int32 | Compare (TStringView< OtherCharType > Other, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const |
| |
| template<UE::CCharType OtherCharType> |
| int32 | Compare (const OtherCharType *Other, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const |
| |
| bool | StartsWith (CharType Prefix) const |
| |
| bool | StartsWith (ViewType Prefix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const |
| |
| bool | EndsWith (CharType Suffix) const |
| |
| bool | EndsWith (ViewType Suffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const |
| |
| int32 | Find (ViewType Search, int32 StartPosition=0, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const |
| |
| bool | Contains (ViewType Search, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const |
| |
| bool | FindChar (CharType Search, int32 &OutIndex) const |
| |
| bool | FindLastChar (CharType Search, int32 &OutIndex) const |
| |
| UE_FORCEINLINE_HINT bool | IsValidIndex (int32 Index) const |
| |
| bool | UEOpEquals (TStringView Rhs) const |
| |
| bool | UEOpLessThan (TStringView Rhs) const |
| |
| template<UE::CConvertibleTo< TStringView > CharRangeType> |
| UE_REWRITE auto | UEOpEquals (CharRangeType &&Rhs) const |
| |
| template<UE::CConvertibleTo< TStringView > CharRangeType> |
| UE_REWRITE auto | UEOpLessThan (CharRangeType &&Rhs) |
| |
| template<UE::CConvertibleTo< TStringView > CharRangeType> |
| UE_REWRITE auto | UEOpGreaterThan (CharRangeType &&Rhs) |
| |
| UE_REWRITE bool | UEOpEquals (const CharType *Rhs) const |
| |
| constexpr const CharType * | begin () const |
| |
| constexpr const CharType * | end () const |
| |
| constexpr TReversePointerIterator< const CharType > | rbegin () const |
| |
| constexpr TReversePointerIterator< const CharType > | rend () const |
| |
A string view is a non-owning view of a range of characters.
Ensure that the underlying string is valid for the lifetime of the string view.
Be careful when constructing a string view from a temporary. Make a local copy if necessary.
FStringView View = Object->GetPathName(); // Invalid
FString PathName = Object->GetPathName(); // Valid FStringView View = PathName;
void ProcessPath(FStringView Path); // Valid ProcessPath(Object->GetPathName());
A string view is implicitly constructible from null-terminated strings, from contiguous ranges of characters such as FString and TStringBuilder, and from literals such as TEXTVIEW("...").
A string view is cheap to copy and is meant to be passed by value. Avoid passing by reference.
A string view is not guaranteed to represent a null-terminated string.
Log or format a string view using UE_LOG(TEXT("%.*s"), View.Len(), View.GetData());
A string view is a good fit for function parameters where the function has no requirements for how the string is stored. A caller may use FString, FStringView, TStringBuilder, a char array, a null-terminated string, or any other type which can convert to a string view.
The UE::String namespace contains many functions that can operate on string views. Most of these functions can be found in String/___.h in Core.
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define TEXTVIEW(str)
Definition StringView.h:553
BuilderType & Append(const OtherCharType *const String, const int32 Length)
Definition StringBuilder.h:238
Definition StringBuilder.h:509