本文整理汇总了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();
}