#include <iostream>
#endif
-
Config_XMLReader::Config_XMLReader(const std::string& theXmlFileName)
{
std::string prefix;
prefix = std::string(char_path);
//chop "bin\XGUI.exe"
unsigned found = prefix.rfind("bin");
- if(found != std::string::npos)
+ if (found != std::string::npos)
prefix.replace(found, prefix.length(), "plugins\\");
#else
//TODO(sbh): Find full path to binary on linux
m_DocumentPath = prefix + theXmlFileName;
}
-
Config_XMLReader::~Config_XMLReader()
{
}
*/
void Config_XMLReader::processNode(xmlNodePtr aNode)
{
- #ifdef _DEBUG
- std::cout << "Config_XMLReader::processNode: "
- << aNode->name << " content: "
- << aNode->content << std::endl;
- #endif
+#ifdef _DEBUG
+ std::cout << "Config_XMLReader::processNode: "
+ << aNode->name << " content: "
+ << aNode->content << std::endl;
+#endif
}
/*
{
xmlDocPtr aDoc;
aDoc = xmlParseFile(m_DocumentPath.c_str());
- if(aDoc == NULL) {
- #ifdef _DEBUG
+ if (aDoc == NULL) {
+#ifdef _DEBUG
std::cout << "Config_XMLReader::import: " << "Document " << m_DocumentPath
- << " is not parsed successfully." << std::endl;
- #endif
+ << " is not parsed successfully." << std::endl;
+#endif
return NULL;
}
xmlNodePtr aRoot = xmlDocGetRootElement(aDoc);
- #ifdef _DEBUG
+#ifdef _DEBUG
if(aRoot == NULL) {
std::cout << "Config_XMLReader::import: " << "Error: empty document";
}
- #endif
+#endif
return aRoot;
}
{
static Event_ID aFeatureEvent = Event_Loop::EventByName("Feature");
- if(!theParent)
+ if (!theParent)
return;
xmlNodePtr aNode = theParent->xmlChildrenNode;
for(; aNode; aNode = aNode->next) {
processNode(aNode);
- if(processChildren(aNode)) {
+ if (processChildren(aNode)) {
readRecursively(aNode);
Config_FeatureMessage aMessage(aFeatureEvent, this);
}
{
std::string result = "";
char* aPropChars = (char*) xmlGetProp(theNode, BAD_CAST name);
- if(!aPropChars || aPropChars[0] == 0)
+ if (!aPropChars || aPropChars[0] == 0)
return result;
result = std::string(aPropChars);
return result;
{
bool result = false;
const xmlChar* aName = theNode->name;
- if(!aName || theNode->type != XML_ELEMENT_NODE)
+ if (!aName || theNode->type != XML_ELEMENT_NODE)
return false;
- if(!xmlStrcmp(aName, (const xmlChar *) theNodeName))
+ if (!xmlStrcmp(aName, (const xmlChar *) theNodeName))
return true;
va_list args; // define argument list variable
- va_start (args, theNodeName); // init list; point to last defined argument
+ va_start(args, theNodeName); // init list; point to last defined argument
while(true) {
char *anArg = va_arg (args, char *); // get next argument
- if(anArg == NULL)
+ if (anArg == NULL)
break;
- if(!xmlStrcmp(aName, (const xmlChar *) anArg)) {
- va_end (args); // cleanup the system stack
+ if (!xmlStrcmp(aName, (const xmlChar *) anArg)) {
+ va_end(args); // cleanup the system stack
return true;
}
}
- va_end (args); // cleanup the system stack
+ va_end(args); // cleanup the system stack
return false;
}