diff options
author | rubidium <rubidium@openttd.org> | 2008-08-25 06:35:28 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-08-25 06:35:28 +0000 |
commit | 411c65e755eb6dd2e1412d2edb0f811ebd5ce73d (patch) | |
tree | a086b2427b7b866fcd2b443ad6263ee2dc19845c /src/ini_type.h | |
parent | 6e4d8a273e655372cdd1c5a1834cbb947381885f (diff) | |
download | openttd-411c65e755eb6dd2e1412d2edb0f811ebd5ce73d.tar.xz |
(svn r14164) -Codechange: simplify and unify the addition of ini items with value when not loading an ini file.
-Fix: wrong insertion management causing leaks.
Diffstat (limited to 'src/ini_type.h')
-rw-r--r-- | src/ini_type.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ini_type.h b/src/ini_type.h index 4c18862ea..060af5d66 100644 --- a/src/ini_type.h +++ b/src/ini_type.h @@ -18,8 +18,30 @@ struct IniItem { char *value; ///< The value of this item char *comment; ///< The comment associated with this item + /** + * Construct a new in-memory item of an Ini file. + * @param parent the group we belong to + * @param name the name of the item + * @param len the length of the name of the item + */ IniItem(struct IniGroup *parent, const char *name, size_t len = 0); + + /** + * Construct a new in-memory item of an Ini file. + * @param parent the group we belong to + * @param name the name of the item + * @param value the value to immediatelly assign + */ + IniItem(IniGroup *parent, const char *name, const char *value); + + /** Free everything we loaded. */ ~IniItem(); + + /** + * Replace the current value with another value. + * @param value the value to replace with. + */ + void SetValue(const char *value); }; /** A group within an ini file. */ |