Image into a container

May 6, 2015 at 4:22 AM
Hi I have implemented twitter into my game. I need to get images from twitter and at the moment I am downloading them. I was wondering if there is a way to put them into a container rather than downloading them.

Mark
Coordinator
May 6, 2015 at 4:24 AM

Hi Mark,

What do you exactly mean by ‘put them into a container’?

Steve

May 6, 2015 at 4:25 AM
Like into a vector container to be able to call them in my game.


Coordinator
May 6, 2015 at 5:30 PM
You could use a container_stream backed by a std::vector or std::string. Then pass that to http_request::set_response_stream(...) before sending out the request. The HTTP response body will then be written into that stream you've provided which is backed by your STL container.

Steve