-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandProcessor.h
More file actions
32 lines (26 loc) · 1.32 KB
/
CommandProcessor.h
File metadata and controls
32 lines (26 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Конструкторы
CommandProcessor();
template <uint COMMAND_COUNT> CommandProcessor(Command (&aCommandList)[COMMAND_COUNT]);
// Основной цикл обработки ввода
CommandProcessor& readInput();
void processCommand();
// Управление буфером и состоянием
CommandProcessor& resetBuffer();
CommandProcessor& setTerminator(char terminator);
CommandProcessor& setTrimSpaces(bool enable);
// Работа с командами
Command* findCommand(const char *name);
CommandProcessor& showSimilarCommands(const char *filter);
template <uint COMMAND_COUNT> CommandProcessor& setCommands(Command (&commands)[COMMAND_COUNT]);
CommandProcessor& setCommands(Command *commands, uint count);
// Работа с токенами (аргументами)
char* getToken(uint index);
char* operator[](uint index);
int getArgumentCount() const;
// Настройка интерфейса пользователя
CommandProcessor& setPrompt(const char* prompt);
CommandProcessor& showWelcome();
CommandProcessor& setDebugMode(bool enable);
// Вспомогательные методы (опционально, можно показать как пример "продвинутости")
CommandProcessor& tokenizeInput(int expectedArgs = -1);
CommandProcessor& extractFirstToken(uint *firstWordEnd);