Ark Server API (ASA) - Wiki
|
#include <AsciiSet.h>
Classes | |
struct | InitData |
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~ () 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) |
Private Types | |
enum class | EDir { Forward , Reverse } |
enum class | EInclude { Members , NonMembers } |
enum class | EKeep { Head , Tail } |
Private Member Functions | |
constexpr FORCEINLINE uint64 | TestImpl (uint32 Char) const |
constexpr | FAsciiSet (InitData Bitset) |
constexpr | FAsciiSet (uint64 Lo, uint64 Hi) |
Static Private Member Functions | |
template<EInclude Include, typename CharType > | |
static constexpr const CharType * | FindFirst (FAsciiSet Set, const CharType *It, const CharType *End) |
template<EInclude Include, typename CharType > | |
static constexpr const CharType * | FindLast (FAsciiSet Set, const CharType *It, const CharType *End) |
template<EDir Dir, EInclude Include, EKeep Keep, class StringType > | |
static constexpr StringType | Scan (const StringType &Str, FAsciiSet Set) |
static constexpr FORCEINLINE void | SetImpl (InitData &Bitset, uint32 Char) |
template<typename CharType , int N> | |
static constexpr InitData | StringToBitset (const CharType(&Chars)[N]) |
Private Attributes | |
uint64 | LoMask |
uint64 | HiMask |
Static Private Attributes | |
static constexpr uint64 | NilMask = uint64(1) << '\0' |
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;
Definition at line 29 of file AsciiSet.h.
|
strongprivate |
Enumerator | |
---|---|
Forward | |
Reverse |
Definition at line 209 of file AsciiSet.h.
|
strongprivate |
Enumerator | |
---|---|
Members | |
NonMembers |
Definition at line 210 of file AsciiSet.h.
|
strongprivate |
Enumerator | |
---|---|
Head | |
Tail |
Definition at line 211 of file AsciiSet.h.
Definition at line 33 of file AsciiSet.h.
Definition at line 274 of file AsciiSet.h.
Definition at line 278 of file AsciiSet.h.
|
inlineconstexpr |
Returns true if a character is part of the set
Definition at line 39 of file AsciiSet.h.
|
inlinestaticconstexprprivate |
Definition at line 214 of file AsciiSet.h.
|
inlinestaticconstexpr |
Find first character of string inside set or end pointer. Never returns null.
Definition at line 69 of file AsciiSet.h.
|
inlinestaticconstexprprivate |
Definition at line 221 of file AsciiSet.h.
|
inlinestaticconstexpr |
Find last character of string inside set or end pointer. Never returns null.
Definition at line 78 of file AsciiSet.h.
|
inlinestaticconstexpr |
Get initial substring with all characters in set
Definition at line 127 of file AsciiSet.h.
|
inlinestaticconstexpr |
Get initial substring with no characters in set
Definition at line 134 of file AsciiSet.h.
|
inlinestaticconstexpr |
Get trailing substring with all characters in set
Definition at line 155 of file AsciiSet.h.
|
inlinestaticconstexpr |
Get trailing substring with no characters in set
Definition at line 162 of file AsciiSet.h.
|
inlinestaticconstexpr |
Test if string contains any character in set
Definition at line 104 of file AsciiSet.h.
|
inlinestaticconstexpr |
Test if string contains any character in set
Definition at line 183 of file AsciiSet.h.
|
inlinestaticconstexpr |
Test if string contains no character in set
Definition at line 111 of file AsciiSet.h.
|
inlinestaticconstexpr |
Test if string contains no character in set
Definition at line 190 of file AsciiSet.h.
|
inlinestaticconstexpr |
Test if string contains any character outside of set
Definition at line 118 of file AsciiSet.h.
|
inlinestaticconstexpr |
Test if string contains any character outside of set
Definition at line 202 of file AsciiSet.h.
|
inlineconstexpr |
Create new set with specified character in it
Definition at line 52 of file AsciiSet.h.
|
inlineconstexpr |
Create new set containing inverse set of characters - likely including null-terminator
Definition at line 60 of file AsciiSet.h.
|
inlinestaticconstexprprivate |
Definition at line 228 of file AsciiSet.h.
|
inlinestaticconstexprprivate |
Definition at line 243 of file AsciiSet.h.
|
inlinestaticconstexpr |
Find first character of string outside of set. Never returns null.
Definition at line 92 of file AsciiSet.h.
|
inlinestaticconstexprprivate |
Definition at line 263 of file AsciiSet.h.
|
inlineconstexpr |
Returns non-zero if a character is part of the set. Prefer Contains() to avoid VS2019 conversion warnings.
Definition at line 46 of file AsciiSet.h.
|
inlineconstexprprivate |
Definition at line 253 of file AsciiSet.h.
|
inlinestaticconstexpr |
Trim initial characters in set
Definition at line 141 of file AsciiSet.h.
|
inlinestaticconstexpr |
Trim initial characters not in set
Definition at line 148 of file AsciiSet.h.
|
inlinestaticconstexpr |
Trim trailing characters in set
Definition at line 169 of file AsciiSet.h.
|
inlinestaticconstexpr |
Trim trailing characters not in set
Definition at line 176 of file AsciiSet.h.
|
private |
Definition at line 282 of file AsciiSet.h.
|
private |
Definition at line 282 of file AsciiSet.h.
Definition at line 241 of file AsciiSet.h.