diff options
author | Henri Herscher <henri@oreka.org> | 2005-11-16 04:48:36 +0000 |
---|---|---|
committer | Henri Herscher <henri@oreka.org> | 2005-11-16 04:48:36 +0000 |
commit | c566a2df5d07033a042fec0a9347b9d7b736cee4 (patch) | |
tree | c6445b685c8bbb570a7d1749a2d06a94f69882b9 | |
parent | c6ca8207051cbee951d168d4316e26c812161aa4 (diff) |
config.xml config file can now be located in /etc/oreka
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@47 09dcff7a-b715-0410-9601-b79a96267cd0
-rw-r--r-- | orkaudio/ConfigManager.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/orkaudio/ConfigManager.cpp b/orkaudio/ConfigManager.cpp index df38818..9157539 100644 --- a/orkaudio/ConfigManager.cpp +++ b/orkaudio/ConfigManager.cpp @@ -23,6 +23,7 @@ #include "LogManager.h" #define CONFIG_FILE_NAME "config.xml" +#define ETC_CONFIG_FILE_NAME "/etc/oreka/config.xml" void ConfigManager::Initialize() @@ -32,9 +33,23 @@ void ConfigManager::Initialize() try { + char* cfgFilename = ""; + FILE* file = ACE_OS::fopen(CONFIG_FILE_NAME, "r"); + if(file) + { + // config.xml exists in the current directory + cfgFilename = CONFIG_FILE_NAME; + fclose(file); + } + else + { + // config.xml could not be found in the current directory, try to find it in /etc/oreka + cfgFilename = ETC_CONFIG_FILE_NAME; + } + XMLPlatformUtils::Initialize(); XercesDOMParser *parser = new XercesDOMParser; - parser->parse(CONFIG_FILE_NAME); + parser->parse(cfgFilename); DOMNode *doc = NULL; doc = parser->getDocument(); |