diff options
author | Renato Filho <renato.filho@openbossa.org> | 2010-08-24 16:43:05 -0300 |
---|---|---|
committer | Renato Filho <renato.filho@openbossa.org> | 2010-08-25 10:38:40 -0300 |
commit | 2926ebb67df6ebe19cdf5b4961386f425a187f21 (patch) | |
tree | 4782f428941cf5357d77423986280c8bcb0106a5 | |
parent | 4dc680453961dd23e6d0df764824f2d52cdedae0 (diff) |
Accepts inject conde on virtual functions before call c++ code.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
Hugo Parente Lima <hugo.pl@gmail.com>
-rw-r--r-- | cppgenerator.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp index 28d23f98c..62545dd0c 100644 --- a/cppgenerator.cpp +++ b/cppgenerator.cpp @@ -461,6 +461,15 @@ void CppGenerator::writeVirtualMethodNative(QTextStream &s, const AbstractMetaFu s << INDENT << "if (py_override.isNull()) {" << endl; { Indentation indentation(INDENT); + + CodeSnipList snips; + if (func->hasInjectedCode()) { + snips = func->injectedCodeSnips(); + const AbstractMetaArgument* lastArg = func->arguments().isEmpty() ? 0 : func->arguments().last(); + writeCodeSnips(s, snips, CodeSnip::Beginning, TypeSystem::ShellCode, func, lastArg); + s << endl; + } + if (func->isAbstract()) { s << INDENT << "PyErr_SetString(PyExc_NotImplementedError, \"pure virtual method '"; s << func->ownerClass()->name() << '.' << func->name(); |