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


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

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


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

示例1: getName

void
ASTCSymbolDelayNode::write(XMLOutputStream& stream) const
{
  if (&stream == NULL) return;

  stream.startElement("apply");
  
  stream.startElement("csymbol");

  stream.setAutoIndent(false);
  
  ASTBase::writeAttributes(stream);

  stream.writeAttribute( "encoding"     , mEncoding );
  stream.writeAttribute( "definitionURL", mDefinitionURL  );

  stream << " " << getName() << " ";
  
  stream.endElement("csymbol");
  
  stream.setAutoIndent(true);

  for (unsigned int n = 0; n < getNumChildren(); n++)
  {
    ASTFunctionBase::getChild(n)->write(stream);
  }
  
  stream.endElement("apply");
}
开发者ID:0u812,项目名称:libsbml.js.frozen,代码行数:29,代码来源:ASTCSymbolDelayNode.cpp

示例2:

void
ASTPiecewiseFunctionNode::write(XMLOutputStream& stream) const
{
  if (&stream == NULL) return;

  ASTBase::writeStartElement(stream);

  unsigned int i;
  unsigned int numChild = 0;
  unsigned int numChildren = ASTFunctionBase::getNumChildren();
  for (i = 0; i < getNumPiece(); i++)
  {
  /* HACK TO REPLICATE OLD AST */
  /* old ast behaviour would take each child in turn as elements of piece
   * and then otherwise
   */
    if (ASTFunctionBase::getChild(i)->getType() == AST_CONSTRUCTOR_PIECE)
    {
      ASTFunctionBase::getChild(i)->write(stream);
    }
    else
    {
      stream.startElement("piece");
      if (numChild < numChildren)
      {
        ASTFunctionBase::getChild(numChild)->write(stream);
        numChild++;
      }
      if (numChild < numChildren)
      {
        ASTFunctionBase::getChild(numChild)->write(stream);
        numChild++;
      }
      stream.endElement("piece");
    }
  }

  if (getHasOtherwise() == true)
  {
    if (ASTFunctionBase::getChild(numChildren-1)->getType() 
                                             == AST_CONSTRUCTOR_OTHERWISE)
    {
      ASTFunctionBase::getChild(numChildren-1)->write(stream);
    }
    else
    {
      stream.startElement("otherwise");
      ASTFunctionBase::getChild(numChildren-1)->write(stream);
      stream.endElement("otherwise");
    }
  }

  
    
  stream.endElement("piecewise");
}
开发者ID:0u812,项目名称:roadrunner-backup,代码行数:56,代码来源:ASTPiecewiseFunctionNode.cpp

示例3: writeMathML

/*
 * Subclasses should override this method to write out their contained
 * SBML objects as XML elements.  Be sure to call your parents
 * implementation of this method as well.
 */
void
SpeciesReference::writeElements (XMLOutputStream& stream) const
{
  if ( mNotes != NULL ) stream << *mNotes;
  SpeciesReference * sr = const_cast <SpeciesReference *> (this);
  sr->syncAnnotation();
  if ( mAnnotation != NULL ) stream << *mAnnotation;

  if (getLevel() == 2)
  {
    if (mStoichiometryMath || mDenominator != 1)
    {
      if (mStoichiometryMath != NULL) 
      {
        mStoichiometryMath->write(stream);
      }
      else
      {
        ASTNode node;
        node.setValue(static_cast<long>(mStoichiometry), mDenominator);

        stream.startElement("stoichiometryMath");
        writeMathML(&node, stream);
        stream.endElement("stoichiometryMath");
      }
    }
  }

  //
  // (EXTENSION)
  //
  SBase::writeExtensionElements(stream);

}
开发者ID:sbmlteam,项目名称:python-libsbml,代码行数:39,代码来源:SpeciesReference.cpp

示例4: ASTQualifierNode

void
ASTLambdaFunctionNode::write(XMLOutputStream& stream) const
{

  ASTBase::writeStartElement(stream);

  /* HACK TO REPLICATE OLD AST */
  /* all but the last child will be wrapped as bvars
   * even if they are technically not
   */
  unsigned int numChildren = ASTFunctionBase::getNumChildren();
  for (unsigned int i = 0; i < numChildren; i++)
  {
    if (i < numChildren-1 && ASTFunctionBase::getChild(i)->getType() != AST_QUALIFIER_BVAR)
    {
      ASTQualifierNode * bvar = new ASTQualifierNode(AST_QUALIFIER_BVAR);
      bvar->addChild(ASTFunctionBase::getChild(i)->deepCopy());
      bvar->write(stream);
      delete bvar;
    }
    else
    {
      ASTFunctionBase::getChild(i)->write(stream);
    }
  }
    
  stream.endElement("lambda");
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:28,代码来源:ASTLambdaFunctionNode.cpp

示例5: getChild

void 
ASTSemanticsNode::write(XMLOutputStream& stream) const
{
  stream.startElement("semantics");

  ASTBase::writeAttributes(stream);

  if (isSetDefinitionURL() == true)
  {
    stream.writeAttribute( "definitionURL", mDefinitionURL  );
  }

  if (getNumChildren() > 0)
  {
    getChild(0)->write(stream);
  }


  for (unsigned int n = 0; n < getNumSemanticsAnnotations(); n++)
  {
    stream << *getSemanticsAnnotation(n);
  }

  stream.endElement("semantics");
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:25,代码来源:ASTSemanticsNode.cpp

示例6: writeAttributes

void 
ASTBase::writeConstant(XMLOutputStream& stream, const std::string & name) const
{

	stream.startElement(name);
  writeAttributes(stream);
	stream.endElement(name);
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:8,代码来源:ASTBase.cpp

示例7:

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

示例8: getNameFromType

void 
ASTBase::writeStartEndElement (XMLOutputStream& stream) const
{

  const char * name = getNameFromType(getExtendedType());
	stream.startElement(name);
  writeAttributes(stream);
	stream.endElement(name);
  
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:10,代码来源:ASTBase.cpp

示例9: getElementName

/*
 * Writes (serializes) this SBML object by writing it to XMLOutputStream.
 */
void
Text::write (XMLOutputStream& stream) const
{
    
  stream.startElement( getElementName() );

  writeAttributes( stream );
  // in addition to attributes we need to write the characters
  stream << this->getText();

  stream.endElement( getElementName() );
}
开发者ID:kirichoi,项目名称:roadrunner,代码行数:15,代码来源:Text.cpp

示例10: getPrefix

void
PolygonObject::write(XMLOutputStream& stream) const
{
  stream.startElement(getElementName(), getPrefix());
  writeAttributes(stream);
  if(isSetPointIndex())
  {
    for (int i = 0; i < mPointIndexLength; ++i)
    {
      stream << (long)mPointIndex[i] << " ";
    }
  }
  stream.endElement(getElementName(), getPrefix());
}
开发者ID:kirichoi,项目名称:roadrunner,代码行数:14,代码来源:PolygonObject.cpp

示例11: getPrefix

void
ImageData::write(XMLOutputStream& stream) const
{
  stream.startElement(getElementName(), getPrefix());
  writeAttributes(stream);
  if(isSetSamples())
  {
    for (int i = 0; i < mSamplesLength; ++i)
    {
      stream << (long)mSamples[i] << " ";
    }
  }
  stream.endElement(getElementName(), getPrefix());
}
开发者ID:sys-bio,项目名称:libroadrunner-deps,代码行数:14,代码来源:ImageData.cpp

示例12: if

/*
 * Writes this XMLNode and its children to stream.
 */
void
XMLNode::write (XMLOutputStream& stream) const
{
  if (&stream == NULL) return;

  unsigned int children = getNumChildren();

  XMLToken::write(stream);

  if (children > 0)
  {
    bool haveTextNode = false;
    for (unsigned int c = 0; c < children; ++c) 
    {
        const XMLNode& current = getChild(c);
        stream << current;
        haveTextNode |= current.isText();
    }

    if (!mTriple.isEmpty())
    {
      // edge case ... we have an element with a couple of elements, and 
      // one is a text node (ugly!) in this case we can get a hanging
      // indent ... so we downindent ... 
      if (children > 1 && haveTextNode)
      {
        stream.downIndent();
      }
      stream.endElement( mTriple );
    }
  }
  else if ( isStart() && !isEnd() ) 
  {
    stream.endElement( mTriple );
  }

}
开发者ID:0u812,项目名称:libsbml.js.frozen,代码行数:40,代码来源:XMLNode.cpp

示例13: if

void
ASTUnaryFunctionNode::write(XMLOutputStream& stream) const
{
  if (&stream == NULL) return;

  stream.startElement("apply");
    
  //const char * name = ASTBase::getNameFromType(type);
  		
  ASTBase::writeStartEndElement(stream);

  /* write the one child
   * note we expect to have one child but cannot guarantee it 
   */
   
  unsigned int numChildren = getNumChildren();

  /* HACK TO REPLICATE OLD AST */
  /* for log 10 write out the logbase explicilty
   * for sqrt write out the degree explicilty
   * NOTE the qualifier node will add the necessary integers
   */
  if (numChildren == 1)
  {
    if (isLog10() == true)
    {
      ASTQualifierNode * logbase = new ASTQualifierNode(AST_QUALIFIER_LOGBASE);
      logbase->write(stream);
      delete logbase;
    }
    else if (isSqrt() == true)
    {
      ASTQualifierNode * degree = new ASTQualifierNode(AST_QUALIFIER_DEGREE);
      degree->write(stream);
      delete degree;
    }

    ASTFunctionBase::getChild(0)->write(stream);
  }
  else
  {
    for (unsigned int n = 0; n < numChildren; n++)
    {
      ASTFunctionBase::getChild(n)->write(stream);
    }
  }

  stream.endElement("apply");
}
开发者ID:kirichoi,项目名称:roadrunner,代码行数:49,代码来源:ASTUnaryFunctionNode.cpp

示例14: getCharacters

/*
 * Writes this XMLToken to stream.
 */
void
XMLToken::write (XMLOutputStream& stream) const
{
  if ( isEOF () ) return;

  if ( isText() )
  {
    stream << getCharacters();
    return;
  }

  if ( isStart() ) stream.startElement( mTriple );
  if ( isStart() ) stream << mNamespaces << mAttributes;
  if ( isEnd()   ) stream.endElement( mTriple );
}
开发者ID:copasi,项目名称:copasi-dependencies,代码行数:18,代码来源:XMLToken.cpp

示例15: writeENotation

void
ASTCnExponentialNode::write(XMLOutputStream& stream) const
{
  stream.startElement("cn");

  stream.setAutoIndent(false);

  ASTCnBase::write(stream);

  writeENotation (  getMantissa(), getExponent(), stream);
  
  stream.endElement("cn");
  
  stream.setAutoIndent(true);
}
开发者ID:0u812,项目名称:libsbml.js.frozen,代码行数:15,代码来源:ASTCnExponentialNode.cpp


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