Page 1 of 1

wxConfig question

Posted: Wed Dec 18, 2013 5:25 pm
by spectrum
Dear all,

i would need that wxConfig keep stored a list of strings in a certain order, the same i write to it. But i see, at reload, the order never change since it is "map/key" based.

Any idea on how to keep saved a sorted list of strings(key) + string(value) ?

Thanks,
Angelo

Re: wxConfig question

Posted: Wed Dec 18, 2013 6:29 pm
by doublemax
I don't think this is possible with wxConfig/wxFileConfig.

Re: wxConfig question

Posted: Wed Dec 18, 2013 7:29 pm
by DavidHart
Hi,

I use the method described in this old thread. In your case you'd either have to adapt that to use a numerical key (rather than "aaa" etc.) or else have a structure like:

Code: Select all

[SomePath/aaa]
mykey=123
myvalue=foo
[SomePath/aab]
mykey=456
myvalue=bar
Regards,

David