コード例 #1
0
void DOMBuilder::comment(const String &text) {
  ASSERT_OR_THROW("No parent!", !proxyStack.empty());

  XMLStream *stream = proxyStack.top()->getStream();
  if (stream) stream->comment(text);
  else proxyStack.top()->appendChild(factory.createComment(text));
}
コード例 #2
0
void DOMBuilder::pi(const String &target, const String &data) {
  ASSERT_OR_THROW("No parent!", !proxyStack.empty());

  XMLStream *stream = proxyStack.top()->getStream();
  if (stream) stream->pi(target, data);
  else proxyStack.top()->appendChild(factory.createPI(target, data));
}
コード例 #3
0
void DOMBuilder::attribute(const QName *name, const String &text) {
  ASSERT_OR_THROW("No parent element!", !proxyStack.empty());
  
  XMLStream *stream = proxyStack.top()->getStream();
  if (stream) stream->attribute(name, text);
  else proxyStack.top()->appendAttr(factory.createAttribute(name, text));
}
コード例 #4
0
void DOMBuilder::endElement() {
  ASSERT_OR_THROW("No element!", !proxyStack.empty());

  if (streamDepth) {
    XMLStream *stream = proxyStack.top()->getStream();
    ASSERT_OR_THROW("Stream depth > 0 but no stream!", stream);
    stream->endElement();
    streamDepth--;

  } else proxyStack.pop();
}
コード例 #5
0
ファイル: mutation.cpp プロジェクト: WinstonEwertTest/test
/*
 * Function: InsertModification
 *
 */
void
InsertModification::toXML(XMLStream& xs, STFLAGS grfRecordDetail) const
{
    ENTER(GENOME,toXML);

    xs.openStart(xmlTag(XT_INSERTED));
    xs.writeAttribute(xmlTag(XT_TARGETINDEX), (_iTarget+1));
    xs.writeAttribute(xmlTag(XT_COUNTBASES), _strBases.length());
    xs.writeAttribute(xmlTag(XT_BASES), _strBases);
    xs.closeStart(false);
}
コード例 #6
0
ファイル: mutation.cpp プロジェクト: WinstonEwertTest/test
/*
 * Function: TransposeModification
 *
 */
void
TransposeModification::toXML(XMLStream& xs, STFLAGS grfRecordDetail) const
{
    ENTER(GENOME,toXML);

    xs.openStart(xmlTag(XT_TRANSPOSED));
    xs.writeAttribute(xmlTag(XT_SOURCEINDEX), (_iSource+1));
    xs.writeAttribute(xmlTag(XT_TARGETINDEX), (_iTarget+1));
    xs.writeAttribute(xmlTag(XT_COUNTBASES), _strBases.length());
    xs.writeAttribute(xmlTag(XT_BASES), _strBases);
    xs.closeStart(false);
}
コード例 #7
0
void DOMBuilder::startElement(const QName *name) {
  ASSERT_OR_THROW("No parent!", !proxyStack.empty());

  XMLStream *stream = proxyStack.top()->getStream();
  if (stream) {
    stream->startElement(name);
    streamDepth++;

  } else {
    Element *elem = factory.createElement(name);

    proxyStack.top()->appendChild(elem);
    proxyStack.push(*this, elem);
  }
}
コード例 #8
0
ファイル: helpers.cpp プロジェクト: biologic/stylus
/*
 * Function: toXML
 *
 */
void
Rectangle::toXML(XMLStream& xs, STFLAGS grfRecordDetail) const
{
	xs.openStart(xmlTag(XT_BOUNDS));
	xs.writeAttribute(xmlTag(XT_TOP), _ptTopLeft.y());
	xs.writeAttribute(xmlTag(XT_LEFT), _ptTopLeft.x());
	xs.writeAttribute(xmlTag(XT_BOTTOM), _ptBottomRight.y());
	xs.writeAttribute(xmlTag(XT_RIGHT), _ptBottomRight.x());
	xs.writeAttribute(xmlTag(XT_WIDTH), _dxWidth);
	xs.writeAttribute(xmlTag(XT_HEIGHT), _dyHeight);
	xs.writeAttribute(xmlTag(XT_XMIDPOINT), _ptCenter.x());
	xs.writeAttribute(xmlTag(XT_YMIDPOINT), _ptCenter.y());
	xs.closeStart(false);
}
コード例 #9
0
ファイル: global.cpp プロジェクト: WinstonEwertTest/test
/*
 * Function: toXML
 * 
 */
void
Globals::toXML(XMLStream& xs)
{
	ENTER(GLOBAL,toXML);
	xs.openStart(xmlTag(XT_GLOBALS));
	xs.writeAttribute(xmlTag(XT_XMLNS), XMLDocument::s_szStylusNamespace);
	xs.closeStart();

	xs.writeStart(xmlTag(XT_WEIGHTS));
	
	xs.openStart(xmlTag(XT_GENOME));
	xs.writeAttribute(xmlTag(XT_FIXEDCOST), static_cast<UNIT>(_aryGenomeWeights[SC_FIXEDCOST]));
	xs.writeAttribute(xmlTag(XT_COSTPERBASE), static_cast<UNIT>(_aryGenomeWeights[SC_COSTPERBASE]));
	xs.writeAttribute(xmlTag(XT_COSTPERUNIT), static_cast<UNIT>(_aryGenomeWeights[SC_COSTPERUNIT]));
	xs.closeStart(false);

	xs.openStart(xmlTag(XT_GENE));
	xs.writeAttribute(xmlTag(XT_SCALE), static_cast<UNIT>(_aryGeneWeights[SC_SCALE]));
	xs.writeAttribute(xmlTag(XT_PLACEMENT), static_cast<UNIT>(_aryGeneWeights[SC_PLACEMENT]));
	xs.writeAttribute(xmlTag(XT_ILLEGALOVERLAPS), static_cast<UNIT>(_aryGeneWeights[SC_ILLEGALOVERLAPS]));
	xs.writeAttribute(xmlTag(XT_MISSINGOVERLAPS), static_cast<UNIT>(_aryGeneWeights[SC_MISSINGOVERLAPS]));
	xs.writeAttribute(xmlTag(XT_MARKS), static_cast<UNIT>(_aryGeneWeights[SC_MARKS]));
	xs.writeAttribute(xmlTag(XT_SPSCALE), static_cast<UNIT>(_aryGeneSetpoints[SC_SCALE]));
	xs.writeAttribute(xmlTag(XT_SPPLACEMENT), static_cast<UNIT>(_aryGeneSetpoints[SC_PLACEMENT]));
	xs.writeAttribute(xmlTag(XT_SPILLEGALOVERLAPS), static_cast<UNIT>(_aryGeneSetpoints[SC_ILLEGALOVERLAPS]));
	xs.writeAttribute(xmlTag(XT_SPMISSINGOVERLAPS), static_cast<UNIT>(_aryGeneSetpoints[SC_MISSINGOVERLAPS]));
	xs.writeAttribute(xmlTag(XT_SPMARKS), static_cast<UNIT>(_aryGeneSetpoints[SC_MARKS]));
	xs.closeStart(false);

	xs.openStart(xmlTag(XT_GROUP));
	xs.writeAttribute(xmlTag(XT_SCALE), static_cast<UNIT>(_aryGroupWeights[SC_SCALE]));
	xs.writeAttribute(xmlTag(XT_PLACEMENT), static_cast<UNIT>(_aryGroupWeights[SC_PLACEMENT]));
	xs.writeAttribute(xmlTag(XT_ILLEGALOVERLAPS), static_cast<UNIT>(_aryGroupWeights[SC_ILLEGALOVERLAPS]));
	xs.writeAttribute(xmlTag(XT_DEVIATION), static_cast<UNIT>(_aryGroupWeights[SC_DEVIATION]));
	xs.writeAttribute(xmlTag(XT_EXTRALENGTH), static_cast<UNIT>(_aryGroupWeights[SC_EXTRALENGTH]));
	xs.writeAttribute(xmlTag(XT_MISSINGOVERLAPS), static_cast<UNIT>(_aryGroupWeights[SC_MISSINGOVERLAPS]));
	xs.writeAttribute(xmlTag(XT_DROPOUTS), static_cast<UNIT>(_aryGroupWeights[SC_DROPOUTS]));
	xs.writeAttribute(xmlTag(XT_SPSCALE), static_cast<UNIT>(_aryGroupSetpoints[SC_SCALE]));
	xs.writeAttribute(xmlTag(XT_SPPLACEMENT), static_cast<UNIT>(_aryGroupSetpoints[SC_PLACEMENT]));
	xs.writeAttribute(xmlTag(XT_SPILLEGALOVERLAPS), static_cast<UNIT>(_aryGroupSetpoints[SC_ILLEGALOVERLAPS]));
	xs.writeAttribute(xmlTag(XT_SPDEVIATION), static_cast<UNIT>(_aryGroupSetpoints[SC_DEVIATION]));
	xs.writeAttribute(xmlTag(XT_SPEXTRALENGTH), static_cast<UNIT>(_aryGroupSetpoints[SC_EXTRALENGTH]));
	xs.writeAttribute(xmlTag(XT_SPMISSINGOVERLAPS), static_cast<UNIT>(_aryGroupSetpoints[SC_MISSINGOVERLAPS]));
	xs.writeAttribute(xmlTag(XT_SPDROPOUTS), static_cast<UNIT>(_aryGroupSetpoints[SC_DROPOUTS]));
	xs.closeStart(false);

	xs.writeEnd(xmlTag(XT_WEIGHTS));
	
	xs.writeEnd(xmlTag(XT_GLOBALS));
}