|
QtPass 2.0.0
Developer documentation
|
A stream of bytes held as its first and last kMaxStderrBytes / 2 bytes, with its gpg status records counted whole. More...
#include <executor.h>
Public Member Functions | |
| void | append (const QByteArray &chunk) |
| Add what the process wrote next. | |
| auto | take () -> QByteArray |
| Everything kept, and start over. | |
| auto | statusCounts () const -> QHash< QString, qint64 > |
| How many complete lines of each gpg status keyword came by since the last take(), the left-out ones included. | |
| void | clear () |
| Drop everything, counts included, for the next command. | |
Static Public Attributes | |
| static constexpr qsizetype | kMaxStatusLineBytes = 1024 |
| Longest line still looked at for a status keyword. | |
| static constexpr int | kMaxStatusKeywords = 64 |
| Most distinct status keywords counted. | |
Private Member Functions | |
| void | countStatus (const QByteArray &line) |
Count line if it is a status record. | |
Private Attributes | |
| QByteArray | m_line |
| The line not ended yet; empty once it ran too long. | |
| bool | m_lineTooLong = false |
| The line not ended yet ran past kMaxStatusLineBytes. | |
| QHash< QString, qint64 > | m_status |
| Status keyword to count, see statusCounts(). | |
| QByteArray | m_head |
| The first bytes, up to half the cap. | |
| QByteArray | m_tail |
| The latest bytes, up to half the cap. | |
| qint64 | m_dropped = 0 |
| Bytes that fell out between head and tail. | |
A stream of bytes held as its first and last kMaxStderrBytes / 2 bytes, with its gpg status records counted whole.
What is left out of the text is still counted: a caller that judges a run by its status records (RealPass counting END_ENCRYPTION against the entries pass re-encrypted) reads statusCounts(), not the capped text.
Definition at line 193 of file executor.h.
| void Executor::CappedOutput::append | ( | const QByteArray & | chunk | ) |
Add what the process wrote next.
| chunk | The bytes, in order. |
Definition at line 89 of file executor.cpp.
|
inline |
Drop everything, counts included, for the next command.
Definition at line 221 of file executor.h.
|
private |
Count line if it is a status record.
| line | One line, without its line end. |
Definition at line 72 of file executor.cpp.
|
inlinenodiscard |
How many complete lines of each gpg status keyword came by since the last take(), the left-out ones included.
A line counts when it starts with "[GNUPG:] "; its keyword is the word after that. Lines longer than kMaxStatusLineBytes, and keywords past the first kMaxStatusKeywords, are not counted: gpg's own status lines are short and few in kind.
Definition at line 217 of file executor.h.
| auto Executor::CappedOutput::take | ( | ) | -> QByteArray |
Everything kept, and start over.
Definition at line 131 of file executor.cpp.
|
staticconstexpr |
Most distinct status keywords counted.
Definition at line 228 of file executor.h.
|
staticconstexpr |
Longest line still looked at for a status keyword.
Definition at line 226 of file executor.h.
|
private |
Bytes that fell out between head and tail.
Definition at line 247 of file executor.h.
|
private |
The first bytes, up to half the cap.
Definition at line 243 of file executor.h.
|
private |
The line not ended yet; empty once it ran too long.
Definition at line 237 of file executor.h.
|
private |
The line not ended yet ran past kMaxStatusLineBytes.
Definition at line 239 of file executor.h.
|
private |
Status keyword to count, see statusCounts().
Definition at line 241 of file executor.h.
|
private |
The latest bytes, up to half the cap.
Definition at line 245 of file executor.h.