MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / IniSaveSettingList

Function IniSaveSettingList

src/settings.cpp:857–865  ·  view source on GitHub ↗

* Saves all items from a list into the 'grpname' section * The list parameter can be a nullptr pointer, in this case a callback function * should be defined that will provide the source data to be saved. * @param ini IniFile handle to the ini file where the destination data is saved * @param grpname character string identifying the section-header of the ini file * @param list pointer to an st

Source from the content-addressed store, hash-verified

855 * source to be saved into the relevant ini section
856 */
857static void IniSaveSettingList(IniFile &ini, std::string_view grpname, StringList &list)
858{
859 IniGroup &group = ini.GetOrCreateGroup(grpname);
860 group.Clear();
861
862 for (const auto &iter : list) {
863 group.GetOrCreateItem(iter).SetValue("");
864 }
865}
866
867/**
868 * Load a WindowDesc from config.

Callers

nothing calls this directly

Calls 2

ClearMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected