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 | |
|---|---|---|---|
| constexpr bool | Contains
(
CharType Char |
Returns true if a character is part of the set | |
| constexpr const CharType * | FindFirstOrEnd
(
const CharType* Str, |
Find first character of string inside set or end pointer. Never returns null. | |
| constexpr const CharType * | FindLastOrEnd
(
const CharType* Str, |
Find last character of string inside set or end pointer. Never returns null. | |
| constexpr StringType | FindPrefixWith
(
const StringType& Str, |
Get initial substring with all characters in set | |
| constexpr StringType | FindPrefixWithout
(
const StringType& Str, |
Get initial substring with no characters in set | |
| constexpr StringType | FindSuffixWith
(
const StringType& Str, |
Get trailing substring with all characters in set | |
| constexpr StringType | FindSuffixWithout
(
const StringType& Str, |
Get trailing substring with no characters in set | |
| constexpr bool | Test if string contains any character in set | ||
| constexpr bool | Test if string contains any character in set | ||
| constexpr bool | Test if string contains no character in set | ||
| constexpr bool | Test if string contains no character in set | ||
| constexpr bool | Test if string contains any character outside of set | ||
| constexpr bool | Test if string contains any character outside of set | ||
| constexpr const CharType * | Find first character of string outside of set. Never returns null. | ||
| constexpr uint64 | Test
(
CharType Char |
Returns non-zero if a character is part of the set. | |
| constexpr StringType | TrimPrefixWith
(
const StringType& Str, |
Trim initial characters in set | |
| constexpr StringType | TrimPrefixWithout
(
const StringType& Str, |
Trim initial characters not in set | |
| constexpr StringType | TrimSuffixWith
(
const StringType& Str, |
Trim trailing characters in set | |
| constexpr StringType | TrimSuffixWithout
(
const StringType& Str, |
Trim trailing characters not in set |
Operators
| Type | Name | Description | |
|---|---|---|---|
| constexpr FAsciiSet | operator~ () |
Create new set containing inverse set of characters - likely including null-terminator | |
| constexpr FAsciiSet | operator+
(
char Char |
Create new set with specified character in it |
Enums
Constants
| Name | Description |
|---|---|
| NilMask |