31 IniItem(
struct IniGroup *parent,
const char *name,
const char *last = NULL);
49 IniItem *GetItem(
const char *name,
bool create);
61 IniLoadFile(
const char *
const *list_group_names = NULL,
const char *
const *seq_group_names = NULL);
64 IniGroup *GetGroup(
const char *
name,
size_t len = 0,
bool create_new =
true);
65 void RemoveGroup(
const char *
name);
67 void LoadFromDisk(
const char *filename,
Subdirectory subdir);
76 virtual FILE *OpenFile(
const char *filename,
Subdirectory subdir,
size_t *size) = 0;
84 virtual void ReportFileError(
const char *
const pre,
const char *
const buffer,
const char *
const post) = 0;
89 IniFile(
const char *
const *list_group_names = NULL);
91 bool SaveToDisk(
const char *filename);
93 virtual FILE *OpenFile(
const char *filename,
Subdirectory subdir,
size_t *size);
94 virtual void ReportFileError(
const char *
const pre,
const char *
const buffer,
const char *
const post);
A group within an ini file.
Subdirectory
The different kinds of subdirectories OpenTTD uses.
char * comment
comment for group
IniItem ** last_item
the last item in the group
IniGroupType
Types of groups.
IniItem * item
the first item in the group
IniItem * next
The next item in this group.
char * comment
last comment in file
A single "line" in an ini file.
Types for Standard In/Out file operations.
IniGroup * group
the first group in the ini
IniGroupType type
type of group
void SetValue(const char *value)
Replace the current value with another value.
char * value
The value of this item.
Values of the form "landscape = hilly".
IniGroup ** last_group
the last group in the ini
IniItem(struct IniGroup *parent, const char *name, const char *last=NULL)
Construct a new in-memory item of an Ini file.
A list of uninterpreted lines, terminated by the next group block.
Ini file that supports both loading and saving.
char * name
The name of this item.
IniGroup * next
the next group within this file
~IniItem()
Free everything we loaded.
A list of values, separated by and terminated by the next group block.
Ini file that only supports loading.
char * comment
The comment associated with this item.
const char *const * list_group_names
NULL terminated list with group names that are lists.
const char *const * seq_group_names
NULL terminated list with group names that are sequences.