Ark Server API (ASE) - Wiki
|
#include <FString.h>
Public Types | |
using | ElementType = TCHAR |
typedef TArray< TCHAR >::TIterator | TIterator |
typedef TArray< TCHAR >::TConstIterator | TConstIterator |
Public Member Functions | |
FString ()=default | |
FString (FString &&)=default | |
FString (const FString &)=default | |
FString & | operator= (FString &&)=default |
FString & | operator= (const FString &)=default |
FORCEINLINE | FString (const FString &Other, int32 ExtraSlack) |
FORCEINLINE | FString (FString &&Other, int32 ExtraSlack) |
template<typename CharType > | |
FORCEINLINE | FString (const CharType *Src, typename TEnableIf< TIsCharType< CharType >::Value >::Type *Dummy=nullptr) |
FORCEINLINE | FString (int32 InCount, const TCHAR *InSrc) |
FORCEINLINE | FString (const std::string &str) |
FORCEINLINE | FString (const std::wstring &str) |
FORCEINLINE FString & | operator= (const TCHAR *Other) |
FORCEINLINE TCHAR & | operator[] (int32 Index) |
FORCEINLINE const TCHAR & | operator[] (int32 Index) const |
FORCEINLINE TIterator | CreateIterator () |
FORCEINLINE TConstIterator | CreateConstIterator () const |
FORCEINLINE uint32 | GetAllocatedSize () const |
FORCEINLINE void | CheckInvariants () const |
FORCEINLINE void | Empty (int32 Slack=0) |
FORCEINLINE bool | IsEmpty () const |
FORCEINLINE void | Reset (int32 NewReservedSize=0) |
FORCEINLINE void | Shrink () |
FORCEINLINE bool | IsValidIndex (int32 Index) const |
FORCEINLINE const TCHAR * | operator* () const |
FORCEINLINE DataType & | GetCharArray () |
FORCEINLINE const DataType & | GetCharArray () const |
FORCEINLINE void | AppendChars (const TCHAR *Array, int32 Count) |
FORCEINLINE FString & | operator+= (const TCHAR *Str) |
template<typename CharType > | |
FORCEINLINE TEnableIf< TIsCharType< CharType >::Value, FString & >::Type | operator+= (CharType InChar) |
FORCEINLINE FString & | AppendChar (const TCHAR InChar) |
FORCEINLINE FString & | Append (const FString &Text) |
FString & | Append (const TCHAR *Text, int32 Count) |
FORCEINLINE void | RemoveAt (int32 Index, int32 Count=1, bool bAllowShrinking=true) |
FORCEINLINE void | InsertAt (int32 Index, TCHAR Character) |
FORCEINLINE void | InsertAt (int32 Index, const FString &Characters) |
bool | RemoveFromStart (const FString &InPrefix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) |
bool | RemoveFromEnd (const FString &InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) |
void | PathAppend (const TCHAR *Str, int32 StrLength) |
FORCEINLINE FString & | operator+= (const FString &Str) |
FORCEINLINE FString & | operator/= (const TCHAR *Str) |
FORCEINLINE FString & | operator/= (const FString &Str) |
FORCEINLINE int32 | Len () const |
FORCEINLINE FString | Left (int32 Count) const |
FORCEINLINE FString | LeftChop (int32 Count) const |
FORCEINLINE FString | Right (int32 Count) const |
FORCEINLINE FString | RightChop (int32 Count) const |
FORCEINLINE FString | Mid (int32 Start, int32 Count=INT_MAX) const |
int32 | Find (const TCHAR *SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart, int32 StartPosition=INDEX_NONE) const |
FORCEINLINE int32 | Find (const FString &SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart, int32 StartPosition=INDEX_NONE) const |
FORCEINLINE bool | Contains (const TCHAR *SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart) const |
FORCEINLINE bool | Contains (const FString &SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart) const |
FORCEINLINE bool | FindChar (TCHAR InChar, int32 &Index) const |
FORCEINLINE bool | FindLastChar (TCHAR InChar, int32 &Index) const |
template<typename Predicate > | |
FORCEINLINE int32 | FindLastCharByPredicate (Predicate Pred, int32 Count) const |
template<typename Predicate > | |
FORCEINLINE int32 | FindLastCharByPredicate (Predicate Pred) const |
FORCEINLINE bool | Equals (const FString &Other, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const |
FORCEINLINE int32 | Compare (const FString &Other, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const |
bool | Split (const FString &InS, FString *LeftS, FString *RightS, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart) const |
FString | ToUpper () const & |
FString | ToUpper () && |
void | ToUpperInline () |
FString | ToLower () const & |
FString | ToLower () && |
void | ToLowerInline () |
FString | LeftPad (int32 ChCount) const |
FString | RightPad (int32 ChCount) const |
bool | IsNumeric () const |
bool | StartsWith (const TCHAR *InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const |
bool | StartsWith (const FString &InPrefix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const |
bool | EndsWith (const TCHAR *InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const |
bool | EndsWith (const FString &InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const |
bool | MatchesWildcard (const FString &Wildcard, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const |
void | TrimStartAndEndInline () |
FString | TrimStartAndEnd () const & |
FString | TrimStartAndEnd () && |
void | TrimStartInline () |
FString | TrimStart () const & |
FString | TrimStart () && |
void | TrimEndInline () |
FString | TrimEnd () const & |
FString | TrimEnd () && |
void | TrimToNullTerminator () |
FString | TrimQuotes (bool *bQuotesRemoved=nullptr) const |
int32 | ParseIntoArray (TArray< FString > &OutArray, const TCHAR *pchDelim, bool InCullEmpty=true) const |
int32 | ParseIntoArrayWS (TArray< FString > &OutArray, const TCHAR *pchExtraDelim=nullptr, bool InCullEmpty=true) const |
int32 | ParseIntoArrayLines (TArray< FString > &OutArray, bool InCullEmpty=true) const |
int32 | ParseIntoArray (TArray< FString > &OutArray, const TCHAR **DelimArray, int32 NumDelims, bool InCullEmpty=true) const |
FString | Reverse () const |
void | ReverseString () |
FString | Replace (const TCHAR *From, const TCHAR *To, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const |
int32 | ReplaceInline (const TCHAR *SearchText, const TCHAR *ReplacementText, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) |
FString | ReplaceQuotesWithEscapedQuotes () const |
FString | ReplaceCharWithEscapedChar (const TArray< TCHAR > *Chars=nullptr) const |
FString | ReplaceEscapedCharWithChar (const TArray< TCHAR > *Chars=nullptr) const |
FString | ConvertTabsToSpaces (const int32 InSpacesPerTab) |
FORCEINLINE void | Reserve (const uint32 CharacterCount) |
void | AppendInt (int32 InNum) |
std::string | ToString () const |
Convert FString to std::string. | |
Static Public Member Functions | |
static FString | Chr (TCHAR Ch) |
static FString | ChrN (int32 NumCharacters, TCHAR Char) |
static int32 | CullArray (TArray< FString > *InArray) |
static FString | FormatAsNumber (int32 InNumber) |
static FORCEINLINE FString | FromInt (int32 Num) |
static bool | ToBlob (const FString &Source, uint8 *DestBuffer, const uint32 DestSize) |
static bool | ToHexBlob (const FString &Source, uint8 *DestBuffer, const uint32 DestSize) |
template<typename T , typename Allocator > | |
static FString | Join (const TArray< T, Allocator > &Array, const TCHAR *Separator) |
template<typename T , typename... Args> | |
static FString | Format (const T *format, Args &&... args) |
Formats text using fmt::format. | |
Private Types | |
typedef TArray< TCHAR > | DataType |
Static Private Member Functions | |
template<typename LhsType , typename RhsType > | |
static FORCEINLINE FString | ConcatFStrings (typename TIdentity< LhsType >::Type Lhs, typename TIdentity< RhsType >::Type Rhs) |
template<typename RhsType > | |
static FORCEINLINE FString | ConcatTCHARsToFString (const TCHAR *Lhs, typename TIdentity< RhsType >::Type Rhs) |
template<typename LhsType > | |
static FORCEINLINE FString | ConcatFStringToTCHARs (typename TIdentity< LhsType >::Type Lhs, const TCHAR *Rhs) |
Private Attributes | |
DataType | Data |
Friends | |
struct | TContainerTraits< FString > |
FORCEINLINE friend DataType::RangedForIteratorType | begin (FString &Str) |
FORCEINLINE friend DataType::RangedForConstIteratorType | begin (const FString &Str) |
FORCEINLINE friend DataType::RangedForIteratorType | end (FString &Str) |
FORCEINLINE friend DataType::RangedForConstIteratorType | end (const FString &Str) |
template<typename CharType > | |
FORCEINLINE friend TEnableIf< TIsCharType< CharType >::Value, FString >::Type | operator+ (const FString &Lhs, CharType Rhs) |
template<typename CharType > | |
FORCEINLINE friend TEnableIf< TIsCharType< CharType >::Value, FString >::Type | operator+ (FString &&Lhs, CharType Rhs) |
FORCEINLINE friend FString | operator+ (const FString &Lhs, const FString &Rhs) |
FORCEINLINE friend FString | operator+ (FString &&Lhs, const FString &Rhs) |
FORCEINLINE friend FString | operator+ (const FString &Lhs, FString &&Rhs) |
FORCEINLINE friend FString | operator+ (FString &&Lhs, FString &&Rhs) |
FORCEINLINE friend FString | operator+ (const TCHAR *Lhs, const FString &Rhs) |
FORCEINLINE friend FString | operator+ (const TCHAR *Lhs, FString &&Rhs) |
FORCEINLINE friend FString | operator+ (const FString &Lhs, const TCHAR *Rhs) |
FORCEINLINE friend FString | operator+ (FString &&Lhs, const TCHAR *Rhs) |
FORCEINLINE friend FString | operator/ (const FString &Lhs, const TCHAR *Rhs) |
FORCEINLINE friend FString | operator/ (FString &&Lhs, const TCHAR *Rhs) |
FORCEINLINE friend FString | operator/ (const FString &Lhs, const FString &Rhs) |
FORCEINLINE friend FString | operator/ (FString &&Lhs, const FString &Rhs) |
FORCEINLINE friend FString | operator/ (const TCHAR *Lhs, const FString &Rhs) |
FORCEINLINE friend bool | operator<= (const FString &Lhs, const FString &Rhs) |
template<typename CharType > | |
FORCEINLINE friend bool | operator<= (const FString &Lhs, const CharType *Rhs) |
template<typename CharType > | |
FORCEINLINE friend bool | operator<= (const CharType *Lhs, const FString &Rhs) |
FORCEINLINE friend bool | operator< (const FString &Lhs, const FString &Rhs) |
template<typename CharType > | |
FORCEINLINE friend bool | operator< (const FString &Lhs, const CharType *Rhs) |
template<typename CharType > | |
FORCEINLINE friend bool | operator< (const CharType *Lhs, const FString &Rhs) |
FORCEINLINE friend bool | operator>= (const FString &Lhs, const FString &Rhs) |
template<typename CharType > | |
FORCEINLINE friend bool | operator>= (const FString &Lhs, const CharType *Rhs) |
template<typename CharType > | |
FORCEINLINE friend bool | operator>= (const CharType *Lhs, const FString &Rhs) |
FORCEINLINE friend bool | operator> (const FString &Lhs, const FString &Rhs) |
template<typename CharType > | |
FORCEINLINE friend bool | operator> (const FString &Lhs, const CharType *Rhs) |
template<typename CharType > | |
FORCEINLINE friend bool | operator> (const CharType *Lhs, const FString &Rhs) |
FORCEINLINE friend bool | operator== (const FString &Lhs, const FString &Rhs) |
template<typename CharType > | |
FORCEINLINE friend bool | operator== (const FString &Lhs, const CharType *Rhs) |
template<typename CharType > | |
FORCEINLINE friend bool | operator== (const CharType *Lhs, const FString &Rhs) |
FORCEINLINE friend bool | operator!= (const FString &Lhs, const FString &Rhs) |
template<typename CharType > | |
FORCEINLINE friend bool | operator!= (const FString &Lhs, const CharType *Rhs) |
template<typename CharType > | |
FORCEINLINE friend bool | operator!= (const CharType *Lhs, const FString &Rhs) |
A dynamically sizeable string.
|
private |
using FString::ElementType = TCHAR |
typedef TArray<TCHAR>::TConstIterator FString::TConstIterator |
typedef TArray<TCHAR>::TIterator FString::TIterator |
|
default |
|
default |
|
default |
Create a copy of the Other string with extra space for characters at the end of the string
Other | the other string to create a new copy from |
ExtraSlack | number of extra characters to add to the end of the other string in this string |
Definition at line 76 of file FString.h.
Create a copy of the Other string with extra space for characters at the end of the string
Other | the other string to create a new copy from |
ExtraSlack | number of extra characters to add to the end of the other string in this string |
Definition at line 87 of file FString.h.
|
inline |
|
inlineexplicit |
|
inlineexplicit |
Appends an array of characters to the string.
Array | A pointer to the start of an array of characters to append. This array need not be null-terminated, and null characters are not treated specially. |
Count | The number of characters to copy from Array. |
Definition at line 322 of file FString.h.
|
inline |
|
inline |
Returns a string that is full of a variable number of characters
NumCharacters | Number of characters to put into the string |
Char | Character to put into the string |
Definition at line 2501 of file FString.h.
|
inline |
Lexicographically tests how this string compares to the Other given string
Other | The string test against |
SearchCase | Whether or not the comparison should ignore case |
Definition at line 1240 of file FString.h.
|
inline |
Returns whether this string contains the specified substring.
SubStr | Find to search for |
SearchCase | Indicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase ) |
SearchDir | Indicates whether the search starts at the begining or at the end ( defaults to ESearchDir::FromStart ) |
Definition at line 1156 of file FString.h.
|
inline |
Returns whether this string contains the specified substring.
SubStr | Find to search for |
SearchCase | Indicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase ) |
SearchDir | Indicates whether the search starts at the begining or at the end ( defaults to ESearchDir::FromStart ) |
Definition at line 1142 of file FString.h.
Replaces all instances of '\t' with TabWidth number of spaces
InSpacesPerTab | - Number of spaces that a tab represents |
Replaces all instances of '\t' with TabWidth number of spaces
InSpacesPerTab | - Number of spaces that a tab represents |
Definition at line 2980 of file FString.h.
|
inline |
|
inline |
|
inline |
|
inline |
Test whether this string ends with given string.
SearchCase | Indicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase ) |
Definition at line 2180 of file FString.h.
|
inline |
Test whether this string ends with given string.
SearchCase | Indicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase ) |
Definition at line 2155 of file FString.h.
|
inline |
Lexicographically tests whether this string is equivalent to the Other given string
Other | The string test against |
SearchCase | Whether or not the comparison should ignore case |
Definition at line 1221 of file FString.h.
|
inline |
Searches the string for a substring, and returns index into this string of the first found instance. Can search from beginning or end, and ignore case or not.
SubStr | The string to search for |
StartPosition | The start character position to search from |
SearchCase | Indicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase ) |
SearchDir | Indicates whether the search starts at the begining or at the end ( defaults to ESearchDir::FromStart ) |
Definition at line 1128 of file FString.h.
|
inline |
Searches the string for a substring, and returns index into this string of the first found instance. Can search from beginning or end, and ignore case or not.
SubStr | The string array of TCHAR to search for |
StartPosition | The start character position to search from |
SearchCase | Indicates whether the search is case sensitive or not |
SearchDir | Indicates whether the search starts at the begining or at the end. |
Definition at line 2027 of file FString.h.
Searches the string for a character
InChar | the character to search for |
Index | out the position the character was found at, INDEX_NONE if return is false |
Definition at line 1169 of file FString.h.
Searches the string for the last occurrence of a character
InChar | the character to search for |
Index | out the position the character was found at, INDEX_NONE if return is false |
Definition at line 1181 of file FString.h.
|
inline |
Searches the string for the last occurrence of a character which matches the specified predicate.
Pred | Predicate that takes TCHAR and returns true if TCHAR matches search criteria, false otherwise. |
StartIndex | Index of element from which to start searching. Defaults to last TCHAR in string. |
|
inline |
Searches an initial substring for the last occurrence of a character which matches the specified predicate.
Pred | Predicate that takes TCHAR and returns true if TCHAR matches search criteria, false otherwise. |
Count | The number of characters from the front of the string through which to search. |
|
inlinestatic |
Formats text using fmt::format.
T | Either a a char or wchar_t |
Args | Optional arguments types |
format | Message |
args | Optional arguments |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Tests if index is valid, i.e. greater than or equal to zero, and less than the number of characters in this string (excluding the null terminator).
Index | Index to test. |
Definition at line 272 of file FString.h.
|
inlinestatic |
Joins an array of 'something that can be concatentated to strings with +=' together into a single string with separators.
Array | The array of 'things' to concatenate. |
Separator | The string used to separate each element. |
|
inline |
|
inline |
Searches this string for a given wild card
Wildcard | *?-type wildcard |
SearchCase | Indicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase ) |
Definition at line 2585 of file FString.h.
|
inline |
|
inline |
|
inline |
Breaks up a delimited string into elements of a string array, using the given delimiters
InArray | The array to fill with the string pieces |
DelimArray | The strings to delimit on |
NumDelims | The number of delimiters. |
Definition at line 2702 of file FString.h.
|
inline |
Breaks up a delimited string into elements of a string array.
InArray | The array to fill with the string pieces |
pchDelim | The string to delimit on |
InCullEmpty | If 1, empty strings are not added to the array |
Definition at line 2560 of file FString.h.
|
inline |
Breaks up a delimited string into elements of a string array, using line ending characters
InArray | The array to fill with the string pieces |
Definition at line 2684 of file FString.h.
|
inline |
Breaks up a delimited string into elements of a string array, using any whitespace and an optional extra delimter, like a ","
InArray | The array to fill with the string pieces |
pchExtraDelim | The string to delimit on |
Caution!! this routine is O(N^2) allocations...use it for parsing very short text or not at all
Definition at line 2660 of file FString.h.
Concatenate this path with given path ensuring the / character is used between them
Str | Pointer to an array of TCHARs (not necessarily null-terminated) to be concatenated onto the end of this. |
StrLength | Exact number of characters from Str to append. |
Definition at line 2234 of file FString.h.
|
inline |
Removes characters within the string.
Index | The index of the first character to remove. |
Count | The number of characters to remove. |
bAllowShrinking | Whether or not to reallocate to shrink the storage after removal. |
Definition at line 435 of file FString.h.
|
inline |
|
inline |
|
inline |
Replace all occurrences of a substring in this string
From | substring to replace |
To | substring to replace From with |
SearchCase | Indicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase ) |
Definition at line 2766 of file FString.h.
Replaces certain characters with the "escaped" version of that character (i.e. replaces "\n" with "\\n"). The characters supported are: {
, \r, \t, \', ", \ }.
Chars | by default, replaces all supported characters; this parameter allows you to limit the replacement to a subset. |
Definition at line 2934 of file FString.h.
Removes the escape backslash for all supported characters, replacing the escape and character with the non-escaped version. (i.e. replaces "\\n" with "\n". Counterpart to ReplaceCharWithEscapedChar().
Removes the escape backslash for all supported characters, replacing the escape and character with the non-escaped version. (i.e. replaces "\\n" with "\n". Counterpart to ReplaceCharWithEscapedChar().
Definition at line 2956 of file FString.h.
|
inline |
Replace all occurrences of SearchText with ReplacementText in this string.
SearchText | the text that should be removed from this string |
ReplacementText | the text to insert in its place |
SearchCase | Indicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase ) |
Definition at line 2805 of file FString.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Splits this string at given string position case sensitive.
InStr | The string to search and split at |
LeftS | out the string to the left of InStr, not updated if return is false |
RightS | out the string to the right of InStr, not updated if return is false |
SearchCase | Indicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase ) |
SearchDir | Indicates whether the search starts at the begining or at the end ( defaults to ESearchDir::FromStart ) |
Definition at line 1262 of file FString.h.
|
inline |
Test whether this string starts with given string.
SearchCase | Indicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase ) |
Definition at line 2143 of file FString.h.
|
inline |
Test whether this string starts with given string.
SearchCase | Indicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase ) |
Definition at line 2131 of file FString.h.
|
inlinestatic |
Converts a string into a buffer
DestBuffer | the buffer to fill with the string data |
DestSize | the size of the buffer in bytes (must be at least string len / 3) |
Definition at line 2448 of file FString.h.
|
inlinestatic |
Converts a string into a buffer
DestBuffer | the buffer to fill with the string data |
DestSize | the size of the buffer in bytes (must be at least string len / 2) |
Definition at line 2471 of file FString.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |