(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.
This commit is contained in:
rubidium
2008-08-25 06:35:28 +00:00
parent 6e4d8a273e
commit 411c65e755
3 changed files with 34 additions and 35 deletions

View File

@@ -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. */