Mercurial > projects > qtd
comparison generator/cppimplgenerator.cpp @ 40:a5cc4ada07f5
remove obsolete stuff
author | eldar |
---|---|
date | Sun, 17 May 2009 02:08:42 +0000 |
parents | a5cba313c924 |
children | 1750a803af74 |
comparison
equal
deleted
inserted
replaced
39:a5cba313c924 | 40:a5cc4ada07f5 |
---|---|
40 ****************************************************************************/ | 40 ****************************************************************************/ |
41 | 41 |
42 #include "cppimplgenerator.h" | 42 #include "cppimplgenerator.h" |
43 #include "dgenerator.h" | 43 #include "dgenerator.h" |
44 #include "reporthandler.h" | 44 #include "reporthandler.h" |
45 #include <qnativepointer.h> | |
46 | 45 |
47 #include <QDir> | 46 #include <QDir> |
48 #include <QtDebug> | 47 #include <QtDebug> |
49 #include <QVariant> | 48 #include <QVariant> |
50 #include <iostream> | 49 #include <iostream> |
2914 } | 2913 } |
2915 } | 2914 } |
2916 // qtd s << INDENT << "QTJAMBI_EXCEPTION_CHECK(__jni_env);" << endl; | 2915 // qtd s << INDENT << "QTJAMBI_EXCEPTION_CHECK(__jni_env);" << endl; |
2917 } | 2916 } |
2918 | 2917 |
2919 static int nativePointerType(const AbstractMetaType *java_type) | |
2920 { | |
2921 Q_ASSERT(java_type); | |
2922 Q_ASSERT(java_type->isNativePointer()); | |
2923 | |
2924 if (!java_type->typeEntry()->isPrimitive()) | |
2925 return PointerType; | |
2926 | |
2927 if (java_type->indirections() > 1) | |
2928 return PointerType; | |
2929 | |
2930 static QHash<QString, int> types; | |
2931 if (types.isEmpty()) { | |
2932 types["boolean"] = BooleanType; | |
2933 types["byte"] = ByteType; | |
2934 types["char"] = CharType; | |
2935 types["short"] = ShortType; | |
2936 types["int"] = IntType; | |
2937 types["long"] = LongType; | |
2938 types["float"] = FloatType; | |
2939 types["double"] = DoubleType; | |
2940 } | |
2941 | |
2942 QString targetLangName = java_type->typeEntry()->targetLangName(); | |
2943 if (!types.contains(targetLangName)) | |
2944 return PointerType; | |
2945 | |
2946 return types[targetLangName]; | |
2947 } | |
2948 | |
2949 void CppImplGenerator::writeQtToJava(QTextStream &s, | 2918 void CppImplGenerator::writeQtToJava(QTextStream &s, |
2950 const AbstractMetaType *java_type, | 2919 const AbstractMetaType *java_type, |
2951 const QString &qt_name, | 2920 const QString &qt_name, |
2952 const QString &java_name, | 2921 const QString &java_name, |
2953 const AbstractMetaFunction *java_function, | 2922 const AbstractMetaFunction *java_function, |