aboutsummaryrefslogtreecommitdiff
path: root/common/xmlparser.h
diff options
context:
space:
mode:
authorVicent Marti2008-08-01 10:18:47 +0000
committerVicent Marti2008-08-01 10:18:47 +0000
commit9bd3b07647bfbd5016f06a4f055a4310b3269587 (patch)
tree0ebafb8d7d9d9275aac96282395972e46d099d0a /common/xmlparser.h
parent7d797c878dd8f880a9e0045a93a3a7c44cb14c04 (diff)
downloadscummvm-rg350-9bd3b07647bfbd5016f06a4f055a4310b3269587.tar.gz
scummvm-rg350-9bd3b07647bfbd5016f06a4f055a4310b3269587.tar.bz2
scummvm-rg350-9bd3b07647bfbd5016f06a4f055a4310b3269587.zip
Support for XML layout with unspecified keys.
XML Layout parsing. WIP. svn-id: r33488
Diffstat (limited to 'common/xmlparser.h')
-rw-r--r--common/xmlparser.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/xmlparser.h b/common/xmlparser.h
index 11028dbaa8..9308524388 100644
--- a/common/xmlparser.h
+++ b/common/xmlparser.h
@@ -108,6 +108,10 @@ namespace Common {
contained children keys, using the XML_KEY() macro again.
The scope of a XML key is closed with the KEY_END() macro.
+ Keys which may contain any kind of Property names may be defined with the
+ XML_PROP_ANY() macro instead of the XML_PROP() macro. This macro takes no
+ arguments.
+
As an example, the following XML layout:
XML_KEY(palette)
@@ -178,6 +182,7 @@ namespace Common {
#define XML_KEY(keyName) {\
lay = new XMLKeyLayout; \
+ lay->anyProps = false; \
lay->custom = new kLocalParserName::CustomParserCallback; \
((kLocalParserName::CustomParserCallback*)(lay->custom))->callback = (&kLocalParserName::parserCallback_##keyName); \
layout.top()->children[#keyName] = lay; \
@@ -189,6 +194,9 @@ namespace Common {
prop.name = #propName; \
prop.required = req; \
layout.top()->properties.push_back(prop); }\
+
+#define XML_PROP_ANY() {\
+ layout.top()->anyProps = true; }
#define CUSTOM_XML_PARSER(parserName) \
protected: \
@@ -291,6 +299,7 @@ public:
};
Common::List<XMLKeyProperty> properties;
+ bool anyProps;
ChildMap children;
~XMLKeyLayout() {