diff options
author | Mike Buland <eichlan@xagasoft.com> | 2009-02-11 05:29:41 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2009-02-11 05:29:41 +0000 |
commit | f4b191f0ea396b58465bfba40749977780a3af58 (patch) | |
tree | 891490e91ab3b67524be67b2b71c85d84fd2f92a /src/old/configmanagerbase.cpp | |
parent | 292ae9453e7fdb2f1023ed9dfc99cbcd751f8b90 (diff) | |
download | libbu++-f4b191f0ea396b58465bfba40749977780a3af58.tar.gz libbu++-f4b191f0ea396b58465bfba40749977780a3af58.tar.bz2 libbu++-f4b191f0ea396b58465bfba40749977780a3af58.tar.xz libbu++-f4b191f0ea396b58465bfba40749977780a3af58.zip |
Just removing some things that are cluttering up the source tree.
Diffstat (limited to 'src/old/configmanagerbase.cpp')
-rw-r--r-- | src/old/configmanagerbase.cpp | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/src/old/configmanagerbase.cpp b/src/old/configmanagerbase.cpp deleted file mode 100644 index ac55fe0..0000000 --- a/src/old/configmanagerbase.cpp +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | #include <stdlib.h> | ||
2 | #include <string.h> | ||
3 | #include "xmlnode.h" | ||
4 | #include "xmlfilereader.h" | ||
5 | #include "configmanagerbase.h" | ||
6 | |||
7 | ConfigManagerBase::ConfigManagerBase() | ||
8 | { | ||
9 | } | ||
10 | |||
11 | ConfigManagerBase::~ConfigManagerBase() | ||
12 | { | ||
13 | } | ||
14 | |||
15 | void ConfigManagerBase::addSearchPath( const std::string &sPath ) | ||
16 | { | ||
17 | lSearchPath.push_back( sPath ); | ||
18 | } | ||
19 | |||
20 | void ConfigManagerBase::loadConfig( const std::string &sFileName, const char *lpProfile ) | ||
21 | { | ||
22 | // Try a few locations... | ||
23 | std::list<std::string>::const_iterator i; | ||
24 | for( i = lSearchPath.begin(); i != lSearchPath.end(); i++ ) | ||
25 | { | ||
26 | if( parseConfig( (*i + sFileName).c_str(), lpProfile ) ) | ||
27 | { | ||
28 | break; | ||
29 | } | ||
30 | } | ||
31 | } | ||
32 | |||
33 | bool ConfigManagerBase::parseConfig( const char *lpFileName, const char *lpProfile ) | ||
34 | { | ||
35 | XmlNode *pRoot, *pCur; | ||
36 | XmlFileReader doc( lpFileName ); | ||
37 | |||
38 | pRoot = doc.getRoot(); | ||
39 | if( pRoot == NULL ) | ||
40 | { | ||
41 | return false; | ||
42 | } | ||
43 | |||
44 | if( strcmp("config", pRoot->getName() ) ) | ||
45 | { | ||
46 | return false; | ||
47 | } | ||
48 | |||
49 | for( int j = 0;; j++ ) | ||
50 | { | ||
51 | pCur = pRoot->getChild( "profile", j ); | ||
52 | if( pCur == NULL ) | ||
53 | return false; | ||
54 | |||
55 | if( !strcmp( pCur->getProperty("id"), lpProfile ) ) | ||
56 | { | ||
57 | return processProfile( pCur ); | ||
58 | } | ||
59 | } | ||
60 | |||
61 | return false; | ||
62 | } | ||
63 | |||