From fd8e28fa13c7424f0ebba60d90d025cf4ac3b7b9 Mon Sep 17 00:00:00 2001 From: Marcelo Lira Date: Fri, 28 Jan 2011 17:51:05 -0300 Subject: Added the "%CPPTYPE" type system variable. %CPPTYPE will be converted to the original C++ name of a class, without any "Wrapper" suffix or namespace prefix. Documentation for the new variable was added as well. Reviewed by Hugo Parente Reviewed by Luciano Wolf --- generator/shibokengenerator.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'generator/shibokengenerator.cpp') diff --git a/generator/shibokengenerator.cpp b/generator/shibokengenerator.cpp index 72f396d0e..387a87690 100644 --- a/generator/shibokengenerator.cpp +++ b/generator/shibokengenerator.cpp @@ -1145,6 +1145,7 @@ void ShibokenGenerator::writeCodeSnips(QTextStream& s, // class context in which the variable is used code.replace("%PYTHONTYPEOBJECT", cpythonTypeName(context) + ".super.ht_type"); code.replace("%TYPE", wrapperName(context)); + code.replace("%CPPTYPE", context->name()); } // replace "toPython "converters @@ -1325,6 +1326,9 @@ void ShibokenGenerator::writeCodeSnips(QTextStream& s, if (func->isConstructor() && shouldGenerateCppWrapper(func->ownerClass())) code.replace("%TYPE", wrapperName(func->ownerClass())); + if (func->ownerClass()) + code.replace("%CPPTYPE", func->ownerClass()->name()); + replaceTemplateVariables(code, func); } -- cgit v1.2.3