MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / remove

Method remove

Source/3rdParty/bx/src/settings.cpp:135–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135void Settings::remove(const StringView& _name) const
136{
137 ini_t* ini = INI_T(m_ini);
138
139 FilePath uri(_name);
140 const StringView path = strTrim(uri.getPath(), "/");
141 const StringView& fileName = uri.getFileName();
142
143 int32_t section = INI_GLOBAL_SECTION;
144
145 if (!path.isEmpty() )
146 {
147 section = ini_find_section(ini, path.getPtr(), path.getLength() );
148 if (INI_NOT_FOUND == section)
149 {
150 section = INI_GLOBAL_SECTION;
151 }
152 }
153
154 int32_t property = ini_find_property(ini, section, fileName.getPtr(), fileName.getLength() );
155 if (INI_NOT_FOUND == property)
156 {
157 return;
158 }
159
160 ini_property_remove(ini, section, property);
161
162 if (INI_GLOBAL_SECTION != section
163 && 0 == ini_property_count(ini, section) )
164 {
165 ini_section_remove(ini, section);
166 }
167}
168
169int32_t Settings::read(ReaderSeekerI* _reader, Error* _err)
170{

Callers

nothing calls this directly

Calls 10

strTrimFunction · 0.85
ini_find_sectionFunction · 0.85
ini_find_propertyFunction · 0.85
ini_property_removeFunction · 0.85
ini_property_countFunction · 0.85
ini_section_removeFunction · 0.85
getFileNameMethod · 0.80
getPathMethod · 0.65
isEmptyMethod · 0.45
getLengthMethod · 0.45

Tested by

no test coverage detected