diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-03-05 22:05:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-03-05 22:05:51 +0300 |
commit | ff83a1b745c4c679eb01c9db1f0a82ab613e2195 (patch) | |
tree | 75c7d054b61644ba07c469b37718415160895df5 /src/configuration.cpp | |
parent | aff4b3cf27d823696ffb0d34ed469a4a0adcd2a4 (diff) | |
download | manaverse-ff83a1b745c4c679eb01c9db1f0a82ab613e2195.tar.gz manaverse-ff83a1b745c4c679eb01c9db1f0a82ab613e2195.tar.bz2 manaverse-ff83a1b745c4c679eb01c9db1f0a82ab613e2195.tar.xz manaverse-ff83a1b745c4c679eb01c9db1f0a82ab613e2195.zip |
Add method for incriment config variables.
Diffstat (limited to 'src/configuration.cpp')
-rw-r--r-- | src/configuration.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/configuration.cpp b/src/configuration.cpp index 34d301446..d43cca15e 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -226,6 +226,14 @@ void Configuration::setValue(const std::string &key, const std::string &value) } } +void Configuration::incValue(const std::string &key) +{ + GETLOG(); + const Options::const_iterator iter = mOptions.find(key); + setValue(key, (iter != mOptions.end()) + ? atoi(iter->second.c_str()) + 1 : 1); +} + void Configuration::setSilent(const std::string &key, const std::string &value) { ConfigurationObject::setValue(key, value); |