|
OpenTTD Source 20251117-master-g7398d2e290
|
A group within an ini file. More...
#include <ini_type.h>
Public Member Functions | |
| IniGroup (std::string_view name, IniGroupType type) | |
| Construct a new in-memory group of an Ini file. | |
| const IniItem * | GetItem (std::string_view name) const |
| Get the item with the given name. | |
| IniItem & | GetOrCreateItem (std::string_view name) |
| Get the item with the given name, and if it doesn't exist create a new item. | |
| IniItem & | CreateItem (std::string_view name) |
| Create an item with the given name. | |
| void | RemoveItem (std::string_view name) |
| Remove the item with the given name. | |
| void | Clear () |
| Clear all items in the group. | |
Data Fields | |
| std::list< IniItem > | items |
| all items in the group | |
| IniGroupType | type |
| type of group | |
| std::string | name |
| name of group | |
| std::string | comment |
| comment for group | |
A group within an ini file.
Definition at line 34 of file ini_type.h.
| IniGroup::IniGroup | ( | std::string_view | name, |
| IniGroupType | type | ||
| ) |
Construct a new in-memory group of an Ini file.
| parent | the file we belong to |
| name | the name of the group |
Definition at line 41 of file ini_load.cpp.
References name, and StrMakeValid().
| void IniGroup::Clear | ( | ) |
Clear all items in the group.
Definition at line 97 of file ini_load.cpp.
References items.
Referenced by BadgeClassSaveConfigFeature(), GraphicsSetSaveConfig(), IniSaveSettingList(), and PickerSaveConfig().
| IniItem & IniGroup::CreateItem | ( | std::string_view | name | ) |
Create an item with the given name.
This does not reuse an existing item of the same name.
| name | name of the item to create. |
Definition at line 80 of file ini_load.cpp.
References items.
Referenced by BadgeClassSaveConfigFeature(), GetOrCreateItem(), IniLoadFile::LoadFromDisk(), and PickerSaveConfig().
| const IniItem * IniGroup::GetItem | ( | std::string_view | name | ) | const |
Get the item with the given name.
| name | name of the item to find. |
Definition at line 51 of file ini_load.cpp.
Referenced by DumpSections(), BaseSet< T >::FillSetDetails(), FindItemValue(), BaseSet< T >::GetMandatoryItem(), GraphicsSetLoadConfig(), IniLoadSettings(), IsConversionNeeded(), HotkeyList::Load(), and LoadFromConfig().
| IniItem & IniGroup::GetOrCreateItem | ( | std::string_view | name | ) |
Get the item with the given name, and if it doesn't exist create a new item.
| name | name of the item to find. |
Definition at line 65 of file ini_load.cpp.
References CreateItem(), items, and name.
Referenced by GraphicsSetSaveConfig(), IniSaveSettingList(), HotkeyList::Save(), and SaveVersionInConfig().
| void IniGroup::RemoveItem | ( | std::string_view | name | ) |
Remove the item with the given name.
| name | Name of the item to remove. |
Definition at line 89 of file ini_load.cpp.
References items, IniItem::name, and name.
Referenced by RemoveEntriesFromIni(), and SaveToConfig().
| std::string IniGroup::comment |
comment for group
Definition at line 38 of file ini_type.h.
Referenced by IniLoadFile::LoadFromDisk(), and SaveToConfig().
| std::list<IniItem> IniGroup::items |
all items in the group
Definition at line 35 of file ini_type.h.
Referenced by BadgeClassLoadConfigFeature(), Clear(), CreateItem(), DumpGroup(), BaseSet< T >::FillSetDetails(), GetItem(), GetOrCreateItem(), GRFLoadConfig(), IniLoadSettingList(), PickerLoadConfig(), and RemoveItem().
| std::string IniGroup::name |
name of group
Definition at line 37 of file ini_type.h.
Referenced by GetGRFPresetList(), GetItem(), BaseSet< T >::GetMandatoryItem(), GetOrCreateItem(), IniGroup(), IniLoadFile::RemoveGroup(), and RemoveItem().
| IniGroupType IniGroup::type |
type of group
Definition at line 36 of file ini_type.h.
Referenced by DumpGroup(), and IniLoadFile::LoadFromDisk().