S
smith4894
Hello all,
I'm working on writing my own streambuf classes (to use in my custom
ostream/isteam classes that will handle reading/writing data to a
mmap'd file).
When reading from the mmap file, I essentially have a char buffer in my
streambuf class, that I'm registering with setp(). on an overflow()
call, I simply copy the contents of the buffer into the mmap'd file via
memcpy().
If I want to use this to write binary data via the streambuf classes
ie, are there any special considerations I need to be aware of in my
streambuf classes? Do I need to set any special flags to indicate that
the data is in binary mode perhaps? Any special precautions I need to
take, in overflow(int_type) for example?
My setup seems to work with binary data *MOST* of the time, however
there are rare occasions when there is inconsistency with the data i'm
writing and reading...
Any advice, comments would be much appreciated
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
I'm working on writing my own streambuf classes (to use in my custom
ostream/isteam classes that will handle reading/writing data to a
mmap'd file).
When reading from the mmap file, I essentially have a char buffer in my
streambuf class, that I'm registering with setp(). on an overflow()
call, I simply copy the contents of the buffer into the mmap'd file via
memcpy().
If I want to use this to write binary data via the streambuf classes
ie, are there any special considerations I need to be aware of in my
streambuf classes? Do I need to set any special flags to indicate that
the data is in binary mode perhaps? Any special precautions I need to
take, in overflow(int_type) for example?
My setup seems to work with binary data *MOST* of the time, however
there are rare occasions when there is inconsistency with the data i'm
writing and reading...
Any advice, comments would be much appreciated
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]