Fixed compilation error

This commit is contained in:
Dmitry Panin
2013-11-19 11:06:31 +04:00
parent f370899a8a
commit 071a487100
2 changed files with 22 additions and 13 deletions

View File

@@ -14,18 +14,9 @@ private:
static boost::mutex mMutex; static boost::mutex mMutex;
public: public:
static void add(const std::string& s) { static void add(const std::string& s);
boost::mutex::scoped_lock lock(mMutex); static void debugAndClear();
stream << s << "\n"; static void clear();
}
static void debugAndClear() {
stream.flush();
qDebug("%s", stream.str().c_str());
stream.str("");
}
static void clear() {
stream.str("");
}
}; };
#endif #endif

View File

@@ -1,4 +1,22 @@
#include "../include/OutputCapturer.h" #include "../include/OutputCapturer.h"
std::ostringstream OutputCapturer::stream; std::ostringstream OutputCapturer::stream;
boost::mutex mMutex; boost::mutex OutputCapturer::mMutex;
void OutputCapturer::add(const std::string& s)
{
boost::mutex::scoped_lock lock(mMutex);
stream << s << "\n";
}
void OutputCapturer::debugAndClear()
{
stream.flush();
qDebug("%s", stream.str().c_str());
stream.str("");
}
void OutputCapturer::clear()
{
stream.str("");
}