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

#include <cmd_msg_bar.h>

+ Inheritance diagram for teditor::CmdMsgBar:

Public Member Functions

 CmdMsgBar ()
 
void insert (char c) override
 
void insert (const std::string &str) override
 
void draw (Editor &ed, const Window &win) override
 
int drawLine (int y, const std::string &line, Editor &ed, int lineNum, const Window &win) override
 
void load (const std::string &file, int line=0) override
 
bool save (const std::string &fName="") override
 
void clear () override
 
void setMinLoc (int loc)
 
int getMinStartLoc () const override
 
int totalLinesNeeded (const Point &dim) const override
 
void setChoices (Choices *ch)
 
void clearChoices ()
 
bool usingChoices () const
 
std::string getStr () const
 
std::string getFinalChoice () const
 
void down ()
 
void up ()
 
void updateChoices ()
 
int getOptLoc () const
 
void setOptLoc (int loc)
 
void lineUp (const Point &dim) override
 
void lineDown () override
 
void setStartLine (int line)
 
- Public Member Functions inherited from teditor::Buffer
 Buffer (const std::string &name="", bool noUndoRedo=false)
 
virtual ~Buffer ()
 
void remove (bool removeCurrent=false)
 main remove method More...
 
std::string removeAndCopy ()
 
std::string removeRegion (const Point &start, const Point &end)
 removes region between start and end More...
 
std::string killLine (bool pushToStack=true)
 
void sortRegion ()
 
void keepRemoveLines (parser::NFA &regex, bool keep)
 Keep/Remove lines that match the input regex. More...
 
bool undo ()
 undo the previous operation More...
 
bool redo ()
 redo the previously undid operation. More...
 
bool matchCurrentParen ()
 find matching paren at the current location More...
 
int length () const
 
Lineat (int idx)
 
const Lineat (int idx) const
 
Point buffer2screen (const Point &loc, const Point &start, const Point &dim) const
 
Point screen2buffer (const Point &loc, const Point &start, const Point &dim) const
 
char charAt (const Point &pos) const
 
void drawPoint (Editor &ed, const AttrColor &bg, const Window &win)
 
void startOfLine ()
 
void endOfLine ()
 
void left ()
 
void right ()
 
void down ()
 
void up ()
 
void begin ()
 
void end ()
 
void pageDown (int ijump)
 
void pageUp (int ijump)
 
void nextPara ()
 
void previousPara ()
 
void nextWord ()
 
void previousWord ()
 
void gotoLine (int lineNum, const Point &dim)
 
bool hasPointOn (int line) const
 
const PointgetPoint () const
 
void setPoint (const Point &p)
 
bool isRegionActive () const
 
std::string regionAsStr () const
 
std::string regionAsStr (const Point &start, const Point &end) const
 
void startRegion ()
 
void stopRegion ()
 
const PointgetRegion () const
 
int lengthOf (int i) const
 
void indent ()
 
void lineReset ()
 
void lineEnd (const Point &start, const Point &dim)
 
const std::string & bufferName () const
 
const std::string & getFileName () const
 
const std::string & pwd () const
 
bool isRO () const
 
bool isModified () const
 
std::string dirModeGetFileAtLine (int line)
 
void reload ()
 
const AttrColorgetColor (const std::string &name) const
 
const std::string & getWord () const
 
const std::string & modeName () const
 
void makeReadOnly ()
 
void setMode (ModePtr m)
 
template<typename ModeT >
ModeT * getMode (const std::string &name)
 
Strings cmdNames () const
 

Additional Inherited Members

- Protected Types inherited from teditor::Buffer
enum  OpType { OpInsert = 0, OpDelete, OpKillLine, OpKeepRemoveLines }
 
typedef std::vector< RemovedLineRemovedLines
 
typedef std::stack< OpDataOpStack
 
- Protected Member Functions inherited from teditor::Buffer
void insertImpl (char c)
 
void addLine ()
 
void resetBufferState (int line, const std::string &file, bool dir)
 
KeyCmdMapgetKeyCmdMap ()
 
void loadFile (const std::string &file, int line)
 
void loadDir (const std::string &dir)
 
std::string removeFrom (const Point &start, const Point &end)
 
Point matchCurrentParen (bool &isOpen)
 
int dirModeFileOffset () const
 
void drawStatusBar (Editor &ed, const Window &win)
 
std::string removeChar ()
 
std::string removeCurrentChar ()
 
void applyInsertOp (OpData &op, bool pushToStack=true)
 Insert characters into the buffer. More...
 
void applyDeleteOp (OpData &op)
 Delete characters/regions from the buffer. More...
 
void addLines (const RemovedLines &rlines)
 
void removeLines (const RemovedLines &rlines)
 
void pushNewOp (OpData &op)
 
void clearStack (OpStack &st)
 
- Protected Attributes inherited from teditor::Buffer
std::vector< Linelines
 
int startLine
 
bool modified
 
bool readOnly
 
std::string buffName
 
std::string fileName
 
std::string dirName
 
std::string tmpFileName
 
Point region
 
ModePtr mode
 
Point cu
 
int longestX
 
OpStack undoStack
 
OpStack redoStack
 
bool disableStack
 

Constructor & Destructor Documentation

◆ CmdMsgBar()

teditor::CmdMsgBar::CmdMsgBar ( )

Member Function Documentation

◆ clear()

void teditor::CmdMsgBar::clear ( )
overridevirtual

clear buffer contents

Reimplemented from teditor::Buffer.

◆ clearChoices()

void teditor::CmdMsgBar::clearChoices ( )

◆ down()

void teditor::CmdMsgBar::down ( )

◆ draw()

void teditor::CmdMsgBar::draw ( Editor ed,
const Window win 
)
overridevirtual

Reimplemented from teditor::Buffer.

◆ drawLine()

int teditor::CmdMsgBar::drawLine ( int  y,
const std::string &  line,
Editor ed,
int  lineNum,
const Window win 
)
overridevirtual

Reimplemented from teditor::Buffer.

◆ getFinalChoice()

std::string teditor::CmdMsgBar::getFinalChoice ( ) const

◆ getMinStartLoc()

int teditor::CmdMsgBar::getMinStartLoc ( ) const
inlineoverridevirtual

Reimplemented from teditor::Buffer.

◆ getOptLoc()

int teditor::CmdMsgBar::getOptLoc ( ) const
inline

◆ getStr()

std::string teditor::CmdMsgBar::getStr ( ) const
inline

◆ insert() [1/2]

void teditor::CmdMsgBar::insert ( char  c)
overridevirtual

insert a character at the current cursor location

Reimplemented from teditor::Buffer.

◆ insert() [2/2]

void teditor::CmdMsgBar::insert ( const std::string &  str)
overridevirtual

insert a string at the current cursor location

Reimplemented from teditor::Buffer.

◆ lineDown()

void teditor::CmdMsgBar::lineDown ( )
overridevirtual

Reimplemented from teditor::Buffer.

◆ lineUp()

void teditor::CmdMsgBar::lineUp ( const Point dim)
overridevirtual

Reimplemented from teditor::Buffer.

◆ load()

void teditor::CmdMsgBar::load ( const std::string &  file,
int  line = 0 
)
inlineoverridevirtual

Load a file/dir into the buffer and optionally jump to a line

Reimplemented from teditor::Buffer.

◆ save()

bool teditor::CmdMsgBar::save ( const std::string &  fName = "")
inlineoverridevirtual

Reimplemented from teditor::Buffer.

◆ setChoices()

void teditor::CmdMsgBar::setChoices ( Choices ch)
inline

◆ setMinLoc()

void teditor::CmdMsgBar::setMinLoc ( int  loc)
inline

◆ setOptLoc()

void teditor::CmdMsgBar::setOptLoc ( int  loc)
inline

◆ setStartLine()

void teditor::CmdMsgBar::setStartLine ( int  line)
inline

◆ totalLinesNeeded()

int teditor::CmdMsgBar::totalLinesNeeded ( const Point dim) const
overridevirtual

number of lines needed to draw the currrent buffer in this window

Reimplemented from teditor::Buffer.

◆ up()

void teditor::CmdMsgBar::up ( )

◆ updateChoices()

void teditor::CmdMsgBar::updateChoices ( )

◆ usingChoices()

bool teditor::CmdMsgBar::usingChoices ( ) const
inline

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