Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qiopipe_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QIOPIPE_P_H
5#define QIOPIPE_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qiodevice.h>
19#include <QtCore/qbytearray.h>
20#include <QtCore/private/qiodevice_p.h>
21#include <QtCore/qpointer.h>
22
24
25class QObject;
26class QIOPipePrivate;
27
28class QIOPipe : public QIODevice
29{
31
32public:
33 enum Mode {
34 EndPipe = 0x0000,
35 ProxyPipe = 0x0001
36 };
37
39 ~QIOPipe() override;
40
41 bool open(OpenMode openMode) override;
42 bool isSequential() const override;
43 void setReadChannelCount(int count);
44 void addChildPipe(QIOPipe *childPipe);
45
46protected:
47 qint64 readData(char *data, qint64 maxlen) override;
48 qint64 writeData(const char *data, qint64 len) override;
49
50private:
51 Q_DECLARE_PRIVATE(QIOPipe)
52 Q_DISABLE_COPY(QIOPipe)
53};
54
56{
57public:
58 Q_DECLARE_PUBLIC(QIOPipe)
59
60 explicit QIOPipePrivate(QIODevice *iodevice, bool proxying);
61 ~QIOPipePrivate() override;
62
63 void initialize();
64 bool readAvailableData();
65 void pumpData(const QByteArray &ba);
66 void pushData(const QByteArray &ba);
67 void _q_onReadyRead();
68 void addChildPipe(QIOPipe *childPipe);
69 void removeChildPipe(QIOPipe *childPipe);
70
71 bool m_proxying = false;
72 QPointer<QIODevice> source;
73 QList<QPointer<QIOPipe>> childPipes;
74};
75
77
78#endif // QIOPIPE_P_H
79
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore \reentrant
Definition qiodevice.h:34
QIODeviceBase::OpenMode openMode() const
Returns the mode in which the device has been opened; i.e.
void addChildPipe(QIOPipe *childPipe)
Definition qiopipe.cpp:77
void _q_onReadyRead()
Definition qiopipe.cpp:70
void removeChildPipe(QIOPipe *childPipe)
Definition qiopipe.cpp:84
QPointer< QIODevice > source
Definition qiopipe_p.h:72
QList< QPointer< QIOPipe > > childPipes
Definition qiopipe_p.h:73
~QIOPipePrivate() override
Definition qiopipe.cpp:19
QIOPipePrivate(QIODevice *iodevice, bool proxying)
Definition qiopipe.cpp:14
void pumpData(const QByteArray &ba)
Definition qiopipe.cpp:46
void pushData(const QByteArray &ba)
Definition qiopipe.cpp:59
bool readAvailableData()
Definition qiopipe.cpp:35
void initialize()
Definition qiopipe.cpp:23
QIOPipe(QIODevice *parent, Mode mode=EndPipe)
Definition qiopipe.cpp:89
~QIOPipe() override
Definition qiopipe.cpp:100
bool isSequential() const override
Returns true if this device is sequential; otherwise returns false.
Definition qiopipe.cpp:119
@ EndPipe
Definition qiopipe_p.h:34
@ ProxyPipe
Definition qiopipe_p.h:35
void setReadChannelCount(int count)
Definition qiopipe.cpp:124
bool open(OpenMode openMode) override
Definition qiopipe.cpp:105
void addChildPipe(QIOPipe *childPipe)
Definition qiopipe.cpp:130
qint64 writeData(const char *data, qint64 len) override
Writes up to maxSize bytes from data to the device.
Definition qiopipe.cpp:156
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
Combined button and popup list for selecting options.
GLenum mode
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLsizei len
#define Q_OBJECT
long long qint64
Definition qtypes.h:60
QByteArray ba
[0]
QByteArray readData()