OpenTTD Source
20241108-master-g80f628063a
|
Derived class for loading INI files without going through Fio stuff. More...
Public Member Functions | |
SettingsIniFile (const IniGroupNameList &list_group_names={}, const IniGroupNameList &seq_group_names={}) | |
Construct a new ini loader. More... | |
std::optional< FileHandle > | OpenFile (const std::string &filename, Subdirectory, size_t *size) override |
Open the INI file. More... | |
void | ReportFileError (const char *const pre, const char *const buffer, const char *const post) override |
Report an error about the file contents. More... | |
Public Member Functions inherited from IniLoadFile | |
IniLoadFile (const IniGroupNameList &list_group_names={}, const IniGroupNameList &seq_group_names={}) | |
Construct a new in-memory Ini file representation. More... | |
const IniGroup * | GetGroup (std::string_view name) const |
Get the group with the given name. More... | |
IniGroup * | GetGroup (std::string_view name) |
Get the group with the given name. More... | |
IniGroup & | GetOrCreateGroup (std::string_view name) |
Get the group with the given name, and if it doesn't exist create a new group. More... | |
IniGroup & | CreateGroup (std::string_view name) |
Create an group with the given name. More... | |
void | RemoveGroup (std::string_view name) |
Remove the group with the given name. More... | |
void | LoadFromDisk (const std::string &filename, Subdirectory subdir) |
Load the Ini file's data from the disk. More... | |
Additional Inherited Members | |
Public Types inherited from IniLoadFile | |
using | IniGroupNameList = std::initializer_list< std::string_view > |
Data Fields inherited from IniLoadFile | |
std::list< IniGroup > | groups |
all groups in the ini | |
std::string | comment |
last comment in file | |
const IniGroupNameList | list_group_names |
list of group names that are lists | |
const IniGroupNameList | seq_group_names |
list of group names that are sequences. | |
Derived class for loading INI files without going through Fio stuff.
Definition at line 148 of file settingsgen.cpp.
|
inline |
Construct a new ini loader.
list_group_names | A list with group names that should be loaded as lists instead of variables. |
seq_group_names | A list with group names that should be loaded as lists of names. |
Definition at line 154 of file settingsgen.cpp.
|
inlineoverridevirtual |
Open the INI file.
filename | Name of the INI file. | |
subdir | The subdir to load the file from. | |
[out] | size | Size of the opened file. |
std::nullopt
. Implements IniLoadFile.
Definition at line 159 of file settingsgen.cpp.
References FileHandle::Open().
|
inlineoverridevirtual |
Report an error about the file contents.
pre | Prefix text of the buffer part. |
buffer | Part of the file with the error. |
post | Suffix text of the buffer part. |
Implements IniLoadFile.
Definition at line 173 of file settingsgen.cpp.