Lines Matching refs:section_name
77 bool BtifConfigCache::HasPersistentSection(const std::string& section_name) { in HasPersistentSection() argument
78 return paired_devices_list_.Find(section_name) != in HasPersistentSection()
82 bool BtifConfigCache::HasUnpairedSection(const std::string& section_name) { in HasUnpairedSection() argument
83 return unpaired_devices_cache_.HasKey(section_name); in HasUnpairedSection()
86 bool BtifConfigCache::HasSection(const std::string& section_name) { in HasSection() argument
87 return HasUnpairedSection(section_name) || HasPersistentSection(section_name); in HasSection()
90 bool BtifConfigCache::HasKey(const std::string& section_name, in HasKey() argument
92 auto section_iter = paired_devices_list_.Find(section_name); in HasKey()
96 section_t* section = unpaired_devices_cache_.Find(section_name); in HasKey()
116 bool BtifConfigCache::RemoveKey(const std::string& section_name, in RemoveKey() argument
118 section_t* section = unpaired_devices_cache_.Find(section_name); in RemoveKey()
126 unpaired_devices_cache_.Remove(section_name); in RemoveKey()
130 auto section_iter = paired_devices_list_.Find(section_name); in RemoveKey()
145 unpaired_devices_cache_.Put(section_name, std::move(moved_section)); in RemoveKey()
166 void BtifConfigCache::SetString(std::string section_name, std::string key, in SetString() argument
168 if (trim_new_line(section_name) || trim_new_line(key) || in SetString()
172 if (section_name.empty()) { in SetString()
180 if (!paired_devices_list_.Has(section_name)) { in SetString()
184 if (!unpaired_devices_cache_.Get(section_name, §ion)) { in SetString()
186 section.name = section_name; in SetString()
192 if (is_local_section_info(section_name) || in SetString()
193 (is_link_key(key) && RawAddress::IsValidAddress(section_name))) { in SetString()
196 unpaired_devices_cache_.Remove(section_name); in SetString()
203 unpaired_devices_cache_.Put(section_name, section); in SetString()
207 auto section_found = paired_devices_list_.Find(section_name); in SetString()
217 const std::string& section_name, const std::string& key) { in GetString() argument
219 auto section_iter = paired_devices_list_.Find(section_name); in GetString()
229 if (!unpaired_devices_cache_.Get(section_name, §ion)) { in GetString()
239 void BtifConfigCache::SetInt(std::string section_name, std::string key, in SetInt() argument
241 SetString(std::move(section_name), std::move(key), std::to_string(value)); in SetInt()
244 std::optional<int> BtifConfigCache::GetInt(const std::string& section_name, in GetInt() argument
246 auto value = GetString(section_name, key); in GetInt()
253 LOG(WARNING) << "Failed to parse value to long for section " << section_name in GetInt()
259 << section_name << ", key " << key; in GetInt()
265 void BtifConfigCache::SetUint64(std::string section_name, std::string key, in SetUint64() argument
267 SetString(std::move(section_name), std::move(key), std::to_string(value)); in SetUint64()
271 const std::string& section_name, const std::string& key) { in GetUint64() argument
272 auto value = GetString(section_name, key); in GetUint64()
280 << section_name << ", key " << key; in GetUint64()
286 void BtifConfigCache::SetBool(std::string section_name, std::string key, in SetBool() argument
288 SetString(std::move(section_name), std::move(key), value ? "true" : "false"); in SetBool()
291 std::optional<bool> BtifConfigCache::GetBool(const std::string& section_name, in GetBool() argument
293 auto value = GetString(section_name, key); in GetBool()
304 << section_name << ", key " << key; in GetBool()