teditor  1.8.0@@fee5e94
Terminal based editor written in C++
Classes | Namespaces | Macros | Typedefs | Functions
command.h File Reference
#include <string>
#include <unordered_map>
#include "utils.h"
#include <utility>

Go to the source code of this file.

Classes

struct  teditor::CmdRegistrar
 

Namespaces

 teditor
 

Macros

#define DEF_CMD(UniqName, CmdName, CmdGroup, OpFunc)   CmdRegistrar cmd ## UniqName(CmdName, OpFunc, CmdGroup)
 
#define DEF_OP()   [](Editor& ed)
 

Typedefs

typedef void(* teditor::OperateFunc) (Editor &ed)
 
typedef std::pair< OperateFunc, std::string > teditor::Command
 
typedef std::unordered_map< std::string, Command > teditor::CommandMap
 
typedef bool(* teditor::CmdFilterOp) (const std::string &)
 

Functions

bool teditor::defaultCmdFilterOp (const std::string &name)
 
const Command & teditor::getCmd (const std::string &cmd)
 Helper to return the command of interest. More...
 
Strings teditor::allCmdNames (CmdFilterOp filterOp=defaultCmdFilterOp)
 Accessor function to the list of command names. More...
 

Macro Definition Documentation

◆ DEF_CMD

#define DEF_CMD (   UniqName,
  CmdName,
  CmdGroup,
  OpFunc 
)    CmdRegistrar cmd ## UniqName(CmdName, OpFunc, CmdGroup)

macro to register a command to the database

◆ DEF_OP

#define DEF_OP ( )    [](Editor& ed)

helper macro to define a command function