engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | 所有成员列表
FAsciiSet类 参考

ASCII character bitset useful for fast and readable parsing 更多...

#include <AsciiSet.h>

Public 成员函数

template<typename CharType >
constexpr FORCEINLINE bool Contains (CharType Char) const
 Returns true if a character is part of the set
 
constexpr FORCEINLINE FAsciiSet operator+ (char Char) const
 Create new set with specified character in it
 
constexpr FORCEINLINE FAsciiSet operator~ () const
 Create new set containing inverse set of characters - likely including null-terminator
 
template<typename CharType >
constexpr FORCEINLINE uint64 Test (CharType Char) const
 Returns non-zero if a character is part of the set. 更多...
 

静态 Public 成员函数

template<class CharType >
static constexpr const CharType * FindFirstOrEnd (const CharType *Str, FAsciiSet Set)
 Find first character of string inside set or end pointer. 更多...
 
template<class CharType >
static constexpr const CharType * FindLastOrEnd (const CharType *Str, FAsciiSet Set)
 Find last character of string inside set or end pointer. 更多...
 
template<typename CharType >
static constexpr bool HasAny (const CharType *Str, FAsciiSet Set)
 Test if string contains any character in set
 
template<typename CharType >
static constexpr bool HasNone (const CharType *Str, FAsciiSet Set)
 Test if string contains no character in set
 
template<typename CharType >
static constexpr bool HasOnly (const CharType *Str, FAsciiSet Set)
 Test if string contains any character outside of set
 
template<typename CharType >
static constexpr const CharType * Skip (const CharType *Str, FAsciiSet Set)
 Find first character of string outside of set. 更多...
 

详细描述

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;

成员函数说明

◆ FindFirstOrEnd()

template<class CharType >
static constexpr const CharType * FAsciiSet::FindFirstOrEnd ( const CharType *  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Find first character of string inside set or end pointer.

Never returns null.

◆ FindLastOrEnd()

template<class CharType >
static constexpr const CharType * FAsciiSet::FindLastOrEnd ( const CharType *  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Find last character of string inside set or end pointer.

Never returns null.

◆ Skip()

template<typename CharType >
static constexpr const CharType * FAsciiSet::Skip ( const CharType *  Str,
FAsciiSet  Set 
)
inlinestaticconstexpr

Find first character of string outside of set.

Never returns null.

◆ Test()

template<typename CharType >
constexpr FORCEINLINE uint64 FAsciiSet::Test ( CharType  Char) const
inlineconstexpr

Returns non-zero if a character is part of the set.

Prefer Contains() to avoid VS2019 conversion warnings.


该类的文档由以下文件生成: