In memory INI File Writer
I have an MFC application that is wizard based. The application prompts the user for a variable number of questions, which are then written to an INI file, which is later encrypted when the user clicks the Finish button.
All INI file parsers I've seen so far read from or write to a physical file on disk. I don't want to do this as the INI file contains confidential information. Instead, I would like the INI file to be in-memory-only based and never written to disk unencrypted.
As the app allows users to go back and change responses, it occurred to me that I could use an in-memory database for this purpose, but again I don't want anything to be written to disk and don't need to send the DB using mine application if it can be avoided.
I need to use an INI file as it is not processed by a unencrypted file by a third party.
Any suggestions are greatly appreciated.
Thanks..
a source to share
I have a C ++ IniFile class that allows working with Ini files in memory: http://www.lemonteam.com/downloads/inifile.h
It is a short, well-documented single .h file. Using example:
IniFile if ( "myinifile.ini" );
if.SetString( "mykey", "myvalue" );
// Nothing gets actually written to disk until you call Flush(), Close() or the object is deleted
if.Flush();
if.Close();
You should be able to modify the Flush () method to apply some kind of encryption to the stored data.
a source to share