2 * Config_WidgetReader.cpp
4 * Created on: Apr 2, 2014
8 #include <Config_WidgetReader.h>
9 #include <Config_Keywords.h>
10 #include <Config_Common.h>
12 #include <libxml/parser.h>
13 #include <libxml/tree.h>
14 #include <libxml/xpath.h>
15 #include <libxml/xmlstring.h>
22 Config_WidgetReader::Config_WidgetReader(const std::string& theXmlFile)
23 : Config_XMLReader(theXmlFile)
28 Config_WidgetReader::~Config_WidgetReader()
32 std::string Config_WidgetReader::featureWidgetCfg(const std::string& theFeatureName)
34 return myWidgetCache[theFeatureName];
37 std::string Config_WidgetReader::featureDescription(const std::string& theFeatureName)
39 return myDescriptionCache[theFeatureName];
42 void Config_WidgetReader::processNode(xmlNodePtr theNode)
44 if (isNode(theNode, NODE_FEATURE, NULL)) {
45 std::string result = "";
46 std::string aNodeName = getProperty(theNode, _ID);
47 if (hasChild(theNode)) {
48 xmlBufferPtr buffer = xmlBufferCreate();
49 int size = xmlNodeDump(buffer, theNode->doc, theNode, 0, 1);
50 result = std::string((char*) buffer->content);
52 myWidgetCache[aNodeName] = result;
53 myDescriptionCache[aNodeName] = getProperty(theNode, FEATURE_TEXT);
57 bool Config_WidgetReader::processChildren(xmlNodePtr theNode)
59 return isNode(theNode, NODE_WORKBENCH, NODE_GROUP, NULL);