IniFile Struct Reference

Ini file that supports both loading and saving. More...

#include <ini_type.h>

Inheritance diagram for IniFile:
IniLoadFile

Public Member Functions

 IniFile (const char *const *list_group_names=NULL)
 Create a new ini file with given group names.
bool SaveToDisk (const char *filename)
 Save the Ini file's data to the disk.
virtual FILE * OpenFile (const char *filename, size_t *size)
 Open the INI file.
virtual void ReportFileError (const char *const pre, const char *const buffer, const char *const post)
 Report an error about the file contents.

Detailed Description

Ini file that supports both loading and saving.

Definition at line 85 of file ini_type.h.


Constructor & Destructor Documentation

IniFile::IniFile ( const char *const *  list_group_names = NULL  ) 

Create a new ini file with given group names.

Parameters:
list_group_names A NULL terminated list with group names that should be loaded as lists instead of variables.
See also:
IGT_LIST

Definition at line 32 of file ini.cpp.


Member Function Documentation

FILE * IniFile::OpenFile ( const char *  filename,
size_t *  size 
) [virtual]

Open the INI file.

Parameters:
filename Name of the INI file.
size [out] Size of the opened file.
Returns:
File handle of the opened file, or NULL.

Implements IniLoadFile.

Definition at line 114 of file ini.cpp.

References DATA_DIR, and FioFOpenFile().

void IniFile::ReportFileError ( const char *const   pre,
const char *const   buffer,
const char *const   post 
) [virtual]

Report an error about the file contents.

Parameters:
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 121 of file ini.cpp.

References ShowInfoF().

bool IniFile::SaveToDisk ( const char *  filename  ) 

Save the Ini file's data to the disk.

Parameters:
filename the file to save to.
Returns:
true if saving succeeded.

Definition at line 41 of file ini.cpp.

References IniLoadFile::comment, IniGroup::comment, IniLoadFile::group, IniGroup::item, lastof, MemSetT(), IniGroup::name, IniItem::next, IniGroup::next, strecat(), and strecpy().

Referenced by DeleteGRFPresetFromConfig(), SaveGRFPresetToConfig(), and SaveToConfig().


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

Generated on Sun May 8 07:31:13 2011 for OpenTTD by  doxygen 1.6.1