Home » Community » Newbie corner » best method of saving users settings?
Re: best method of saving users settings? [message #33319 is a reply to message #33314] |
Sun, 24 July 2011 19:09  |
|
Hi dave,
This is quite common question... I wish there was a simple answer, so we could put it in FAQ section 
It depends a lot on what you want to do. If you want to store some internal information (e.g. GUI state), binary serialization is a good choice. XML is good choice when you store information you want to be easily accessible from other applications or human readable. For storing application configuration, which should be human editable, text based config file is appropriate.
Both Serialize() and Xmlize() have quite similar semantics and working with them is rather simple in U++. For reading/writing the ".ini" like text files, there exist a class that handles this as well.
Using a serialization of map should work in general, but it will make you do more work in case you wan't to store more than just one type. So I would recommend to stay with one of the three methods mentioned above.
Also, nothing stops you from combining these methods. You can save part of the information in serialized form, while the rest is in text file. I personally prefer to have it split, so user only reads what is intended for him to read 
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Sat Jul 19 12:20:24 CEST 2025
Total time taken to generate the page: 0.03924 seconds
|