11 return m_Map.count(keyname) != 0;
20 auto outerIter =
m_Map.find(a_KeyName);
21 if (outerIter ==
m_Map.end())
25 auto iter = outerIter->second.find(a_ValueName);
26 return (iter != outerIter->second.end());
35 m_Map.emplace(a_keyname, std::unordered_multimap<AString, sValue>{});
74 m_Map[a_KeyName].emplace(a_ValueName,
sValue(a_Value));
86 m_Map[a_KeyName].emplace(a_ValueName,
sValue(a_Value));
98 m_Map[a_KeyName].emplace(a_ValueName,
sValue(a_Value));
108 std::vector<std::pair<AString, AString>> ret;
109 for (
const auto & pair :
m_Map[a_keyName])
111 ret.emplace_back(pair.first, pair.second.getStringValue());
122 auto outerIter =
m_Map.find(a_KeyName);
123 if (outerIter ==
m_Map.end())
127 auto iter = outerIter->second.find(a_ValueName);
128 if (iter == outerIter->second.end())
132 return iter->second.getStringValue();
141 auto outerIter =
m_Map.find(a_KeyName);
142 if (outerIter ==
m_Map.end())
144 AddValue(a_KeyName, a_ValueName, defValue);
147 auto iter = outerIter->second.find(a_ValueName);
148 if (iter == outerIter->second.end())
150 AddValue(a_KeyName, a_ValueName, defValue);
153 return iter->second.getStringValue();
162 auto outerIter =
m_Map.find(a_KeyName);
163 if (outerIter ==
m_Map.end())
165 AddValue(a_KeyName, a_ValueName,
static_cast<Int64>(defValue));
168 auto iter = outerIter->second.find(a_ValueName);
169 if (iter == outerIter->second.end())
171 AddValue(a_KeyName, a_ValueName,
static_cast<Int64>(defValue));
174 return static_cast<int>(iter->second.getIntValue());
183 auto outerIter =
m_Map.find(a_KeyName);
184 if (outerIter ==
m_Map.end())
186 AddValue(a_KeyName, a_ValueName, defValue);
189 auto iter = outerIter->second.find(a_ValueName);
190 if (iter == outerIter->second.end())
192 AddValue(a_KeyName, a_ValueName, defValue);
195 return iter->second.getIntValue();
204 auto outerIter =
m_Map.find(a_KeyName);
205 if (outerIter ==
m_Map.end())
207 AddValue(a_KeyName, a_ValueName, defValue);
210 auto iter = outerIter->second.find(a_ValueName);
211 if (iter == outerIter->second.end())
213 AddValue(a_KeyName, a_ValueName, defValue);
216 return iter->second.getBoolValue();
229 auto outerIter =
m_Map.find(a_KeyName);
230 if (outerIter ==
m_Map.end())
232 if (a_CreateIfNotExists)
234 AddValue(a_KeyName, a_ValueName, a_Value);
236 return a_CreateIfNotExists;
238 auto iter = outerIter->second.find(a_ValueName);
239 if (iter == outerIter->second.end())
241 if (a_CreateIfNotExists)
243 AddValue(a_KeyName, a_ValueName, a_Value);
245 return a_CreateIfNotExists;
247 iter->second =
sValue(a_Value);
261 auto outerIter =
m_Map.find(a_KeyName);
262 if (outerIter ==
m_Map.end())
264 if (a_CreateIfNotExists)
266 AddValue(a_KeyName, a_ValueName,
static_cast<Int64>(a_Value));
268 return a_CreateIfNotExists;
270 auto iter = outerIter->second.find(a_ValueName);
271 if (iter == outerIter->second.end())
273 if (a_CreateIfNotExists)
275 AddValue(a_KeyName, a_ValueName,
static_cast<Int64>(a_Value));
277 return a_CreateIfNotExists;
279 iter->second =
sValue(
static_cast<Int64>(a_Value));
293 auto outerIter =
m_Map.find(a_KeyName);
294 if (outerIter ==
m_Map.end())
298 auto iter = outerIter->second.find(a_ValueName);
299 if (iter == outerIter->second.end())
303 outerIter->second.erase(iter);
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 DeleteValue(const AString &keyname, const AString &valuename) override
Deletes the specified key, value pair.
virtual AString GetKeyComment(const AString &keyname, const int commentID) const override
Return a key comment, returns "" for repositories that do not return comments.
virtual bool GetValueSetB(const AString &keyname, const AString &valuename, const bool defValue=false) override
virtual int AddKeyName(const AString &keyname) override
Add a key name.
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 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 void AddValue(const AString &a_KeyName, const AString &a_ValueName, const AString &a_Value) override
Adds a new value to the specified key.
virtual int GetValueSetI(const AString &keyname, const AString &valuename, const int defValue=0) override
virtual bool Flush() override
Writes the changes to the backing store, if the repository has one.
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 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 DeleteKeyComment(const AString &keyname, const int commentID) override
Delete a key comment, will always fail if the repository does not support comments.
virtual bool SetValueI(const AString &a_KeyName, const AString &a_ValueName, const int a_Value, const bool a_CreateIfNotExists=true) override
virtual bool HasValue(const AString &a_KeyName, const AString &a_ValueName) const override
Returns true iff the specified value exists.
virtual bool KeyExists(const AString keyname) const override
Returns true iff the specified key exists.
std::unordered_map< AString, std::unordered_multimap< AString, sValue > > m_Map