What is the best way to convert a void* to stringstream? I need to convert incoming curl data to be able to parse it.
I have done the following and it appears to work but Im sure there is a better way
void ProcessData(void* data, size_t datalength)
{
if( data != nullptr )
{
std::stringstream ssdata;
ssdata << (char*)data;
}
}
EDIT My question is part of a larger challenge that I have. I have a curl call back that constantly is providing me MIME data where on each call back I have to parse the data and look for
A boundary string e.g "MYBOUNADRY" and then
Parse for a content length string e.g. "Content Length=1400"
And then copy the data that starts right after the Content Length string for 1400 bytes to another data buffer
But because of the chunking nature of the data callbacks the image data could be in one callback or spread over 2 callbacks so I have to constantly parse each incoming chunk of data.