teditor
1.8.0@@fee5e94
Terminal based editor written in C++
|
Go to the documentation of this file.
4 #include <unordered_map>
16 typedef std::pair<OperateFunc, std::string>
Command;
18 typedef std::unordered_map<std::string, Command>
CommandMap;
51 #define DEF_CMD(UniqName, CmdName, CmdGroup, OpFunc) \
52 CmdRegistrar cmd ## UniqName(CmdName, OpFunc, CmdGroup)
55 #define DEF_OP() [](Editor& ed)
void(* OperateFunc)(Editor &ed)
Definition: command.h:14
std::pair< OperateFunc, std::string > Command
Definition: command.h:16
CommandMap & cmds()
Definition: command.cpp:8
Strings allCmdNames(CmdFilterOp filterOp)
Accessor function to the list of command names.
Definition: command.cpp:30
std::vector< std::string > Strings
Definition: utils.h:42
#define ASSERT(check, fmt,...)
Macro to assert with runtime_error exception if the check fails.
Definition: utils.h:35
CmdRegistrar(const std::string &cmd, OperateFunc op, const std::string &grp)
Definition: command.cpp:13
const Command & getCmd(const std::string &cmd)
Helper to return the command of interest.
Definition: command.cpp:23
bool defaultCmdFilterOp(const std::string &name)
Definition: command.cpp:21
bool(* CmdFilterOp)(const std::string &)
Definition: command.h:20
std::unordered_map< std::string, Command > CommandMap
Definition: command.h:18