semf
semf::esh::History Class Reference

Manages the shell's history. More...

#include <history.h>

Collaboration diagram for semf::esh::History:
Collaboration graph

Public Member Functions

 History (char *historyBuffer, size_t numberOfEntries, size_t lineSize)
 Constructor. More...
 
 History (const History &other)=delete
 
virtual ~History ()=default
 
void insert (std::string_view command)
 Inserts a command. More...
 
void handleArrowUp (char commandBuffer[])
 Performes a lookup based on an up-arrow key stroke. More...
 
void handleArrowDown (char commandBuffer[])
 Performes a lookup based on an down-arrow key stroke. More...
 

Detailed Description

Manages the shell's history.

Definition at line 23 of file history.h.

Constructor & Destructor Documentation

◆ History() [1/2]

semf::esh::History::History ( char *  historyBuffer,
size_t  numberOfEntries,
size_t  lineSize 
)

Constructor.

Parameters
historyBufferBuffer for storing the history. The size of this buffer should be historySize * lineSize .
numberOfEntriesNumber of history entries.
lineSizeSize of a single history entry.

Definition at line 18 of file history.cpp.

◆ History() [2/2]

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

◆ ~History()

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

Member Function Documentation

◆ handleArrowDown()

void semf::esh::History::handleArrowDown ( char  commandBuffer[])

Performes a lookup based on an down-arrow key stroke.

Parameters
commandBuffer[out] Buffer to store the result.
Note
It is assumed that the size of commandBuffer is m_lineSize .

Definition at line 52 of file history.cpp.

◆ handleArrowUp()

void semf::esh::History::handleArrowUp ( char  commandBuffer[])

Performes a lookup based on an up-arrow key stroke.

Parameters
commandBuffer[out] Buffer to store the result.
Note
It is assumed that the size of commandBuffer is m_lineSize .

Definition at line 37 of file history.cpp.

◆ insert()

void semf::esh::History::insert ( std::string_view  command)

Inserts a command.

Parameters
commandCommand to insert.

Definition at line 25 of file history.cpp.