diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2008-10-19 21:21:57 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2008-10-19 21:21:57 +0200 |
commit | 3944988f51769b0ffd8e58c05566c82416bf983d (patch) | |
tree | 5dcfdec6f2d74a8545da84617b56d2685060397b /src/Common | |
parent | 96b6f07a32cb02ae5d907bacd81f62fc25fdc278 (diff) | |
download | mad-3944988f51769b0ffd8e58c05566c82416bf983d.tar mad-3944988f51769b0ffd8e58c05566c82416bf983d.zip |
Interface-?nderungen am ConfigManager/Configurable
Diffstat (limited to 'src/Common')
-rw-r--r-- | src/Common/ConfigManager.cpp | 14 | ||||
-rw-r--r-- | src/Common/ConfigManager.h | 2 | ||||
-rw-r--r-- | src/Common/Configurable.h | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/Common/ConfigManager.cpp b/src/Common/ConfigManager.cpp index fbd73ea..20a6110 100644 --- a/src/Common/ConfigManager.cpp +++ b/src/Common/ConfigManager.cpp @@ -31,16 +31,16 @@ namespace Common { ConfigManager ConfigManager::configManager; -void ConfigManager::handleConfigEntry(const std::vector<std::string> &entry, const std::vector<std::vector<std::string> > §ion) { +void ConfigManager::handleConfigEntry(const std::vector<std::vector<std::string> > &entry) { bool handled = false; for(std::set<Configurable*>::iterator c = configurables.begin(); c != configurables.end(); ++c) { - if((*c)->handleConfigEntry(entry, section)) + if((*c)->handleConfigEntry(entry)) handled = true; } if(!handled) - Logger::logf(Logger::WARNING, "Unknown config option '%s'.", entry.front().c_str()); + Logger::logf(Logger::WARNING, "Invalid config option '%s'.", entry.back().front().c_str()); } bool ConfigManager::loadFile(const std::string &filename, bool finish) { @@ -87,15 +87,15 @@ bool ConfigManager::loadFile(const std::string &filename, bool finish) { if(pos == std::string::npos) { entry.push_back(line); - - handleConfigEntry(entry, section); } else { entry.push_back(line.substr(0, pos)); entry.push_back(Util::trim(line.substr(pos))); - - handleConfigEntry(entry, section); } + + section.push_back(entry); + handleConfigEntry(section); + section.pop_back(); } switch(bracket) { diff --git a/src/Common/ConfigManager.h b/src/Common/ConfigManager.h index 7fa781e..ccf5d13 100644 --- a/src/Common/ConfigManager.h +++ b/src/Common/ConfigManager.h @@ -38,7 +38,7 @@ class ConfigManager { ConfigManager() : finished(false) {} - void handleConfigEntry(const std::vector<std::string>&, const std::vector<std::vector<std::string> >&); + void handleConfigEntry(const std::vector<std::vector<std::string> > &entry); public: bool loadFile(const std::string &filename, bool finish = true); diff --git a/src/Common/Configurable.h b/src/Common/Configurable.h index 350b444..0c471c7 100644 --- a/src/Common/Configurable.h +++ b/src/Common/Configurable.h @@ -32,7 +32,7 @@ class Configurable { protected: friend class ConfigManager; - virtual bool handleConfigEntry(const std::vector<std::string>&, const std::vector<std::vector<std::string> >&) {return false;} + virtual bool handleConfigEntry(const std::vector<std::vector<std::string> >&) {return false;} virtual void configFinished() {} }; |