Interactive CLI 2.3
A cross-platform C++14 library for interactive command-line interfaces
Loading...
Searching...
No Matches
cli::CliLocalTerminalSession Class Reference

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>

Inheritance diagram for cli::CliLocalTerminalSession:

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ CliLocalTerminalSession()

cli::CliLocalTerminalSession::CliLocalTerminalSession ( Cli & _cli,
Scheduler & scheduler,
std::ostream & _out,
std::size_t historySize = 100 )
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.

Parameters
_cliThe cli object that defines the menu hierarchy for this session
schedulerThe scheduler that will process the command handlers
_outthe output stream where command output will be printed
historySizethe size of the command history

Definition at line 63 of file clilocalsession.h.

Member Function Documentation

◆ TerminalWidth()

virtual std::size_t cli::CliLocalTerminalSession::TerminalWidth ( ) const
inlineoverrideprotectedvirtual

Reimplemented from cli::CliSession.

Definition at line 73 of file clilocalsession.h.


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