2019-01-23 19:41:12 +01:00
|
|
|
#pragma once
|
|
|
|
#include "Launcher.h"
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class Stream;
|
|
|
|
class WaitableStream;
|
|
|
|
|
|
|
|
class StreamBasedLauncher : public Launcher
|
|
|
|
{
|
|
|
|
WaitableStream *stream;
|
|
|
|
Stream *rStream;
|
|
|
|
std::vector<char> outputBytes;
|
|
|
|
bool upgradeMode = false;
|
|
|
|
public:
|
2019-08-18 13:21:00 +02:00
|
|
|
StreamBasedLauncher(boost::program_options::variables_map& options);
|
|
|
|
virtual ~StreamBasedLauncher();
|
2019-01-23 19:41:12 +01:00
|
|
|
|
2019-08-18 13:21:00 +02:00
|
|
|
virtual bool Go(int timeout = 0);
|
|
|
|
virtual void DumpOutput();
|
2019-01-23 19:41:12 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void SetupStream(WaitableStream* aStream, Stream* wrapped = nullptr);
|
|
|
|
private:
|
|
|
|
void write(const void *p, size_t n);
|
|
|
|
ssize_t read(void * p, size_t n);
|
|
|
|
};
|