mirror of
https://github.com/badaix/snapcast.git
synced 2025-04-29 18:27:12 +02:00
Add "add" method to Parameter
This commit is contained in:
parent
de9e3496df
commit
7ad308cd01
1 changed files with 10 additions and 3 deletions
|
@ -190,6 +190,8 @@ public:
|
|||
bool has(const std::string& key) const;
|
||||
bool has(size_t idx) const;
|
||||
|
||||
void add(const std::string& key, const Json& value);
|
||||
|
||||
template <typename T>
|
||||
T get(const std::string& key) const
|
||||
{
|
||||
|
@ -691,11 +693,16 @@ inline Parameter::Parameter(const std::string& key1, const Json& value1, const s
|
|||
{
|
||||
param_map[key1] = value1;
|
||||
if (!key2.empty())
|
||||
param_map[key2] = value2;
|
||||
add(key2, value2);
|
||||
if (!key3.empty())
|
||||
param_map[key3] = value3;
|
||||
add(key3, value3);
|
||||
if (!key4.empty())
|
||||
param_map[key4] = value4;
|
||||
add(key4, value4);
|
||||
}
|
||||
|
||||
inline void Parameter::add(const std::string& key, const Json& value)
|
||||
{
|
||||
param_map[key] = value;
|
||||
}
|
||||
|
||||
inline void Parameter::parse_json(const Json& json)
|
||||
|
|
Loading…
Add table
Reference in a new issue