Proposing a cIniFile change
#1
I'd like to propose a change to the way cIniFile handles its SetValue() calls.

Currently, if any of the SetValue() family of functions is called, the value is searched for and if it exists, a *new* value is added (resulting in duplicate value being stored in the file). This can be fixed by setting the "create" parameter to false, but then the value is not created if it doesn't exist at all.

I'd say the semantics that is the most useful is "set if it exists, create if it doesn't", which are not available in the current code. I can't really see any use for duplicate values in the file, since the code is unable to load them back later (only the first match is always reported).

I'm therefore proposing to change the SetValue() method to ignore the "create" parameter if the value already exists, and always overwrite the value.

Are there any objections?

Note that this function is available at plugin-interface level, too, so plugins will be affected as well.
Reply
Thanks given by:


Messages In This Thread
Proposing a cIniFile change - by xoft - 04-21-2012, 02:30 AM
RE: Proposing a cIniFile change - by FakeTruth - 04-21-2012, 02:33 AM
RE: Proposing a cIniFile change - by xoft - 04-21-2012, 04:19 AM
RE: Proposing a cIniFile change - by FakeTruth - 04-21-2012, 07:13 AM
RE: Proposing a cIniFile change - by xoft - 04-22-2012, 09:52 PM
RE: Proposing a cIniFile change - by FakeTruth - 04-23-2012, 12:12 AM
RE: Proposing a cIniFile change - by xoft - 04-23-2012, 06:41 AM
RE: Proposing a cIniFile change - by FakeTruth - 04-23-2012, 07:24 AM
RE: Proposing a cIniFile change - by xoft - 06-10-2012, 12:33 AM
RE: Proposing a cIniFile change - by xoft - 06-10-2012, 01:53 AM
RE: Proposing a cIniFile change - by FakeTruth - 06-10-2012, 06:43 AM



Users browsing this thread: 2 Guest(s)