is there a function or unit sames as TIniFiles that will not save to file?
TMemIniFile is what you need and should always be preferred to TIniFile. You choose whether or not to save to file.
What you can't do directly is initialize it from a resource, but it's not too hard to put it together yourself.
- Use a resource stream to extract your resource.
- Create a string list and call load your resource stream into the string list.
- Create a TMemIniFile and call SetStrings passing the string list.
There is a class named TMemIniFile that only saves the changes to the inifile when you call UpdateFile
. Is that good enough for you?
TMemIniFile (descendant of TCustomIniFile) will not save unless you tell it to UpdateFile;