|
OpenTTD Source 20260206-master-g4d4e37dbf1
|
Public Member Functions | |
| AutoCompletion (Textbuf *textbuf) | |
| Public Member Functions inherited from AutoCompletion | |
| AutoCompletion (Textbuf *textbuf) | |
| bool | AutoComplete () |
| void | Reset () |
Private Member Functions | |
| std::vector< std::string > | GetSuggestions (std::string_view prefix, std::string_view query) override |
| Get suggestions for auto completion with the given 'query' input text. | |
| void | ApplySuggestion (std::string_view prefix, std::string_view suggestion) override |
| Format the given suggestion after the given prefix, and write that to the buffer. | |
Additional Inherited Members | |
| Protected Attributes inherited from AutoCompletion | |
| Textbuf * | textbuf |
Definition at line 74 of file console_gui.cpp.
|
inlineoverrideprivatevirtual |
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}'.
| prefix | The text before the token that was auto completed on. |
| suggestion | The chosen suggestion. |
Implements AutoCompletion.
Definition at line 103 of file console_gui.cpp.
References AutoCompletion::prefix.
|
inline |
Definition at line 29 of file autocompletion.h.
|
inlineoverrideprivatevirtual |
Get suggestions for auto completion with the given 'query' input text.
| prefix | The text before the token that is auto completed on. |
| query | The token to perform the auto completion on. |
Implements AutoCompletion.
Definition at line 79 of file console_gui.cpp.
References AutoCompletion::prefix, AutoCompletion::query, and StringConsumer::WHITESPACE_NO_NEWLINE.