MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / insert_item

Function insert_item

ogsr_engine/xrCore/Xr_ini.cpp:166–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166void 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
185void CInifile::Load(IReader* F, LPCSTR path, BOOL allow_dup_sections, const CInifile* override, bool root_level, LPCSTR current_file)
186{

Callers 3

LoadMethod · 0.85
w_stringMethod · 0.85
Xr_ini.cppFile · 0.85

Calls 8

find_ifClass · 0.85
emplaceMethod · 0.80
xr_strcmpFunction · 0.70
findMethod · 0.45
endMethod · 0.45
equalMethod · 0.45
beginMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected