mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-30 11:27:19 +02:00
Config
- Added a :has method to detect settings that have no default value.
This commit is contained in:
parent
015575295c
commit
c360923909
2 changed files with 7 additions and 0 deletions
|
@ -585,6 +585,12 @@ void Config::clear ()
|
||||||
std::map <std::string, std::string>::clear ();
|
std::map <std::string, std::string>::clear ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
const bool Config::has (const std::string& key)
|
||||||
|
{
|
||||||
|
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)
|
const std::string Config::get (const std::string& key)
|
||||||
|
|
|
@ -49,6 +49,7 @@ public:
|
||||||
void setDefaults ();
|
void setDefaults ();
|
||||||
void clear ();
|
void clear ();
|
||||||
|
|
||||||
|
const bool has (const std::string&);
|
||||||
const std::string get (const std::string&);
|
const std::string get (const std::string&);
|
||||||
const int getInteger (const std::string&);
|
const int getInteger (const std::string&);
|
||||||
const double getReal (const std::string&);
|
const double getReal (const std::string&);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue