• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TextResourceDecoder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中TextResourceDecoder的典型用法代码示例。如果您正苦于以下问题:C++ TextResourceDecoder类的具体用法?C++ TextResourceDecoder怎么用?C++ TextResourceDecoder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了TextResourceDecoder类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: strlen

void DecodedDataDocumentParser::appendBytes(DocumentWriter* writer , const char* data, int length, bool shouldFlush)
{
    std::cout<<"DecodedDataDocumentParser::appendBytes!!!!!!!: "<< ( data!=NULL ? strlen(data) : 0) <<std::endl;

    string dataString;

    if (data!=NULL) {

	dataString = data;
        dataString = replaceSocamPersonTags(dataString);
        dataString = replaceSocamAccelerometerTags(dataString);
        //cout<<"Result:"<<replacedData.c_str()<<endl;
	//cout<<endl<<endl<<"REPLACED DATA:"<<data<<endl<<endl;

    }

    if (!length && !shouldFlush)
        return;

    TextResourceDecoder* decoder = writer->createDecoderIfNeeded();
    String decoded = decoder->decode(dataString.c_str(), dataString.size());
    if (shouldFlush)
        decoded += decoder->flush();

    cout<<"Decoded:"<<decoded.ascii().data()<<endl;

    if (decoded.isEmpty())
        return;

    writer->reportDataReceived();

    append(decoded);
}
开发者ID:socam,项目名称:qtwebkit,代码行数:33,代码来源:DecodedDataDocumentParser.cpp


示例2:

DocumentEncodingData::DocumentEncodingData(const TextResourceDecoder& decoder)
{
    m_encoding = decoder.encoding();
    m_wasDetectedHeuristically = decoder.encodingWasDetectedHeuristically();
    m_attemptedToDetermineEncodingFromContentSniffing = decoder.attemptedToDetermineEncodingFromContentSniffing();
    m_encodingWasDetectedFromContentSniffing = decoder.encodingWasDetectedFromContentSniffing();
    m_sawDecodingError = decoder.sawError();
}
开发者ID:howardroark2018,项目名称:chromium,代码行数:8,代码来源:DocumentEncodingData.cpp


示例3: ASSERT

void XSSFilter::init()
{
    const size_t miniumLengthForSuffixTree = 512; // FIXME: Tune this parameter.
    const int suffixTreeDepth = 5;

    ASSERT(m_state == Uninitialized);
    m_state = Initial;

    if (!m_isEnabled)
        return;
    
    // In theory, the Document could have detached from the Frame after the
    // XSSFilter was constructed.
    if (!m_parser->document()->frame()) {
        m_isEnabled = false;
        return;
    }

    const KURL& url = m_parser->document()->url();

    if (url.protocolIsData()) {
        m_isEnabled = false;
        return;
    }

    TextResourceDecoder* decoder = m_parser->document()->decoder();
    m_decodedURL = decoder ? decodeURL(url.string(), decoder->encoding()) : url.string();
    if (m_decodedURL.find(isRequiredForInjection, 0) == notFound)
        m_decodedURL = String();

    if (DocumentLoader* documentLoader = m_parser->document()->frame()->loader()->documentLoader()) {
        DEFINE_STATIC_LOCAL(String, XSSProtectionHeader, ("X-XSS-Protection"));
        m_xssProtection = parseXSSProtectionHeader(documentLoader->response().httpHeaderField(XSSProtectionHeader));

        FormData* httpBody = documentLoader->originalRequest().httpBody();
        if (httpBody && !httpBody->isEmpty()) {
            String httpBodyAsString = httpBody->flattenToString();
            m_decodedHTTPBody = decoder ? decodeURL(httpBodyAsString, decoder->encoding()) : httpBodyAsString;
            if (m_decodedHTTPBody.find(isRequiredForInjection, 0) == notFound)
                m_decodedHTTPBody = String();
            if (m_decodedHTTPBody.length() >= miniumLengthForSuffixTree)
                m_decodedHTTPBodySuffixTree = adoptPtr(new SuffixTree<ASCIICodebook>(m_decodedHTTPBody, suffixTreeDepth));
        }
    }

    if (m_decodedURL.isEmpty() && m_decodedHTTPBody.isEmpty())
        m_isEnabled = false;
}
开发者ID:13W,项目名称:phantomjs,代码行数:48,代码来源:XSSFilter.cpp


示例4: appendBytes

void DecodedDataDocumentParser::appendBytes(DocumentWriter* writer , const char* data, int length, bool shouldFlush)
{
    if (!length && !shouldFlush)
        return;

    TextResourceDecoder* decoder = writer->createDecoderIfNeeded();
    String decoded = decoder->decode(data, length);
    if (shouldFlush)
        decoded += decoder->flush();
    if (decoded.isEmpty())
        return;

    writer->reportDataReceived();

    append(decoded);
}
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:16,代码来源:DecodedDataDocumentParser.cpp


示例5: String

String WebFrame::source() const 
{
    if (!m_coreFrame)
        return String();
    Document* document = m_coreFrame->document();
    if (!document)
        return String();
    TextResourceDecoder* decoder = document->decoder();
    if (!decoder)
        return String();
    DocumentLoader* documentLoader = m_coreFrame->loader().activeDocumentLoader();
    if (!documentLoader)
        return String();
    RefPtr<ResourceBuffer> mainResourceData = documentLoader->mainResourceData();
    if (!mainResourceData)
        return String();
    return decoder->encoding().decode(mainResourceData->data(), mainResourceData->size());
}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:18,代码来源:WebFrame.cpp


示例6: setUserChosenEncoding

void DocumentWriter::setUserChosenEncoding(const String& charset)
{
    TextResourceDecoder* decoder = m_parser->decoder();
    if (decoder)
        decoder->setEncoding(charset, TextResourceDecoder::UserChosenEncoding);
}
开发者ID:darktears,项目名称:blink-crosswalk,代码行数:6,代码来源:DocumentWriter.cpp



注:本文中的TextResourceDecoder类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TextRun类代码示例发布时间:2022-05-31
下一篇:
C++ TextRenderer类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap