Config: Removed useless const
This commit is contained in:
@@ -634,20 +634,20 @@ void Config::clear ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
const bool Config::has (const std::string& key)
|
bool Config::has (const std::string& key)
|
||||||
{
|
{
|
||||||
return (*this).find (key) != (*this).end ();
|
return (*this).find (key) != (*this).end ();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Return the configuration value given the specified key.
|
// Return the configuration value given the specified key.
|
||||||
const std::string Config::get (const std::string& key)
|
std::string Config::get (const std::string& key)
|
||||||
{
|
{
|
||||||
return (*this)[key];
|
return (*this)[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
const int Config::getInteger (const std::string& key)
|
int Config::getInteger (const std::string& key)
|
||||||
{
|
{
|
||||||
if ((*this).find (key) != (*this).end ())
|
if ((*this).find (key) != (*this).end ())
|
||||||
return strtoimax ((*this)[key].c_str (), NULL, 10);
|
return strtoimax ((*this)[key].c_str (), NULL, 10);
|
||||||
@@ -656,7 +656,7 @@ const int Config::getInteger (const std::string& key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
const double Config::getReal (const std::string& key)
|
double Config::getReal (const std::string& key)
|
||||||
{
|
{
|
||||||
//NOTE: Backwards compatible handling of next coefficient.
|
//NOTE: Backwards compatible handling of next coefficient.
|
||||||
//TODO: Remove.
|
//TODO: Remove.
|
||||||
@@ -670,7 +670,7 @@ const double Config::getReal (const std::string& key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
const bool Config::getBoolean (const std::string& key)
|
bool Config::getBoolean (const std::string& key)
|
||||||
{
|
{
|
||||||
if ((*this).find (key) != (*this).end ())
|
if ((*this).find (key) != (*this).end ())
|
||||||
{
|
{
|
||||||
|
|||||||
10
src/Config.h
10
src/Config.h
@@ -49,11 +49,11 @@ public:
|
|||||||
void setDefaults ();
|
void setDefaults ();
|
||||||
void clear ();
|
void clear ();
|
||||||
|
|
||||||
const bool has (const std::string&);
|
bool has (const std::string&);
|
||||||
const std::string get (const std::string&);
|
std::string get (const std::string&);
|
||||||
const int getInteger (const std::string&);
|
int getInteger (const std::string&);
|
||||||
const double getReal (const std::string&);
|
double getReal (const std::string&);
|
||||||
const bool getBoolean (const std::string&);
|
bool getBoolean (const std::string&);
|
||||||
|
|
||||||
void set (const std::string&, const int);
|
void set (const std::string&, const int);
|
||||||
void set (const std::string&, const double);
|
void set (const std::string&, const double);
|
||||||
|
|||||||
Reference in New Issue
Block a user