25 #ifndef COMMON_READLINE_H 26 #define COMMON_READLINE_H 164 #endif // COMMON_READLINE_H std::list< UString >::iterator position
size_t _historySizeCurrent
Current size of the history.
ReadLine(size_t historySize)
bool _overwrite
Overwrite instead of insert?
std::list< UString >::iterator _historyPosition
The current browsing position within the history.
ArgumentSets _arguments
All know tab-completable command arguments.
A class holding an UTF-8 string.
bool _historyIgnoreSpace
Should we not remember input beginning with spaces?
size_t _cursorPosition
The current cursor position.
size_t findLastWordStart(bool onlySpace=false) const
void addInput(uint32 c)
Add that character to the current input.
std::set< UString > CommandSet
UString _currentLineBak
The backupped input line while we're browsing the history.
bool processKeyDown(const Events::Event &event, UString &command)
utf8::iterator< std::string::const_iterator > iterator
CommandSet _commands
All known tab-completable commands.
bool processEvent(const Events::Event &event, UString &command)
Process that given events.
const std::vector< UString > & getCompleteHint(size_t &maxSize) const
Return the current tab-completion hints.
static bool isWordCharacter(uint32 c, bool onlySpace=false)
void historyEraseDups(bool eraseDups)
Erase all lines matching the line to be saved.
UString::iterator getCurrentPosition() const
void setArguments(const UString &command, const std::vector< UString > &arguments)
Set the tab-completable arguments for a command.
Low-level type definitions to handle fixed width types portably.
bool _historyEraseDups
Should we actively remove duplicate lines?
void historyIgnoreDups(bool ignoreDups)
Don't save lines matching the bottom of the history.
std::list< UString > _history
The history of previous input lines.
size_t _historySizeMax
Max size of the history.
void historyIgnoreSpace(bool ignoreSpace)
Don't save lines starting with a space.
void addCommand(const UString &command)
Add a command that can be tab-completed.
size_t getCursorPosition() const
Return the current cursor position within the input line.
bool getOverwrite() const
Return whether we're current in overwrite mode.
void clearHistory()
Clear the input history.
void addCurrentLineToHistory()
size_t _maxHintSize
Max size of a current command candidates.
std::vector< UString > _completeHint
Current possible command candidates for the input line.
std::list< HistorySave > _historySave
Saved copies of modified history lines.
bool _historyIgnoreDups
Should we not remember duplicate lines?
size_t findNextWordEnd(bool onlySpace=false) const
static UString findCommonSubstring(const std::list< UString > &strings)
std::map< UString, CommandSet > ArgumentSets
UString _currentLine
The current input line.
std::list< HistorySave >::iterator findHistorySave()
bool processTextInput(const Events::Event &event, UString &command)
const UString & getCurrentLine() const
Return the current input line.