Commander-API V3.0.0
Lightweight Command Parser
Loading...
Searching...
No Matches
AutoComplete Class Reference

#include <Commander-Autocomplete.hpp>

Collaboration diagram for AutoComplete:

Classes

struct  TrieElement_t
 

Public Member Functions

 AutoComplete (TrieElement_t *trie_p)
 
void searchRecursive (int current_index, char *key, int key_size)
 
int searchLastMatchingNode (const char *key)
 
int generateHint (const char *key_p, char *buffer_p, int buffer_size_p)
 
const char * getResult (int index, bool only_remaining_chars=false)
 

Private Attributes

TrieElement_ttrie = NULL
 
char * buffer
 
int buffer_size
 
int input_data_size
 
int work_buffer_size
 
int result_buffer_start
 
int result_buffer_counter
 
const char * result_pointers [AUTOCOMPLETE_RESULT_SIZE]
 
int result_counter
 

Static Private Attributes

static const char empty_result = '\0'
 

Detailed Description

Definition at line 48 of file Commander-Autocomplete.hpp.

Constructor & Destructor Documentation

◆ AutoComplete()

AutoComplete::AutoComplete ( TrieElement_t trie_p)

Definition at line 39 of file Commander-Autocomplete.cpp.

Member Function Documentation

◆ generateHint()

int AutoComplete::generateHint ( const char *  key_p,
char *  buffer_p,
int  buffer_size_p 
)

Definition at line 156 of file Commander-Autocomplete.cpp.

Here is the call graph for this function:

◆ getResult()

const char * AutoComplete::getResult ( int  index,
bool  only_remaining_chars = false 
)

Definition at line 191 of file Commander-Autocomplete.cpp.

◆ searchLastMatchingNode()

int AutoComplete::searchLastMatchingNode ( const char *  key)

Definition at line 112 of file Commander-Autocomplete.cpp.

Here is the caller graph for this function:

◆ searchRecursive()

void AutoComplete::searchRecursive ( int  current_index,
char *  key,
int  key_size 
)

Definition at line 47 of file Commander-Autocomplete.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ buffer

char* AutoComplete::buffer
private

Definition at line 69 of file Commander-Autocomplete.hpp.

◆ buffer_size

int AutoComplete::buffer_size
private

Definition at line 70 of file Commander-Autocomplete.hpp.

◆ empty_result

const char AutoComplete::empty_result = '\0'
staticprivate

Definition at line 77 of file Commander-Autocomplete.hpp.

◆ input_data_size

int AutoComplete::input_data_size
private

Definition at line 71 of file Commander-Autocomplete.hpp.

◆ result_buffer_counter

int AutoComplete::result_buffer_counter
private

Definition at line 76 of file Commander-Autocomplete.hpp.

◆ result_buffer_start

int AutoComplete::result_buffer_start
private

Definition at line 74 of file Commander-Autocomplete.hpp.

◆ result_counter

int AutoComplete::result_counter
private

Definition at line 79 of file Commander-Autocomplete.hpp.

◆ result_pointers

const char* AutoComplete::result_pointers[AUTOCOMPLETE_RESULT_SIZE]
private

Definition at line 78 of file Commander-Autocomplete.hpp.

◆ trie

TrieElement_t* AutoComplete::trie = NULL
private

Definition at line 68 of file Commander-Autocomplete.hpp.

◆ work_buffer_size

int AutoComplete::work_buffer_size
private

Definition at line 73 of file Commander-Autocomplete.hpp.