On 03/20/2015 02:18 PM, Nat Goodspeed wrote:
On Fri, Mar 20, 2015 at 10:37 AM, tcamuso
wrote: What I'd like to do, because i think it would be much faster, is to go through the one big file and deserialize each of those serializations as they are encountered. Early testing showed that it would only take a few minutes to integrate these pieces into one whole.
If there were some simple way for user code to recognize the end of an archive, maybe you could interpose an input filter using Boost.Iostreams. The filter would present EOF to its caller on spotting the end of archive, but leave the underlying file open (with its read pointer adjusted to immediately after the end of archive) for the application to bind another instance of the same filter onto the same underlying file.
I must look into Boost.Iostreams, because I can recognize the end of an archive by detecting the "serialization::archive" string at the beginning of another. This is a hack, I realize, and there's no guarantee that this banner won't change in the future.
If there were linefeeds in the serialized data, the code to do this would be much simpler.
Maybe you could derive an archive type yourself from one of the existing ones that differs only in appending an easily-recognizable marker when finished writing?
This may be the what's needed. I'm almost out of time on this project, so I may have to eat the long time it takes to build the database and revisit this another day when I'm in maintenance mode. I will be happy to post my results.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users