Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
23
24class QObject;
25class QIOPipePrivate;
26
27class QIOPipe : public QIODevice
28{
30
31public:
32 enum Mode {
33 EndPipe = 0x0000,
34 ProxyPipe = 0x0001
35 };
36
38 ~QIOPipe() override;
39
40 bool open(OpenMode openMode) override;
41 bool isSequential() const override;
42 void setReadChannelCount(int count);
43 void addChildPipe(QIOPipe *childPipe);
44
45protected:
46 qint64 readData(char *data, qint64 maxlen) override;
47 qint64 writeData(const char *data, qint64 len) override;
48
49private:
50 Q_DECLARE_PRIVATE(QIOPipe)
51 Q_DISABLE_COPY(QIOPipe)
52};
53
55{
56public:
57 Q_DECLARE_PUBLIC(QIOPipe)
58
59 explicit QIOPipePrivate(QIODevice *iodevice, bool proxying);
60 ~QIOPipePrivate() override;
61
62 void initialize();
63 bool readAvailableData();
64 void pumpData(const QByteArray &ba);
65 void pushData(const QByteArray &ba);
66 void _q_onReadyRead();
67 void addChildPipe(QIOPipe *childPipe);
68 void removeChildPipe(QIOPipe *childPipe);
69
70 bool m_proxying = false;
73};
74
76
77#endif // QIOPIPE_P_H
78
\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:71
QList< QPointer< QIOPipe > > childPipes
Definition qiopipe_p.h:72
~QIOPipePrivate() override
Definition qiopipe.cpp:19
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() 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:33
@ ProxyPipe
Definition qiopipe_p.h:34
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
Definition qlist.h:74
\inmodule QtCore
Definition qobject.h:90
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:311
\inmodule QtCore
Definition qpointer.h:18
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:55
QByteArray ba
[0]
QByteArray readData()