Libraries to group together formulas, parameter sets, maps, L-system definitions, IFS definitions, etc. #311
Replies: 3 comments 1 reply
-
In ManpWIN, I have a ManpWIN.ini file that lives in AppData\Roaming\ManpWIN folder. This saves all the preferences that are set up in the Setup menu as well as the default locations for all the file types. as well as the most recently used filename of each type. This file is recreated every time ManpWIN exits. ;======================================================================== |
Beta Was this translation helpful? Give feedback.
-
Phew! Well that took a whole bunch of code massaging, but now all reading and writing of files is done via the libraries mechanism and the documentation has been updated to describe libraries and how they work. Unit tests were added for the search mechanisms and all the file-based tests were updated with the new file locations on output. |
Beta Was this translation helpful? Give feedback.
-
Well done Richard. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Ever since I created an installer for Iterated Dynamics that put the various data files in Program Files (a read-only location), there's been a struggle to identify locations of files for reading vs. locations for writing. I haven't really been happy with the situation so far, where each type of file has it's own bespoke logic for identifying the read location.
In issue #95 I proposed specifying a list of directories for the various file types to assist in searching for files to read. Unfortunately this just makes a complex situation already more complicated as each type of file would be searching through possibly different directory locations.
It's also the case that these various files are related to each other. Parameter sets can refer to formula files, IFS files, L-system files, colormap files. Looking forward down the roadmap, there will be cases where formula files will reference other files following the syntax of Ultra Fractal.
So, instead of having individual search locations for each type of file, I'm proposing the idea of a Library. A Library is simply a directory containing subdirectories for each file type organized similar to the
home
directory in the source tree. Instead of specifying a list of search locations per file type, you specify a list of library locations to search. The search algorithm will be roughly as follows:maps
,pars
, etc.) for the file.For saving files (writing PAR sets, batch files, color maps, etc.) there will be a single library path and again, the appropriate subdir will be selected. For saving images, the subdirectory will be
images
under the library save location. When saving, the appropriate subdirectory for the type of file being written will be created if it doesn't exist.Currently the default save location (on Windows) is the user's Documents folder. This implies that subdirectories would be created in the user's documents folder when saving files. Instead of putting everything in the documents folder, the default save location should be a subdirectory named
Id
of the documents folder so that everything is grouped together into a single folder. Since the user's documents folder is not a fixed path, the convention shall be that setting the value of the save library location to a relative path will always be relative to the user's documents folder and will default toId
.For reading, wxWidgets can treat a ZIP file as a file system, so it should be possible to specify read locations as ZIP files, making it easy to share libraries between users.
For the purposes of this discussion, I'd like to hear your opinions on this idea and see if I've missed anything. I think this will be a better solution than having a plethora of search locations for the different file types.
Beta Was this translation helpful? Give feedback.
All reactions