コード例 #1
0
void HTMLSourceTracker::start(SegmentedString& currentInput, HTMLTokenizer* tokenizer, HTMLToken& token)
{
    if (token.type() == HTMLToken::Uninitialized) {
        m_previousSource.clear();
        if (tokenizer->numberOfBufferedCharacters())
            m_previousSource = tokenizer->bufferedCharacters();
    } else
        m_previousSource.append(m_currentSource);

    m_currentSource = currentInput;
    token.setBaseOffset(m_currentSource.numberOfCharactersConsumed() - m_previousSource.length());
}
コード例 #2
0
ファイル: HTMLSourceTracker.cpp プロジェクト: dog-god/iptv
void HTMLSourceTracker::start(const HTMLInputStream& input, HTMLTokenizer* tokenizer, HTMLToken& token)
{
    if (token.type() == HTMLTokenTypes::Uninitialized) {
        m_previousSource.clear();
        if (tokenizer->numberOfBufferedCharacters())
            m_previousSource = tokenizer->bufferedCharacters();
    } else
        m_previousSource.append(m_currentSource);

    m_currentSource = input.current();
    token.setBaseOffset(m_currentSource.numberOfCharactersConsumed() - m_previousSource.length());
}