Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "output.h"
- Output::Output(const QString &prefix) :
- std::ostream(&buffer), buffer(std::cout, prefix)
- {
- }
- Output::StreamBuffer::StreamBuffer(std::ostream& str, const QString &p)
- :out(str)
- {
- prefix = p + "-> ";
- }
- std::ostream& operator<<(std::ostream &out, const QString var)
- {
- out<<qPrintable(var);
- return out;
- }
- int Output::StreamBuffer::sync()
- {
- out <<qPrintable(prefix)<< str();
- str("");
- out.flush();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement