im is currently working on a C ++ application that uses the c library, which requires a callback implemented by me, for example, a callback is defined as follows:
int onWrite(char *what, char *buffer, size_t size, off_t offset);
I have std :: set, which needs to be formed and written to the buffer, and take care of the size and offset, where size is the size of the buffer and the offset, how many bytes are already processed
is there a C ++ way where I can use a stream in a buffer? I am thinking of something like this:
SomeSTLStandardStream stream(buffer,size);
stream.ignore(offset);
for(it=dataset.begin();it!=dataset.end() && stream.buffer_avail()>0;it++)
stream << *it << "|";
The main question I have is: is there a standard C ++ method for capturing the entire fragment of generated / stream data and writing to a given buffer?
If not bad, I need to execute my own
, , , ,
, ....