当前位置: 首页>>代码示例>>C++>>正文


C++ TextNode::get_content方法代码示例

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


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

示例1: check

bool TextOutput::check(sedna::Query &query)
{
    #ifdef SETEST_DEBUG
        std::cout << "TEST======A======TEST" << std::endl;
    #endif
    /* Wrapping text and result in XML Containers and compare them as xml */
    
    if (query.resultCode != SEDNA_QUERY_SUCCEEDED) {
        //Query exited with error or it was bulk load or update (incorrect test case)
        return false;
    }
    #ifdef SETEST_DEBUG
        std::cout << "TEST======B======TEST" << std::endl;
    #endif

    string answerString;
    boost::filesystem::path answerFile(fileName);
    answerString.resize(boost::filesystem::file_size(fileName));
    boost::filesystem::ifstream answerFileStream(answerFile);
    answerFileStream.read(&answerString[0], answerString.size());
    
    Document answerDoc;
    Element *answerRoot = answerDoc.create_root_node("TextOutput");
    //answerRoot->add_child_text(answerString);
    TextNode* tmpA = answerRoot->add_child_text(answerString);
    
    Document resultDoc;
    Element *resultRoot = answerDoc.create_root_node("TextOutput");
    //resultRoot->add_child_text(query.resultString);
    TextNode* tmpB = resultRoot->add_child_text(query.resultString);

    #ifdef SETEST_DEBUG
        std::cout << "TEST======D======TEST" << std::endl;
    #endif
    std::istringstream answerStream(answerDoc.write_to_string());
    std::istringstream resultStream(answerDoc.write_to_string());
    
    #ifdef SETEST_DEBUG
        std::cout << "TEST======C======TEST" << std::endl;
        std::cout << query.resultString << std::endl;
	std::string tmpBB = string(tmpB->get_content());
	std::cout << tmpBB << std::endl;
	std::cout << "=====================" << std::endl;
	std::cout << answerString << std::endl;
	std::string tmpAA = string(tmpA->get_content());
	std::cout << tmpAA << std::endl;
	std::cout << "END======C=======END" << std::endl;
    #endif
    
    XmlDiff xmlDiff(answerStream, resultStream);
    return !xmlDiff.diff();
}
开发者ID:AlexanderYAPPO,项目名称:setest,代码行数:52,代码来源:XQTSOutputs.cpp


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