teditor  1.8.0@@fee5e94
Terminal based editor written in C++
Public Member Functions | Protected Member Functions | List of all members
teditor::History Class Reference

Container to store history (files-visited or command-history, etc) More...

#include <utils.h>

+ Inheritance diagram for teditor::History:

Public Member Functions

 History (const std::string &f, int _max)
 Ctor. More...
 
int max () const
 
const std::string & getFile () const
 
void prune ()
 
void store () const
 
void add (const std::string &elem)
 
const Stringsget () const
 

Protected Member Functions

virtual bool isDuplicate (const std::string &a, const std::string &b) const
 

Detailed Description

Container to store history (files-visited or command-history, etc)

Constructor & Destructor Documentation

◆ History()

teditor::History::History ( const std::string &  f,
int  _max 
)

Ctor.

Parameters
ffile where to persist history on disk
_maxmaximum history items to be stored

Member Function Documentation

◆ add()

void teditor::History::add ( const std::string &  elem)

adds an element back to history

◆ get()

const Strings& teditor::History::get ( ) const
inline

◆ getFile()

const std::string& teditor::History::getFile ( ) const
inline

◆ isDuplicate()

bool teditor::History::isDuplicate ( const std::string &  a,
const std::string &  b 
) const
protectedvirtual

Reimplemented in teditor::FilesHist.

◆ max()

int teditor::History::max ( ) const
inline

◆ prune()

void teditor::History::prune ( )

prunes the history length to max()

◆ store()

void teditor::History::store ( ) const

store the history list back to the file


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