|
| void | InitSuggestions (std::string_view text) |
| virtual std::vector< std::string > | GetSuggestions (std::string_view prefix, std::string_view query)=0 |
| | Get suggestions for auto completion with the given 'query' input text.
|
| virtual void | ApplySuggestion (std::string_view prefix, std::string_view suggestion)=0 |
| | Format the given suggestion after the given prefix, and write that to the buffer.
|
|
| std::string | initial_buf |
| | Value of text buffer when we started current suggestion session.
|
| std::string_view | prefix |
| | Prefix of the text before the last space.
|
| std::string_view | query |
| | Last token of the text. This is used to based the suggestions on.
|
| std::vector< std::string > | suggestions |
| size_t | current_suggestion_index |
Definition at line 15 of file autocompletion.h.
◆ AutoCompletion()
| AutoCompletion::AutoCompletion |
( |
Textbuf * | textbuf | ) |
|
|
inline |
◆ ApplySuggestion()
| virtual void AutoCompletion::ApplySuggestion |
( |
std::string_view | prefix, |
|
|
std::string_view | suggestion ) |
|
privatepure virtual |
Format the given suggestion after the given prefix, and write that to the buffer.
For example, in case of a name in chat format '{name}: ' when the prefix is empty, otherwise '{prefix}{name}'.
- Parameters
-
| prefix | The text before the token that was auto completed on. |
| suggestion | The chosen suggestion. |
Implemented in ConsoleAutoCompletion, and NetworkChatAutoCompletion.
References prefix.
Referenced by AutoComplete().
◆ AutoComplete()
| bool AutoCompletion::AutoComplete |
( |
| ) |
|
◆ GetSuggestions()
| virtual std::vector< std::string > AutoCompletion::GetSuggestions |
( |
std::string_view | prefix, |
|
|
std::string_view | query ) |
|
privatepure virtual |
◆ InitSuggestions()
| void AutoCompletion::InitSuggestions |
( |
std::string_view | text | ) |
|
|
private |
◆ Reset()
| void AutoCompletion::Reset |
( |
| ) |
|
◆ current_suggestion_index
| size_t AutoCompletion::current_suggestion_index |
|
private |
◆ initial_buf
| std::string AutoCompletion::initial_buf |
|
private |
◆ prefix
| std::string_view AutoCompletion::prefix |
|
private |
◆ query
| std::string_view AutoCompletion::query |
|
private |
◆ suggestions
| std::vector<std::string> AutoCompletion::suggestions |
|
private |
◆ textbuf
The documentation for this class was generated from the following files: