io/process: add StdioCollector data stream parser

This commit is contained in:
outfoxxed 2025-06-09 22:26:34 -07:00
parent 0224fa942b
commit 2b01a75679
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
3 changed files with 67 additions and 4 deletions

View file

@ -111,3 +111,27 @@ void SplitParser::setSplitMarker(QString marker) {
this->mSplitMarkerChanged = true;
emit this->splitMarkerChanged();
}
void StdioCollector::parseBytes(QByteArray& incoming, QByteArray& buffer) {
buffer.append(incoming);
if (!this->mWaitForEnd) {
this->mData = buffer;
emit this->dataChanged();
}
}
void StdioCollector::streamEnded(QByteArray& buffer) {
if (this->mWaitForEnd) {
this->mData = buffer;
emit this->dataChanged();
}
emit this->streamFinished();
}
void StdioCollector::setWaitForEnd(bool waitForEnd) {
if (waitForEnd == this->mWaitForEnd) return;
this->mWaitForEnd = waitForEnd;
emit this->waitForEndChanged();
}