When do you use a prefs or other file ?
Posted: Fri Dec 27, 2019 9:38 am
Hi,
I'm curious how you would deal with the following situation. I am writing a small utility to aid the renaming and moving of raw image files created by a digital camera. While I'm going to be the primary user I can see that such an application may be of use to others so I need to include more raw formats in the application as the present version is hard coded only to deal with the two raw file types that I shoot. I wish to extend this to all common raw types by including a list of raw file extensions. The chances are that this list is unlikely to change in the near future as camera manufactures continue with the same extension even if the file format changes. For example a Nikon NEF file created by a Nikon D70 is different from that created by a Nikon D850 but both use the .nef extension.
So should I give the end user the option of adding new file types given that the base list is unlikely to change very often? If I do then what method should be employed? The methods I have thought of are :
1) Hard code the list into the application and only update the application when someone needs it updated.
2) Store the list as a prefs file. This needs some OS juggling but I have a library I can use.
3) Use a compiled "splash" stack and save the data as part of the working stack which may be saved.
4) Save the data as a text file that is saved to the same folder as the application stack.
5) Some elegant solution I have not thought of.
best wishes
Simon K.
I'm curious how you would deal with the following situation. I am writing a small utility to aid the renaming and moving of raw image files created by a digital camera. While I'm going to be the primary user I can see that such an application may be of use to others so I need to include more raw formats in the application as the present version is hard coded only to deal with the two raw file types that I shoot. I wish to extend this to all common raw types by including a list of raw file extensions. The chances are that this list is unlikely to change in the near future as camera manufactures continue with the same extension even if the file format changes. For example a Nikon NEF file created by a Nikon D70 is different from that created by a Nikon D850 but both use the .nef extension.
So should I give the end user the option of adding new file types given that the base list is unlikely to change very often? If I do then what method should be employed? The methods I have thought of are :
1) Hard code the list into the application and only update the application when someone needs it updated.
2) Store the list as a prefs file. This needs some OS juggling but I have a library I can use.
3) Use a compiled "splash" stack and save the data as part of the working stack which may be saved.
4) Save the data as a text file that is saved to the same folder as the application stack.
5) Some elegant solution I have not thought of.
best wishes
Simon K.