Mercurial > projects > qtd
comparison generator/cppheadergenerator.cpp @ 257:17b5e13364b7 lifetime
(none)
author | maxter |
---|---|
date | Wed, 16 Sep 2009 13:56:02 +0000 |
parents | 34a37904ff77 |
children | 515d6e1c7b10 |
comparison
equal
deleted
inserted
replaced
256:b1abe7f57321 | 257:17b5e13364b7 |
---|---|
124 | 124 |
125 s << "#ifndef " << include_block << endl | 125 s << "#ifndef " << include_block << endl |
126 << "#define " << include_block << endl << endl | 126 << "#define " << include_block << endl << endl |
127 // << "#include <qtjambi_core.h>" << endl | 127 // << "#include <qtjambi_core.h>" << endl |
128 << "#include <QtCore/QHash>" << endl | 128 << "#include <QtCore/QHash>" << endl |
129 << "#include <QObjectEntity.h>" << endl; | 129 << "#include <qtd_core.h>" << endl; |
130 | 130 |
131 Include inc = java_class->typeEntry()->include(); | 131 Include inc = java_class->typeEntry()->include(); |
132 s << "#include "; | 132 s << "#include "; |
133 if (inc.type == Include::IncludePath) | 133 if (inc.type == Include::IncludePath) |
134 s << "<"; | 134 s << "<"; |
178 | 178 |
179 s << "class " << shellClassName(java_class) | 179 s << "class " << shellClassName(java_class) |
180 << " : public " << java_class->qualifiedCppName(); | 180 << " : public " << java_class->qualifiedCppName(); |
181 if (java_class->isQObject()) | 181 if (java_class->isQObject()) |
182 s << ", public QtD_QObjectEntity"; | 182 s << ", public QtD_QObjectEntity"; |
183 else if(java_class->hasVirtualFunctions()) | 183 else if (java_class->hasVirtualFunctions()) |
184 s << ", public QtD_Entity"; | 184 s << ", public QtD_Entity"; |
185 s << endl << "{" << endl; | 185 s << endl << "{" << endl; |
186 | 186 |
187 if (java_class->isQObject()) { | 187 if (java_class->isQObject()) { |
188 s << "public:" << endl | 188 s << "public:" << endl |
205 // constructor | 205 // constructor |
206 foreach (const AbstractMetaFunction *function, java_class->functions()) { | 206 foreach (const AbstractMetaFunction *function, java_class->functions()) { |
207 if (function->isConstructor() && !function->isPrivate()) | 207 if (function->isConstructor() && !function->isPrivate()) |
208 writeFunction(s, function); | 208 writeFunction(s, function); |
209 } | 209 } |
210 | 210 |
211 s << " ~" << shellClassName(java_class) << "();" << endl; | 211 if (java_class->hasVirtualFunctions()) |
212 s << endl; | 212 s << " ~" << shellClassName(java_class) << "();" << endl << endl; |
213 | |
213 | 214 |
214 // All functions in original class that should be reimplemented in shell class | 215 // All functions in original class that should be reimplemented in shell class |
215 AbstractMetaFunctionList shell_functions = java_class->functionsInShellClass(); | 216 AbstractMetaFunctionList shell_functions = java_class->functionsInShellClass(); |
216 foreach (const AbstractMetaFunction *function, shell_functions) { | 217 foreach (const AbstractMetaFunction *function, shell_functions) { |
217 if(notWrappedYet(function)) | 218 if(notWrappedYet(function)) |