Beispiel #1
0
void BpfCompressor::finish()
{
    // Pop our special stream so that we can write the the file.
    m_out.popStream();

    // Deflate and write the result to the output file.
    int ret = Z_OK;
    while (ret == Z_OK)
    {
        ret = ::deflate(&m_strm, Z_FINISH);
        size_t written = CHUNKSIZE - m_strm.avail_out;
        m_compressedSize += written;
        m_out.put(m_tmpbuf, written);
        m_strm.avail_out = CHUNKSIZE;
        m_strm.next_out = m_tmpbuf;
    }
    if (ret != Z_STREAM_END)
        throw error("Couldn't close BPF compression stream.");
    deflateEnd(&m_strm);

    // Mark our position so that we can get back here.
    OStreamMarker blockEnd(m_out);

    // Rewind to the start of the block and write the size bytes.
    m_blockStart.rewind();
    m_out << (uint32_t)m_rawSize << (uint32_t)m_compressedSize;

    // Set the position back to the end of the block.
    blockEnd.rewind();
}
CSSParserToken CSSTokenizer::rightBrace(UChar cc)
{
    return blockEnd(RightBraceToken, LeftBraceToken);
}
CSSParserToken CSSTokenizer::rightParenthesis(UChar cc)
{
    return blockEnd(RightParenthesisToken, LeftParenthesisToken);
}
Beispiel #4
0
MediaQueryToken MediaQueryTokenizer::rightBrace(UChar cc)
{
    return blockEnd(RightBraceToken, LeftBraceToken);
}
Beispiel #5
0
MediaQueryToken MediaQueryTokenizer::rightParenthesis(UChar cc)
{
    return blockEnd(RightParenthesisToken, LeftParenthesisToken);
}
 void blockEnd() { FOREACH blockEnd(); }