From e63f88aa3f8fe1c0cf8366ee09188a4b18ede166 Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Thu, 30 Mar 2023 15:58:57 -0400 Subject: Finish reactions module --- src/modules.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/modules.cpp') diff --git a/src/modules.cpp b/src/modules.cpp index 6a8d500..b2e56e1 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -182,6 +182,22 @@ bool ModuleLoader::reload(const std::string &filename) return (unload(filename) && load(filename)); } + +/** + * Load all modules from the config file modules.json + */ +void ModuleLoader::load_all() +{ + json document; + std::ifstream configfile("./config.json"); + configfile >> document; + json modlist = document["modules"]; + for (auto entry = modlist.begin(); entry != modlist.end(); ++entry) { + std::string modulename = entry->get(); + this->load(modulename); + } +} + /** * Return a given symbol name from a shared object represented by the ModuleNative value. */ -- cgit v1.2.3