Saving and Loading the Configuration
Welcome to Chapter 5! In the previous chapter, we added a separate view mode to the application. In this view-only mode, the user interface and selection functionality are disabled. Then, we added a simplified and, eventually, a full version of undo/redo for the instances. Setting changes to an instance can now be reverted, or reapplied.
In this chapter, we will add the ability to save the configuration of the application to a file. First, we will explore different file types to store the data. After considering the pros and cons of each type of file and determining a suitable file format, we will dive into the structure of the file format. Then, we’ll implement a parser class that will allow us to load and save our configuration. Finally, we will load a default configuration at application startup, allowing the user to play around with the application.
For any bigger application, it is crucial to be able to save the current state...