56 #include "QtCore/qprocess.h" 57 #include "QtCore/qstringlist.h" 58 #include "QtCore/qhash.h" 59 #include "QtCore/qshareddata.h" 60 #include "private/qringbuffer_p.h" 61 #include "private/qiodevice_p.h" 63 #include <QtCore/private/qorderedmutexlocker_p.h> 67 #include "QtCore/qt_windows.h" 69 #define INVALID_Q_PIPE INVALID_HANDLE_VALUE 72 #define INVALID_Q_PIPE -1 83 #if defined(Q_OS_SYMBIAN) 122 return byteValue.isEmpty() && other.byteValue.
isEmpty()
123 ? stringValue == other.stringValue
124 : bytes() == other.bytes();
128 if (byteValue.isEmpty() && !stringValue.isEmpty())
129 byteValue = stringValue.toLocal8Bit();
134 if (stringValue.isEmpty() && !byteValue.isEmpty())
166 Key &ent = nameMap[
name];
171 inline QString nameToString(
const Key &name)
const 174 nameMap[sname] =
name;
177 inline Value prepareValue(
const QString &value)
const {
return Value(value); }
178 inline QString valueToString(
const Value &value)
const {
return value.string(); }
230 if (
d &&
d->
ref == 1)
233 : new QProcessEnvironmentPrivate);
298 bool _q_canReadStandardOutput();
299 bool _q_canReadStandardError();
301 bool _q_startupNotification();
302 bool _q_processDied();
320 bool createChannel(
Channel &channel);
321 void closeWriteChannel();
325 #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) 336 void destroyPipe(
Q_PIPE pipe[2]);
347 #if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && !defined(Q_OS_QNX) 348 void execChild(
const char *workingDirectory,
char **path,
char **argv,
char **envp);
349 #elif defined(Q_OS_QNX) 350 pid_t spawnChild(
const char *workingDirectory,
char **argv,
char **envp);
352 bool processStarted();
353 void terminateProcess();
357 bool waitForDeadChild();
360 void flushPipeWriter();
361 qint64 pipeWriterBytesToWrite()
const;
374 bool waitForStarted(
int msecs = 30000);
375 bool waitForReadyRead(
int msecs = 30000);
376 bool waitForBytesWritten(
int msecs = 30000);
377 bool waitForFinished(
int msecs = 30000);
378 bool waitForWrite(
int msecs = 30000);
380 qint64 bytesAvailableFromStdout()
const;
381 qint64 bytesAvailableFromStderr()
const;
388 static void initializeProcessManager();
392 bool processLaunched;
393 RProcess* symbianProcess;
399 #endif // QT_NO_PROCESS 401 #endif // QPROCESS_P_H The QProcessEnvironment class holds the environment variables that can be passed to a program...
static uint hash(const uchar *p, int n)
uint qHash(const QProcEnvKey &key)
QProcEnvKey(const QString &other)
OrderedMutexLocker(const QProcessEnvironmentPrivate *, const QProcessEnvironmentPrivate *)
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
#define QT_END_NAMESPACE
This macro expands to.
The QMutex class provides access serialization between threads.
ProcessError
This enum describes the different types of errors that are reported by QProcess.
ProcessChannel
This enum describes the process channels used by the running process.
QProcEnvKey(const QProcEnvKey &other)
void pipeFrom(QProcessPrivate *other)
void pipeTo(QProcessPrivate *other)
void detach()
If the shared data object's reference count is greater than 1, this function creates a deep copy of t...
The QByteArray class provides an array of bytes.
Value prepareValue(const QString &value) const
QProcess::ProcessState processState
ProcessState
This enum describes the different states of QProcess.
QString nameToString(const Key &name) const
bool ref()
Atomically increments the value of this QAtomicInt.
Key prepareName(const QString &name) const
The QString class provides a Unicode character string.
QProcessEnvironment environment
static QList< QVariant > toList(char **buf, int count, T *=0)
QString valueToString(const Value &value) const
QChar * data()
Returns a pointer to the data stored in the QString.
QSocketNotifier * notifier
The QSocketNotifier class provides support for monitoring activity on a file descriptor.
QProcess::ProcessChannel processChannel
QWindowsPipeWriter * pipeWriter
#define QT_BEGIN_NAMESPACE
This macro expands to.
QProcess::ProcessError processError
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
ProcessChannelMode
This enum describes the process channel modes of QProcess.
QHash< QString, Key > NameHash
The QStringList class provides a list of strings.
QString toCaseFolded() const Q_REQUIRED_RESULT
Returns the case folded equivalent of the string.
#define Q_INLINE_TEMPLATE
Q_DECLARE_TYPEINFO(QProcEnvKey, Q_MOVABLE_TYPE)
QProcess::ProcessChannelMode processChannelMode
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT
Returns the local 8-bit representation of the string as a QByteArray.
QProcessPrivate * process
ExitStatus
This enum describes the different exit statuses of QProcess.
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
#define Q_DECLARE_PUBLIC(Class)
QString & append(QChar c)
int compare(const QString &s) const
QProcess::ExitStatus exitStatus
The QSharedData class is a base class for shared data objects.
void clear()
Clears the contents of the string and makes it empty.
MutexLocker(const QProcessEnvironmentPrivate *)
QSocketNotifier * startupSocketNotifier
bool operator==(const QProcEnvKey &other) const
QRingBuffer errorReadBuffer
QWinEventNotifier * processFinishedNotifier
The QTimer class provides repetitive and single-shot timers.
QSocketNotifier * deathNotifier
QString & insert(int i, QChar c)
static QString fileName(const QString &fileUrl)
Channel & operator=(const QString &fileName)
QRingBuffer outputReadBuffer
The QProcess class is used to start external programs and to communicate with them.
QString()
Constructs a null string.