HAL
hal::PythonConsoleHistory Class Reference

Stores the history of python commands. More...

#include <python_console_history.h>

Collaboration diagram for hal::PythonConsoleHistory:
Collaboration graph

Public Member Functions

 PythonConsoleHistory ()
 
 ~PythonConsoleHistory ()
 
void addHistory (const std::string &command)
 
const std::string & getHistoryItem (const int &index) const
 
int size () const
 
void updateFromFile ()
 

Detailed Description

Stores the history of python commands.

This class manages the history of python console inputs. It can be used to access previous inputs.

Definition at line 39 of file python_console_history.h.

Constructor & Destructor Documentation

◆ PythonConsoleHistory()

hal::PythonConsoleHistory::PythonConsoleHistory ( )

Constructs a new PythonConsoleHistory object.

Definition at line 9 of file python_console_history.cpp.

References updateFromFile().

◆ ~PythonConsoleHistory()

hal::PythonConsoleHistory::~PythonConsoleHistory ( )

The destructor.

Definition at line 14 of file python_console_history.cpp.

Member Function Documentation

◆ addHistory()

void hal::PythonConsoleHistory::addHistory ( const std::string &  command)

Add command to history and writes it back to the history file.

Parameters
command- Command to remember

Definition at line 18 of file python_console_history.cpp.

References control::command.

◆ getHistoryItem()

const std::string & hal::PythonConsoleHistory::getHistoryItem ( const int &  index) const

Returns the history item at index.

Parameters
index- Index of the history item to resolve.
Returns
command at index.

Definition at line 24 of file python_console_history.cpp.

◆ size()

int hal::PythonConsoleHistory::size ( ) const

Get the current size of the index;

Returns
- History size.

Definition at line 29 of file python_console_history.cpp.

◆ updateFromFile()

void hal::PythonConsoleHistory::updateFromFile ( )

Reloads the history from the history file.

Definition at line 34 of file python_console_history.cpp.

Referenced by PythonConsoleHistory().


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