This class allows an application to more easily manage user preferences. As
an application grows, more preferences will likely be added, but if the application
uses flat file storage, managing these preferences while adding new preferences
can be difficult. This class manages, documents, and provides default values, all the
while not interfering with changes the user has made, meaning that you are free
to add new preferences, or change default values, without fear of changing
values that the user has specifically set. For sample usage, see
Provide the name of the app, and logger, for recording errors, and a list
of defaults, in case the value is not provided by the user, or an invalid
value is provided. It also writes a custom header at the top of the file.
Newlines are supported, but only \n
Given a file that the preferences are supposedly stored in, this
function will try to load the preferences. If the preferences don't exist,
or they are incomplete, this will also fill in the missing values, and
store the now complete preferences in the file location specified.