6 m_Main(
std::move(a_Main)),
7 m_Overrides(&a_Overrides)
42 return m_Main->AddKeyName(a_keyname);
56 return m_Main->AddKeyComment(a_keyname, a_comment);
71 return m_Main->GetKeyComment(a_keyname, a_commentID);
85 return m_Main->DeleteKeyComment(a_keyname, a_commentID);
100 m_Main->AddValue(a_KeyName, a_ValueName, a_Value);
113 auto ret = overrides;
115 for (
const auto & mainpair :
main)
118 for (
const auto & overridepair : overrides)
120 if (overridepair.first == mainpair.first)
128 ret.push_back(mainpair);
146 return m_Main->GetValue(a_KeyName, a_ValueName, defValue);
162 return m_Main->GetValueSet(a_KeyName, a_ValueName, defValue);
178 return m_Main->GetValueSetI(a_KeyName, a_ValueName, defValue);
194 return m_Main->GetValueSetI(a_KeyName, a_ValueName, defValue);
210 return m_Main->GetValueSetB(a_KeyName, a_ValueName, defValue);
226 return m_Main->SetValue(a_KeyName, a_ValueName, a_Value, a_CreateIfNotExists);
242 return m_Main->SetValueI(a_KeyName, a_ValueName, a_Value, a_CreateIfNotExists);
258 return m_Main->DeleteValue(a_KeyName, a_ValueName);
int main(int argc, char **argv)
virtual std::vector< std::pair< AString, AString > > GetValues(AString a_keyName) override
returns a vector containing a name, value pair for each value under the key
virtual int GetValueSetI(const AString &keyname, const AString &valuename, const int defValue=0) override
virtual AString GetKeyComment(const AString &keyname, const int commentID) const override
Return a key comment, returns "" for repositories that do not return comments.
cSettingsRepositoryInterface * m_Overrides
virtual AString GetValue(const AString &keyname, const AString &valuename, const AString &defValue="") const override
Get the value at the specified key and value, returns defValue on failure.
virtual bool AddKeyComment(const AString &keyname, const AString &comment) override
Add a key comment, will always fail if the repository does not support comments.
virtual bool HasValue(const AString &a_KeyName, const AString &a_ValueName) const override
Returns true iff the specified value exists.
cOverridesSettingsRepository(std::unique_ptr< cSettingsRepositoryInterface > a_Main, cSettingsRepositoryInterface &a_Overrides)
virtual bool GetValueSetB(const AString &keyname, const AString &valuename, const bool defValue=false) override
virtual bool SetValue(const AString &a_KeyName, const AString &a_ValueName, const AString &a_Value, const bool a_CreateIfNotExists=true) override
Overwrites the value of the key, value pair Specify the optional parameter as false if you do not wan...
virtual int AddKeyName(const AString &keyname) override
Add a key name.
virtual bool DeleteKeyComment(const AString &keyname, const int commentID) override
Delete a key comment, will always fail if the repository does not support comments.
std::unique_ptr< cSettingsRepositoryInterface > m_Main
virtual bool DeleteValue(const AString &keyname, const AString &valuename) override
Deletes the specified key, value pair.
virtual bool KeyExists(const AString keyname) const override
Returns true iff the specified key exists.
virtual bool Flush() override
Writes the changes to the backing store, if the repository has one.
virtual bool SetValueI(const AString &a_KeyName, const AString &a_ValueName, const int a_Value, const bool a_CreateIfNotExists=true) override
virtual void AddValue(const AString &a_KeyName, const AString &a_ValueName, const AString &a_Value) override
Adds a new value to the specified key.
virtual AString GetValueSet(const AString &keyname, const AString &valuename, const AString &defValue="") override
Gets the value; if not found, write the default to the repository.
virtual bool DeleteValue(const AString &keyname, const AString &valuename)=0
Deletes the specified key, value pair.
virtual bool GetValueSetB(const AString &keyname, const AString &valuename, const bool defValue=false)=0
virtual int AddKeyName(const AString &keyname)=0
Add a key name.
virtual AString GetValueSet(const AString &keyname, const AString &valuename, const AString &defValue="")=0
Gets the value; if not found, write the default to the repository.
virtual bool AddKeyComment(const AString &keyname, const AString &comment)=0
Add a key comment, will always fail if the repository does not support comments.
virtual bool DeleteKeyComment(const AString &keyname, const int commentID)=0
Delete a key comment, will always fail if the repository does not support comments.
virtual std::vector< std::pair< AString, AString > > GetValues(AString a_keyName)=0
returns a vector containing a name, value pair for each value under the key
virtual bool KeyExists(const AString keyname) const =0
Returns true iff the specified key exists.
virtual AString GetValue(const AString &keyname, const AString &valuename, const AString &defValue="") const =0
Get the value at the specified key and value, returns defValue on failure.
virtual void AddValue(const AString &a_KeyName, const AString &a_ValueName, const AString &a_Value)=0
Adds a new value to the specified key.
virtual int GetValueSetI(const AString &keyname, const AString &valuename, const int defValue=0)=0
virtual AString GetKeyComment(const AString &keyname, const int commentID) const =0
Return a key comment, returns "" for repositories that do not return comments.
virtual bool SetValue(const AString &a_KeyName, const AString &a_ValueName, const AString &a_Value, const bool a_CreateIfNotExists=true)=0
Overwrites the value of the key, value pair Specify the optional parameter as false if you do not wan...
virtual bool Flush()=0
Writes the changes to the backing store, if the repository has one.
virtual bool HasValue(const AString &a_KeyName, const AString &a_ValueName) const =0
Returns true iff the specified value exists.
virtual bool SetValueI(const AString &a_KeyName, const AString &a_ValueName, const int a_Value, const bool a_CreateIfNotExists=true)=0