OpenTTD Source  1.11.0-beta2
SettingsIniFile Struct Reference

Derived class for loading INI files without going through Fio stuff. More...

Inheritance diagram for SettingsIniFile:
IniLoadFile

Public Member Functions

 SettingsIniFile (const char *const *list_group_names=nullptr, const char *const *seq_group_names=nullptr)
 Construct a new ini loader. More...
 
virtual FILE * OpenFile (const std::string &filename, Subdirectory subdir, size_t *size)
 Open the INI file. More...
 
virtual void ReportFileError (const char *const pre, const char *const buffer, const char *const post)
 Report an error about the file contents. More...
 
- Public Member Functions inherited from IniLoadFile
 IniLoadFile (const char *const *list_group_names=nullptr, const char *const *seq_group_names=nullptr)
 Construct a new in-memory Ini file representation. More...
 
virtual ~IniLoadFile ()
 Free everything we loaded.
 
IniGroupGetGroup (const std::string &name, bool create_new=true)
 Get the group with the given name. More...
 
void RemoveGroup (const char *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

- Data Fields inherited from IniLoadFile
IniGroupgroup
 the first group in the ini
 
IniGroup ** last_group
 the last group in the ini
 
std::string comment
 last comment in file
 
const char *const * list_group_names
 nullptr terminated list with group names that are lists
 
const char *const * seq_group_names
 nullptr terminated list with group names that are sequences.
 

Detailed Description

Derived class for loading INI files without going through Fio stuff.

Definition at line 157 of file settingsgen.cpp.

Constructor & Destructor Documentation

◆ SettingsIniFile()

SettingsIniFile::SettingsIniFile ( const char *const *  list_group_names = nullptr,
const char *const *  seq_group_names = nullptr 
)
inline

Construct a new ini loader.

Parameters
list_group_namesA nullptr terminated list with group names that should be loaded as lists instead of variables.
See also
IGT_LIST
Parameters
seq_group_namesA nullptr terminated list with group names that should be loaded as lists of names.
See also
IGT_SEQUENCE

Definition at line 163 of file settingsgen.cpp.

Member Function Documentation

◆ OpenFile()

virtual FILE* SettingsIniFile::OpenFile ( const std::string &  filename,
Subdirectory  subdir,
size_t *  size 
)
inlinevirtual

Open the INI file.

Parameters
filenameName of the INI file.
subdirThe subdir to load the file from.
[out]sizeSize of the opened file.
Returns
File handle of the opened file, or nullptr.

Implements IniLoadFile.

Definition at line 168 of file settingsgen.cpp.

◆ ReportFileError()

virtual void SettingsIniFile::ReportFileError ( const char *const  pre,
const char *const  buffer,
const char *const  post 
)
inlinevirtual

Report an error about the file contents.

Parameters
prePrefix text of the buffer part.
bufferPart of the file with the error.
postSuffix text of the buffer part.

Implements IniLoadFile.

Definition at line 182 of file settingsgen.cpp.

References error().


The documentation for this struct was generated from the following file: