本文整理汇总了C++中XMLOutputStream::startEndElement方法的典型用法代码示例。如果您正苦于以下问题:C++ XMLOutputStream::startEndElement方法的具体用法?C++ XMLOutputStream::startEndElement怎么用?C++ XMLOutputStream::startEndElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XMLOutputStream
的用法示例。
在下文中一共展示了XMLOutputStream::startEndElement方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
ASTBase::writeNegInfinity(XMLOutputStream& stream) const
{
stream.startElement("apply");
stream.startEndElement("minus");
stream.startEndElement("infinity");
stream.endElement("apply");
}
示例2: if
void
ASTNaryFunctionNode::write(XMLOutputStream& stream) const
{
int type = getType();
unsigned int numChildren = getNumChildren();
if (numChildren <= 2 && (type == AST_PLUS || type == AST_TIMES))
{
writeNodeOfType(stream, type);
}
else if (type == AST_UNKNOWN && numChildren == 0)
{
// we have an empty apply tag
stream.startEndElement("apply");
}
else
{
stream.startElement("apply");
//const char * name = ASTBase::getNameFromType(type);
ASTBase::writeStartEndElement(stream);
/* write children */
/* HACK TO REPLICATE OLD AST */
/* for log/root with two or more children assume first is logbase/degree
* and last is the value operated on
*
* however if the node is read in with a logbase and then more than
* further children it uses the first as the value operated on
*/
if (type == AST_FUNCTION_ROOT)
{
if (numChildren > 1)
{
if (ASTFunctionBase::getChild(0)->getType() != AST_QUALIFIER_DEGREE)
{
ASTQualifierNode * logbase = new ASTQualifierNode(AST_QUALIFIER_DEGREE);
logbase->addChild(ASTFunctionBase::getChild(0)->deepCopy());
logbase->write(stream);
delete logbase;
ASTFunctionBase::getChild(numChildren-1)->write(stream);
}
else
{
/* if there is only 1 child that is logbase we dont write either */
ASTFunctionBase::getChild(0)->write(stream);
ASTFunctionBase::getChild(numChildren-1)->write(stream);
}
}
else
{
ASTFunctionBase::getChild(0)->write(stream);
}
}
else
{
for (unsigned int i = 0; i < ASTFunctionBase::getNumChildren(); i++)
{
ASTFunctionBase::getChild(i)->write(stream);
}
}
stream.endElement("apply");
}
}