[iostreams] Decompressing n lines at a time and parsing
Hi, I'd appreciate any advice on how to acheive the following using iostreams: 1) Read in part of a compressed file. 2) Decompress the chunk just read. 3) Pass this to boost::tokenizer (or boost::spirit?) 4) Parse the decompressed text, one line at a time. 1) Read in the next chunk of compressed data. The docs don't seem to have this as an example, and I'm a novice at programming so am a little wary of trying something 'off-the-cuff'. It seems 4) can be a little sticky - when the chunk of compressed data does not end at the 'end of a line' in the decompressed data.... I'd rather spend some time becoming familar with iostreams - it has more 'head-room'. Nonethelss, this may not be what iostreams was designed for, so will it be more effective to use the the zlib library, using gzgets()? Finally, looking at some posts it seems that if using boost::iostreams the correct buffer is an array_source and array_sink? Would appreciate any suggestions. Regards Mark
Mark Van De Vyver wrote:
Hi, I'd appreciate any advice on how to acheive the following using iostreams:
1) Read in part of a compressed file. 2) Decompress the chunk just read. 3) Pass this to boost::tokenizer (or boost::spirit?) 4) Parse the decompressed text, one line at a time. 1) Read in the next chunk of compressed data.
Just want to let you know I've seen this message; I have to think abot it a bit. -- Jonathan Turkanis www.kangaroologic.com
Jonathan Turkanis
Just want to let you know I've seen this message; I have to think abot it a bit.
That is fine, I'm a _little_ more familiar with the library and have thought how I'd best use it against my 'problem', a work around should be possible. On a related point is it possible to pass arrays of more than one dimension as the input and output buffer? I hadn't yet seen this explicitly in an example or any of the mailing list postings. Here I had in mind to consider using Blitz++ (using transposeSelf) - this gets me several rows of the same character/byte which I expect will compress well and quickly. BTW I posted (via gmane, so I don't have a copy unfortunately, nnd this post is a 'test') a little note on one of the examples, but I've not seen that on the list - did it come to your attention? Admittiedly it was posted before I'd acknowledged my boost.user subscription. Regards Mark
participants (2)
-
Jonathan Turkanis
-
Mark Van De Vyver