1
1
forked from 0ad/0ad
0ad/source/ps/XML
wraitii cdd75deafb XMB Improvements, parse JS into XMB, make strings more efficient.
XMB format is bumped to 4, invalidating all cached files. The
differences are:
 - element/attribute names are stored after the elements themselves, and
not before. This allows writing XMB data in one pass instead of two.
 - names themselves becomes offsets (instead of arbitrary integers),
making getting the string from the int name much more efficient.

XMBFile is renamed to XMBData to clarify that it does not, in fact,
refer to a file on disk.

XMBData::GetElementString is also changed to return a const char*, thus
not creating an std::string. A string_view version is added where
convenient.

The XML->XMB and JS->XMB conversion functions and the corresponding
storage are moved to `ps/XMB`, since that format doesn't particularly
relate to XML. CXeromyces becomes lighter and more focused as a result.
The XML->XMB conversion also benefits from the above streamlining.

Note that in a few cases, string_view gets printed to CLogger via
data(), which is generally not legal, but we know that the strings are
null-terminated here. Our libfmt (version 4) doesn't support
string_view, that would be v5.

Differential Revision: https://code.wildfiregames.com/D3909
This was SVN commit r25375.
2021-05-04 13:02:34 +00:00
..
tests XMB Improvements, parse JS into XMB, make strings more efficient. 2021-05-04 13:02:34 +00:00
RelaxNG.cpp ParamNode: switch to utf8, ToXML -> ToXMLString, test tweak, PCH tweak 2021-04-11 09:23:10 +00:00
RelaxNG.h ParamNode: switch to utf8, ToXML -> ToXMLString, test tweak, PCH tweak 2021-04-11 09:23:10 +00:00
Xeromyces.cpp XMB Improvements, parse JS into XMB, make strings more efficient. 2021-05-04 13:02:34 +00:00
Xeromyces.h XMB Improvements, parse JS into XMB, make strings more efficient. 2021-05-04 13:02:34 +00:00
XMLWriter.cpp XMB Improvements, parse JS into XMB, make strings more efficient. 2021-05-04 13:02:34 +00:00
XMLWriter.h XMB Improvements, parse JS into XMB, make strings more efficient. 2021-05-04 13:02:34 +00:00