semf
semf::esh::Tabulator Class Reference

Handles the command auto completion. More...

#include <tabulator.h>

Collaboration diagram for semf::esh::Tabulator:
Collaboration graph

Public Types

enum class  ErrorCode : uint8_t { Start_IsBusy = 0 }
 Error codes for this class. Error ID identify a unique error() / onError call (excluding transferring). More...
 

Public Member Functions

 Tabulator (Printer &printer, const LinkedList< Command > &commands, char lineBuffer[], size_t lineBufferSize, std::string_view prompt)
 Constructor. More...
 
 Tabulator (const Tabulator &other)=delete
 
virtual ~Tabulator ()=default
 
void start (size_t charCount)
 Starts the auto completion. More...
 
bool isBusy () const
 Returns the busy-flag. More...
 
 SEMF_SIGNAL (done, size_t)
 
 SEMF_SIGNAL (error, Error)
 

Detailed Description

Handles the command auto completion.

Definition at line 27 of file tabulator.h.

Member Enumeration Documentation

◆ ErrorCode

enum class semf::esh::Tabulator::ErrorCode : uint8_t
strong

Error codes for this class. Error ID identify a unique error() / onError call (excluding transferring).

Enumerator
Start_IsBusy 

Definition at line 33 of file tabulator.h.

Constructor & Destructor Documentation

◆ Tabulator() [1/2]

semf::esh::Tabulator::Tabulator ( Printer printer,
const LinkedList< Command > &  commands,
char  lineBuffer[],
size_t  lineBufferSize,
std::string_view  prompt 
)

Constructor.

Parameters
printerPrinter for printing.
commandsList containing all commands.
lineBufferbuffer containing the command line.
lineBufferSizeSize of lineBuffer .
promptPrompt string.

Definition at line 15 of file tabulator.cpp.

◆ Tabulator() [2/2]

semf::esh::Tabulator::Tabulator ( const Tabulator other)
delete

◆ ~Tabulator()

virtual semf::esh::Tabulator::~Tabulator ( )
virtualdefault

Member Function Documentation

◆ isBusy()

bool semf::esh::Tabulator::isBusy ( ) const

Returns the busy-flag.

Returns
true of object is busy.

Definition at line 39 of file tabulator.cpp.

◆ SEMF_SIGNAL() [1/2]

semf::esh::Tabulator::SEMF_SIGNAL ( done  ,
size_t   
)

Gets emitted when the auto complete process is done.

◆ SEMF_SIGNAL() [2/2]

semf::esh::Tabulator::SEMF_SIGNAL ( error  ,
Error   
)

Gets emitted when an unexpected error occures.

◆ start()

void semf::esh::Tabulator::start ( size_t  charCount)

Starts the auto completion.

Parameters
charCountCurrent length of the command line.
Exceptions
Start_IsBusyIf object is busy.

Definition at line 24 of file tabulator.cpp.