2 * Config_ModuleReader.cpp
4 * Created on: Mar 20, 2014
8 #include <Config_ModuleReader.h>
9 #include <Config_FeatureReader.h>
11 #include <libxml\parser.h>
12 #include <libxml\tree.h>
18 //Hardcoded xml entities
20 const static char* NODE_PLUGIN = "plugin";
21 const static char* NODE_PLUGINS = "plugins";
24 const static char* PLUGINS_MODULE = "module";
25 const static char* PLUGIN_CONFIG = "configuration";
26 const static char* PLUGIN_LIBRARY = "library";
29 Config_ModuleReader::Config_ModuleReader()
30 : Config_XMLReader("plugins.xml"),
35 Config_ModuleReader::~Config_ModuleReader()
40 * Get module name from plugins.xml
43 std::string Config_ModuleReader::getModuleName()
45 xmlNodePtr aRoot = findRoot();
46 return getProperty(aRoot, PLUGINS_MODULE);
52 void Config_ModuleReader::processNode(xmlNodePtr theNode)
54 if(isNode(theNode, NODE_PLUGIN, NULL)) {
55 std::string aPluginName = getProperty(theNode, PLUGIN_CONFIG);
57 importPlugin(aPluginName);
58 m_pluginsList.push_back(aPluginName);
62 bool Config_ModuleReader::processChildren(xmlNodePtr theNode)
64 return isNode(theNode, NODE_PLUGINS, NULL);
67 void Config_ModuleReader::importPlugin(const std::string& thePluginName)
69 Config_FeatureReader aReader(thePluginName);
73 void Config_ModuleReader::setAutoImport(bool enabled)
75 m_isAutoImport = enabled;
78 const std::list<std::string>& Config_ModuleReader::pluginsList() const