#include <libxml/parser.h>
#include <libxml/tree.h>
-/*
#ifdef WIN32
-//For GetModuleFileNameW
-#include <windows.h>
+#pragma warning(disable : 4996) // for getenv
#endif
-*/
#ifdef _DEBUG
#include <iostream>
std::string aSourceFile = getProperty(theNode, SOURCE_FILE);
Config_XMLReader aSourceReader = Config_XMLReader(aSourceFile);
readRecursively(aSourceReader.findRoot());
- #ifdef _DEBUG
+#ifdef _DEBUG
std::cout << "Config_XMLReader::sourced node: " << aSourceFile << std::endl;
- #endif
+#endif
} else if (isNode(theNode, NODE_VALIDATOR, NULL)) {
processValidator(theNode);
}
if (!theParent)
return;
xmlNodePtr aNode = theParent->xmlChildrenNode;
- for(; aNode; aNode = aNode->next) {
+ for (; aNode; aNode = aNode->next) {
//Still no text processing in features...
- if(!isElementNode(aNode)) {
+ if (!isElementNode(aNode)) {
continue;
}
processNode(aNode);
return static_cast<xmlNodePtr>(theNode);
}
-/*
- * Returns named property for a given node as std::string.
- */
-std::string Config_XMLReader::getProperty(xmlNodePtr theNode, const char* theName)
+std::string Config_XMLReader::getNodeName(xmlNodePtr theNode)
{
std::string result = "";
- char* aPropChars = (char*) xmlGetProp(theNode, BAD_CAST theName);
+ char* aPropChars = (char*) theNode->name;
if (!aPropChars || aPropChars[0] == 0)
return result;
result = std::string(aPropChars);
{
Events_ID aValidatoEvent = Events_Loop::eventByName(EVENT_VALIDATOR_LOADED);
Events_Loop* aEvLoop = Events_Loop::loop();
- Config_ValidatorMessage aMessage(aValidatoEvent, this);
+ std::shared_ptr<Config_ValidatorMessage>
+ aMessage(new Config_ValidatorMessage(aValidatoEvent, this));
std::string aValidatorId;
std::list<std::string> aValidatorParameters;
getValidatorInfo(theNode, aValidatorId, aValidatorParameters);
- aMessage.setValidatorId(aValidatorId);
- aMessage.setValidatorParameters(aValidatorParameters);
+ aMessage->setValidatorId(aValidatorId);
+ aMessage->setValidatorParameters(aValidatorParameters);
xmlNodePtr aFeatureOrWdgNode = theNode->parent;
- if(isNode(aFeatureOrWdgNode, NODE_FEATURE, NULL)) {
- aMessage.setFeatureId(getProperty(aFeatureOrWdgNode, _ID));
+ if (isNode(aFeatureOrWdgNode, NODE_FEATURE, NULL)) {
+ aMessage->setFeatureId(getProperty(aFeatureOrWdgNode, _ID));
} else {
- aMessage.setAttributeId(getProperty(aFeatureOrWdgNode, _ID));
- aMessage.setFeatureId(myCurrentFeature);
+ aMessage->setAttributeId(getProperty(aFeatureOrWdgNode, _ID));
+ aMessage->setFeatureId(myCurrentFeature);
}
aEvLoop->send(aMessage);
}