Adding method to get prefs file path without Fl_Preferences constructor
"anmol....
Apr 30, 2021
I am reposting this as it was previously posted in a thread from 2015.
I am trying to keep a default prefs file as a string within my app (this is necessary as I am using prefs to store encrypted data), and when the user runs the app, I would like to detect if a file was created, and if not, copy over the contained file.
For this, I need to know the prefs path before invoking the Fl_Preferences constructor as the constructor itself creates an empty file.
So far, from Fl_Preferences.cxx, I found that the system_driver preference_rootnode method creates the filename.
This is a virtual function that is defined based on the platform, hence I cannot simply copy the code from inside it.
Could I request the developers to expose a method from within Fl_Preferences that will simply return the generated filename if <root> <vendor> and <application> were to be passed as the constructor arguments ?
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.