Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/ps/XML/XMLWriter.cpp
/* Copyright (C) 2013 Wildfire Games. | /* Copyright (C) 2021 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
const CStr& XMLWriter_File::GetOutput() | const CStr& XMLWriter_File::GetOutput() | ||||
{ | { | ||||
return m_Data; | return m_Data; | ||||
} | } | ||||
void XMLWriter_File::XMB(const XMBFile& file) | void XMLWriter_File::XMB(const XMBData& xmb) | ||||
{ | { | ||||
ElementXMB(file, file.GetRoot()); | ElementXMB(xmb, xmb.GetRoot()); | ||||
} | } | ||||
void XMLWriter_File::ElementXMB(const XMBFile& file, XMBElement el) | void XMLWriter_File::ElementXMB(const XMBData& xmb, XMBElement el) | ||||
{ | { | ||||
XMLWriter_Element writer(*this, file.GetElementString(el.GetNodeName()).c_str()); | XMLWriter_Element writer(*this, xmb.GetElementString(el.GetNodeName())); | ||||
XERO_ITER_ATTR(el, attr) | XERO_ITER_ATTR(el, attr) | ||||
writer.Attribute(file.GetAttributeString(attr.Name).c_str(), attr.Value); | writer.Attribute(xmb.GetAttributeString(attr.Name), attr.Value); | ||||
XERO_ITER_EL(el, child) | XERO_ITER_EL(el, child) | ||||
ElementXMB(file, child); | ElementXMB(xmb, child); | ||||
} | } | ||||
void XMLWriter_File::Comment(const char* text) | void XMLWriter_File::Comment(const char* text) | ||||
{ | { | ||||
ElementStart(NULL, "!-- "); | ElementStart(NULL, "!-- "); | ||||
m_Data += escapeComment(text); | m_Data += escapeComment(text); | ||||
m_Data += " -->"; | m_Data += " -->"; | ||||
--m_Indent; | --m_Indent; | ||||
▲ Show 20 Lines • Show All 187 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator