| 133 | } |
| 134 | |
| 135 | void 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 | |
| 169 | int32_t Settings::read(ReaderSeekerI* _reader, Error* _err) |
| 170 | { |
nothing calls this directly
no test coverage detected