Flutter Engine
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. More...
 
bool Query (const char *argument)
 Returns true if argument is prefixed by the contents of the trie. More...
 

Static Public Attributes

static const int kMaxAsciiValue = 128
 The max Ascii value. More...
 

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 17 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 34 of file ascii_trie.cc.

References fml::AsciiTrie::TrieNode::children, FML_DCHECK, and Query().

Referenced by TEST().

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

◆ 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.

Referenced by Fill(), and TEST().

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

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: