SimpleConfig: Add const char * key variants.
This commit is contained in:
@@ -83,6 +83,13 @@ SimpleConfig::GetGlobal(std::string &key)
|
||||
}
|
||||
|
||||
|
||||
std::string
|
||||
SimpleConfig::GetGlobal(const char *key)
|
||||
{
|
||||
return globalConfig.Get(key);
|
||||
}
|
||||
|
||||
|
||||
std::string
|
||||
SimpleConfig::GetGlobal(std::string &key, const std::string &defaultValue)
|
||||
{
|
||||
@@ -90,6 +97,13 @@ SimpleConfig::GetGlobal(std::string &key, const std::string &defaultValue)
|
||||
}
|
||||
|
||||
|
||||
std::string
|
||||
SimpleConfig::GetGlobal(const char *key, const std::string &defaultValue)
|
||||
{
|
||||
return globalConfig.Get(key, defaultValue);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SimpleConfig::PutGlobal(std::string &key, const std::string &value)
|
||||
{
|
||||
@@ -160,6 +174,14 @@ SimpleConfig::Get(std::string &key)
|
||||
}
|
||||
|
||||
|
||||
std::string
|
||||
SimpleConfig::Get(const char *key)
|
||||
{
|
||||
auto keyStr = std::string(key);
|
||||
return this->Get(keyStr, "");
|
||||
}
|
||||
|
||||
|
||||
std::string
|
||||
SimpleConfig::Get(std::string &key, std::string defaultValue)
|
||||
{
|
||||
@@ -180,6 +202,14 @@ SimpleConfig::Get(std::string &key, std::string defaultValue)
|
||||
}
|
||||
|
||||
|
||||
std::string
|
||||
SimpleConfig::Get(const char *key, std::string defaultValue)
|
||||
{
|
||||
auto keyStr = std::string(key);
|
||||
return this->Get(keyStr, std::move(defaultValue));
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SimpleConfig::Put(std::string &key, const std::string value)
|
||||
{
|
||||
@@ -187,6 +217,14 @@ SimpleConfig::Put(std::string &key, const std::string value)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SimpleConfig::Put(const char *key, const std::string value)
|
||||
{
|
||||
auto keyStr = std::string(key);
|
||||
this->vars[std::move(keyStr)] = std::move(key);
|
||||
}
|
||||
|
||||
|
||||
std::vector<std::string>
|
||||
SimpleConfig::KeyList()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user