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";
28 Config_ModuleReader::Config_ModuleReader()
29 : Config_XMLReader("plugins.xml"), m_isAutoImport(false)
33 Config_ModuleReader::~Config_ModuleReader()
38 * Get module name from plugins.xml
41 std::string Config_ModuleReader::getModuleName()
43 xmlNodePtr aRoot = findRoot();
44 return getProperty(aRoot, PLUGINS_MODULE);
50 void Config_ModuleReader::processNode(xmlNodePtr theNode)
52 if (isNode(theNode, NODE_PLUGIN, NULL)) {
53 std::string aPluginName = getProperty(theNode, PLUGIN_CONFIG);
55 importPlugin(aPluginName);
56 m_pluginsList.push_back(aPluginName);
60 bool Config_ModuleReader::processChildren(xmlNodePtr theNode)
62 return isNode(theNode, NODE_PLUGINS, NULL);
65 void Config_ModuleReader::importPlugin(const std::string& thePluginName)
67 Config_FeatureReader aReader(thePluginName);
71 void Config_ModuleReader::setAutoImport(bool enabled)
73 m_isAutoImport = enabled;
76 const std::list<std::string>& Config_ModuleReader::pluginsList() const