diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-09-20 19:24:40 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-09 19:10:10 -0300 |
commit | e6b15c234864cc8061f43a1c238ad57b78dcc61f (patch) | |
tree | f230e92600fb3753b35843857cddb55abef3c529 /typesystem_p.h | |
parent | 614bab3782a20d534f3b17ba35d69518a9ac73c3 (diff) |
Adds support for nested type declarations on the type system file.
Instead of:
<enum-type name="Foo::Bar"/>
<value-type name="Foo"/>
the nested version could be used:
<value-type name="Foo">
<enum-type name="Bar"/>
</value-type>
The old usage is still allowed.
Diffstat (limited to 'typesystem_p.h')
-rw-r--r-- | typesystem_p.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/typesystem_p.h b/typesystem_p.h index a62056db9..e70a4fa4c 100644 --- a/typesystem_p.h +++ b/typesystem_p.h @@ -23,6 +23,7 @@ #ifndef TYPESYSTEM_P_H #define TYPESYSTEM_P_H +#include <QStack> #include <QXmlDefaultHandler> #include "typesystem.h" @@ -110,6 +111,15 @@ class StackElement } value; }; +struct StackElementContext +{ + CodeSnipList codeSnips; + AddedFunctionList addedFunctions; + FunctionModificationList functionMods; + FieldModificationList fieldMods; + DocModificationList docModifications; +}; + class Handler : public QXmlDefaultHandler { public: @@ -137,7 +147,7 @@ private: bool importFileElement(const QXmlAttributes &atts); bool convertBoolean(const QString &, const QString &, bool); - TypeDatabase *m_database; + TypeDatabase* m_database; StackElement* m_current; QString m_defaultPackage; QString m_defaultSuperclass; @@ -145,12 +155,7 @@ private: TypeEntry::CodeGeneration m_generate; EnumTypeEntry* m_currentEnum; - - CodeSnipList m_codeSnips; - AddedFunctionList m_addedFunctions; - FunctionModificationList m_functionMods; - FieldModificationList m_fieldMods; - DocModificationList m_docModifications; + QStack<StackElementContext*> m_contextStack; QHash<QString, StackElement::ElementType> tagNames; QString m_currentSignature; |