|
Interactive CLI 2.3
A cross-platform C++14 library for interactive command-line interfaces
|
CliLocalTerminalSession represents a local session. You should instantiate it to start an interactive prompt on the standard input/output of your application. The handlers of the commands will be invoked in the same thread the Scheduler runs.
More...
#include <clilocalsession.h>

Public Member Functions | |
| CliLocalTerminalSession (Cli &_cli, Scheduler &scheduler, std::ostream &_out, std::size_t historySize=100) | |
Construct a new Cli Local Terminal Session object that uses the specified std::ostream for output. You can also specify a size for the command history. | |
| Public Member Functions inherited from cli::CliSession | |
| CliSession (Cli &_cli, std::ostream &_out, std::size_t historySize=100) | |
| virtual | ~CliSession () noexcept |
| CliSession (const CliSession &)=delete | |
| CliSession & | operator= (const CliSession &)=delete |
| CliSession (CliSession &&)=delete | |
| CliSession & | operator= (CliSession &&)=delete |
| void | Feed (const std::string &cmd) |
| void | Prompt () |
| void | Current (Menu *menu) |
| std::ostream & | OutStream () |
| void | Help () const |
| void | Help (const std::string &commandName) const |
| void | Enter () |
| void | Exit () |
| void | EnterAction (const std::function< void(std::ostream &)> &action) |
| void | ExitAction (const std::function< void(std::ostream &)> &action) |
| void | ShowHistory () const |
| void | ExecFromHistory (unsigned index) |
| std::string | PreviousCmd (const std::string &line) |
| std::string | NextCmd () |
| std::vector< std::string > | GetCompletions (std::string currentLine) const |
Protected Member Functions | |
| virtual std::size_t | TerminalWidth () const override |
CliLocalTerminalSession represents a local session. You should instantiate it to start an interactive prompt on the standard input/output of your application. The handlers of the commands will be invoked in the same thread the Scheduler runs.
Definition at line 50 of file clilocalsession.h.
|
inline |
Construct a new Cli Local Terminal Session object that uses the specified std::ostream for output. You can also specify a size for the command history.
| _cli | The cli object that defines the menu hierarchy for this session |
| scheduler | The scheduler that will process the command handlers |
| _out | the output stream where command output will be printed |
| historySize | the size of the command history |
Definition at line 63 of file clilocalsession.h.
|
inlineoverrideprotectedvirtual |
Reimplemented from cli::CliSession.
Definition at line 73 of file clilocalsession.h.