5#include <QtCore/qmetaobject.h>
11
12
13
15 : m_proxying(proxying), source(iodevice)
25 const QIOPipe *parentPipe = qobject_cast<QIOPipe *>(source);
26 if (parentPipe && parentPipe->d_func()->m_proxying)
32 QObjectPrivate::connect(source, &QIODevice::readyRead,
this, &QIOPipePrivate::_q_onReadyRead);
38 QByteArray ba = source->readAll();
49 auto isNull = [](
const auto &cp) {
return cp ==
nullptr; };
50 childPipes.removeIf(isNull);
51 for (
const auto &cp : std::as_const(childPipes))
52 cp->d_func()->pushData(ba);
54 for (
auto &buffer : readBuffers)
79 if (childPipes.contains(childPipe))
81 childPipes.append(childPipe);
86 childPipes.removeOne(childPipe);
92 this->d_func()->initialize();
93 if (!parent->isOpen() && !parent->open(QIODevice::ReadOnly)) {
94 qWarning() <<
"QIOPipe: Failed to open " << parent;
110 static const OpenMode supportedOpenMode = ReadOnly;
111 if (!(mode & supportedOpenMode)) {
112 qFatal(
"Unsupported open mode");
116 return QIODevice::open(mode);
127 d->setReadChannelCount(qMax(count, 1));
133 d->addChildPipe(childPipe);
137
138
139
140
141
142
143
144
145
158 qFatal(
"QIOPipe is a read-only device");
164#include "moc_qiopipe_p.cpp"
\inmodule QtCore \reentrant
~QIOPipePrivate() override
void pumpData(const QByteArray &ba)
void pushData(const QByteArray &ba)
QIOPipe(QIODevice *parent, Mode mode=EndPipe)
qint64 readData(char *data, qint64 maxlen) override
\reimp
bool isSequential() const override
Returns true if this device is sequential; otherwise returns false.
void setReadChannelCount(int count)
bool open(OpenMode openMode) override
void addChildPipe(QIOPipe *childPipe)
qint64 writeData(const char *data, qint64 len) override
Writes up to maxSize bytes from data to the device.