Пример #1
0
void ImageDocumentTest::loadImage() {
  DocumentParser* parser = document().implicitOpen(
      ParserSynchronizationPolicy::ForceSynchronousParsing);
  const Vector<unsigned char>& data = jpegImage();
  parser->appendBytes(reinterpret_cast<const char*>(data.data()), data.size());
  parser->finish();
}
Пример #2
0
void DocumentWriter::addData(const char* str, int len, bool flush)
{
    if (len == -1)
        len = strlen(str);

    DocumentParser* parser = m_frame->document()->parser();
    if (parser)
        parser->appendBytes(this, str, len, flush);
}