-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompleter.hpp
More file actions
43 lines (34 loc) · 845 Bytes
/
completer.hpp
File metadata and controls
43 lines (34 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef __COMPLETER_H__
#define __COMPLETER_H__
#include <readline/history.h>
#include <readline/readline.h>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Node {
public:
char chr;
vector<Node *> children;
Node(const char);
~Node();
};
class Completer {
public:
Node *root;
Completer();
~Completer();
void init();
void insert_word(Node *, const char *, int);
void insert_word(const string &);
void display_paths(Node *, string, const string &);
void get_completions(Node *, string, vector<string> &, const string &);
char **get_completions(string);
void show_completions(string);
Node *find(Node *, const char *);
};
// utils prototypes
void dump_dot(Node *);
void load_commands(Completer &);
void load_words(Completer &, const string &);
#endif