本文整理汇总了C++中XMLSerializer类的典型用法代码示例。如果您正苦于以下问题:C++ XMLSerializer类的具体用法?C++ XMLSerializer怎么用?C++ XMLSerializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XMLSerializer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1:
void FormattingSetting<VerticalFormatting>::writeXMLTagToStream(XMLSerializer& xml_stream) const
{
if (d_propertySource.empty())
xml_stream.openTag("VertFormat");
else
xml_stream.openTag("VertFormatProperty");
}
开发者ID:AjaxWang1989,项目名称:cegui,代码行数:7,代码来源:FormattingSetting.cpp
示例2: writeXMLToStream
void Imageset::writeXMLToStream(XMLSerializer& xml_stream) const
{
// output Imageset tag
xml_stream.openTag("Imageset")
.attribute("Name", d_name)
.attribute("Imagefile", d_textureFilename);
if (d_nativeHorzRes != DefaultNativeHorzRes)
xml_stream.attribute("NativeHorzRes",
PropertyHelper::uintToString(static_cast<uint>(d_nativeHorzRes)));
if (d_nativeVertRes != DefaultNativeVertRes)
xml_stream.attribute("NativeVertRes",
PropertyHelper::uintToString(static_cast<uint>(d_nativeVertRes)));
if (d_autoScale)
xml_stream.attribute("AutoScaled", "true");
// output images
ImageIterator image = getIterator();
while (!image.isAtEnd())
{
image.getCurrentValue().writeXMLToStream(xml_stream);
++image;
}
// output closing tag
xml_stream.closeTag();
}
开发者ID:akadjoker,项目名称:gmogre3d,代码行数:28,代码来源:CEGUIImageset.cpp
示例3: writeXMLToStream
//----------------------------------------------------------------------------//
void ComponentArea::writeXMLToStream(XMLSerializer& xml_stream) const
{
xml_stream.openTag("Area");
// see if we should write an AreaProperty element
if (isAreaFetchedFromProperty())
{
xml_stream.openTag("AreaProperty")
.attribute("name", d_namedSource)
.closeTag();
}
else if (isAreaFetchedFromNamedArea())
{
xml_stream.openTag("NamedAreaSource")
.attribute("look", d_namedAreaSourceLook)
.attribute("name", d_namedSource)
.closeTag();
}
// not a property, write out individual dimensions explicitly.
else
{
d_left.writeXMLToStream(xml_stream);
d_top.writeXMLToStream(xml_stream);
d_right_or_width.writeXMLToStream(xml_stream);
d_bottom_or_height.writeXMLToStream(xml_stream);
}
xml_stream.closeTag();
}
开发者ID:Toby91,项目名称:DDEngine,代码行数:29,代码来源:Dimensions.cpp
示例4: writeXMLElementAttributes_impl
//----------------------------------------------------------------------------//
void WidgetDim::writeXMLElementAttributes_impl(XMLSerializer& xml_stream) const
{
if (!d_widgetName.empty())
xml_stream.attribute("widget", d_widgetName);
xml_stream.attribute("dimension", FalagardXMLHelper<DimensionType>::toString(d_what));
}
开发者ID:Toby91,项目名称:DDEngine,代码行数:8,代码来源:Dimensions.cpp
示例5: writeColoursXML
//----------------------------------------------------------------------------//
bool FalagardComponentBase::writeColoursXML(XMLSerializer& xml_stream) const
{
if (!d_colourPropertyName.empty())
{
xml_stream.openTag("ColourRectProperty");
xml_stream.attribute("name", d_colourPropertyName)
.closeTag();
}
else if (!d_colours.isMonochromatic() ||
d_colours.d_top_left != Colour(1,1,1,1))
{
xml_stream.openTag("Colours")
.attribute("topLeft",
PropertyHelper<Colour>::toString(d_colours.d_top_left))
.attribute("topRight",
PropertyHelper<Colour>::toString(d_colours.d_top_right))
.attribute("bottomLeft",
PropertyHelper<Colour>::toString(d_colours.d_bottom_left))
.attribute("bottomRight",
PropertyHelper<Colour>::toString(d_colours.d_bottom_right))
.closeTag();
}
else
return false;
return true;
}
开发者ID:AjaxWang1989,项目名称:cegui,代码行数:29,代码来源:ComponentBase.cpp
示例6: writeXML
void BTPc::writeXML(const char *filename, XMLVector<BTGroup*> &group, XMLVector<BTPc*> &pc)
{
XMLSerializer parser;
parser.add("party", &group, &BTGroup::create);
parser.add("pc", &pc, &BTPc::create);
parser.write(filename, true);
}
开发者ID:Methuselas,项目名称:btbuilder,代码行数:7,代码来源:pc.C
示例7: writeXMLToStream
void NamedArea::writeXMLToStream(XMLSerializer& xml_stream) const
{
xml_stream.openTag("NamedArea")
.attribute("name", d_name);
d_area.writeXMLToStream(xml_stream);
xml_stream.closeTag();
}
开发者ID:akadjoker,项目名称:gmogre3d,代码行数:7,代码来源:CEGUIFalNamedArea.cpp
示例8: serializeXML
void SequenceExpr::serializeXML(XMLSerializer &serializer) {
XMLSerializer::attributes_t attrs;
addCommonAttributes(attrs);
serializer.startElement("sequence", attrs);
serializeChildren(serializer);
serializer.endElement();
}
开发者ID:xmlpl,项目名称:xmlplcc,代码行数:8,代码来源:SequenceExpr.cpp
示例9: serializeXML
void ForeachStmt::serializeXML(XMLSerializer &serializer) {
XMLSerializer::attributes_t attrs;
addCommonAttributes(attrs);
serializer.startElement("foreach", attrs);
serializeChildren(serializer);
serializer.endElement();
}
开发者ID:xmlpl,项目名称:xmlplcc,代码行数:8,代码来源:ForeachStmt.cpp
示例10: serializeXML
void ReturnStmt::serializeXML(XMLSerializer &serializer) {
XMLSerializer::attributes_t attrs;
addCommonAttributes(attrs);
serializer.startElement("return", attrs);
serializeChildren(serializer);
serializer.endElement();
}
开发者ID:xmlpl,项目名称:xmlplcc,代码行数:8,代码来源:ReturnStmt.cpp
示例11: serializeXML
void FilterExpr::serializeXML(XMLSerializer &serializer) {
XMLSerializer::attributes_t attrs;
addCommonAttributes(attrs);
serializer.startElement("filter", attrs);
serializeChildren(serializer);
serializer.endElement();
}
开发者ID:xmlpl,项目名称:xmlplcc,代码行数:8,代码来源:FilterExpr.cpp
示例12: serializeXML
void IntPredicate::serializeXML(XMLSerializer &serializer) {
XMLSerializer::attributes_t attrs;
addCommonAttributes(attrs);
serializer.startElement("int-predicate", attrs);
serializeChildren(serializer);
serializer.endElement();
}
开发者ID:xmlpl,项目名称:xmlplcc,代码行数:8,代码来源:IntPredicate.cpp
示例13: writeXMLToStream
void TextComponent::writeXMLToStream(XMLSerializer& xml_stream) const
{
// opening tag
xml_stream.openTag("TextComponent");
// write out area
d_area.writeXMLToStream(xml_stream);
// write text element
if (!d_font.empty() && !d_text.empty())
{
xml_stream.openTag("Text");
if (!d_font.empty())
xml_stream.attribute("font", d_font);
if (!d_text.empty())
xml_stream.attribute("string", d_text);
xml_stream.closeTag();
}
// write text property element
if (!d_textPropertyName.empty())
{
xml_stream.openTag("TextProperty")
.attribute("name", d_textPropertyName)
.closeTag();
}
// write font property element
if (!d_fontPropertyName.empty())
{
xml_stream.openTag("FontProperty")
.attribute("name", d_fontPropertyName)
.closeTag();
}
// get base class to write colours
writeColoursXML(xml_stream);
// write vert format, allowing base class to do this for us if a propety is in use
if (!writeVertFormatXML(xml_stream))
{
// was not a property, so write out explicit formatting in use
xml_stream.openTag("VertFormat")
.attribute("type", FalagardXMLHelper::vertTextFormatToString(d_vertFormatting))
.closeTag();
}
// write horz format, allowing base class to do this for us if a propety is in use
if (!writeHorzFormatXML(xml_stream))
{
// was not a property, so write out explicit formatting in use
xml_stream.openTag("HorzFormat")
.attribute("type", FalagardXMLHelper::horzTextFormatToString(d_horzFormatting))
.closeTag();
}
// closing tag
xml_stream.closeTag();
}
开发者ID:Silentfood,项目名称:oonline,代码行数:58,代码来源:CEGUIFalTextComponent.cpp
示例14: serializeXML
void BinaryExpr::serializeXML(XMLSerializer &serializer) {
XMLSerializer::attributes_t attrs;
attrs["op"] = getOp();
addCommonAttributes(attrs);
serializer.startElement("binexpr", attrs);
serializeChildren(serializer);
serializer.endElement();
}
开发者ID:xmlpl,项目名称:xmlplcc,代码行数:9,代码来源:BinaryExpr.cpp
示例15: readXML
void BTPc::readXML(const char *filename, XMLVector<BTGroup*> &group, XMLVector<BTPc*> &pc)
{
XMLSerializer parser;
parser.add("party", &group, &BTGroup::create);
parser.add("pc", &pc, &BTPc::create);
parser.parse(filename, true);
for (int i = 0; i < pc.size(); ++i)
pc[i]->updateSkills();
}
开发者ID:Methuselas,项目名称:btbuilder,代码行数:9,代码来源:pc.C
示例16: serializeXML
void TypeTest::serializeXML(XMLSerializer &serializer) {
XMLSerializer::attributes_t attrs;
attrs["type"] = Type::get(getTypeTest()).getName();
addCommonAttributes(attrs);
serializer.startElement("typetest", attrs);
serializeChildren(serializer);
serializer.endElement();
}
开发者ID:xmlpl,项目名称:xmlplcc,代码行数:10,代码来源:TypeTest.cpp
示例17: Deserialize
bool Rect::Deserialize(const char* filePath)
{
XMLSerializer* serializer = XMLSerializer::Load(filePath);
if (serializer == nullptr)
return false;
this->Deserialize(serializer);
return serializer->Close();
}
开发者ID:SentioMe,项目名称:D2D_Project,代码行数:10,代码来源:Rect.cpp
示例18: writeXMLToStream
//----------------------------------------------------------------------------//
void FrameComponent::writeXMLToStream(XMLSerializer& xml_stream) const
{
// opening tag
xml_stream.openTag("FrameComponent");
// write out area
d_area.writeXMLToStream(xml_stream);
// write images
for (int i = 0; i < FIC_FRAME_IMAGE_COUNT; ++i)
{
if (d_frameImages[i].d_specified)
{
if (d_frameImages[i].d_propertyName.empty())
xml_stream.openTag("Image")
.attribute("name", d_frameImages[i].d_image->getName())
.attribute("component", FalagardXMLHelper<FrameImageComponent>::toString(static_cast<FrameImageComponent>(i)))
.closeTag();
else
xml_stream.openTag("ImageProperty")
.attribute("name", d_frameImages[i].d_propertyName)
.attribute("component", FalagardXMLHelper<FrameImageComponent>::toString(static_cast<FrameImageComponent>(i)))
.closeTag();
}
}
// get base class to write colours
writeColoursXML(xml_stream);
d_backgroundVertFormatting.writeXMLTagToStream(xml_stream);
d_backgroundVertFormatting.writeXMLAttributesToStream(xml_stream);
xml_stream.attribute("component", "Background").closeTag();
d_leftEdgeFormatting.writeXMLTagToStream(xml_stream);
d_leftEdgeFormatting.writeXMLAttributesToStream(xml_stream);
xml_stream.attribute("component", "LeftEdge").closeTag();
d_rightEdgeFormatting.writeXMLTagToStream(xml_stream);
d_rightEdgeFormatting.writeXMLAttributesToStream(xml_stream);
xml_stream.attribute("component", "RightEdge").closeTag();
d_backgroundHorzFormatting.writeXMLTagToStream(xml_stream);
d_backgroundHorzFormatting.writeXMLAttributesToStream(xml_stream);
xml_stream.attribute("component", "Background").closeTag();
d_topEdgeFormatting.writeXMLTagToStream(xml_stream);
d_topEdgeFormatting.writeXMLAttributesToStream(xml_stream);
xml_stream.attribute("component", "TopEdge").closeTag();
d_bottomEdgeFormatting.writeXMLTagToStream(xml_stream);
d_bottomEdgeFormatting.writeXMLAttributesToStream(xml_stream);
xml_stream.attribute("component", "BottomEdge").closeTag();
// closing tag
xml_stream.closeTag();
}
开发者ID:respu,项目名称:xsilium-engine,代码行数:56,代码来源:FrameComponent.cpp
示例19: serializeXML
void ImportDecl::serializeXML(XMLSerializer &serializer) {
XMLSerializer::attributes_t attrs;
attrs["name"] = name.getFullRealName();
if (name.hasPseudonym()) attrs["as"] = name.getFullName();
addCommonAttributes(attrs);
serializer.startElement("import", attrs);
serializeChildren(serializer);
serializer.endElement();
}
开发者ID:xmlpl,项目名称:xmlplcc,代码行数:11,代码来源:ImportDecl.cpp
示例20: XMLSerializer
bool Rect::Serialize(const char* filePath)
{
XMLSerializer* serializer = new XMLSerializer(filePath);
if (false == Serialize(serializer))
return serializer->Close();
serializer->Save();
return serializer->Close();
}
开发者ID:SentioMe,项目名称:D2D_Project,代码行数:11,代码来源:Rect.cpp
注:本文中的XMLSerializer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论