This is for an ordinary client-side Win32 app. Splitting the file into
multiple simpler files would make it a mess for the users. It would be
like breaking an Excel document into a cluster of three or four
related documents.
I'd be interested in any advice, and especially pointers to usable
code. Licensing a commercial database engine is overkill. Just
something that would allow for managing a document thru a nice API
that encapsulated the mechanics of reshuffling things everytime a
longer version of a string needed to be saved and that could know
where to find things.
I realize that this is asking a lot, but there was a relatively cheap
shareware utility that did just this for the Mac, more than 10 years
ago (long gone). It seems like such a common problem that I would
expect many more such utilities would be available now for a platform
1000x the size of the Mac platform 10 years ago.
Any ideas? Thanks.
Sounds like you need structured storage. Lookup "StgCreateDocfile" or
"Structured storage". This would be my first option I think.
If that doesn't fit then perhaps this will:
-->http://www.gipsysoft.com/code/code/crandomfile.zip
It basically manages the process of stuffing randomly sized blocks of data
into a file. It allows deleting of those blocks and eventual reuse of the
freed space. It won't compile as-is because it uses some of my own array
type classes but it should be fairly trivial to 'port' it to STL or MFC
containers.
--
russ.
http://www.gipsysoft.com/qhtm/ - FREE HTML display in a small and light DLL
http://www.gipsysoft.com/ZoomPlus/ - Programmers Zoom Utility on Steroids
http://www.kingcoder.com/ - Contract software developer
Sounds like XML to me. There are a variety of XML libraries
available, and MS went XML crazy in XP.
An alternative might be to use a parser tool like bison/yacc.
This would make the reading in of the file easier (though the
file output, which is usually much simpler would still need
hand coding.).