]> Dogcows Code - chaz/openbox/commitdiff
fixed getStringValue failure case and compiler warnings
authorMarius Nita <marius@cs.pdx.edu>
Thu, 22 Aug 2002 01:03:33 +0000 (01:03 +0000)
committerMarius Nita <marius@cs.pdx.edu>
Thu, 22 Aug 2002 01:03:33 +0000 (01:03 +0000)
util/epist/config.cc
util/epist/config.hh

index 0df15e9c9ab0e260ad269f1a101c6517f12b855b..506aab76f517ad4a7843b035c222e45dca25114c 100644 (file)
@@ -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;
 }
 
index 1732012510c465fa7b055bb29c1da9f7032abe9a..443834edf8eff918bb3b494f3c648316e32a2035 100644 (file)
@@ -45,7 +45,7 @@ public:
   Config();
   ~Config();
 
-  const std::string &getStringValue(Config::ItemType) const;
+  bool getStringValue(Config::ItemType, std::string &) const;
   int getNumberValue(Config::ItemType) const;
   void addOption(ConfigItem *);
   void addOption(const std::string &, const std::string &);
This page took 0.024945 seconds and 4 git commands to generate.