• Home
  • Raw
  • Download

Lines Matching refs:section

114 bool ConfigCache::HasSection(const std::string& section) const {  in HasSection()
116 return information_sections_.contains(section) || persistent_devices_.contains(section) || in HasSection()
117 temporary_devices_.contains(section); in HasSection()
120 bool ConfigCache::HasProperty(const std::string& section, const std::string& property) const { in HasProperty() argument
122 auto section_iter = information_sections_.find(section); in HasProperty()
126 section_iter = persistent_devices_.find(section); in HasProperty()
130 section_iter = temporary_devices_.find(section); in HasProperty()
137 std::optional<std::string> ConfigCache::GetProperty(const std::string& section, const std::string& … in GetProperty() argument
139 auto section_iter = information_sections_.find(section); in GetProperty()
146 section_iter = persistent_devices_.find(section); in GetProperty()
153 section_iter = temporary_devices_.find(section); in GetProperty()
163 void ConfigCache::SetProperty(std::string section, std::string property, std::string value) { in SetProperty() argument
165 if (TrimAfterNewLine(section) || TrimAfterNewLine(property) || TrimAfterNewLine(value)) { in SetProperty()
168 ASSERT_LOG(!section.empty(), "Empty section name not allowed"); in SetProperty()
170 if (!IsDeviceSection(section)) { in SetProperty()
171 auto section_iter = information_sections_.find(section); in SetProperty()
173 …section_iter = information_sections_.try_emplace_back(section, common::ListMap<std::string, std::s… in SetProperty()
179 auto section_iter = persistent_devices_.find(section); in SetProperty()
182 auto section_properties = temporary_devices_.extract(section); in SetProperty()
184 …section_iter = persistent_devices_.try_emplace_back(section, std::move(section_properties->second)… in SetProperty()
186 …section_iter = persistent_devices_.try_emplace_back(section, common::ListMap<std::string, std::str… in SetProperty()
194 section_iter = temporary_devices_.find(section); in SetProperty()
196 …auto triple = temporary_devices_.try_emplace(section, common::ListMap<std::string, std::string>{}); in SetProperty()
202 bool ConfigCache::RemoveSection(const std::string& section) { in RemoveSection() argument
205 if (information_sections_.extract(section) || persistent_devices_.extract(section)) { in RemoveSection()
209 return temporary_devices_.extract(section).has_value(); in RemoveSection()
213 bool ConfigCache::RemoveProperty(const std::string& section, const std::string& property) { in RemoveProperty() argument
215 auto section_iter = information_sections_.find(section); in RemoveProperty()
229 section_iter = persistent_devices_.find(section); in RemoveProperty()
237 auto section_properties = persistent_devices_.extract(section); in RemoveProperty()
238 temporary_devices_.insert_or_assign(section, std::move(section_properties->second)); in RemoveProperty()
247 section_iter = temporary_devices_.find(section); in RemoveProperty()
258 bool ConfigCache::IsDeviceSection(const std::string& section) { in IsDeviceSection() argument
259 return hci::Address::IsValidAddress(section); in IsDeviceSection()
310 SetProperty(std::move(entry.section), std::move(entry.property), std::move(entry.value)); in Commit()
313 RemoveProperty(entry.section, entry.property); in Commit()
316 RemoveSection(entry.section); in Commit()
327 for (const auto& section : *config_section) { in SerializeToLegacyFormat()
328 serialized << "[" << section.first << "]" << std::endl; in SerializeToLegacyFormat()
329 for (const auto& property : section.second) { in SerializeToLegacyFormat()
346 result.emplace_back(SectionAndPropertyValue{.section = elem.first, .property = it->second}); in GetSectionNamesWithProperty()
354 result.emplace_back(SectionAndPropertyValue{.section = elem.first, .property = it->second}); in GetSectionNamesWithProperty()
426 const std::string& section, const std::unordered_set<std::string_view>& property_names) const { in HasAtLeastOneMatchingPropertiesInSection() argument
429 if (!IsDeviceSection(section)) { in HasAtLeastOneMatchingPropertiesInSection()
430 auto section_iter = information_sections_.find(section); in HasAtLeastOneMatchingPropertiesInSection()
436 auto section_iter = persistent_devices_.find(section); in HasAtLeastOneMatchingPropertiesInSection()
438 section_iter = temporary_devices_.find(section); in HasAtLeastOneMatchingPropertiesInSection()
453 bool ConfigCache::IsPersistentSection(const std::string& section) const { in IsPersistentSection()
455 return persistent_devices_.contains(section); in IsPersistentSection()