I am using curl to communicate with a server.
When I make a request for data I receive the HTTP headers followed by jpeg data separated by a boundary like so:
I need to parse out
- The boundary string
- The Content-Length.
I have copied the incoming data to a a char array like so:
static size_t OnReceiveData ( void * pvData, size_t tSize, size_t tCount, void * pvUser )
{
printf("%*.*s", tSize * tCount, tSize * tCount, pvData);
char* _data;
if(pvData != nullptr && 0 != tCount)
{
_data = new char[tCount];
memcpy(_data, pvData, tCount);
}
return ( tCount );
}
How can I best do this in C++?? How do I actually inspect and parse the _data array for the information that I want?? Are the any boost libraries that I can use for example??