Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

New Post: streambuf and stringstreambuf

$
0
0
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:
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.

Viewing all articles
Browse latest Browse all 4845

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>