Search code examples
c++savewxwidgets

How to make a more complex wxWidgets save system


I'm making a desktop app with wxWidgets but I can't figure out how it can have a more complex save system. For example, a project in Sony Vegas is saved in one file, and it's a (.veg). My save system will have to save mostly text from user, but in different areas. To be able to do this, do I need to save each thing I need separatly and load them all when I wish to re-enter the app? Sorry if this question seems obvious, I'm new fairly new at using wxWidgets.


Solution

  • Saving data to one or more files depends on how you organize your app.

    • It may read data from a file only when needed. Different tasks may use different files.
    • It may store everything in a single file. Read it all once. Or read parts of it for different tasks. If the file is too much big (my opinion, greater than 50 MB), obviously this is not the best option.

    For the second option you may use std <fstream> functions. Or some of those provided by wxWidgets, which you will appreciate if you need to deal with text encodings, or other features as well.

    Also, wxFileConfig may be useful if you wish to set several "sections" of your data.