Commit 47d0007d authored by Sylvain Thery's avatar Sylvain Thery

sauvegarde avant suppression tous les cout cerr

parent cfe6d910
......@@ -245,6 +245,9 @@ int main(int argc, char **argv)
// show final pour premier redraw
sqt.show();
CGoGNout.out2Console(&sqt);
CGoGNerr.out2Console(&sqt);
// et on attend la fin.
return app.exec();
......
......@@ -26,6 +26,7 @@
#define _SIZEBLOCK_H_
#include "gzstream.h"
#include "Utils/cgognStream.h"
#define _BLOCKSIZE_ 4096
......
......@@ -25,13 +25,12 @@
#ifndef _CGOGNSTREAM_H_
#define _CGOGNSTREAM_H_
// pb of compilation ??
#ifndef DBG_MAX_LEVEL
#define DBG_MAX_LEVEL 5
#endif
#include <string>
#include <iostream>
#include <sstream>
......
......@@ -192,9 +192,7 @@ Out<LEVEL>& Out<LEVEL>::operator<< (Special& os )
{
if (&os == &CGoGNendl)
{
m_buffer << std::endl;
char bufc[512];
m_buffer.getline(bufc,512);
// for cout & cerr just do the endl
if (m_out_mode & STDOUT)
......@@ -203,31 +201,56 @@ Out<LEVEL>& Out<LEVEL>::operator<< (Special& os )
std::cerr << std::endl;
if (m_out_mode & FILEOUT)
*m_ofs << bufc << std::endl;
{
while (! m_buffer.eof())
{
m_buffer.getline(bufc,512);
*m_ofs << bufc << std::endl;
}
}
if (m_out_mode & QTSTATUSBAR)
m_sqt_bar->statusMsg(bufc);
{
while (! m_buffer.eof())
{
m_buffer.getline(bufc,512);
m_sqt_bar->statusMsg(bufc);
}
}
if (m_out_mode & QTCONSOLE)
{
if (m_code>=100)
m_sqt_console->console()->setTextColor( QColor(0, 150 - (m_code-100)*20, 50+(m_code-100)*20) );
else
while (! m_buffer.eof())
{
if (m_code>0)
m_sqt_console->console()->setTextColor( QColor(150, 0, 0) );
m_buffer.getline(bufc,512);
if (m_code>=100)
m_sqt_console->console()->setTextColor( QColor(0, 150 - (m_code-100)*20, 50+(m_code-100)*20) );
else
m_sqt_console->console()->setTextColor( QColor(0, 0, 150) );
{
if (m_code>0)
m_sqt_console->console()->setTextColor( QColor(150, 0, 0) );
else
m_sqt_console->console()->setTextColor( QColor(0, 0, 150) );
}
m_sqt_console->console()->insertPlainText(QString(bufc));
m_sqt_console->console()->insertPlainText(QString("\n"));
}
m_sqt_console->console()->insertPlainText(QString(bufc));
m_sqt_console->console()->insertPlainText(QString("\n"));
}
if (m_out_mode & SSBUFFER)
*m_oss << bufc << std::endl;
{
while (! m_buffer.eof())
{
m_buffer.getline(bufc,512);
*m_oss << bufc << std::endl;
}
}
}
}
m_buffer.clear();
return *this;
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment