19#include "QtCore/qprocess.h"
20#include "QtCore/qstringlist.h"
21#include "QtCore/qhash.h"
22#include "QtCore/qmap.h"
23#include "QtCore/qshareddata.h"
24#include "QtCore/qdeadlinetimer.h"
25#include "private/qiodevice_p.h"
30#include <QtCore/private/qorderedmutexlocker_p.h>
34#include "QtCore/qt_windows.h"
36#define INVALID_Q_PIPE INVALID_HANDLE_VALUE
39#define INVALID_Q_PIPE -1
131 ent =
name.toLocal8Bit();
139 nameMap[sname] =
name;
155 nameMap =
other.nameMap;
167 mutable NameHash nameMap;
168 mutable QMutex nameMapMutex;
179 if (
d &&
d->ref.loadRelaxed() == 1)
184 if (
d && !
d->ref.deref())
189#if QT_CONFIG(process)
194 Q_DECLARE_PUBLIC(QProcess)
197 enum ProcessChannelType :
char {
214 void pipeTo(QProcessPrivate *
other)
221 void pipeFrom(QProcessPrivate *
other)
229 QProcessPrivate *process =
nullptr;
246 virtual ~QProcessPrivate();
249 bool _q_canReadStandardOutput();
250 bool _q_canReadStandardError();
252 qint64 pipeWriterBytesToWrite()
const;
253 void _q_bytesWritten(
qint64 bytes);
254 void _q_writeFailed();
259 bool _q_startupNotification();
260 void _q_processDied();
262 Channel stdinChannel;
263 Channel stdoutChannel;
264 Channel stderrChannel;
266 bool openChannelsForDetached();
267 bool openChannel(Channel &
channel);
268 void closeChannel(Channel *
channel);
269 void closeWriteChannel();
270 void closeChannels();
271 bool tryReadFromChannel(Channel *
channel);
279 QProcess::CreateProcessArgumentModifier modifyCreateProcessArgs;
281 Q_PROCESS_INFORMATION *pid =
nullptr;
284 std::function<
void(
void)> childProcessModifier;
285 QProcess::UnixProcessParameters processParameters;
287 std::unique_ptr<UnixExtras> unixExtras;
295 quint8 processState = QProcess::NotRunning;
296 quint8 exitStatus = QProcess::NormalExit;
297 quint8 processError = QProcess::UnknownError;
298 quint8 processChannelMode = QProcess::SeparateChannels;
299 quint8 inputChannelMode = QProcess::ManagedInputChannel;
300 bool emittedReadyRead =
false;
301 bool emittedBytesWritten =
false;
305#if defined(Q_OS_UNIX)
306 void commitChannels()
const;
309 void processFinished();
310 void terminateProcess();
313 void waitForDeadChild();
318 STARTUPINFOW createStartupInfo();
319 bool callCreateProcess(QProcess::CreateProcessArguments *cpargs);
320 bool drainOutputPipes();
323 bool startDetached(
qint64 *pPid);
330 qint64 bytesAvailableInChannel(
const Channel *
channel)
const;
333 void destroyPipe(
Q_PIPE pipe[2]);
336 void setErrorAndEmit(QProcess::ProcessError
error,
const QString &description =
QString());
DarwinBluetooth::LECBManagerNotifier * notifier
IOBluetoothL2CAPChannel * channel
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
QProcEnvValue(const QString &value)
bool operator==(const QProcEnvValue &other) const
QProcEnvValue(const QByteArray &value)
QProcessEnvironmentPrivate(const QProcessEnvironmentPrivate &other)
Value prepareValue(const QString &value) const
QProcessEnvironmentPrivate()
static QProcessEnvironment fromList(const QStringList &list)
Key prepareName(const QString &name) const
QString valueToString(const Value &value) const
void insert(const QProcessEnvironmentPrivate &other)
QString nameToString(const Key &name) const
QStringList toList() const
void detach()
If the shared data object's reference count is greater than 1, this function creates a deep copy of t...
const T * constData() const noexcept
Returns a const pointer to the shared data object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QByteArray toLocal8Bit() const &
list append(new Employee("Blackpool", "Stephen"))
QList< QVariant > arguments
Combined button and popup list for selecting options.
QImageReader reader("image.png")
[1]
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
DBusConnection const char DBusError * error
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
static void setError(QJsonObject *response, const QString &msg)
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
static bool operator<(const QSettingsIniKey &k1, const QSettingsIniKey &k2)
#define QT_REQUIRE_CONFIG(feature)
static int compare(quint64 a, quint64 b)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
static QString errorMessage(QUrlPrivate::ErrorCode errorCode, const QString &errorSource, qsizetype errorPosition)
device waitForReadyRead(deadline)
QDeadlineTimer deadline(30s)
NameMapMutexLocker(const QProcessEnvironmentPrivate *d)
OrderedNameMapMutexLocker(const QProcessEnvironmentPrivate *d1, const QProcessEnvironmentPrivate *d2)