From 2270cb2b4e57b8e3d82dd1cf692eea75a4342c45 Mon Sep 17 00:00:00 2001 From: Hugo Lima Date: Fri, 21 Aug 2009 18:36:37 -0300 Subject: Removed QtDocGenerator dependence from BoostPythonGenerator, so a lot of function were moved from BoostPythonGenerator to the Generator class. In other words, QtDocGenerator finally compiles and their unit test pass :-) --- generators/boostpython/boostpythongenerator.cpp | 49 ------------------------- generators/qtdoc/CMakeLists.txt | 2 +- generators/qtdoc/qtdocgenerator.h | 9 +++++ 3 files changed, 10 insertions(+), 50 deletions(-) (limited to 'generators') diff --git a/generators/boostpython/boostpythongenerator.cpp b/generators/boostpython/boostpythongenerator.cpp index b799f4d2f..c62b876d8 100644 --- a/generators/boostpython/boostpythongenerator.cpp +++ b/generators/boostpython/boostpythongenerator.cpp @@ -36,55 +36,6 @@ static Indentor INDENT; static void dump_function(AbstractMetaFunctionList lst); -QString BoostPythonGenerator::translateType(const AbstractMetaType *cType, - const AbstractMetaClass *context, - int option) const -{ - QString s; - - if (context && cType && - context->typeEntry()->isGenericClass() && - cType->originalTemplateType()) { - qDebug() << "set original templateType" << cType->name(); - cType = cType->originalTemplateType(); - } - - if (!cType) { - s = "void"; - } else if (cType->isArray()) { - s = translateType(cType->arrayElementType(), context) + "[]"; - } else if (cType->isEnum() || cType->isFlags()) { - if (option & Generator::EnumAsInts) - s = "int"; - else - s = cType->cppSignature(); -#if 0 - } else if (c_type->isContainer()) { - qDebug() << "is container" << c_type->cppSignature(); - s = c_type->name(); - if (!(option & SkipTemplateParameters)) { - s += " < "; - QList args = c_type->instantiations(); - for (int i = 0; i < args.size(); ++i) { - if (i) - s += ", "; - qDebug() << "container type: " << args.at(i)->cppSignature() << " / " << args.at(i)->instantiations().count(); - s += translateType(args.at(i), context, option); - } - s += " > "; - } -#endif - } else { - s = cType->cppSignature(); - if (cType->isConstant() && (option & Generator::ExcludeConst)) - s.replace("const", ""); - if (cType->isReference() && (option & Generator::ExcludeReference)) - s.replace("&", ""); - } - - return s; -} - QString BoostPythonGenerator::getWrapperName(const AbstractMetaClass* clazz) { QString result = clazz->name().toLower(); diff --git a/generators/qtdoc/CMakeLists.txt b/generators/qtdoc/CMakeLists.txt index 68c92b950..fb71784ab 100644 --- a/generators/qtdoc/CMakeLists.txt +++ b/generators/qtdoc/CMakeLists.txt @@ -5,6 +5,6 @@ qtdocgenerator.cpp ) add_library(qtdoc_generator SHARED ${qtdoc_generator_SRC}) -target_link_libraries(qtdoc_generator ${APIEXTRACTOR_LIBRARY} ${QT_QTCORE_LIBRARY} generator) +target_link_libraries(qtdoc_generator ${APIEXTRACTOR_LIBRARY} ${QT_QTCORE_LIBRARY} genrunner) install(TARGETS qtdoc_generator DESTINATION ${LIB_INSTALL_DIR}) diff --git a/generators/qtdoc/qtdocgenerator.h b/generators/qtdoc/qtdocgenerator.h index 1d898197e..c9b411335 100644 --- a/generators/qtdoc/qtdocgenerator.h +++ b/generators/qtdoc/qtdocgenerator.h @@ -180,6 +180,15 @@ protected: QString fileNameForClass(const AbstractMetaClass* cppClass) const; void generateClass(QTextStream& s, const AbstractMetaClass* cppClass); void finishGeneration(); + + void writeFunctionArguments(QTextStream&, const AbstractMetaFunction*, uint) const {} + void writeArgumentNames(QTextStream&, const AbstractMetaFunction*, uint) const {} + QString subDirectoryForClass(const AbstractMetaClass* clazz) const + { + Q_ASSERT(false); + return QString(); + } + private: void writeEnums(QTextStream& s, const AbstractMetaClass* cppClass); -- cgit v1.2.3