teditor  1.8.0@@fee5e94
Terminal based editor written in C++
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
teditor Namespace Reference

Namespaces

 buffer
 
 calc
 
 cmbar
 
 cpp
 
 cursor
 
 dir
 
 editor
 
 grep
 
 ledger
 
 parser
 
 readonly
 
 text
 
 todo
 
 Utf8
 
 watch
 

Classes

struct  AllCombos
 
struct  Any
 struct Impl /// More...
 
struct  AttrColor
 
struct  AttrHelper
 
struct  Border
 
class  Buffer
 
class  Buffers
 
struct  Cell
 
class  CellBuffer
 
class  Choices
 
class  CmdMsgBar
 
struct  CmdRegistrar
 
struct  CmdStatus
 
struct  ColorHelper
 
class  ColorMap
 
class  DirCache
 
struct  DoubleBuffer
 A simple double buffer container for ping-pong kind of operations. More...
 
class  Editor
 
struct  FilePerm
 
class  FilesHist
 
class  History
 Container to store history (files-visited or command-history, etc) More...
 
struct  Impl
 struct Impl /// More...
 
struct  Impl< Head, Rest... >
 
struct  Impl<>
 
struct  InfoCmp
 
class  ISearch
 Incremental search support used by Ctrl-F command. More...
 
class  KeyCmdMap
 
struct  KeyCmdPair
 
struct  KeyCombo
 
class  Line
 
class  Logger
 
class  LRUCache
 LRU Cache implementation. More...
 
struct  MetaKey
 
class  Mode
 
struct  NameColorPair
 
class  Node
 
class  Option
 Class to define an option used in the editor. More...
 
struct  Pos2d
 Any 2D position. More...
 
struct  PromptYesNoKeys
 
struct  Remote
 
class  SingletonHandler
 
class  StringChoices
 
class  Terminal
 
class  Timer
 Main object used for timing event. More...
 
class  Trie
 
class  Window
 
class  Windows
 

Typedefs

typedef uint32_t Chr
 
typedef bool(* ChoicesFilter) (const std::string &, const std::string &)
 
typedef uint16_t color_t
 
typedef void(* OperateFunc) (Editor &ed)
 
typedef std::pair< OperateFunc, std::string > Command
 
typedef std::unordered_map< std::string, CommandCommandMap
 
typedef bool(* CmdFilterOp) (const std::string &)
 
typedef std::unordered_map< std::string, std::string > OptionMap
 
typedef std::vector< FilePermFiles
 
typedef std::pair< std::string, int > FileInfo
 
typedef uint32_t key_t
 
typedef Mode *(* ModeCreator) ()
 
typedef std::shared_ptr< ModeModePtr
 
typedef std::unordered_map< std::string, ModeCreatorModeCreatorMap
 
typedef bool(* InferMode) (const std::string &)
 
typedef std::unordered_map< std::string, InferModeModeInferMap
 
typedef std::unordered_map< std::string, std::shared_ptr< Option > > Options
 
typedef Pos2d< int > Pos2di
 
typedef Pos2d< unsigned > Pos2du
 
typedef Pos2d< size_t > Pos2ds
 
typedef Pos2di Point
 
typedef std::chrono::system_clock::time_point TimePoint
 
typedef std::unordered_map< std::string, TimerTimers
 
typedef std::vector< std::string > Strings
 

Enumerations

enum  TrieStatus { TS_NULL, TS_NON_LEAF, TS_LEAF }
 
enum  Func {
  Func_EnterCA, Func_ExitCA, Func_ShowCursor, Func_HideCursor,
  Func_ClearScreen, Func_Sgr0, Func_Underline, Func_Italic,
  Func_Bold, Func_Blink, Func_EnterKeypad, Func_ExitKeypad,
  Func_EnterMouse, Func_ExitMouse, Func_FuncsNum
}
 
enum  EventType { Event_Key = 1, Event_Resize, Event_Mouse, Event_None = 0 }
 

Functions

bool operator== (const Cell &a, const Cell &b)
 
bool operator== (const AttrColor &a, const AttrColor &b)
 
bool operator!= (const AttrColor &a, const AttrColor &b)
 
template<typename Colors >
void populateColorMap (ColorMap &cm, bool clear=false)
 
CommandMapcmds ()
 
bool defaultCmdFilterOp (const std::string &name)
 
const CommandgetCmd (const std::string &cmd)
 Helper to return the command of interest. More...
 
Strings allCmdNames (CmdFilterOp filterOp=defaultCmdFilterOp)
 Accessor function to the list of command names. More...
 
std::string remoteFileType (const std::string &f)
 
bool isRemoteDir (const std::string &type)
 
bool isDir (const std::string &f)
 
bool isFile (const std::string &f)
 
bool isReadOnly (const char *f)
 
void makeDir (const std::string &d)
 
bool isRemote (const std::string &f)
 
std::string slurp (const std::string &file)
 
Strings slurpToArr (const std::string &file)
 
std::string getpwd ()
 
bool isAbs (const std::string &file)
 
std::string rel2abs (const std::string &pwd, const std::string &rel)
 
std::string basename (const std::string &file)
 
std::string dirname (const std::string &file)
 
std::string tempFileName ()
 
std::string findFirstUpwards (const std::string &dir, const std::string &file)
 
std::string extension (const std::string &name)
 
bool FileCompare (const FilePerm &a, const FilePerm &b)
 
Files listDir (const std::string &dir)
 
Strings listDirRel (const std::string &dir)
 
std::string listDir2str (const std::string &dir)
 
void copyFile (const std::string &in, const std::string &out)
 
FileInfo readFileInfo (const std::string &arg)
 
bool fileStrFind (const std::string &line, const std::string &str)
 
bool isCurrentOrParentDir (const std::string &dir)
 
std::string copyFromRemote (const std::string &file)
 
void copyToRemote (const std::string &rfile, const std::string &local)
 
bool strFindEmpty (const std::string &line, const std::string &str)
 
bool iStrFindEmpty (const std::string &line, const std::string &str)
 
template<typename Keys >
void populateKeyMap (KeyCmdMap &kcm, bool clear=false)
 
bool operator== (const MetaKey &mk1, const MetaKey &mk2)
 
bool LineCompare (const Line &a, const Line &b)
 
ModeCreatorMapmodes ()
 
ModeInferMapinfers ()
 
Strings allModeNames ()
 
std::string dnsLookup (const std::string &url, const std::string &domain)
 
Optionsoptions ()
 
void registerAllOptions ()
 
void parseRcFile (const std::string &rc)
 
bool parseArgs (int argc, char **argv, std::vector< FileInfo > &files)
 
const char * func2terminfo (Func f)
 
void exitGracefully (int signum)
 
void sigwinch_handler (int xxx)
 
bool operator> (const struct timeval &ta, const struct timeval &tb)
 
const std::string & timeFormat ()
 
struct tm toStructTm (const TimePoint &pt)
 
TimePoint toTimePoint (struct tm &tm_)
 
std::string timeToStr (const TimePoint &pt)
 
std::string timeToDateStr (const TimePoint &pt)
 
std::string currentTimeToStr ()
 
TimePoint timeFromStr (const std::string &dt)
 
int dayOfWeek (const TimePoint &pt)
 
int year (const TimePoint &pt)
 
int month (const TimePoint &pt)
 
int day (const TimePoint &pt)
 
void addSecond (TimePoint &pt)
 
void addMinute (TimePoint &pt)
 
void addHour (TimePoint &pt)
 
void addDay (TimePoint &pt, int times)
 
void addWeek (TimePoint &pt, int times)
 
void addMonth (TimePoint &pt)
 
void addYear (TimePoint &pt)
 
TimePoint addSecond (const TimePoint &pt)
 
TimePoint addMinute (const TimePoint &pt)
 
TimePoint addHour (const TimePoint &pt)
 
TimePoint addDay (const TimePoint &pt, int times)
 
TimePoint addWeek (const TimePoint &pt, int times)
 
TimePoint addMonth (const TimePoint &pt)
 
TimePoint addYear (const TimePoint &pt)
 
void weekFor (TimePoint &start, TimePoint &end, const TimePoint &pt)
 
TimersgetTimers ()
 
TimergetTimer (const std::string &name)
 
void tic (const std::string &name)
 
void toc (const std::string &name)
 
void resetTimers ()
 
std::string format (const char *fmt, va_list &vl)
 
std::string format (const char *fmt,...)
 
std::string env (const std::string &s)
 
bool startsWith (const char *s1, int len1, const char *s2)
 
Strings split (const std::string &str, char delim)
 
std::string join (const Strings &s, char delim, int start, int end)
 
std::string num2str (int num)
 
int str2num (const std::string &str)
 
float str2real (const std::string &str)
 
double str2double (const std::string &str)
 
bool isUnderGit (const std::string &dir)
 
std::string gitBranchName (const std::string &dir)
 
CmdStatus check_output (const std::string &cmd)
 
CmdStatus check_output (const std::string &cmd, const std::string &host)
 
std::string urlHexify (const std::string &url)
 Hexify the input url. More...
 
void downloadUrl (const std::string &url, const std::string &file, const std::string &dnldProg="curl", const std::string &dnldProgOpts="-s")
 Download the content of input url into the given file. More...
 
std::string downloadUrlToString (const std::string &url, const std::string &dnldProg="curl", const std::string &dnldProgOpts="-s")
 Download the content of input url into a string. More...
 
bool isOpenParen (char c)
 
bool isCloseParen (char c)
 
bool isParen (char c)
 
char getMatchingParen (char c)
 
std::string expandEnvVars (const std::string &str)
 
bool strFind (const std::string &line, const std::string &str)
 
bool iStrFind (const std::string &line, const std::string &str)
 
void dos2unix (std::string &in)
 
std::string dos2unix (const std::string &in)
 
unsigned numThreads ()
 
bool allStringsEmpty (const Strings &strs)
 
template<typename T >
bool same (const std::vector< T > &s1, const std::vector< T > &s2)
 
template<typename K , typename V >
std::vector< K > sortedKeys (const std::unordered_map< K, V > &map)
 

Variables

static const color_t Attr_None = 0x0000
 
static const color_t Attr_Bold = 0x0100
 
static const color_t Attr_Underline = 0x0200
 
static const color_t Attr_Italic = 0x0400
 
static const key_t Meta_None = 0x00000000
 
static const key_t Meta_Shift = 0x00010000
 
static const key_t Meta_Alt = 0x00020000
 
static const key_t Meta_Ctrl = 0x00040000
 
static const key_t Meta_Motion = 0x00080000
 
static const key_t Key_F1 = (0xFFFF-0)
 
static const key_t Key_F2 = (0xFFFF-1)
 
static const key_t Key_F3 = (0xFFFF-2)
 
static const key_t Key_F4 = (0xFFFF-3)
 
static const key_t Key_F5 = (0xFFFF-4)
 
static const key_t Key_F6 = (0xFFFF-5)
 
static const key_t Key_F7 = (0xFFFF-6)
 
static const key_t Key_F8 = (0xFFFF-7)
 
static const key_t Key_F9 = (0xFFFF-8)
 
static const key_t Key_F10 = (0xFFFF-9)
 
static const key_t Key_F11 = (0xFFFF-10)
 
static const key_t Key_F12 = (0xFFFF-11)
 
static const key_t Key_Insert = (0xFFFF-12)
 
static const key_t Key_Delete = (0xFFFF-13)
 
static const key_t Key_Home = (0xFFFF-14)
 
static const key_t Key_End = (0xFFFF-15)
 
static const key_t Key_PageUp = (0xFFFF-16)
 
static const key_t Key_PageDown = (0xFFFF-17)
 
static const key_t Key_ArrowLeft = (0xFFFF-18)
 
static const key_t Key_ArrowRight = (0xFFFF-19)
 
static const key_t Key_ArrowDown = (0xFFFF-20)
 
static const key_t Key_ArrowUp = (0xFFFF-21)
 
static const key_t Key_MouseLeft = (0xFFFF-22)
 
static const key_t Key_MouseRight = (0xFFFF-23)
 
static const key_t Key_MouseMiddle = (0xFFFF-24)
 
static const key_t Key_MouseRelease = (0xFFFF-25)
 
static const key_t Key_MouseWheelUp = (0xFFFF-26)
 
static const key_t Key_MouseWheelDown = (0xFFFF-27)
 
static const key_t Key_CtrlTilde = 0x00
 
static const key_t Key_Ctrl2 = 0x00
 
static const key_t Key_CtrlA = 0x01
 
static const key_t Key_CtrlB = 0x02
 
static const key_t Key_CtrlC = 0x03
 
static const key_t Key_CtrlD = 0x04
 
static const key_t Key_CtrlE = 0x05
 
static const key_t Key_CtrlF = 0x06
 
static const key_t Key_CtrlG = 0x07
 
static const key_t Key_Backspace = 0x08
 
static const key_t Key_CtrlH = 0x08
 
static const key_t Key_Tab = 0x09
 
static const key_t Key_CtrlI = 0x09
 
static const key_t Key_CtrlJ = 0x0A
 
static const key_t Key_CtrlK = 0x0B
 
static const key_t Key_CtrlL = 0x0C
 
static const key_t Key_Enter = 0x0D
 
static const key_t Key_CtrlM = 0x0D
 
static const key_t Key_CtrlN = 0x0E
 
static const key_t Key_CtrlO = 0x0F
 
static const key_t Key_CtrlP = 0x10
 
static const key_t Key_CtrlQ = 0x11
 
static const key_t Key_CtrlR = 0x12
 
static const key_t Key_CtrlS = 0x13
 
static const key_t Key_CtrlT = 0x14
 
static const key_t Key_CtrlU = 0x15
 
static const key_t Key_CtrlV = 0x16
 
static const key_t Key_CtrlW = 0x17
 
static const key_t Key_CtrlX = 0x18
 
static const key_t Key_CtrlY = 0x19
 
static const key_t Key_CtrlZ = 0x1A
 
static const key_t Key_Esc = 0x1B
 
static const key_t Key_CtrlLsqBracket = 0x1B
 
static const key_t Key_Ctrl3 = 0x1B
 
static const key_t Key_Ctrl4 = 0x1C
 
static const key_t Key_CtrlBackslash = 0x1C
 
static const key_t Key_Ctrl5 = 0x1D
 
static const key_t Key_CtrlRsqBracket = 0x1D
 
static const key_t Key_Ctrl6 = 0x1E
 
static const key_t Key_Ctrl7 = 0x1F
 
static const key_t Key_CtrlSlash = 0x1F
 
static const key_t Key_CtrlUnderscore = 0x1F
 
static const key_t Key_Space = (key_t)' '
 
static const key_t Key_Exclaim = (key_t)'!'
 
static const key_t Key_DQuote = (key_t)'"'
 
static const key_t Key_Hash = (key_t)'#'
 
static const key_t Key_Dollar = (key_t)'$'
 
static const key_t Key_Percent = (key_t)'%'
 
static const key_t Key_Ampersand = (key_t)'&'
 
static const key_t Key_SQuote = (key_t)'\''
 
static const key_t Key_BrktOpen = (key_t)'('
 
static const key_t Key_BrktClose = (key_t)')'
 
static const key_t Key_Star = (key_t)'*'
 
static const key_t Key_Plus = (key_t)'+'
 
static const key_t Key_Comma = (key_t)','
 
static const key_t Key_Minus = (key_t)'-'
 
static const key_t Key_Dot = (key_t)'.'
 
static const key_t Key_Slash = (key_t)'/'
 
static const key_t Key_Zero = (key_t)'0'
 
static const key_t Key_One = (key_t)'1'
 
static const key_t Key_Two = (key_t)'2'
 
static const key_t Key_Three = (key_t)'3'
 
static const key_t Key_Four = (key_t)'4'
 
static const key_t Key_Five = (key_t)'5'
 
static const key_t Key_Six = (key_t)'6'
 
static const key_t Key_Seven = (key_t)'7'
 
static const key_t Key_Eight = (key_t)'8'
 
static const key_t Key_Nine = (key_t)'9'
 
static const key_t Key_Colon = (key_t)':'
 
static const key_t Key_SemiColo = (key_t)';'
 
static const key_t Key_Lt = (key_t)'<'
 
static const key_t Key_Question = (key_t)'?'
 
static const key_t Key_At = (key_t)'@'
 
static const key_t Key_A = (key_t)'A'
 
static const key_t Key_B = (key_t)'B'
 
static const key_t Key_C = (key_t)'C'
 
static const key_t Key_D = (key_t)'D'
 
static const key_t Key_E = (key_t)'E'
 
static const key_t Key_F = (key_t)'F'
 
static const key_t Key_G = (key_t)'G'
 
static const key_t Key_H = (key_t)'H'
 
static const key_t Key_I = (key_t)'I'
 
static const key_t Key_J = (key_t)'J'
 
static const key_t Key_K = (key_t)'K'
 
static const key_t Key_L = (key_t)'L'
 
static const key_t Key_M = (key_t)'M'
 
static const key_t Key_N = (key_t)'N'
 
static const key_t Key_O = (key_t)'O'
 
static const key_t Key_P = (key_t)'P'
 
static const key_t Key_Q = (key_t)'Q'
 
static const key_t Key_R = (key_t)'R'
 
static const key_t Key_S = (key_t)'S'
 
static const key_t Key_T = (key_t)'T'
 
static const key_t Key_U = (key_t)'U'
 
static const key_t Key_V = (key_t)'V'
 
static const key_t Key_W = (key_t)'W'
 
static const key_t Key_X = (key_t)'X'
 
static const key_t Key_Y = (key_t)'Y'
 
static const key_t Key_Z = (key_t)'Z'
 
static const key_t Key_SqBrktOpt = (key_t)'['
 
static const key_t Key_BackSlash = (key_t)'\\'
 
static const key_t Key_SqBrktClose = (key_t)']'
 
static const key_t Key_Caret = (key_t)'^'
 
static const key_t Key_Underscore = (key_t)'_'
 
static const key_t Key_Backtick = (key_t)'`'
 
static const key_t Key_a = (key_t)'a'
 
static const key_t Key_b = (key_t)'b'
 
static const key_t Key_c = (key_t)'c'
 
static const key_t Key_d = (key_t)'d'
 
static const key_t Key_e = (key_t)'e'
 
static const key_t Key_f = (key_t)'f'
 
static const key_t Key_g = (key_t)'g'
 
static const key_t Key_h = (key_t)'h'
 
static const key_t Key_i = (key_t)'i'
 
static const key_t Key_j = (key_t)'j'
 
static const key_t Key_k = (key_t)'k'
 
static const key_t Key_l = (key_t)'l'
 
static const key_t Key_m = (key_t)'m'
 
static const key_t Key_n = (key_t)'n'
 
static const key_t Key_o = (key_t)'o'
 
static const key_t Key_p = (key_t)'p'
 
static const key_t Key_q = (key_t)'q'
 
static const key_t Key_r = (key_t)'r'
 
static const key_t Key_s = (key_t)'s'
 
static const key_t Key_t = (key_t)'t'
 
static const key_t Key_u = (key_t)'u'
 
static const key_t Key_v = (key_t)'v'
 
static const key_t Key_w = (key_t)'w'
 
static const key_t Key_x = (key_t)'x'
 
static const key_t Key_y = (key_t)'y'
 
static const key_t Key_z = (key_t)'z'
 
static const key_t Key_FBrktOpen = (key_t)'{'
 
static const key_t Key_Line = (key_t)'|'
 
static const key_t Key_FBrktClose = (key_t)'}'
 
static const key_t Key_Tilde = (key_t)'~'
 
static const key_t Key_Backspace2 = 0x7F
 
static const key_t Key_Ctrl8 = 0x7F
 
static const key_t Key_Invalid = 0xFFFFFFFF
 

Typedef Documentation

◆ ChoicesFilter

typedef bool(* teditor::ChoicesFilter) (const std::string &, const std::string &)

Functor to filter input string against a list of choices

◆ Chr

typedef uint32_t teditor::Chr

◆ CmdFilterOp

typedef bool(* teditor::CmdFilterOp) (const std::string &)

command name filter

◆ color_t

typedef uint16_t teditor::color_t

◆ Command

typedef std::pair<OperateFunc, std::string> teditor::Command

Main class to add operators onto the editor/buffer

◆ CommandMap

typedef std::unordered_map<std::string, Command> teditor::CommandMap

list of all currently registered commands

◆ FileInfo

typedef std::pair<std::string, int> teditor::FileInfo

◆ Files

typedef std::vector<FilePerm> teditor::Files

◆ InferMode

typedef bool(* teditor::InferMode) (const std::string &)

◆ key_t

typedef uint32_t teditor::key_t

◆ ModeCreator

typedef Mode*(* teditor::ModeCreator) ()

◆ ModeCreatorMap

typedef std::unordered_map<std::string,ModeCreator> teditor::ModeCreatorMap

◆ ModeInferMap

typedef std::unordered_map<std::string,InferMode> teditor::ModeInferMap

◆ ModePtr

typedef std::shared_ptr<Mode> teditor::ModePtr

◆ OperateFunc

typedef void(* teditor::OperateFunc) (Editor &ed)

main lambda to operate on the editor/buffer

◆ OptionMap

typedef std::unordered_map<std::string, std::string> teditor::OptionMap

◆ Options

typedef std::unordered_map<std::string, std::shared_ptr<Option> > teditor::Options

◆ Point

cursor

◆ Pos2di

typedef Pos2d<int> teditor::Pos2di

integer pos2d

◆ Pos2ds

typedef Pos2d<size_t> teditor::Pos2ds

size_t pos2d

◆ Pos2du

typedef Pos2d<unsigned> teditor::Pos2du

unsigned integer pos2d

◆ Strings

typedef std::vector<std::string> teditor::Strings

short-form for vector of strings

◆ TimePoint

typedef std::chrono::system_clock::time_point teditor::TimePoint

◆ Timers

typedef std::unordered_map<std::string, Timer> teditor::Timers

Enumeration Type Documentation

◆ EventType

Enumerator
Event_Key 
Event_Resize 
Event_Mouse 
Event_None 

◆ Func

Enumerator
Func_EnterCA 
Func_ExitCA 
Func_ShowCursor 
Func_HideCursor 
Func_ClearScreen 
Func_Sgr0 
Func_Underline 
Func_Italic 
Func_Bold 
Func_Blink 
Func_EnterKeypad 
Func_ExitKeypad 
Func_EnterMouse 
Func_ExitMouse 
Func_FuncsNum 

◆ TrieStatus

Enumerator
TS_NULL 
TS_NON_LEAF 
TS_LEAF 

Function Documentation

◆ addDay() [1/2]

TimePoint teditor::addDay ( const TimePoint pt,
int  times 
)

◆ addDay() [2/2]

void teditor::addDay ( TimePoint pt,
int  times 
)

◆ addHour() [1/2]

TimePoint teditor::addHour ( const TimePoint pt)

◆ addHour() [2/2]

void teditor::addHour ( TimePoint pt)

◆ addMinute() [1/2]

TimePoint teditor::addMinute ( const TimePoint pt)

◆ addMinute() [2/2]

void teditor::addMinute ( TimePoint pt)

◆ addMonth() [1/2]

TimePoint teditor::addMonth ( const TimePoint pt)

◆ addMonth() [2/2]

void teditor::addMonth ( TimePoint pt)

◆ addSecond() [1/2]

TimePoint teditor::addSecond ( const TimePoint pt)

◆ addSecond() [2/2]

void teditor::addSecond ( TimePoint pt)

◆ addWeek() [1/2]

TimePoint teditor::addWeek ( const TimePoint pt,
int  times 
)

◆ addWeek() [2/2]

void teditor::addWeek ( TimePoint pt,
int  times 
)

◆ addYear() [1/2]

TimePoint teditor::addYear ( const TimePoint pt)

◆ addYear() [2/2]

void teditor::addYear ( TimePoint pt)

◆ allModeNames()

Strings teditor::allModeNames ( )

Accessor function to the list of mode names

◆ allStringsEmpty()

bool teditor::allStringsEmpty ( const Strings strs)
inline

whether all the strings internally are empty or not

◆ basename()

std::string teditor::basename ( const std::string &  file)

◆ check_output() [1/2]

CmdStatus teditor::check_output ( const std::string &  cmd)

◆ check_output() [2/2]

CmdStatus teditor::check_output ( const std::string &  cmd,
const std::string &  host 
)

run the given command on the remote host and return its output

◆ cmds()

CommandMap& teditor::cmds ( )

◆ copyFile()

void teditor::copyFile ( const std::string &  in,
const std::string &  out 
)

◆ copyFromRemote()

std::string teditor::copyFromRemote ( const std::string &  file)

◆ copyToRemote()

void teditor::copyToRemote ( const std::string &  rfile,
const std::string &  local 
)

◆ currentTimeToStr()

std::string teditor::currentTimeToStr ( )

◆ day()

int teditor::day ( const TimePoint pt)

◆ dayOfWeek()

int teditor::dayOfWeek ( const TimePoint pt)

◆ defaultCmdFilterOp()

bool teditor::defaultCmdFilterOp ( const std::string &  name)

default command name filter

◆ dirname()

std::string teditor::dirname ( const std::string &  file)

◆ dnsLookup()

std::string teditor::dnsLookup ( const std::string &  url,
const std::string &  domain 
)

◆ dos2unix() [1/2]

std::string teditor::dos2unix ( const std::string &  in)

◆ dos2unix() [2/2]

void teditor::dos2unix ( std::string &  in)

◆ downloadUrl()

void teditor::downloadUrl ( const std::string &  url,
const std::string &  file,
const std::string &  dnldProg,
const std::string &  dnldProgOpts 
)

Download the content of input url into the given file.

◆ downloadUrlToString()

std::string teditor::downloadUrlToString ( const std::string &  url,
const std::string &  dnldProg,
const std::string &  dnldProgOpts 
)

Download the content of input url into a string.

◆ env()

std::string teditor::env ( const std::string &  s)

◆ exitGracefully()

void teditor::exitGracefully ( int  signum)

◆ expandEnvVars()

std::string teditor::expandEnvVars ( const std::string &  str)

◆ extension()

std::string teditor::extension ( const std::string &  name)

get file's extension from its name

◆ FileCompare()

bool teditor::FileCompare ( const FilePerm a,
const FilePerm b 
)

◆ fileStrFind()

bool teditor::fileStrFind ( const std::string &  line,
const std::string &  str 
)

Filter function while working with files

◆ findFirstUpwards()

std::string teditor::findFirstUpwards ( const std::string &  dir,
const std::string &  file 
)

Tries to find the file starting from dir all the way uptill root

◆ format() [1/2]

std::string teditor::format ( const char *  fmt,
va_list &  vl 
)

◆ format() [2/2]

std::string teditor::format ( const char *  fmt,
  ... 
)

helper function to convert formatted C-strings to std::string

◆ func2terminfo()

const char * teditor::func2terminfo ( Func  f)

◆ getMatchingParen()

char teditor::getMatchingParen ( char  c)

◆ getpwd()

std::string teditor::getpwd ( )

◆ getTimer()

Timer & teditor::getTimer ( const std::string &  name)

get the timer object of the given name

◆ getTimers()

Timers& teditor::getTimers ( )

◆ gitBranchName()

std::string teditor::gitBranchName ( const std::string &  dir)

returns the current branch name of the dir

◆ infers()

ModeInferMap& teditor::infers ( )

◆ isAbs()

bool teditor::isAbs ( const std::string &  file)

◆ isCloseParen()

bool teditor::isCloseParen ( char  c)

◆ isCurrentOrParentDir()

bool teditor::isCurrentOrParentDir ( const std::string &  dir)

check if the file represents current dir or parent dir

◆ isDir()

bool teditor::isDir ( const std::string &  f)

◆ isFile()

bool teditor::isFile ( const std::string &  f)

◆ isOpenParen()

bool teditor::isOpenParen ( char  c)

◆ isParen()

bool teditor::isParen ( char  c)

◆ isReadOnly()

bool teditor::isReadOnly ( const char *  f)

◆ isRemote()

bool teditor::isRemote ( const std::string &  f)

◆ isRemoteDir()

bool teditor::isRemoteDir ( const std::string &  type)

◆ iStrFind()

bool teditor::iStrFind ( const std::string &  line,
const std::string &  str 
)

Filter function that performs case insensitive find

◆ iStrFindEmpty()

bool teditor::iStrFindEmpty ( const std::string &  line,
const std::string &  str 
)

◆ isUnderGit()

bool teditor::isUnderGit ( const std::string &  dir)

checks if the given dir is part of a git repo

◆ join()

std::string teditor::join ( const Strings s,
char  delim,
int  start,
int  end 
)

◆ LineCompare()

bool teditor::LineCompare ( const Line a,
const Line b 
)

helper function to compare strings stored in the 2 lines. Very useful as a functor to be passed for the 'sort' function

◆ listDir()

Files teditor::listDir ( const std::string &  dir)

◆ listDir2str()

std::string teditor::listDir2str ( const std::string &  dir)

◆ listDirRel()

Strings teditor::listDirRel ( const std::string &  dir)

◆ makeDir()

void teditor::makeDir ( const std::string &  d)

◆ modes()

ModeCreatorMap& teditor::modes ( )

◆ month()

int teditor::month ( const TimePoint pt)

◆ num2str()

std::string teditor::num2str ( int  num)

◆ numThreads()

unsigned teditor::numThreads ( )

◆ operator!=()

bool teditor::operator!= ( const AttrColor a,
const AttrColor b 
)

◆ operator==() [1/3]

bool teditor::operator== ( const AttrColor a,
const AttrColor b 
)

◆ operator==() [2/3]

bool teditor::operator== ( const Cell a,
const Cell b 
)

◆ operator==() [3/3]

bool teditor::operator== ( const MetaKey mk1,
const MetaKey mk2 
)

◆ operator>()

bool teditor::operator> ( const struct timeval &  ta,
const struct timeval &  tb 
)

◆ options()

Options& teditor::options ( )

◆ parseArgs()

bool teditor::parseArgs ( int  argc,
char **  argv,
std::vector< FileInfo > &  files 
)

parse input commandline args

◆ parseRcFile()

void teditor::parseRcFile ( const std::string &  rc)

◆ populateColorMap()

template<typename Colors >
void teditor::populateColorMap ( ColorMap cm,
bool  clear = false 
)

◆ populateKeyMap()

template<typename Keys >
void teditor::populateKeyMap ( KeyCmdMap kcm,
bool  clear = false 
)

◆ readFileInfo()

FileInfo teditor::readFileInfo ( const std::string &  arg)

◆ registerAllOptions()

void teditor::registerAllOptions ( )

◆ rel2abs()

std::string teditor::rel2abs ( const std::string &  pwd,
const std::string &  rel 
)

◆ remoteFileType()

std::string teditor::remoteFileType ( const std::string &  f)

◆ resetTimers()

void teditor::resetTimers ( )

remove all the named timers created so far

◆ same()

template<typename T >
bool teditor::same ( const std::vector< T > &  s1,
const std::vector< T > &  s2 
)

whether the 2 vectors are same

◆ sigwinch_handler()

void teditor::sigwinch_handler ( int  xxx)

◆ slurp()

std::string teditor::slurp ( const std::string &  file)

◆ slurpToArr()

Strings teditor::slurpToArr ( const std::string &  file)

◆ sortedKeys()

template<typename K , typename V >
std::vector<K> teditor::sortedKeys ( const std::unordered_map< K, V > &  map)

◆ split()

Strings teditor::split ( const std::string &  str,
char  delim 
)

◆ startsWith()

bool teditor::startsWith ( const char *  s1,
int  len1,
const char *  s2 
)

◆ str2double()

double teditor::str2double ( const std::string &  str)

◆ str2num()

int teditor::str2num ( const std::string &  str)

◆ str2real()

float teditor::str2real ( const std::string &  str)

◆ strFind()

bool teditor::strFind ( const std::string &  line,
const std::string &  str 
)

Filter function that just performs std::string::find

◆ strFindEmpty()

bool teditor::strFindEmpty ( const std::string &  line,
const std::string &  str 
)

◆ tempFileName()

std::string teditor::tempFileName ( )

◆ tic()

void teditor::tic ( const std::string &  name)

start a named timer

◆ timeFormat()

const std::string& teditor::timeFormat ( )

◆ timeFromStr()

TimePoint teditor::timeFromStr ( const std::string &  dt)

◆ timeToDateStr()

std::string teditor::timeToDateStr ( const TimePoint pt)

◆ timeToStr()

std::string teditor::timeToStr ( const TimePoint pt)

◆ toc()

void teditor::toc ( const std::string &  name)

stop the previously started named timer

◆ toStructTm()

struct tm teditor::toStructTm ( const TimePoint pt)

◆ toTimePoint()

TimePoint teditor::toTimePoint ( struct tm &  tm_)

◆ urlHexify()

std::string teditor::urlHexify ( const std::string &  url)

Hexify the input url.

◆ weekFor()

void teditor::weekFor ( TimePoint start,
TimePoint end,
const TimePoint pt 
)

◆ year()

int teditor::year ( const TimePoint pt)

Variable Documentation

◆ Attr_Bold

const color_t teditor::Attr_Bold = 0x0100
static

◆ Attr_Italic

const color_t teditor::Attr_Italic = 0x0400
static

◆ Attr_None

const color_t teditor::Attr_None = 0x0000
static

◆ Attr_Underline

const color_t teditor::Attr_Underline = 0x0200
static

◆ Key_A

const key_t teditor::Key_A = (key_t)'A'
static

◆ Key_a

const key_t teditor::Key_a = (key_t)'a'
static

◆ Key_Ampersand

const key_t teditor::Key_Ampersand = (key_t)'&'
static

◆ Key_ArrowDown

const key_t teditor::Key_ArrowDown = (0xFFFF-20)
static

◆ Key_ArrowLeft

const key_t teditor::Key_ArrowLeft = (0xFFFF-18)
static

◆ Key_ArrowRight

const key_t teditor::Key_ArrowRight = (0xFFFF-19)
static

◆ Key_ArrowUp

const key_t teditor::Key_ArrowUp = (0xFFFF-21)
static

◆ Key_At

const key_t teditor::Key_At = (key_t)'@'
static

◆ Key_B

const key_t teditor::Key_B = (key_t)'B'
static

◆ Key_b

const key_t teditor::Key_b = (key_t)'b'
static

◆ Key_BackSlash

const key_t teditor::Key_BackSlash = (key_t)'\\'
static

◆ Key_Backspace

const key_t teditor::Key_Backspace = 0x08
static

◆ Key_Backspace2

const key_t teditor::Key_Backspace2 = 0x7F
static

◆ Key_Backtick

const key_t teditor::Key_Backtick = (key_t)'`'
static

◆ Key_BrktClose

const key_t teditor::Key_BrktClose = (key_t)')'
static

◆ Key_BrktOpen

const key_t teditor::Key_BrktOpen = (key_t)'('
static

◆ Key_C

const key_t teditor::Key_C = (key_t)'C'
static

◆ Key_c

const key_t teditor::Key_c = (key_t)'c'
static

◆ Key_Caret

const key_t teditor::Key_Caret = (key_t)'^'
static

◆ Key_Colon

const key_t teditor::Key_Colon = (key_t)':'
static

◆ Key_Comma

const key_t teditor::Key_Comma = (key_t)','
static

◆ Key_Ctrl2

const key_t teditor::Key_Ctrl2 = 0x00
static

◆ Key_Ctrl3

const key_t teditor::Key_Ctrl3 = 0x1B
static

◆ Key_Ctrl4

const key_t teditor::Key_Ctrl4 = 0x1C
static

◆ Key_Ctrl5

const key_t teditor::Key_Ctrl5 = 0x1D
static

◆ Key_Ctrl6

const key_t teditor::Key_Ctrl6 = 0x1E
static

◆ Key_Ctrl7

const key_t teditor::Key_Ctrl7 = 0x1F
static

◆ Key_Ctrl8

const key_t teditor::Key_Ctrl8 = 0x7F
static

◆ Key_CtrlA

const key_t teditor::Key_CtrlA = 0x01
static

◆ Key_CtrlB

const key_t teditor::Key_CtrlB = 0x02
static

◆ Key_CtrlBackslash

const key_t teditor::Key_CtrlBackslash = 0x1C
static

◆ Key_CtrlC

const key_t teditor::Key_CtrlC = 0x03
static

◆ Key_CtrlD

const key_t teditor::Key_CtrlD = 0x04
static

◆ Key_CtrlE

const key_t teditor::Key_CtrlE = 0x05
static

◆ Key_CtrlF

const key_t teditor::Key_CtrlF = 0x06
static

◆ Key_CtrlG

const key_t teditor::Key_CtrlG = 0x07
static

◆ Key_CtrlH

const key_t teditor::Key_CtrlH = 0x08
static

◆ Key_CtrlI

const key_t teditor::Key_CtrlI = 0x09
static

◆ Key_CtrlJ

const key_t teditor::Key_CtrlJ = 0x0A
static

◆ Key_CtrlK

const key_t teditor::Key_CtrlK = 0x0B
static

◆ Key_CtrlL

const key_t teditor::Key_CtrlL = 0x0C
static

◆ Key_CtrlLsqBracket

const key_t teditor::Key_CtrlLsqBracket = 0x1B
static

◆ Key_CtrlM

const key_t teditor::Key_CtrlM = 0x0D
static

◆ Key_CtrlN

const key_t teditor::Key_CtrlN = 0x0E
static

◆ Key_CtrlO

const key_t teditor::Key_CtrlO = 0x0F
static

◆ Key_CtrlP

const key_t teditor::Key_CtrlP = 0x10
static

◆ Key_CtrlQ

const key_t teditor::Key_CtrlQ = 0x11
static

◆ Key_CtrlR

const key_t teditor::Key_CtrlR = 0x12
static

◆ Key_CtrlRsqBracket

const key_t teditor::Key_CtrlRsqBracket = 0x1D
static

◆ Key_CtrlS

const key_t teditor::Key_CtrlS = 0x13
static

◆ Key_CtrlSlash

const key_t teditor::Key_CtrlSlash = 0x1F
static

◆ Key_CtrlT

const key_t teditor::Key_CtrlT = 0x14
static

◆ Key_CtrlTilde

const key_t teditor::Key_CtrlTilde = 0x00
static

◆ Key_CtrlU

const key_t teditor::Key_CtrlU = 0x15
static

◆ Key_CtrlUnderscore

const key_t teditor::Key_CtrlUnderscore = 0x1F
static

◆ Key_CtrlV

const key_t teditor::Key_CtrlV = 0x16
static

◆ Key_CtrlW

const key_t teditor::Key_CtrlW = 0x17
static

◆ Key_CtrlX

const key_t teditor::Key_CtrlX = 0x18
static

◆ Key_CtrlY

const key_t teditor::Key_CtrlY = 0x19
static

◆ Key_CtrlZ

const key_t teditor::Key_CtrlZ = 0x1A
static

◆ Key_D

const key_t teditor::Key_D = (key_t)'D'
static

◆ Key_d

const key_t teditor::Key_d = (key_t)'d'
static

◆ Key_Delete

const key_t teditor::Key_Delete = (0xFFFF-13)
static

◆ Key_Dollar

const key_t teditor::Key_Dollar = (key_t)'$'
static

◆ Key_Dot

const key_t teditor::Key_Dot = (key_t)'.'
static

◆ Key_DQuote

const key_t teditor::Key_DQuote = (key_t)'"'
static

◆ Key_E

const key_t teditor::Key_E = (key_t)'E'
static

◆ Key_e

const key_t teditor::Key_e = (key_t)'e'
static

◆ Key_Eight

const key_t teditor::Key_Eight = (key_t)'8'
static

◆ Key_End

const key_t teditor::Key_End = (0xFFFF-15)
static

◆ Key_Enter

const key_t teditor::Key_Enter = 0x0D
static

◆ Key_Esc

const key_t teditor::Key_Esc = 0x1B
static

◆ Key_Exclaim

const key_t teditor::Key_Exclaim = (key_t)'!'
static

◆ Key_F

const key_t teditor::Key_F = (key_t)'F'
static

◆ Key_f

const key_t teditor::Key_f = (key_t)'f'
static

◆ Key_F1

const key_t teditor::Key_F1 = (0xFFFF-0)
static

◆ Key_F10

const key_t teditor::Key_F10 = (0xFFFF-9)
static

◆ Key_F11

const key_t teditor::Key_F11 = (0xFFFF-10)
static

◆ Key_F12

const key_t teditor::Key_F12 = (0xFFFF-11)
static

◆ Key_F2

const key_t teditor::Key_F2 = (0xFFFF-1)
static

◆ Key_F3

const key_t teditor::Key_F3 = (0xFFFF-2)
static

◆ Key_F4

const key_t teditor::Key_F4 = (0xFFFF-3)
static

◆ Key_F5

const key_t teditor::Key_F5 = (0xFFFF-4)
static

◆ Key_F6

const key_t teditor::Key_F6 = (0xFFFF-5)
static

◆ Key_F7

const key_t teditor::Key_F7 = (0xFFFF-6)
static

◆ Key_F8

const key_t teditor::Key_F8 = (0xFFFF-7)
static

◆ Key_F9

const key_t teditor::Key_F9 = (0xFFFF-8)
static

◆ Key_FBrktClose

const key_t teditor::Key_FBrktClose = (key_t)'}'
static

◆ Key_FBrktOpen

const key_t teditor::Key_FBrktOpen = (key_t)'{'
static

◆ Key_Five

const key_t teditor::Key_Five = (key_t)'5'
static

◆ Key_Four

const key_t teditor::Key_Four = (key_t)'4'
static

◆ Key_G

const key_t teditor::Key_G = (key_t)'G'
static

◆ Key_g

const key_t teditor::Key_g = (key_t)'g'
static

◆ Key_H

const key_t teditor::Key_H = (key_t)'H'
static

◆ Key_h

const key_t teditor::Key_h = (key_t)'h'
static

◆ Key_Hash

const key_t teditor::Key_Hash = (key_t)'#'
static

◆ Key_Home

const key_t teditor::Key_Home = (0xFFFF-14)
static

◆ Key_I

const key_t teditor::Key_I = (key_t)'I'
static

◆ Key_i

const key_t teditor::Key_i = (key_t)'i'
static

◆ Key_Insert

const key_t teditor::Key_Insert = (0xFFFF-12)
static

◆ Key_Invalid

const key_t teditor::Key_Invalid = 0xFFFFFFFF
static

◆ Key_J

const key_t teditor::Key_J = (key_t)'J'
static

◆ Key_j

const key_t teditor::Key_j = (key_t)'j'
static

◆ Key_K

const key_t teditor::Key_K = (key_t)'K'
static

◆ Key_k

const key_t teditor::Key_k = (key_t)'k'
static

◆ Key_L

const key_t teditor::Key_L = (key_t)'L'
static

◆ Key_l

const key_t teditor::Key_l = (key_t)'l'
static

◆ Key_Line

const key_t teditor::Key_Line = (key_t)'|'
static

◆ Key_Lt

const key_t teditor::Key_Lt = (key_t)'<'
static

◆ Key_M

const key_t teditor::Key_M = (key_t)'M'
static

◆ Key_m

const key_t teditor::Key_m = (key_t)'m'
static

◆ Key_Minus

const key_t teditor::Key_Minus = (key_t)'-'
static

◆ Key_MouseLeft

const key_t teditor::Key_MouseLeft = (0xFFFF-22)
static

◆ Key_MouseMiddle

const key_t teditor::Key_MouseMiddle = (0xFFFF-24)
static

◆ Key_MouseRelease

const key_t teditor::Key_MouseRelease = (0xFFFF-25)
static

◆ Key_MouseRight

const key_t teditor::Key_MouseRight = (0xFFFF-23)
static

◆ Key_MouseWheelDown

const key_t teditor::Key_MouseWheelDown = (0xFFFF-27)
static

◆ Key_MouseWheelUp

const key_t teditor::Key_MouseWheelUp = (0xFFFF-26)
static

◆ Key_N

const key_t teditor::Key_N = (key_t)'N'
static

◆ Key_n

const key_t teditor::Key_n = (key_t)'n'
static

◆ Key_Nine

const key_t teditor::Key_Nine = (key_t)'9'
static

◆ Key_O

const key_t teditor::Key_O = (key_t)'O'
static

◆ Key_o

const key_t teditor::Key_o = (key_t)'o'
static

◆ Key_One

const key_t teditor::Key_One = (key_t)'1'
static

◆ Key_P

const key_t teditor::Key_P = (key_t)'P'
static

◆ Key_p

const key_t teditor::Key_p = (key_t)'p'
static

◆ Key_PageDown

const key_t teditor::Key_PageDown = (0xFFFF-17)
static

◆ Key_PageUp

const key_t teditor::Key_PageUp = (0xFFFF-16)
static

◆ Key_Percent

const key_t teditor::Key_Percent = (key_t)'%'
static

◆ Key_Plus

const key_t teditor::Key_Plus = (key_t)'+'
static

◆ Key_Q

const key_t teditor::Key_Q = (key_t)'Q'
static

◆ Key_q

const key_t teditor::Key_q = (key_t)'q'
static

◆ Key_Question

const key_t teditor::Key_Question = (key_t)'?'
static

◆ Key_R

const key_t teditor::Key_R = (key_t)'R'
static

◆ Key_r

const key_t teditor::Key_r = (key_t)'r'
static

◆ Key_S

const key_t teditor::Key_S = (key_t)'S'
static

◆ Key_s

const key_t teditor::Key_s = (key_t)'s'
static

◆ Key_SemiColo

const key_t teditor::Key_SemiColo = (key_t)';'
static

◆ Key_Seven

const key_t teditor::Key_Seven = (key_t)'7'
static

◆ Key_Six

const key_t teditor::Key_Six = (key_t)'6'
static

◆ Key_Slash

const key_t teditor::Key_Slash = (key_t)'/'
static

◆ Key_Space

const key_t teditor::Key_Space = (key_t)' '
static

◆ Key_SqBrktClose

const key_t teditor::Key_SqBrktClose = (key_t)']'
static

◆ Key_SqBrktOpt

const key_t teditor::Key_SqBrktOpt = (key_t)'['
static

◆ Key_SQuote

const key_t teditor::Key_SQuote = (key_t)'\''
static

◆ Key_Star

const key_t teditor::Key_Star = (key_t)'*'
static

◆ Key_T

const key_t teditor::Key_T = (key_t)'T'
static

◆ Key_t

const key_t teditor::Key_t = (key_t)'t'
static

◆ Key_Tab

const key_t teditor::Key_Tab = 0x09
static

◆ Key_Three

const key_t teditor::Key_Three = (key_t)'3'
static

◆ Key_Tilde

const key_t teditor::Key_Tilde = (key_t)'~'
static

◆ Key_Two

const key_t teditor::Key_Two = (key_t)'2'
static

◆ Key_U

const key_t teditor::Key_U = (key_t)'U'
static

◆ Key_u

const key_t teditor::Key_u = (key_t)'u'
static

◆ Key_Underscore

const key_t teditor::Key_Underscore = (key_t)'_'
static

◆ Key_V

const key_t teditor::Key_V = (key_t)'V'
static

◆ Key_v

const key_t teditor::Key_v = (key_t)'v'
static

◆ Key_W

const key_t teditor::Key_W = (key_t)'W'
static

◆ Key_w

const key_t teditor::Key_w = (key_t)'w'
static

◆ Key_X

const key_t teditor::Key_X = (key_t)'X'
static

◆ Key_x

const key_t teditor::Key_x = (key_t)'x'
static

◆ Key_Y

const key_t teditor::Key_Y = (key_t)'Y'
static

◆ Key_y

const key_t teditor::Key_y = (key_t)'y'
static

◆ Key_Z

const key_t teditor::Key_Z = (key_t)'Z'
static

◆ Key_z

const key_t teditor::Key_z = (key_t)'z'
static

◆ Key_Zero

const key_t teditor::Key_Zero = (key_t)'0'
static

◆ Meta_Alt

const key_t teditor::Meta_Alt = 0x00020000
static

◆ Meta_Ctrl

const key_t teditor::Meta_Ctrl = 0x00040000
static

◆ Meta_Motion

const key_t teditor::Meta_Motion = 0x00080000
static

◆ Meta_None

const key_t teditor::Meta_None = 0x00000000
static

◆ Meta_Shift

const key_t teditor::Meta_Shift = 0x00010000
static