4 * Created on: Apr 17, 2014
8 #include "Config_Common.h"
10 #include <libxml/parser.h>
11 #include <libxml/tree.h>
13 bool isElementNode(xmlNodePtr theNode)
15 return theNode->type == XML_ELEMENT_NODE;
18 bool isNode(xmlNodePtr theNode, const char* theNodeName, ...)
21 const xmlChar* aName = theNode->name;
22 if (!aName || !isElementNode(theNode)) {
25 if (!xmlStrcmp(aName, (const xmlChar *) theNodeName)) {
28 va_list args; // define argument list variable
29 va_start(args, theNodeName); // init list; point to last defined argument
31 char *anArg = va_arg (args, char*); // get next argument
34 if (!xmlStrcmp(aName, (const xmlChar *) anArg)) {
35 va_end(args); // cleanup the system stack
39 va_end(args); // cleanup the system stack
43 bool hasChild(xmlNodePtr theNode)
45 xmlNodePtr aNode = theNode->children;
46 for( ; aNode; aNode = aNode->next) {
47 if (isElementNode(theNode)) {
54 std::string library(const std::string& theLibName)
56 std::string aLibName = theLibName;
58 static std::string aLibExt( ".so" );
59 if (aLibName.size() < 3 || aLibName.substr(0, 3) !="lib") {
60 aLibName = "lib" + aLibName;
63 static std::string aLibExt(".dll");
65 std::string anExt = aLibName.substr(aLibName.size() - 4);