|
-
November 5th, 2012, 06:17 AM
#2
Re: custom streambuf for use with std::fstream?
can't you just open the same file 8 times and use istream::seekg on each stream accordingly ? the only caveat being that any code relying on eof for each stream to detect the end of the data would not work anymore ... if this is an issue for you then, yes, you can use boost iostream and write a so called "Source" model: you could just store a copy of the original stream in the said source model, calling seekg during construction and forwarding the read() call with eof signaled when the full data section has been retrieved. Of course, if you need a bidirectional or seekable stream then things get more complex, see the boost docs for details ...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|