UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FWildcardString Class Reference

#include <WildcardString.h>

+ Inheritance diagram for FWildcardString:

Public Member Functions

 FWildcardString ()
 
 FWildcardString (const FString &Pattern)
 
 FWildcardString (const TCHAR *Pattern)
 
bool ContainsWildcards () const
 
bool IsMatch (const TCHAR *Input) const
 
bool IsMatch (const FString &Input) const
 

Static Public Member Functions

static CORE_API bool ContainsWildcards (const TCHAR *Pattern)
 
static CORE_API bool IsMatch (const TCHAR *Pattern, const TCHAR *Input)
 
static CORE_API bool IsMatchSubstring (const TCHAR *Pattern, const TCHAR *Input, const TCHAR *InputEnd, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive)
 

Static Protected Attributes

static const TCHAR EndOfString = TCHAR('\0')
 
static const TCHAR ExactWildcard = TCHAR('?')
 
static const TCHAR SequenceWildcard = TCHAR('*')
 

Detailed Description

Implements a string with wild card pattern matching abilities.

The FWildcardString is meant to hold the pattern you are matching against. For basic use, just call the static functions IsMatch() or IsMatchSubstring if you have FStringView

Constructor & Destructor Documentation

◆ FWildcardString() [1/3]

FWildcardString::FWildcardString ( )
inline

Default constructor.

◆ FWildcardString() [2/3]

FWildcardString::FWildcardString ( const FString &  Pattern)
inline

Creates and initializes a new instance with the specified pattern.

Parameters
PatternThe pattern string.

◆ FWildcardString() [3/3]

FWildcardString::FWildcardString ( const TCHAR Pattern)
inline

Creates and initializes a new instance with the specified pattern.

Parameters
PatternThe pattern string.

Member Function Documentation

◆ ContainsWildcards() [1/2]

bool FWildcardString::ContainsWildcards ( ) const
inline

Checks whether this string contains wild card characters.

Returns
true if this string contains wild cards, false otherwise.

◆ ContainsWildcards() [2/2]

bool FWildcardString::ContainsWildcards ( const TCHAR Pattern)
static

Checks whether the specified pattern contains wild card characters.

Parameters
PatternThe string to check.
Returns
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.

Parameters
InputThe string to match.
Returns
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.

Parameters
InputThe string to match.
Returns
true if the input string matches this pattern, false otherwise.

◆ IsMatch() [3/3]

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

Non-recursive wild card string matching algorithm.

Parameters
PatternThe pattern to match.
InputThe input string to check.

◆ IsMatchSubstring()

bool FWildcardString::IsMatchSubstring ( const TCHAR Pattern,
const TCHAR Input,
const TCHAR InputEnd,
ESearchCase::Type  SearchCase = ESearchCase::CaseSensitive 
)
static

As IsMatch, except can accept the end of the input string in order to facilitate FStringView usage.

if ESearchCase::IgnoreCase is used, the pattern and input are ToLower()d before comparison (note - does not apply locale and just uses c runtime style tolower)

Member Data Documentation

◆ EndOfString

const TCHAR FWildcardString::EndOfString = TCHAR('\0')
staticprotected

Holds the string terminator character.

◆ ExactWildcard

const TCHAR FWildcardString::ExactWildcard = TCHAR('?')
staticprotected

Holds the wild card that matches exactly one character (default is '?').

◆ SequenceWildcard

const TCHAR FWildcardString::SequenceWildcard = TCHAR('*')
staticprotected

Holds the wild card that matches a sequence of characters (default is '*').


The documentation for this class was generated from the following files: