summaryrefslogtreecommitdiff
path: root/src/command_manager.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/command_manager.hh')
-rw-r--r--src/command_manager.hh14
1 files changed, 14 insertions, 0 deletions
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<String, Module, MemoryDomain::Commands>;
+ ModuleMap m_modules;
+
CommandMap::const_iterator find_command(const Context& context,
StringView name) const;
};