Navigation
API > API/Runtime > API/Runtime/Core
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;
| Name | FAsciiSet |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Misc/AsciiSet.h |
| Include Path | #include "Misc/AsciiSet.h" |
Syntax
class FAsciiSet
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
constexpr FAsciiSet
(
uint64 Lo, |
Misc/AsciiSet.h | ||
constexpr FAsciiSet
(
InitData Bitset |
Misc/AsciiSet.h | ||
constexpr FAsciiSet
(
const CharType(&) Chars |
Misc/AsciiSet.h |
Structs
| Name | Remarks |
|---|---|
| InitData | Work-around for constexpr limitations. |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| NilMask | uint64 | Misc/AsciiSet.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| HiMask | uint64 | Misc/AsciiSet.h | ||
| LoMask | uint64 | Misc/AsciiSet.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool Contains
(
CharType Char |
Returns true if a character is part of the set | Misc/AsciiSet.h | |
uint64 Test
(
CharType Char |
Returns non-zero if a character is part of the set. | Misc/AsciiSet.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static const CharType * FindFirst
(
FAsciiSet Set, |
Misc/AsciiSet.h | ||
static const CharType * FindFirstOrEnd
(
const CharType* Str, |
Find first character of string inside set or end pointer. Never returns null. | Misc/AsciiSet.h | |
static const CharType * FindLast
(
FAsciiSet Set, |
Misc/AsciiSet.h | ||
static const CharType * FindLastOrEnd
(
const CharType* Str, |
Find last character of string inside set or end pointer. Never returns null. | Misc/AsciiSet.h | |
static StringType FindPrefixWith
(
const StringType& Str, |
Get initial substring with all characters in set | Misc/AsciiSet.h | |
static StringType FindPrefixWithout
(
const StringType& Str, |
Get initial substring with no characters in set | Misc/AsciiSet.h | |
static StringType FindSuffixWith
(
const StringType& Str, |
Get trailing substring with all characters in set | Misc/AsciiSet.h | |
static StringType FindSuffixWithout
(
const StringType& Str, |
Get trailing substring with no characters in set | Misc/AsciiSet.h | |
| Test if string contains any character in set | Misc/AsciiSet.h | ||
| Test if string contains any character in set | Misc/AsciiSet.h | ||
| Test if string contains no character in set | Misc/AsciiSet.h | ||
| Test if string contains no character in set | Misc/AsciiSet.h | ||
| Test if string contains any character outside of set | Misc/AsciiSet.h | ||
| Test if string contains any character outside of set | Misc/AsciiSet.h | ||
static StringType Scan
(
const StringType& Str, |
Misc/AsciiSet.h | ||
static void SetImpl
(
InitData& Bitset, |
Misc/AsciiSet.h | ||
static const CharType * Skip
(
const CharType* Str, |
Find first character of string outside of set. Never returns null. | Misc/AsciiSet.h | |
static InitData StringToBitset
(
const CharType(&) Chars |
Misc/AsciiSet.h | ||
static StringType TrimPrefixWith
(
const StringType& Str, |
Trim initial characters in set | Misc/AsciiSet.h | |
static StringType TrimPrefixWithout
(
const StringType& Str, |
Trim initial characters not in set | Misc/AsciiSet.h | |
static StringType TrimSuffixWith
(
const StringType& Str, |
Trim trailing characters in set | Misc/AsciiSet.h | |
static StringType TrimSuffixWithout
(
const StringType& Str, |
Trim trailing characters not in set | Misc/AsciiSet.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Create new set containing only the characters that exist in both this and another specified set | Misc/AsciiSet.h | ||
| Create new set containing the combination of this set and another | Misc/AsciiSet.h | ||
FAsciiSet operator~() |
Create new set containing inverse set of characters - likely including null-terminator | Misc/AsciiSet.h | |
FAsciiSet operator+
(
char Char |
Create new set with specified character in it | Misc/AsciiSet.h |