#pragma once #include #include class Command { std::string m_name; Command (const std::string& name) : m_name (name) { } }; /* * Function pointer type that returns true if we should stop processing input, * false otherwise. */ #define COMMANDHELPERFUNC(x) bool x (const std::string&) typedef COMMANDHELPERFUNC((*CommandHelperFunc)); COMMANDHELPERFUNC(command_Quit); COMMANDHELPERFUNC(command_Help); COMMANDHELPERFUNC(command_Echo); COMMANDHELPERFUNC(command_Shell); const std::map CommandFunctionList = { { "quit", command_Quit, }, { "help", command_Help, }, { "echo", command_Echo, }, { "shell", command_Shell, }, };