04-22-2012, 09:52 PM
I'd say this is convoluted. We need to jump through hoops for the expected behavior.
How about this subtle change:
- GetValue() reads the first value of the specified name
- SetValue() overwrites the first value of the specified name; creates if not found
- EnumValues() reads all the values of the specified name
- AddValue() adds a possibly duplicate name=value pair
This would make all intentions in the code clear - you'd know if the code expects to work with duplicates or not. Also all of this could be exported to plugins and this API is much cleaner, imho.
How about this subtle change:
- GetValue() reads the first value of the specified name
- SetValue() overwrites the first value of the specified name; creates if not found
- EnumValues() reads all the values of the specified name
- AddValue() adds a possibly duplicate name=value pair
This would make all intentions in the code clear - you'd know if the code expects to work with duplicates or not. Also all of this could be exported to plugins and this API is much cleaner, imho.