X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=util%2Fepist%2Fconfig.cc;h=506aab76f517ad4a7843b035c222e45dca25114c;hb=aa827d0c91dcb808469af768cc9bed0ef8980abd;hp=a64d78d9bfe6ea3354ebc2c16e9a7e06afe1b1ad;hpb=bd05f7ec58f3e1f5839c372ad4fb007a8d8866f5;p=chaz%2Fopenbox diff --git a/util/epist/config.cc b/util/epist/config.cc index a64d78d9..506aab76 100644 --- a/util/epist/config.cc +++ b/util/epist/config.cc @@ -22,6 +22,8 @@ #include "config.hh" +using std::string; + Config::Config() {} Config::~Config() @@ -33,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; } @@ -50,7 +55,6 @@ int Config::getNumberValue(Config::ItemType type) const if ((*it)->getType() == type) return (*it)->getNumberValue(); } - return 0; }