Module |
|
Header |
/Engine/Source/Runtime/Core/Public/Misc/AsciiSet.h |
Include |
#include "Misc/AsciiSet.h" |
class FAsciiSet
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;
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 | Description | |
---|---|---|
|
FAsciiSet ( |
Name | Description | ||
---|---|---|---|
|
constexpr bo... |
Contains ( |
Returns true if a character is part of the set |
|
constexpr co... |
FindFirstOrEnd ( |
Find first character of string inside set or end pointer. Never returns null. |
|
constexpr co... |
FindLastOrEnd ( |
Find last character of string inside set or end pointer. Never returns null. |
|
constexpr bo... |
HasAny ( |
Test if string contains any character in set |
|
constexpr bo... |
HasNone ( |
Test if string contains no character in set |
|
constexpr bo... |
HasOnly ( |
Test if string contains any character outside of set |
|
constexpr co... |
Skip ( |
Find first character of string outside of set. Never returns null. |
|
constexpr ui... |
Test ( |
Returns non-zero if a character is part of the set. |
Name | Description | ||
---|---|---|---|
|
constexpr FA... |
operator~() |
Create new set containing inverse set of characters - likely including null-terminator |
|
constexpr FA... |
operator+ ( |
Create new set with specified character in it |
Name |
Description |
---|---|
NilMask |