From 6703920cbc97791c178ee9c1fcf2144e5965e70f Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@dune-project.org>
Date: Tue, 28 Aug 2007 14:43:15 +0000
Subject: [PATCH] I am putting the method get() with a char* back in.  It
 served a purpose after all (which is explained now in the documentation). 
 That purpose is a pretty hacky type resolution issue, but I don't see a
 better way right now.

[[Imported from SVN: r4983]]
---
 common/configparser.cc |  8 ++++++++
 common/configparser.hh | 12 ++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/common/configparser.cc b/common/configparser.cc
index 95746777c..b907da059 100644
--- a/common/configparser.cc
+++ b/common/configparser.cc
@@ -190,6 +190,14 @@ string ConfigParser::get(const string& key, const string& defaultValue)
     return defaultValue;
 }
 
+string ConfigParser::get(const string& key, char* defaultValue)
+{
+  if (hasKey(key))
+    return (*this)[key];
+  else
+    return defaultValue;
+}
+
 
 int ConfigParser::get(const string& key, int defaultValue)
 {
diff --git a/common/configparser.hh b/common/configparser.hh
index 2b3451842..2a890a45f 100644
--- a/common/configparser.hh
+++ b/common/configparser.hh
@@ -147,6 +147,18 @@ namespace Dune {
      */
     std::string get(const std::string& key, const std::string& defaultValue);
 
+    /** \brief get value as string
+     *
+     * Returns pure string value for given key.
+     *
+     * \todo This is a hack so get("my_key", "xyz") compiles
+     * (without this method "xyz" resolves to bool instead of std::string)
+     * \param key key name
+     * \param defaultValue default if key does not exist
+     * \return value as string
+     */
+    std::string get(const std::string& key, char* defaultValue);
+
 
     /** \brief get value as int
      *
-- 
GitLab