diff options
| author | Marius Nita <marius@cs.pdx.edu> | 2002-08-22 01:03:33 +0000 |
|---|---|---|
| committer | Marius Nita <marius@cs.pdx.edu> | 2002-08-22 01:03:33 +0000 |
| commit | aa827d0c91dcb808469af768cc9bed0ef8980abd (patch) | |
| tree | 8169cdd46406d6e27524f82a1fc4620e34d21b0d /util/epist/config.cc | |
| parent | 4d0f46e554d1f0e379f411aa5f8f0ad140fd3237 (diff) | |
fixed getStringValue failure case and compiler warnings
Diffstat (limited to 'util/epist/config.cc')
| -rw-r--r-- | util/epist/config.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/util/epist/config.cc b/util/epist/config.cc index 0df15e9c..506aab76 100644 --- a/util/epist/config.cc +++ b/util/epist/config.cc @@ -35,13 +35,16 @@ Config::~Config() } -const string &Config::getStringValue(Config::ItemType type) const +bool Config::getStringValue(Config::ItemType type, string &ret) const { ItemList::const_iterator it = items.begin(), end = items.end(); for (; it != end; ++it) { - if ((*it)->getType() == type) - return (*it)->getStringValue(); + if ((*it)->getType() == type) { + ret = (*it)->getStringValue(); + return true; + } } + return false; } @@ -52,7 +55,6 @@ int Config::getNumberValue(Config::ItemType type) const if ((*it)->getType() == type) return (*it)->getNumberValue(); } - return 0; } |
