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

#include <clisession.h>

Inheritance diagram for cli::CliSession:

Public Member Functions

 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

Detailed Description

Definition at line 50 of file clisession.h.

Constructor & Destructor Documentation

◆ CliSession() [1/3]

cli::CliSession::CliSession ( Cli & _cli,
std::ostream & _out,
std::size_t historySize = 100 )
inline

Definition at line 132 of file clisession.h.

Here is the caller graph for this function:

◆ ~CliSession()

cli::CliSession::~CliSession ( )
inlinevirtualnoexcept

Definition at line 371 of file clisession.h.

◆ CliSession() [2/3]

cli::CliSession::CliSession ( const CliSession & )
delete

◆ CliSession() [3/3]

cli::CliSession::CliSession ( CliSession && )
delete

Member Function Documentation

◆ Current()

void cli::CliSession::Current ( Menu * menu)
inline

Definition at line 364 of file clisession.h.

◆ Enter()

void cli::CliSession::Enter ( )
inline

Definition at line 68 of file clisession.h.

Here is the caller graph for this function:

◆ EnterAction()

void cli::CliSession::EnterAction ( const std::function< void(std::ostream &)> & action)
inline

Definition at line 86 of file clisession.h.

◆ ExecFromHistory()

void cli::CliSession::ExecFromHistory ( unsigned index)
inline

Definition at line 98 of file clisession.h.

◆ Exit()

void cli::CliSession::Exit ( )
inline

Definition at line 75 of file clisession.h.

Here is the caller graph for this function:

◆ ExitAction()

void cli::CliSession::ExitAction ( const std::function< void(std::ostream &)> & action)
inline

Definition at line 91 of file clisession.h.

Here is the caller graph for this function:

◆ Feed()

void cli::CliSession::Feed ( const std::string & cmd)
inline

Definition at line 175 of file clisession.h.

Here is the caller graph for this function:

◆ GetCompletions()

std::vector< std::string > cli::CliSession::GetCompletions ( std::string currentLine) const
inline

Definition at line 264 of file clisession.h.

◆ Help() [1/2]

void cli::CliSession::Help ( ) const
inline

Definition at line 210 of file clisession.h.

◆ Help() [2/2]

void cli::CliSession::Help ( const std::string & commandName) const
inline

Definition at line 239 of file clisession.h.

◆ NextCmd()

std::string cli::CliSession::NextCmd ( )
inline

Definition at line 110 of file clisession.h.

◆ operator=() [1/2]

CliSession & cli::CliSession::operator= ( CliSession && )
delete

◆ operator=() [2/2]

CliSession & cli::CliSession::operator= ( const CliSession & )
delete

◆ OutStream()

std::ostream & cli::CliSession::OutStream ( )
inline

Definition at line 64 of file clisession.h.

Here is the caller graph for this function:

◆ PreviousCmd()

std::string cli::CliSession::PreviousCmd ( const std::string & line)
inline

Definition at line 105 of file clisession.h.

◆ Prompt()

void cli::CliSession::Prompt ( )
inline

Definition at line 200 of file clisession.h.

Here is the caller graph for this function:

◆ ShowHistory()

void cli::CliSession::ShowHistory ( ) const
inline

Definition at line 96 of file clisession.h.

◆ TerminalWidth()

virtual std::size_t cli::CliSession::TerminalWidth ( ) const
inlineprotectedvirtual

Reimplemented in cli::CliLocalTerminalSession.

Definition at line 118 of file clisession.h.

Here is the caller graph for this function:

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