mirror of
https://git.outfoxxed.me/quickshell/quickshell.git
synced 2025-11-04 19:04:56 +11:00
io/process: add StdioCollector data stream parser
This commit is contained in:
parent
0224fa942b
commit
2b01a75679
3 changed files with 67 additions and 4 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue