lintel 0.2.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
lintel::CommandLineHistoryService Class Reference

#include <CommandLineHistoryService.h>

Inheritance diagram for lintel::CommandLineHistoryService:
lintel::PropertyRegistration< CommandLineHistoryService > lintel::AbstractService< T > lintel::AbstractServiceInterface

Public Member Functions

 CommandLineHistoryService (const std::shared_ptr< ProcessName > &processName)
 
std::vector< CommandHistoryEntry > allOf ()
 
std::optional< CommandHistoryEntry > nextOf (const std::string &menu)
 
std::optional< CommandHistoryEntry > previousOf (const std::string &menu)
 
std::optional< CommandHistoryEntry > startsWith (const std::string &command, const std::string &menu)
 
void historizeOf (const CommandHistoryEntry &commandHistoryEntry)
 
void onInitialize () override
 
- Public Member Functions inherited from lintel::AbstractService< T >
 AbstractService ()=delete
 
 AbstractService (std::string processName, std::string instanceName)
 
 AbstractService (std::string processName)
 
void onShutdown () override
 
ShutdownPriority shutdownPriorityOf () const override
 
const std::string & getProcessName () const override
 
const std::string & getInstanceName () const override
 
std::string_view getClassName () const override
 
- Public Member Functions inherited from lintel::AbstractServiceInterface
virtual ~AbstractServiceInterface ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from lintel::PropertyRegistration< CommandLineHistoryService >
std::shared_ptr< Property< type > > registerProperty (std::string name, type defaultValue, std::string description, bool runtime, const std::string &fileName, int32_t position)
 
- Protected Attributes inherited from lintel::AbstractService< T >
std::vector< std::shared_ptr< PropertyBase > > m_properties
 

Detailed Description

Service is responsible for the serialization of the entered commands and saving for each user those entered entries. The entered cli command will be saved locally in a bash like text file.

data structure:

Constructor & Destructor Documentation

◆ CommandLineHistoryService()

lintel::CommandLineHistoryService::CommandLineHistoryService ( const std::shared_ptr< ProcessName > &  processName)

Member Function Documentation

◆ allOf()

std::vector< CommandHistoryEntry > lintel::CommandLineHistoryService::allOf ( )

returns all available historized commands

◆ historizeOf()

void lintel::CommandLineHistoryService::historizeOf ( const CommandHistoryEntry &  commandHistoryEntry)

historizes the last entered command in the local file

Parameters
commandHistoryEntryhistory entry

◆ nextOf()

std::optional< CommandHistoryEntry > lintel::CommandLineHistoryService::nextOf ( const std::string &  menu)
Returns
next of history element

◆ onInitialize()

void lintel::CommandLineHistoryService::onInitialize ( )
overridevirtual

Default initialization does nothing; override in subclasses.

Reimplemented from lintel::AbstractService< T >.

◆ previousOf()

std::optional< CommandHistoryEntry > lintel::CommandLineHistoryService::previousOf ( const std::string &  menu)
Returns
previous of history element

◆ startsWith()

std::optional< CommandHistoryEntry > lintel::CommandLineHistoryService::startsWith ( const std::string &  command,
const std::string &  menu 
)

searches first match backwards (newest first)

Parameters
commandfirst chars
menu
Returns
returns match if found

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