I am having issue with streambuf and stringstreambuf because they have no support of clearing the buffer.
I am using stringstreambuf for http_response::get_line. I could use streambuf but I didn't find a way to convert it to string with stringstreambuf::collection I can.
So the way I can properly get what I need is to use string::erase in this pattern:
I am using stringstreambuf for http_response::get_line. I could use streambuf but I didn't find a way to convert it to string with stringstreambuf::collection I can.
So the way I can properly get what I need is to use string::erase in this pattern:
read = response.get_line(data).get()
str = data.collection
str.erase(str.begin()+read, str.end())
I find this kind of code odd and probably slow. If I can simply clear "data" (but how; and not reallocating each time unless buffer is too small) it would make the code cleaner.