diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-08-25 17:35:44 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-08-25 17:35:44 +0000 |
commit | 529ba0581833b05921d8dc3336b02a3c6abd511a (patch) | |
tree | 0fe12ba22ffef75d2e0ab5729fa86dd48bbbf20b /src/configuration.cpp | |
parent | 9c5199501633ba0e032035a20ef7b9b8e09585cd (diff) | |
download | mana-529ba0581833b05921d8dc3336b02a3c6abd511a.tar.gz mana-529ba0581833b05921d8dc3336b02a3c6abd511a.tar.bz2 mana-529ba0581833b05921d8dc3336b02a3c6abd511a.tar.xz mana-529ba0581833b05921d8dc3336b02a3c6abd511a.zip |
Fixed line length in ChangeLog and some other small changes.
Diffstat (limited to 'src/configuration.cpp')
-rw-r--r-- | src/configuration.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/configuration.cpp b/src/configuration.cpp index e8e673b3..5e21ee5a 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -24,23 +24,17 @@ #include "configuration.h" -#include <math.h> #include <sstream> #include <libxml/xmlwriter.h> -#ifdef __DEBUG -#include <iostream> -#endif - #include "configlistener.h" #include "log.h" -void Configuration::init(const std::string &filename) +void Configuration::init(const std::string &filename): + mConfigPath(filename) { - configPath = filename; - // Do not attempt to read config from non-existant file - FILE *testFile = fopen(configPath.c_str(), "r"); + FILE *testFile = fopen(filename.c_str(), "r"); if (!testFile) { return; } @@ -82,7 +76,7 @@ void Configuration::init(const std::string &filename) void Configuration::write() { // Do not attempt to write to file that cannot be opened for writing - FILE *testFile = fopen(configPath.c_str(), "w"); + FILE *testFile = fopen(mConfigPath.c_str(), "w"); if (!testFile) { return; } @@ -90,7 +84,7 @@ void Configuration::write() fclose(testFile); } - xmlTextWriterPtr writer = xmlNewTextWriterFilename(configPath.c_str(), 0); + xmlTextWriterPtr writer = xmlNewTextWriterFilename(mConfigPath.c_str(), 0); if (writer) { @@ -120,9 +114,6 @@ void Configuration::write() void Configuration::setValue(const std::string &key, std::string value) { -#ifdef __DEBUG - std::cout << "Configuration::setValue(" << key << ", " << value << ")\n"; -#endif options[key] = value; // Notify listeners |