QtWebEngineTransfer::QtWebEngineTransfer(QWebEngineDownloadItem *item, TransferOptions options, QObject *parent) : Transfer(options, parent), m_item(item), m_suggestedFileName(QFileInfo(item->path()).fileName()) { m_item->accept(); m_item->setParent(this); markStarted(); connect(m_item, SIGNAL(finished()), this, SLOT(markFinished())); connect(m_item, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(downloadProgress(qint64,qint64))); }
void stringOutput (boost::beast::string_view const& bytes) { markStarted (); std::size_t position = 0, writtenUntil = 0; output_ ({"e, 1}); auto data = bytes.data(); for (; position < bytes.size(); ++position) { auto i = jsonSpecialCharacterEscape.find (data[position]); if (i != jsonSpecialCharacterEscape.end ()) { if (writtenUntil < position) { output_ ({data + writtenUntil, position - writtenUntil}); } output_ ({i->second, jsonEscapeLength}); writtenUntil = position + 1; }; } if (writtenUntil < position) output_ ({data + writtenUntil, position - writtenUntil}); output_ ({"e, 1}); }
void output (boost::beast::string_view const& bytes) { markStarted (); output_ (bytes); }