12 #ifndef __UT_FSATable__
13 #define __UT_FSATable__
18 template <
typename T,
int DEFAULT_TOKEN = -1>
30 template <
typename... Args>
33 insertTokens(token, symbol,
args...);
43 if (symbol && myFSA.
findSymbol(symbol, &token))
45 return (
T)DEFAULT_TOKEN;
50 if (symbol && myFSA.
findSymbol(symbol, &token))
52 return (
T)DEFAULT_TOKEN;
66 if (idx >= 0 && idx < myTokens.
entries() && myTokens(idx))
84 int count(
const char *symbol)
const
85 {
return myFSA.
count(symbol); }
96 template <
typename... Args>
98 insertTokens(
T token,
const char *symbol, Args...
args)
100 insertToken(token, symbol);
101 insertTokens(
args...);
105 insertToken(
T token,
const char *symbol)
114 int idx =
static_cast<int>(token);
120 myTokens(idx) = symbol;
123 myTokens.
insert(symbol, idx);
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
bool contains(const char *symbol) const
int findSymbol(const char *symbol, ITEM_T *datap) const
UT_FSATableT()
Empty table constructor.
void extractStrings(UT_StringArray &list) const
Extract all strings.
int64 getMemoryUsage(bool inclusive=false) const
int count(const char *symbol) const
T findSymbol(const UT_String &symbol) const
const char * c_str() const
const char * getToken(T token) const
void extractStrings(UT_StringArray &list) const
A utility class to do read-only operations on a subset of an existing string.
bool count(const char *symbol) const
T findSymbol(const UT_StringRef &symbol) const
T findSymbol(const UT_StringView &symbol) const
int64 getMemoryUsage(bool inclusive) const
exint entries() const
Alias of size(). size() is preferred.
bool contains(const char *symbol) const
UT_FSATableT(T token, const char *symbol, Args...args)
UT_FSATableT< int,-1 > UT_FSATable
**If you just want to fire and args
int64 getMemUsage() const
Returns the memory usage of this object.
T findSymbol(const char *symbol) const
exint insert(exint index)
const char * addSymbol(const char *symbol, const ITEM_T &data)