diff options
Diffstat (limited to 'src/shared/Config/dotconfpp/dotconfpp.cpp')
-rw-r--r-- | src/shared/Config/dotconfpp/dotconfpp.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/shared/Config/dotconfpp/dotconfpp.cpp b/src/shared/Config/dotconfpp/dotconfpp.cpp index e779637256e..8760b118e38 100644 --- a/src/shared/Config/dotconfpp/dotconfpp.cpp +++ b/src/shared/Config/dotconfpp/dotconfpp.cpp @@ -29,7 +29,7 @@ DOTCONFDocumentNode::~DOTCONFDocumentNode() { free(name); if(values != NULL){ - for(int i = 0 ; i < valuesCount; i++){ + for (int i = 0 ; i < valuesCount; i++){ free(values[i]); } free(values); @@ -67,13 +67,13 @@ DOTCONFDocument::DOTCONFDocument(DOTCONFDocument::CaseSensitive caseSensitivity) DOTCONFDocument::~DOTCONFDocument() { - for(std::list<DOTCONFDocumentNode*>::iterator i = nodeTree.begin(); i != nodeTree.end(); ++i){ + for (std::list<DOTCONFDocumentNode*>::iterator i = nodeTree.begin(); i != nodeTree.end(); ++i){ delete(*i); } - for(std::list<char*>::iterator i = requiredOptions.begin(); i != requiredOptions.end(); ++i){ + for (std::list<char*>::iterator i = requiredOptions.begin(); i != requiredOptions.end(); ++i){ free(*i); } - for(std::list<char*>::iterator i = processedFiles.begin(); i != processedFiles.end(); ++i){ + for (std::list<char*>::iterator i = processedFiles.begin(); i != processedFiles.end(); ++i){ free(*i); } free(fileName); @@ -189,7 +189,7 @@ int DOTCONFDocument::parseLine() DOTCONFDocumentNode * tagNode = NULL; bool newNode = false; - for(std::list<char*>::iterator i = words.begin(); i != words.end(); ++i) { + for (std::list<char*>::iterator i = words.begin(); i != words.end(); ++i) { word = *i; if(*word == '<'){ @@ -218,7 +218,7 @@ int DOTCONFDocument::parseLine() } else { nodeName+=2; std::list<DOTCONFDocumentNode*>::reverse_iterator itr=nodeTree.rbegin(); - for(; itr!=nodeTree.rend(); ++itr){ + for (; itr!=nodeTree.rend(); ++itr){ if(!cmp_func(nodeName, (*itr)->name) && !(*itr)->closed){ (*itr)->closed = true; curParent = (*itr)->parentNode; @@ -307,7 +307,7 @@ int DOTCONFDocument::checkConfig(const std::list<DOTCONFDocumentNode*>::iterator DOTCONFDocumentNode * tagNode = NULL; int vi = 0; - for(std::list<DOTCONFDocumentNode*>::iterator i = from; i != nodeTree.end(); ++i){ + for (std::list<DOTCONFDocumentNode*>::iterator i = from; i != nodeTree.end(); ++i){ tagNode = *i; if(!tagNode->closed){ error(tagNode->lineNum, tagNode->fileName, "unclosed tag %s", tagNode->name); @@ -371,7 +371,7 @@ int DOTCONFDocument::setContent(const char * _fileName) std::list<DOTCONFDocumentNode*>::iterator from; DOTCONFDocumentNode * tagNode = NULL; int vi = 0; - for(std::list<DOTCONFDocumentNode*>::iterator i = nodeTree.begin(); i!=nodeTree.end(); ++i){ + for (std::list<DOTCONFDocumentNode*>::iterator i = nodeTree.begin(); i!=nodeTree.end(); ++i){ tagNode = *i; if(!cmp_func("DOTCONFPPIncludeFile", tagNode->name)){ vi = 0; @@ -386,7 +386,7 @@ int DOTCONFDocument::setContent(const char * _fileName) } bool processed = false; - for(std::list<char*>::const_iterator itInode = processedFiles.begin(); itInode != processedFiles.end(); ++itInode){ + for (std::list<char*>::const_iterator itInode = processedFiles.begin(); itInode != processedFiles.end(); ++itInode){ if(!strcmp(*itInode, realpathBuf)){ processed = true; break; @@ -419,7 +419,6 @@ int DOTCONFDocument::setContent(const char * _fileName) } } - if(!requiredOptions.empty()) ret = checkRequiredOptions(); } @@ -429,9 +428,9 @@ int DOTCONFDocument::setContent(const char * _fileName) int DOTCONFDocument::checkRequiredOptions() { - for(std::list<char*>::const_iterator ci = requiredOptions.begin(); ci != requiredOptions.end(); ++ci){ + for (std::list<char*>::const_iterator ci = requiredOptions.begin(); ci != requiredOptions.end(); ++ci){ bool matched = false; - for(std::list<DOTCONFDocumentNode*>::iterator i = nodeTree.begin(); i!=nodeTree.end(); ++i){ + for (std::list<DOTCONFDocumentNode*>::iterator i = nodeTree.begin(); i!=nodeTree.end(); ++i){ if(!cmp_func((*i)->name, *ci)){ matched = true; break; @@ -499,7 +498,7 @@ char * DOTCONFDocument::getSubstitution(char * macro, int lineNum) } else { std::list<DOTCONFDocumentNode*>::iterator i = nodeTree.begin(); DOTCONFDocumentNode * tagNode = NULL; - for(; i!=nodeTree.end(); i++){ + for (; i!=nodeTree.end(); i++){ tagNode = *i; if(!cmp_func(tagNode->name, variable)){ if(tagNode->valuesCount != 0){ @@ -566,7 +565,6 @@ const DOTCONFDocumentNode * DOTCONFDocument::getFirstNode() const const DOTCONFDocumentNode * DOTCONFDocument::findNode(const char * nodeName, const DOTCONFDocumentNode * parentNode, const DOTCONFDocumentNode * startNode) const { - std::list<DOTCONFDocumentNode*>::const_iterator i = nodeTree.begin(); if(startNode == NULL) @@ -579,7 +577,7 @@ const DOTCONFDocumentNode * DOTCONFDocument::findNode(const char * nodeName, con if( i != nodeTree.end() ) ++i; } - for(; i!=nodeTree.end(); ++i){ + for (; i!=nodeTree.end(); ++i){ if((*i)->parentNode != parentNode){ continue; |