32 explicit QWindowsPipeReader(QObject *parent =
nullptr);
33 ~QWindowsPipeReader();
35 void setHandle(HANDLE hPipeReadEnd);
36 void startAsyncRead();
41 void setMaxReadBufferSize(qint64 size);
42 qint64 maxReadBufferSize()
const {
return readBufferMaxSize; }
44 bool isPipeClosed()
const {
return pipeBroken; }
45 qint64 bytesAvailable()
const;
46 qint64 read(
char *data, qint64 maxlen);
47 qint64 readLine(
char *data, qint64 maxlen);
48 qint64 skip(qint64 maxlen);
49 bool canReadLine()
const;
50 DWORD checkPipeState();
51 bool checkForReadyRead() {
return consumePendingAndEmit(
false); }
53 bool isReadOperationActive()
const;
54 HANDLE syncEvent()
const {
return syncHandle; }
57 void winError(ulong,
const QString &);
62 bool event(QEvent *e) override;
65 enum State { Stopped, Running, Draining };
67 void startAsyncReadHelper(QMutexLocker<QMutex> *locker);
68 void startAsyncReadLocked();
69 void cancelAsyncRead(State newState);
70 static void CALLBACK waitCallback(PTP_CALLBACK_INSTANCE instance, PVOID context,
71 PTP_WAIT wait, TP_WAIT_RESULT waitResult);
72 bool readCompleted(DWORD errorCode, DWORD numberOfBytesRead);
73 bool waitForNotification();
74 bool consumePendingAndEmit(
bool allowWinActPosting);
75 bool consumePending();
81 OVERLAPPED overlapped;
82 qint64 readBufferMaxSize;
83 QRingBuffer readBuffer;
84 qint64 actualReadBufferSize;
85 qint64 pendingReadBytes;
90 bool readSequenceStarted;
92 bool readyReadPending;
93 bool winEventActPosted;