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