Files
ptyqt/core/ptyqt.cpp
T
2019-03-19 21:42:34 +03:00

49 lines
1.0 KiB
C++

#include "ptyqt.h"
#include <utility>
#ifdef Q_OS_WIN
#include "winptyprocess.h"
//#include "conptynamedpipeprocess.h"
#include "conptyanonymouspipeprocess.h"
#endif
#ifdef Q_OS_UNIX
#include "unixptyprocess.h"
#endif
IPtyProcess *PtyQt::createPtyProcess(IPtyProcess::PtyType ptyType)
{
switch (ptyType)
{
#ifdef Q_OS_WIN
case IPtyProcess::PtyType::WinPty:
return new WinPtyProcess();
break;
// case IPtyProcess::PtyType::ConPtyNamedPipe:
// return new ConPtyNamedPipeProcess();
// break;
case IPtyProcess::PtyType::ConPty:
return new ConPtyAnonymousPipeProcess();
break;
#endif
#ifdef Q_OS_UNIX
case IPtyProcess::PtyType::UnixPty:
return new UnixPtyProcess();
break;
#endif
case IPtyProcess::PtyType::AutoPty:
default:
break;
}
#ifdef Q_OS_WIN
if (ConPtyAnonymousPipeProcess().isAvailable())
return new ConPtyAnonymousPipeProcess();
else
return new WinPtyProcess();
#endif
#ifdef Q_OS_UNIX
return new UnixPtyProcess();
#endif
}