summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib/general
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2013-03-05 16:08:08 -0500
committerTom Rondeau <trondeau@vt.edu>2013-03-05 16:08:08 -0500
commite2452caaf2e7f5fb640cda92b87f49f8f4d18c86 (patch)
tree417ce934b251ad7a9a86b1725b865ce82f4641ec /gnuradio-core/src/lib/general
parentb279da79d17ab8cd1bb011c5e6c0305c2a506462 (diff)
parentbf343e58bc5b4ef026bb4c8722312a6f123becf2 (diff)
Merge branch 'master' into next
Conflicts: gnuradio-core/src/lib/general/gr_prefs.cc
Diffstat (limited to 'gnuradio-core/src/lib/general')
-rw-r--r--gnuradio-core/src/lib/general/gr_prefs.cc14
-rw-r--r--gnuradio-core/src/lib/general/gr_prefs.h22
-rw-r--r--gnuradio-core/src/lib/general/gr_prefs.i22
3 files changed, 29 insertions, 29 deletions
diff --git a/gnuradio-core/src/lib/general/gr_prefs.cc b/gnuradio-core/src/lib/general/gr_prefs.cc
index 1308949fa8..5d9544f112 100644
--- a/gnuradio-core/src/lib/general/gr_prefs.cc
+++ b/gnuradio-core/src/lib/general/gr_prefs.cc
@@ -132,14 +132,14 @@ gr_prefs::option_to_env(std::string section, std::string option)
}
bool
-gr_prefs::has_section(const std::string section)
+gr_prefs::has_section(const std::string &section)
{
size_t t = d_configs.find("[" + section + "]#");
return t != std::string::npos;
}
bool
-gr_prefs::has_option(const std::string section, const std::string option)
+gr_prefs::has_option(const std::string &section, const std::string &option)
{
if(option_to_env(section, option))
return true;
@@ -155,8 +155,8 @@ gr_prefs::has_option(const std::string section, const std::string option)
}
const std::string
-gr_prefs::get_string(const std::string section, const std::string option,
- const std::string default_val)
+gr_prefs::get_string(const std::string &section, const std::string &option,
+ const std::string &default_val)
{
char *env = option_to_env(section, option);
if(env)
@@ -179,7 +179,7 @@ gr_prefs::get_string(const std::string section, const std::string option,
}
bool
-gr_prefs::get_bool(const std::string section, const std::string option, bool default_val)
+gr_prefs::get_bool(const std::string &section, const std::string &option, bool default_val)
{
if(has_option(section, option)) {
std::string str = get_string(section, option, "");
@@ -200,7 +200,7 @@ gr_prefs::get_bool(const std::string section, const std::string option, bool def
}
long
-gr_prefs::get_long(const std::string section, const std::string option, long default_val)
+gr_prefs::get_long(const std::string &section, const std::string &option, long default_val)
{
if(has_option(section, option)) {
std::string str = get_string(section, option, "");
@@ -218,7 +218,7 @@ gr_prefs::get_long(const std::string section, const std::string option, long def
}
double
-gr_prefs::get_double(const std::string section, const std::string option, double default_val)
+gr_prefs::get_double(const std::string &section, const std::string &option, double default_val)
{
if(has_option(section, option)) {
std::string str = get_string(section, option, "");
diff --git a/gnuradio-core/src/lib/general/gr_prefs.h b/gnuradio-core/src/lib/general/gr_prefs.h
index d9b0c791ba..68957faab9 100644
--- a/gnuradio-core/src/lib/general/gr_prefs.h
+++ b/gnuradio-core/src/lib/general/gr_prefs.h
@@ -46,39 +46,39 @@ public:
/*!
* \brief Does \p section exist?
*/
- virtual bool has_section(const std::string section);
+ virtual bool has_section(const std::string &section);
/*!
* \brief Does \p option exist?
*/
- virtual bool has_option(const std::string section, const std::string option);
+ virtual bool has_option(const std::string &section, const std::string &option);
/*!
* \brief If option exists return associated value; else default_val.
*/
- virtual const std::string get_string(const std::string section,
- const std::string option,
- const std::string default_val);
+ virtual const std::string get_string(const std::string &section,
+ const std::string &option,
+ const std::string &default_val);
/*!
* \brief If option exists and value can be converted to bool, return it; else default_val.
*/
- virtual bool get_bool(const std::string section,
- const std::string option,
+ virtual bool get_bool(const std::string &section,
+ const std::string &option,
bool default_val);
/*!
* \brief If option exists and value can be converted to long, return it; else default_val.
*/
- virtual long get_long(const std::string section,
- const std::string option,
+ virtual long get_long(const std::string &section,
+ const std::string &option,
long default_val);
/*!
* \brief If option exists and value can be converted to double, return it; else default_val.
*/
- virtual double get_double(const std::string section,
- const std::string option,
+ virtual double get_double(const std::string &section,
+ const std::string &option,
double default_val);
protected:
diff --git a/gnuradio-core/src/lib/general/gr_prefs.i b/gnuradio-core/src/lib/general/gr_prefs.i
index cfb4cdb4e3..b21d47f3b0 100644
--- a/gnuradio-core/src/lib/general/gr_prefs.i
+++ b/gnuradio-core/src/lib/general/gr_prefs.i
@@ -31,39 +31,39 @@ public:
/*!
* \brief Does \p section exist?
*/
- virtual bool has_section(const std::string section);
+ virtual bool has_section(const std::string &section);
/*!
* \brief Does \p option exist?
*/
- virtual bool has_option(const std::string section, const std::string option);
+ virtual bool has_option(const std::string &section, const std::string &option);
/*!
* \brief If option exists return associated value; else default_val.
*/
- virtual const std::string get_string(const std::string section,
- const std::string option,
- const std::string default_val);
+ virtual const std::string get_string(const std::string &section,
+ const std::string &option,
+ const std::string &default_val);
/*!
* \brief If option exists and value can be converted to bool, return it; else default_val.
*/
- virtual bool get_bool(const std::string section,
- const std::string option,
+ virtual bool get_bool(const std::string &section,
+ const std::string &option,
bool default_val);
/*!
* \brief If option exists and value can be converted to long, return it; else default_val.
*/
- virtual long get_long(const std::string section,
- const std::string option,
+ virtual long get_long(const std::string &section,
+ const std::string &option,
long default_val);
/*!
* \brief If option exists and value can be converted to double, return it; else default_val.
*/
- virtual double get_double(const std::string section,
- const std::string option,
+ virtual double get_double(const std::string &section,
+ const std::string &option,
double default_val);
};