engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | 静态 Protected 属性 | 所有成员列表
FWildcardString类 参考

Implements a string with wild card pattern matching abilities. 更多...

#include <WildcardString.h>

+ 类 FWildcardString 继承关系图:

Public 成员函数

bool ContainsWildcards () const
 Checks whether this string contains wild card characters. 更多...
 
 FWildcardString ()
 Default constructor.
 
 FWildcardString (const FString &Pattern)
 Creates and initializes a new instance with the specified pattern. 更多...
 
 FWildcardString (const TCHAR *Pattern)
 Creates and initializes a new instance with the specified pattern. 更多...
 
bool IsMatch (const FString &Input) const
 Matches the given input string to this wild card pattern. 更多...
 
bool IsMatch (const TCHAR *Input) const
 Matches the given input string to this wild card pattern. 更多...
 
- Public 成员函数 继承自 FString
template<typename CharRangeType , typename TEnableIf< TIsCharRangeNotCArray< CharRangeType >::Value >::Type * = nullptr>
FORCEINLINE FString & Append (CharRangeType &&Str)
 Append a string and return a reference to this
 
template<class CharType >
FORCEINLINE FString & Append (CharType *Str)
 Append a valid null-terminated string and return a reference to this 更多...
 
template<class CharType >
FORCEINLINE FString & Append (const CharType *Str, int32 Count)
 Append a string and return a reference to this
 
FORCEINLINE FString & AppendChar (TCHAR InChar)
 Append a single character and return a reference to this
 
void AppendChars (const ANSICHAR *Str, int32 Count)
 Appends a character range without null-terminators in it 更多...
 
template<typename FmtType , typename... Types>
TEnableIf< TIsArrayOrRefOfType< FmtType, TCHAR >::Value, FString & >::Type Appendf (const FmtType &Fmt, Types... Args)
 Just like Printf, but appends the formatted text to the existing FString instead. 更多...
 
void AppendInt (int32 InNum)
 appends the integer InNum to this string
 
FORCEINLINE DataType::RangedForIteratorType begin ()
 DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support.
 
FORCEINLINE void CheckInvariants () const
 Run slow checks on this string
 
FORCEINLINE int32 Compare (const FString &Other, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const
 Lexicographically tests how this string compares to the Other given string 更多...
 
FORCEINLINE bool Contains (const FString &SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart) const
 Returns whether this string contains the specified substring. 更多...
 
FORCEINLINE bool Contains (const TCHAR *SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart) const
 Returns whether this string contains the specified substring. 更多...
 
FString ConvertTabsToSpaces (const int32 InSpacesPerTab) &&
 Replaces all instances of '\t' with TabWidth number of spaces 更多...
 
FString ConvertTabsToSpaces (const int32 InSpacesPerTab) const &
 Replaces all instances of '\t' with TabWidth number of spaces 更多...
 
void ConvertTabsToSpacesInline (const int32 InSpacesPerTab)
 Replaces all instances of '\t' with TabWidth number of spaces 更多...
 
FORCEINLINE TConstIterator CreateConstIterator () const
 Creates a const iterator for the characters in this string
 
FORCEINLINE TIterator CreateIterator ()
 Creates an iterator for the characters in this string
 
FORCEINLINE void Empty (int32 Slack=0)
 Create empty string of given size with zero terminating character 更多...
 
bool EndsWith (const FString &InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
 Test whether this string ends with given string. 更多...
 
bool EndsWith (const TCHAR *InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
 Test whether this string ends with given string. 更多...
 
FORCEINLINE bool Equals (const FString &Other, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const
 Lexicographically tests whether this string is equivalent to the Other given string 更多...
 
FORCEINLINE int32 Find (const FString &SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart, int32 StartPosition=INDEX_NONE) const
 Searches the string for a substring, and returns index into this string of the first found instance. 更多...
 
int32 Find (const TCHAR *SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart, int32 StartPosition=INDEX_NONE) const
 Searches the string for a substring, and returns index into this string of the first found instance. 更多...
 
FORCEINLINE bool FindChar (TCHAR InChar, int32 &Index) const
 Searches the string for a character 更多...
 
FORCEINLINE bool FindLastChar (TCHAR InChar, int32 &Index) const
 Searches the string for the last occurrence of a character 更多...
 
template<typename Predicate >
FORCEINLINE int32 FindLastCharByPredicate (Predicate Pred) const
 Searches the string for the last occurrence of a character which matches the specified predicate. 更多...
 
template<typename Predicate >
FORCEINLINE int32 FindLastCharByPredicate (Predicate Pred, int32 Count) const
 Searches an initial substring for the last occurrence of a character which matches the specified predicate. 更多...
 
template<typename CharRangeType , typename TEnableIf< TIsCharRangeNotCArray< CharRangeType >::Value >::Type * = nullptr>
 FString (CharRangeType &&Other)
 Create an FString from a contiguous range of characters 更多...
 
template<typename CharRangeType , typename TEnableIf< TIsCharRangeNotCArray< CharRangeType >::Value >::Type * = nullptr>
 FString (CharRangeType &&Other, int32 ExtraSlack)
 Create an FString from a contiguous range of characters, with extra slack at the end of the string 更多...
 
template<typename CharType , typename = typename TEnableIf<TIsCharType<CharType>::Value>::Type>
FORCEINLINE FString (const CharType *Src)
 Constructor using an array of TCHAR 更多...
 
template<typename CharType , typename = typename TEnableIf<TIsCharType<CharType>::Value>::Type>
FORCEINLINE FString (const CharType *Src, int32 ExtraSlack)
 Constructor to create FString with specified number of characters from another string with additional character zero 更多...
 
FORCEINLINE FString (const FString &Other, int32 ExtraSlack)
 Create a copy of the Other string with extra space for characters at the end of the string 更多...
 
FORCEINLINE FString (FString &&Other, int32 ExtraSlack)
 Create a copy of the Other string with extra space for characters at the end of the string 更多...
 
template<typename CharType , typename = typename TEnableIf<TIsCharType<CharType>::Value>::Type>
FORCEINLINE FString (int32 InCount, const CharType *InSrc)
 Constructor to create FString with specified number of characters from another string with additional character zero 更多...
 
FORCEINLINE DataType & GetCharArray ()
 Get string as array of TCHARS 更多...
 
FORCEINLINE const DataType & GetCharArray () const
 Get string as const array of TCHARS
 
FORCEINLINE bool IsEmpty () const
 Test whether this string is empty 更多...
 
bool IsNumeric () const
 Returns true if the string only contains numeric characters
 
FORCEINLINE bool IsValidIndex (int32 Index) const
 Tests if index is valid, i.e. 更多...
 
FORCEINLINE FString Left (int32 Count) const &
 Returns the left most given number of characters
 
FORCEINLINE FString LeftChop (int32 Count) const &
 Returns the left most characters from the string chopping the given number of characters from the end
 
FORCEINLINE void LeftChopInline (int32 Count, bool bAllowShrinking=true)
 Modifies the string such that it is now the left most characters chopping the given number of characters from the end
 
FORCEINLINE void LeftInline (int32 Count, bool bAllowShrinking=true)
 Modifies the string such that it is now the left most given number of characters
 
FString LeftPad (int32 ChCount) const
 Pad the left of this string for ChCount characters
 
FORCEINLINE int32 Len () const
 Get the length of the string, excluding terminating character
 
FORCEINLINE bool MatchesWildcard (const FString &Wildcard, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
 Searches this string for a given wild card 更多...
 
bool MatchesWildcard (const TCHAR *Wildcard, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
 Searches this string for a given wild card 更多...
 
FORCEINLINE FString Mid (int32 Start, int32 Count=MAX_int32) const &
 Returns the substring from Start position for Count characters.
 
FORCEINLINE void MidInline (int32 Start, int32 Count=MAX_int32, bool bAllowShrinking=true)
 Modifies the string such that it is now the substring from Start position for Count characters.
 
FORCEINLINE const TCHAR * operator* () const
 Get pointer to the string 更多...
 
FORCEINLINE FString & operator+= (ANSICHAR Char)
 Append a single character and return a reference to this
 
template<typename StrType >
FORCEINLINE FString & operator+= (StrType &&Str)
 Append a string and return a reference to this
 
FORCEINLINE FString & operator/= (const FString &Str)
 Concatenate this path with given path ensuring the / character is used between them 更多...
 
FORCEINLINE FString & operator/= (const TCHAR *Str)
 Concatenate this path with given path ensuring the / character is used between them 更多...
 
template<typename CharRangeType , typename TEnableIf< TIsTCharRangeNotCArray< CharRangeType >::Value >::Type * = nullptr>
FString & operator= (CharRangeType &&Other)
 Copy assignment from a contiguous range of characters
 
FORCEINLINE FString & operator= (const TCHAR *Other)
 Copy Assignment from array of TCHAR 更多...
 
FORCEINLINE TCHAR & operator[] (int32 Index)
 Return specific character from this string 更多...
 
FORCEINLINE const TCHAR & operator[] (int32 Index) const
 Return specific const character from this string 更多...
 
int32 ParseIntoArray (TArray< FString > &OutArray, const TCHAR *const *DelimArray, int32 NumDelims, bool InCullEmpty=true) const
 Breaks up a delimited string into elements of a string array, using the given delimiters 更多...
 
int32 ParseIntoArray (TArray< FString > &OutArray, const TCHAR *pchDelim, bool InCullEmpty=true) const
 Breaks up a delimited string into elements of a string array. 更多...
 
int32 ParseIntoArrayLines (TArray< FString > &OutArray, bool InCullEmpty=true) const
 Breaks up a delimited string into elements of a string array, using line ending characters 更多...
 
int32 ParseIntoArrayWS (TArray< FString > &OutArray, const TCHAR *pchExtraDelim=nullptr, bool InCullEmpty=true) const
 Breaks up a delimited string into elements of a string array, using any whitespace and an optional extra delimter, like a "," 更多...
 
void PathAppend (const TCHAR *Str, int32 StrLength)
 Concatenate this path with given path ensuring the / character is used between them 更多...
 
FORCEINLINE void RemoveAt (int32 Index, int32 Count=1, bool bAllowShrinking=true)
 Removes characters within the string. 更多...
 
bool RemoveFromEnd (const FString &InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase)
 Removes the text from the end of the string if it exists. 更多...
 
bool RemoveFromEnd (const TCHAR *InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase)
 Removes the text from the end of the string if it exists. 更多...
 
bool RemoveFromStart (const FString &InPrefix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase)
 Removes the text from the start of the string if it exists. 更多...
 
bool RemoveFromStart (const TCHAR *InPrefix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase)
 Removes the text from the start of the string if it exists. 更多...
 
void RemoveSpacesInline ()
 Removes spaces from the string. 更多...
 
FString Replace (const TCHAR *From, const TCHAR *To, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) &&
 Replace all occurrences of a substring in this string 更多...
 
FString Replace (const TCHAR *From, const TCHAR *To, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const &
 Replace all occurrences of a substring in this string 更多...
 
void ReplaceCharInline (const TCHAR SearchChar, const TCHAR ReplacementChar, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase)
 Replace all occurrences of a character with another. 更多...
 
FString ReplaceCharWithEscapedChar (const TArray< TCHAR > *Chars=nullptr) &&
 Replaces certain characters with the "escaped" version of that character (i.e. 更多...
 
FString ReplaceCharWithEscapedChar (const TArray< TCHAR > *Chars=nullptr) const &
 Replaces certain characters with the "escaped" version of that character (i.e. 更多...
 
FString ReplaceEscapedCharWithChar (const TArray< TCHAR > *Chars=nullptr) &&
 Removes the escape backslash for all supported characters, replacing the escape and character with the non-escaped version. 更多...
 
FString ReplaceEscapedCharWithChar (const TArray< TCHAR > *Chars=nullptr) const &
 Removes the escape backslash for all supported characters, replacing the escape and character with the non-escaped version. 更多...
 
int32 ReplaceInline (const TCHAR *SearchText, const TCHAR *ReplacementText, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase)
 Replace all occurrences of SearchText with ReplacementText in this string. 更多...
 
FString ReplaceQuotesWithEscapedQuotes () &&
 Returns a copy of this string with all quote marks escaped (unless the quote is already escaped)
 
FString ReplaceQuotesWithEscapedQuotes () const &
 Returns a copy of this string with all quote marks escaped (unless the quote is already escaped)
 
FORCEINLINE void Reset (int32 NewReservedSize=0)
 Empties the string, but doesn't change memory allocation, unless the new size is larger than the current string. 更多...
 
FString Reverse () &&
 Returns this string, with the characters in reverse order
 
FString Reverse () const &
 Returns a copy of this string, with the characters in reverse order
 
void ReverseString ()
 Reverses the order of characters in this string
 
FORCEINLINE FString Right (int32 Count) const &
 Returns the string to the right of the specified location, counting back from the right (end of the word).
 
FORCEINLINE FString RightChop (int32 Count) const &
 Returns the string to the right of the specified location, counting forward from the left (from the beginning of the word).
 
FORCEINLINE void RightChopInline (int32 Count, bool bAllowShrinking=true)
 Modifies the string such that it is now the string to the right of the specified location, counting forward from the left (from the beginning of the word).
 
FORCEINLINE void RightInline (int32 Count, bool bAllowShrinking=true)
 Modifies the string such that it is now the right most given number of characters
 
FString RightPad (int32 ChCount) const
 Pad the right of this string for ChCount characters
 
void SerializeAsANSICharArray (FArchive &Ar, int32 MinCharacters=0) const
 Serializes a string as ANSI char array. 更多...
 
FORCEINLINE void Shrink ()
 Remove unallocated empty character space from the end of this string
 
bool Split (const FString &InS, FString *LeftS, FString *RightS, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart) const
 Splits this string at given string position case sensitive. 更多...
 
bool StartsWith (const FString &InPrefix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
 Test whether this string starts with given string. 更多...
 
bool StartsWith (const TCHAR *InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
 Test whether this string starts with given string. 更多...
 
bool ToBool () const
 Converts a string into a boolean value 1, "True", "Yes", FCoreTexts::True, FCoreTexts::Yes, and non-zero integers become true 0, "False", "No", FCoreTexts::False, FCoreTexts::No, and unparsable values become false 更多...
 
FString ToLower () &&
 Converts all characters in this rvalue string to lowercase and moves it into the returned string. 更多...
 
FString ToLower () const &
 Returns a new string with the characters of this converted to lowercase
 
void ToLowerInline ()
 Converts all characters in this string to lowercase
 
FString ToUpper () &&
 Converts all characters in this rvalue string to uppercase and moves it into the returned string. 更多...
 
FString ToUpper () const &
 Returns a new string with the characters of this converted to uppercase
 
void ToUpperInline ()
 Converts all characters in this string to uppercase
 
FString TrimEnd () &&
 Removes whitespace characters from the end of this string. 更多...
 
FString TrimEnd () const &
 Removes whitespace characters from the end of this string. 更多...
 
void TrimEndInline ()
 Removes whitespace characters from the end of this string. 更多...
 
FString TrimQuotes (bool *bQuotesRemoved=nullptr) &&
 Returns this string with wrapping quotation marks removed.
 
FString TrimQuotes (bool *bQuotesRemoved=nullptr) const &
 Returns a copy of this string with wrapping quotation marks removed.
 
void TrimQuotesInline (bool *bQuotesRemoved=nullptr)
 Trims wrapping quotation marks from this string.
 
FString TrimStart () &&
 Removes whitespace characters from the start of this string. 更多...
 
FString TrimStart () const &
 Removes whitespace characters from the start of this string. 更多...
 
FString TrimStartAndEnd () &&
 Removes whitespace characters from the start and end of this string. 更多...
 
FString TrimStartAndEnd () const &
 Removes whitespace characters from the start and end of this string. 更多...
 
void TrimStartAndEndInline ()
 Removes whitespace characters from the start and end of this string. 更多...
 
void TrimStartInline ()
 Removes whitespace characters from the start of this string. 更多...
 
void TrimToNullTerminator ()
 Trims the inner array after the null terminator.
 

静态 Public 成员函数

static CORE_API bool ContainsWildcards (const TCHAR *Pattern)
 Checks whether the specified pattern contains wild card characters. 更多...
 
static CORE_API bool IsMatch (const TCHAR *Pattern, const TCHAR *Input)
 Non-recursive wild card string matching algorithm. 更多...
 
- 静态 Public 成员函数 继承自 FString
static FString Chr (TCHAR Ch)
 Returns a string containing only the Ch character
 
static FString ChrN (int32 NumCharacters, TCHAR Char)
 Returns a string that is full of a variable number of characters 更多...
 
static int32 CullArray (TArray< FString > *InArray)
 Takes an array of strings and removes any zero length entries. 更多...
 
static FString Format (const TCHAR *InFormatString, const FStringFormatNamedArguments &InNamedArguments)
 Format the specified string using the specified arguments. 更多...
 
static FString Format (const TCHAR *InFormatString, const FStringFormatOrderedArguments &InOrderedArguments)
 Format the specified string using the specified arguments. 更多...
 
static FString FromBlob (const uint8 *SrcBuffer, const uint32 SrcSize)
 Converts a buffer to a string 更多...
 
static FString FromHexBlob (const uint8 *SrcBuffer, const uint32 SrcSize)
 Converts a buffer to a string by hex-ifying the elements 更多...
 
static FORCEINLINE FString FromInt (int32 Num)
 Converts an integer to a string.
 
template<typename RangeType >
static FString Join (const RangeType &Range, const TCHAR *Separator)
 Joins a range of 'something that can be concatentated to strings with +=' together into a single string with separators. 更多...
 
template<typename RangeType , typename ProjectionType >
static FString JoinBy (const RangeType &Range, const TCHAR *Separator, ProjectionType Proj)
 Joins a range of elements together into a single string with separators using a projection function. 更多...
 
template<typename FmtType , typename... Types>
static TEnableIf< TIsArrayOrRefOfType< FmtType, TCHAR >::Value, FString >::Type Printf (const FmtType &Fmt, Types... Args)
 Constructs FString object similarly to how classic sprintf works. 更多...
 
static FString SanitizeFloat (double InFloat, const int32 InMinFractionalDigits=1)
 Converts a float string with the trailing zeros stripped For example - 1.234 will be "1.234" rather than "1.234000" 更多...
 
static bool ToBlob (const FString &Source, uint8 *DestBuffer, const uint32 DestSize)
 Converts a string into a buffer 更多...
 
static bool ToHexBlob (const FString &Source, uint8 *DestBuffer, const uint32 DestSize)
 Converts a string into a buffer 更多...
 

静态 Protected 属性

static CORE_API const TCHAR EndOfString = TCHAR('\0')
 Holds the string terminator character.
 
static CORE_API const TCHAR ExactWildcard = TCHAR('?')
 Holds the wild card that matches exactly one character (default is '?').
 
static CORE_API const TCHAR SequenceWildcard = TCHAR('*')
 Holds the wild card that matches a sequence of characters (default is '*').
 

额外继承的成员函数

- Public 类型 继承自 FString
typedef TArray< TCHAR >::TIterator TIterator
 Iterator typedefs
 

详细描述

Implements a string with wild card pattern matching abilities.

构造及析构函数说明

◆ FWildcardString() [1/2]

FWildcardString::FWildcardString ( const FString &  Pattern)
inline

Creates and initializes a new instance with the specified pattern.

参数
PatternThe pattern string.

◆ FWildcardString() [2/2]

FWildcardString::FWildcardString ( const TCHAR *  Pattern)
inline

Creates and initializes a new instance with the specified pattern.

参数
PatternThe pattern string.

成员函数说明

◆ ContainsWildcards() [1/2]

bool FWildcardString::ContainsWildcards ( ) const
inline

Checks whether this string contains wild card characters.

返回
true if this string contains wild cards, false otherwise.

◆ ContainsWildcards() [2/2]

static CORE_API bool FWildcardString::ContainsWildcards ( const TCHAR *  Pattern)
static

Checks whether the specified pattern contains wild card characters.

参数
PatternThe string to check.
返回
true if the string contains wild cards, false otherwise.

◆ IsMatch() [1/3]

bool FWildcardString::IsMatch ( const FString &  Input) const
inline

Matches the given input string to this wild card pattern.

参数
InputThe string to match.
返回
true if the input string matches this pattern, false otherwise.

◆ IsMatch() [2/3]

bool FWildcardString::IsMatch ( const TCHAR *  Input) const
inline

Matches the given input string to this wild card pattern.

参数
InputThe string to match.
返回
true if the input string matches this pattern, false otherwise.

◆ IsMatch() [3/3]

static CORE_API bool FWildcardString::IsMatch ( const TCHAR *  Pattern,
const TCHAR *  Input 
)
static

Non-recursive wild card string matching algorithm.

参数
PatternThe pattern to match.
InputThe input string to check.

该类的文档由以下文件生成: