From 6092852640096c777f700cf669666504b10e2a58 Mon Sep 17 00:00:00 2001 From: Justin Frank Date: Tue, 12 Mar 2019 10:34:30 -0700 Subject: Added 'provide-module' and 'require-module' commands --- src/command_manager.hh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/command_manager.hh') diff --git a/src/command_manager.hh b/src/command_manager.hh index 0468a1fc..329c24f2 100644 --- a/src/command_manager.hh +++ b/src/command_manager.hh @@ -123,6 +123,12 @@ public: void clear_last_complete_command() { m_last_complete_command = String{}; } + bool module_defined(StringView module_name) const; + + void register_module(String module_name, String commands); + + void load_module(StringView module_name, Context& context); + private: void execute_single_command(CommandParameters params, Context& context, @@ -143,6 +149,14 @@ private: String m_last_complete_command; int m_command_depth = 0; + struct Module + { + bool loaded; + String commands; + }; + using ModuleMap = HashMap; + ModuleMap m_modules; + CommandMap::const_iterator find_command(const Context& context, StringView name) const; }; -- cgit v1.2.3