Flutter Engine
 
Loading...
Searching...
No Matches
fml::AsciiTrie Class Reference

A trie for looking for ASCII prefixes. More...

#include <ascii_trie.h>

Classes

struct  TrieNode
 

Public Types

typedef std::unique_ptr< TrieNodeTrieNodePtr
 

Public Member Functions

void Fill (const std::vector< std::string > &entries)
 Clear and insert all the entries into the trie.
 
bool Query (const char *argument)
 Returns true if argument is prefixed by the contents of the trie.
 

Static Public Attributes

static const int kMaxAsciiValue = 128
 The max Ascii value.
 

Detailed Description

A trie for looking for ASCII prefixes.

Definition at line 15 of file ascii_trie.h.

Member Typedef Documentation

◆ TrieNodePtr

typedef std::unique_ptr<TrieNode> fml::AsciiTrie::TrieNodePtr

Definition at line 18 of file ascii_trie.h.

Member Function Documentation

◆ Fill()

void fml::AsciiTrie::Fill ( const std::vector< std::string > &  entries)

Clear and insert all the entries into the trie.

Definition at line 35 of file ascii_trie.cc.

35 {
36 node_ = MakeTrie(entries);
37}

Referenced by TEST(), TEST(), and TEST().

◆ Query()

bool fml::AsciiTrie::Query ( const char *  argument)
inline

Returns true if argument is prefixed by the contents of the trie.

Definition at line 26 of file ascii_trie.h.

26 {
27 return !node_ || Query(node_.get(), argument);
28 }
bool Query(const char *argument)
Returns true if argument is prefixed by the contents of the trie.
Definition ascii_trie.h:26

References Query().

Referenced by Query(), TEST(), TEST(), TEST(), and TEST().

Member Data Documentation

◆ kMaxAsciiValue

const int fml::AsciiTrie::kMaxAsciiValue = 128
static

The max Ascii value.

Definition at line 20 of file ascii_trie.h.


The documentation for this class was generated from the following files: