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

#include <AsciiSet.h>

Public Member Functions

template<typename CharType , int N>
constexpr FAsciiSet (const CharType(&Chars)[N])
 
template<typename CharType >
constexpr FORCEINLINE bool Contains (CharType Char) const
 
template<typename CharType >
constexpr FORCEINLINE uint64 Test (CharType Char) const
 
constexpr FORCEINLINE FAsciiSet operator+ (char Char) const
 
constexpr FORCEINLINE FAsciiSet operator| (FAsciiSet OtherSet) const
 
constexpr FORCEINLINE FAsciiSet operator& (FAsciiSet OtherSet) const
 
constexpr FORCEINLINE FAsciiSet operator~ () const
 

Static Public Member Functions

template<class CharType >
static constexpr const CharType * FindFirstOrEnd (const CharType *Str, FAsciiSet Set)
 
template<class CharType >
static constexpr const CharType * FindLastOrEnd (const CharType *Str, FAsciiSet Set)
 
template<typename CharType >
static constexpr const CharType * Skip (const CharType *Str, FAsciiSet Set)
 
template<typename CharType >
static constexpr bool HasAny (const CharType *Str, FAsciiSet Set)
 
template<typename CharType >
static constexpr bool HasNone (const CharType *Str, FAsciiSet Set)
 
template<typename CharType >
static constexpr bool HasOnly (const CharType *Str, FAsciiSet Set)
 
template<class StringType >
static constexpr StringType FindPrefixWith (const StringType &Str, FAsciiSet Set)
 
template<class StringType >
static constexpr StringType FindPrefixWithout (const StringType &Str, FAsciiSet Set)
 
template<class StringType >
static constexpr StringType TrimPrefixWith (const StringType &Str, FAsciiSet Set)
 
template<class StringType >
static constexpr StringType TrimPrefixWithout (const StringType &Str, FAsciiSet Set)
 
template<class StringType >
static constexpr StringType FindSuffixWith (const StringType &Str, FAsciiSet Set)
 
template<class StringType >
static constexpr StringType FindSuffixWithout (const StringType &Str, FAsciiSet Set)
 
template<class StringType >
static constexpr StringType TrimSuffixWith (const StringType &Str, FAsciiSet Set)
 
template<class StringType >
static constexpr StringType TrimSuffixWithout (const StringType &Str, FAsciiSet Set)
 
template<class StringType >
static constexpr bool HasAny (const StringType &Str, FAsciiSet Set)
 
template<class StringType >
static constexpr bool HasNone (const StringType &Str, FAsciiSet Set)
 
template<class StringType >
static constexpr bool HasOnly (const StringType &Str, FAsciiSet Set)
 

Detailed Description

ASCII character bitset useful for fast and readable parsing

Entirely constexpr. Works with both wide and narrow strings.

Example use cases:

constexpr FAsciiSet WhitespaceCharacters(" \v\f\t\r\n"); bool bIsWhitespace = WhitespaceCharacters.Test(MyChar); const char* HelloWorld = FAsciiSet::Skip(" \t\tHello world!", WhitespaceCharacters);

constexpr FAsciiSet XmlEscapeChars("&<>\"'"); check(FAsciiSet::HasNone(EscapedXmlString, XmlEscapeChars));

constexpr FAsciiSet Delimiters(".:;"); const TCHAR* DelimiterOrEnd = FAsciiSet::FindFirstOrEnd(PrefixedName, Delimiters); FString Prefix(PrefixedName, DelimiterOrEnd - PrefixedName);

constexpr FAsciiSet Slashes("/\\"); const TCHAR* SlashOrEnd = FAsciiSet::FindLastOrEnd(PathName, Slashes); const TCHAR* FileName = *SlashOrEnd ? SlashOrEnd + 1 : PathName;

Constructor & Destructor Documentation

◆ FAsciiSet()

template<typename CharType , int N>
constexpr FAsciiSet::FAsciiSet ( const CharType(&)  Chars[N])
inlineconstexpr

Member Function Documentation

◆ Contains()

template<typename CharType >
constexpr FORCEINLINE bool FAsciiSet::Contains ( CharType  Char) const
inlineconstexpr

Returns true if a character is part of the set

◆ FindFirstOrEnd()

template<class CharType >
static constexpr const CharType * FAsciiSet::FindFirstOrEnd ( const CharType *  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Find first character of string inside set or end pointer. Never returns null.

◆ FindLastOrEnd()

template<class CharType >
static constexpr const CharType * FAsciiSet::FindLastOrEnd ( const CharType *  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Find last character of string inside set or end pointer. Never returns null.

◆ FindPrefixWith()

template<class StringType >
static constexpr StringType FAsciiSet::FindPrefixWith ( const StringType &  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Get initial substring with all characters in set

◆ FindPrefixWithout()

template<class StringType >
static constexpr StringType FAsciiSet::FindPrefixWithout ( const StringType &  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Get initial substring with no characters in set

◆ FindSuffixWith()

template<class StringType >
static constexpr StringType FAsciiSet::FindSuffixWith ( const StringType &  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Get trailing substring with all characters in set

◆ FindSuffixWithout()

template<class StringType >
static constexpr StringType FAsciiSet::FindSuffixWithout ( const StringType &  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Get trailing substring with no characters in set

◆ HasAny() [1/2]

template<typename CharType >
static constexpr bool FAsciiSet::HasAny ( const CharType *  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Test if string contains any character in set

◆ HasAny() [2/2]

template<class StringType >
static constexpr bool FAsciiSet::HasAny ( const StringType &  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Test if string contains any character in set

◆ HasNone() [1/2]

template<typename CharType >
static constexpr bool FAsciiSet::HasNone ( const CharType *  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Test if string contains no character in set

◆ HasNone() [2/2]

template<class StringType >
static constexpr bool FAsciiSet::HasNone ( const StringType &  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Test if string contains no character in set

◆ HasOnly() [1/2]

template<typename CharType >
static constexpr bool FAsciiSet::HasOnly ( const CharType *  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Test if string contains any character outside of set

◆ HasOnly() [2/2]

template<class StringType >
static constexpr bool FAsciiSet::HasOnly ( const StringType &  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Test if string contains any character outside of set

◆ operator&()

constexpr FORCEINLINE FAsciiSet FAsciiSet::operator& ( FAsciiSet  OtherSet) const
inlineconstexpr

Create new set containing only the characters that exist in both this and another specified set

◆ operator+()

constexpr FORCEINLINE FAsciiSet FAsciiSet::operator+ ( char  Char) const
inlineconstexpr

Create new set with specified character in it

◆ operator|()

constexpr FORCEINLINE FAsciiSet FAsciiSet::operator| ( FAsciiSet  OtherSet) const
inlineconstexpr

Create new set containing the combination of this set and another

◆ operator~()

constexpr FORCEINLINE FAsciiSet FAsciiSet::operator~ ( ) const
inlineconstexpr

Create new set containing inverse set of characters - likely including null-terminator

◆ Skip()

template<typename CharType >
static constexpr const CharType * FAsciiSet::Skip ( const CharType *  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Find first character of string outside of set. Never returns null.

◆ Test()

template<typename CharType >
constexpr FORCEINLINE uint64 FAsciiSet::Test ( CharType  Char) const
inlineconstexpr

Returns non-zero if a character is part of the set. Prefer Contains() to avoid VS2019 conversion warnings.

◆ TrimPrefixWith()

template<class StringType >
static constexpr StringType FAsciiSet::TrimPrefixWith ( const StringType &  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Trim initial characters in set

◆ TrimPrefixWithout()

template<class StringType >
static constexpr StringType FAsciiSet::TrimPrefixWithout ( const StringType &  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Trim initial characters not in set

◆ TrimSuffixWith()

template<class StringType >
static constexpr StringType FAsciiSet::TrimSuffixWith ( const StringType &  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Trim trailing characters in set

◆ TrimSuffixWithout()

template<class StringType >
static constexpr StringType FAsciiSet::TrimSuffixWithout ( const StringType &  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Trim trailing characters not in set


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