aboutsummaryrefslogtreecommitdiffstats
path: root/generators
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2009-08-21 18:36:37 -0300
committerHugo Lima <hugo.lima@openbossa.org>2009-08-25 16:23:16 -0300
commit2270cb2b4e57b8e3d82dd1cf692eea75a4342c45 (patch)
treec485f506155df3d5ec7a21347b9d1e8d38f85400 /generators
parent55dd77e04a8cef0e14648d6d8fb18cdc18695931 (diff)
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 :-)
Diffstat (limited to 'generators')
-rw-r--r--generators/boostpython/boostpythongenerator.cpp49
-rw-r--r--generators/qtdoc/CMakeLists.txt2
-rw-r--r--generators/qtdoc/qtdocgenerator.h9
3 files changed, 10 insertions, 50 deletions
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<AbstractMetaType *> 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);