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


C++ XMLOutputStream::startEndElement方法代码示例

本文整理汇总了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");
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:9,代码来源:ASTBase.cpp

示例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");
  }
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:68,代码来源:ASTNaryFunctionNode.cpp


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