#ifndef STDOUT_WATCHER_H
#define STDOUT_WATCHER_H

#include <QThread>
#include <atomic>
#ifdef Q_OS_WINDOWS
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
#include <iostream>
#include <windows.h>
#ifndef _USE_OLD_IOSTREAMS
using namespace std;
#endif


#define CHECK(a) if ((a)!= 0) return -1;


#endif
class stdout_watcher : public QThread
{
	Q_OBJECT
public:
	explicit stdout_watcher(QObject *parent = nullptr);
	void run() override;
	void stop_and_wait();
signals:
	void evt_stdata(QByteArray,bool stderrb);
public:
	std::atomic<bool> m_bStop;

};

#endif // STDOUT_WATCHER_H
