forked from qt-creator/qt-creator
Utils: Use some helper function in QtcProcess for common code
Change-Id: Iffa720f5c6b3c86ad80c92566fbe00465d3ed7a4 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -204,6 +204,8 @@ public:
|
|||||||
void handleRest();
|
void handleRest();
|
||||||
void append(const QByteArray &text);
|
void append(const QByteArray &text);
|
||||||
|
|
||||||
|
QByteArray readAllData() { return std::exchange(rawData, {}); }
|
||||||
|
|
||||||
QByteArray rawData;
|
QByteArray rawData;
|
||||||
QString incompleteLineBuffer; // lines not yet signaled
|
QString incompleteLineBuffer; // lines not yet signaled
|
||||||
QTextCodec *codec = nullptr; // Not owner
|
QTextCodec *codec = nullptr; // Not owner
|
||||||
@@ -1501,16 +1503,12 @@ bool QtcProcess::waitForFinished(int msecs)
|
|||||||
|
|
||||||
QByteArray QtcProcess::readAllStandardOutput()
|
QByteArray QtcProcess::readAllStandardOutput()
|
||||||
{
|
{
|
||||||
QByteArray buf = d->m_stdOut.rawData;
|
return d->m_stdOut.readAllData();
|
||||||
d->m_stdOut.rawData.clear();
|
|
||||||
return buf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray QtcProcess::readAllStandardError()
|
QByteArray QtcProcess::readAllStandardError()
|
||||||
{
|
{
|
||||||
QByteArray buf = d->m_stdErr.rawData;
|
return d->m_stdErr.readAllData();
|
||||||
d->m_stdErr.rawData.clear();
|
|
||||||
return buf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 QtcProcess::write(const QString &input)
|
qint64 QtcProcess::write(const QString &input)
|
||||||
|
|||||||
Reference in New Issue
Block a user