Mercurial > projects > qtd
diff generator/cppgenerator.cpp @ 355:08c1ca7975ab
obviated redundant virtual dispatch callbacks
author | Max Samukha <maxter@spambox.com> |
---|---|
date | Tue, 25 May 2010 17:23:11 +0300 |
parents | cf8a415f3f32 |
children |
line wrap: on
line diff
--- a/generator/cppgenerator.cpp Mon May 24 23:43:30 2010 +0300 +++ b/generator/cppgenerator.cpp Tue May 25 17:23:11 2010 +0300 @@ -230,7 +230,7 @@ s << "("; const AbstractMetaClass *owner = java_function->ownerClass(); - bool has_d_ptr = java_function->isConstructor() && owner && (owner->hasVirtualFunctions()/* || owner->typeEntry()->isObject()*/ ); + bool has_d_ptr = java_function->isConstructor() && owner && (owner->isPolymorphic()/* || owner->typeEntry()->isObject()*/ ); const AbstractMetaArgumentList arg_list = java_function->arguments(); if (has_d_ptr) { s << "void *d_ptr"; @@ -250,3 +250,20 @@ if (java_function->isConstant()) s << " const"; } + +void CppGenerator::writeInclude(QTextStream &s, Include inc) +{ + if (!inc.name.isEmpty()) { + s << "#include "; + if (inc.type == Include::IncludePath) + s << "<"; + else + s << "\""; + s << inc.name; + if (inc.type == Include::IncludePath) + s << ">"; + else + s << "\""; + s << endl; + } +}