OpenTTD Source  20240919-master-gdf0233f4c2
AutoCompletion Class Referenceabstract
Inheritance diagram for AutoCompletion:
ConsoleAutoCompletion NetworkChatAutoCompletion

Public Member Functions

 AutoCompletion (Textbuf *textbuf)
 
bool AutoComplete ()
 
void Reset ()
 

Protected Attributes

Textbuftextbuf
 

Private Member Functions

void InitSuggestions (std::string_view text)
 
virtual std::vector< std::string > GetSuggestions (std::string_view prefix, std::string_view query)=0
 
virtual void ApplySuggestion (std::string_view prefix, std::string_view suggestion)=0
 

Private Attributes

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
 

Detailed Description

Definition at line 15 of file autocompletion.h.


The documentation for this class was generated from the following files: