From f4c20290509d7ed3a8fd5304577e7a4cc0b9d974 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 3 Apr 2007 03:49:53 +0000 Subject: Ok, no code is left in src, it's all in src/old. We'll gradually move code back into src as it's fixed and re-org'd. This includes tests, which, I may write a unit test system into libbu++ just to make my life easier. --- src/configmanagerbase.cpp | 63 ----------------------------------------------- 1 file changed, 63 deletions(-) delete mode 100644 src/configmanagerbase.cpp (limited to 'src/configmanagerbase.cpp') diff --git a/src/configmanagerbase.cpp b/src/configmanagerbase.cpp deleted file mode 100644 index ac55fe0..0000000 --- a/src/configmanagerbase.cpp +++ /dev/null @@ -1,63 +0,0 @@ -#include -#include -#include "xmlnode.h" -#include "xmlfilereader.h" -#include "configmanagerbase.h" - -ConfigManagerBase::ConfigManagerBase() -{ -} - -ConfigManagerBase::~ConfigManagerBase() -{ -} - -void ConfigManagerBase::addSearchPath( const std::string &sPath ) -{ - lSearchPath.push_back( sPath ); -} - -void ConfigManagerBase::loadConfig( const std::string &sFileName, const char *lpProfile ) -{ - // Try a few locations... - std::list::const_iterator i; - for( i = lSearchPath.begin(); i != lSearchPath.end(); i++ ) - { - if( parseConfig( (*i + sFileName).c_str(), lpProfile ) ) - { - break; - } - } -} - -bool ConfigManagerBase::parseConfig( const char *lpFileName, const char *lpProfile ) -{ - XmlNode *pRoot, *pCur; - XmlFileReader doc( lpFileName ); - - pRoot = doc.getRoot(); - if( pRoot == NULL ) - { - return false; - } - - if( strcmp("config", pRoot->getName() ) ) - { - return false; - } - - for( int j = 0;; j++ ) - { - pCur = pRoot->getChild( "profile", j ); - if( pCur == NULL ) - return false; - - if( !strcmp( pCur->getProperty("id"), lpProfile ) ) - { - return processProfile( pCur ); - } - } - - return false; -} - -- cgit v1.2.3