| 164 | } |
| 165 | |
| 166 | void insert_item(CInifile::Sect* tgt, const CInifile::Item& I) |
| 167 | { |
| 168 | auto sect_it = tgt->Data.find(I.first); |
| 169 | if (sect_it != tgt->Data.end() && sect_it->first.equal(I.first)) |
| 170 | { |
| 171 | sect_it->second = I.second; |
| 172 | auto found = std::find_if(tgt->Ordered_Data.begin(), tgt->Ordered_Data.end(), [&](const auto& it) { return xr_strcmp(*it.first, *I.first) == 0; }); |
| 173 | if (found != tgt->Ordered_Data.end()) |
| 174 | { |
| 175 | found->second = I.second; |
| 176 | } |
| 177 | } |
| 178 | else |
| 179 | { |
| 180 | tgt->Data.emplace(I.first, I.second); |
| 181 | tgt->Ordered_Data.push_back(I); |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | void CInifile::Load(IReader* F, LPCSTR path, BOOL allow_dup_sections, const CInifile* override, bool root_level, LPCSTR current_file) |
| 186 | { |