I am using the library libvtemm, which has a function write_contents. It takes an internal buffer and outputs it to a Glib::RefPtr<Gio::OutputStream> object. I have been trying to find a way to convert the contents of the Gio::OutputStream into a std::string or something similar so that I can play with and move around the data inside to other data structures.
Does anyone know how to either construct a Gio::OutputStream to something like a std::ostream or convert its contents into a std::string?
I see there is a Gio::MemoryOutputStream, would something like this be useful in grabbing the data to a std::ostream?
For those of you who are looking for an answer, here is what I have come up with to read the console buffer into a
std::string.Hope this helps someone in the future who comes across a similar problem.