teditor
1.8.0@@fee5e94
Terminal based editor written in C++
|
Go to the documentation of this file.
3 #include <unordered_map>
12 Node(): nodes(), isLeaf(false), leafData() {}
18 bool leaf()
const {
return isLeaf; }
19 const std::string&
data() {
return leafData; }
23 std::unordered_map<std::string, Node*> nodes;
33 void add(
const std::string& keys,
const std::string& str);
34 void del(
const std::string& keys);
Strings split(const std::string &str, char delim)
Definition: utils.cpp:48
Node * getRoot()
Definition: trie.h:35
const std::string & data()
Definition: trie.h:19
void makeLeaf(const std::string &d)
Definition: trie.cpp:47
Node * addNode(const std::string &key)
Definition: trie.cpp:8
Node()
Definition: trie.h:12
~Trie()
Definition: trie.cpp:19
std::vector< std::string > Strings
Definition: utils.h:42
void add(const std::string &keys, const std::string &str)
Definition: trie.cpp:59
#define ASSERT(check, fmt,...)
Macro to assert with runtime_error exception if the check fails.
Definition: utils.h:35
void delNode(const Strings &keys, size_t pos)
Definition: trie.cpp:29
void clear()
Definition: trie.cpp:53
Node * getNode(const std::string &key)
Definition: trie.cpp:24
~Node()
Definition: trie.h:13
Trie()
Definition: trie.h:31
void clear()
Definition: trie.h:36
void del(const std::string &keys)
Definition: trie.cpp:73
bool leaf() const
Definition: trie.h:18