| abstractmetalang.h | | abstractmetalang.h | |
| | | | |
| skipping to change at line 44 | | skipping to change at line 44 | |
| class AbstractMetaClass; | | class AbstractMetaClass; | |
| class AbstractMetaField; | | class AbstractMetaField; | |
| class AbstractMetaFunction; | | class AbstractMetaFunction; | |
| class AbstractMetaType; | | class AbstractMetaType; | |
| class AbstractMetaVariable; | | class AbstractMetaVariable; | |
| class AbstractMetaArgument; | | class AbstractMetaArgument; | |
| class AbstractMetaEnumValue; | | class AbstractMetaEnumValue; | |
| class AbstractMetaEnum; | | class AbstractMetaEnum; | |
| class QPropertySpec; | | class QPropertySpec; | |
| | | | |
|
| class Documentation | | class APIEXTRACTOR_API Documentation | |
| { | | { | |
| public: | | public: | |
| enum Format { | | enum Format { | |
| Native, | | Native, | |
| Target | | Target | |
| }; | | }; | |
| | | | |
| Documentation() | | Documentation() | |
| : m_format(Documentation::Native) {} | | : m_format(Documentation::Native) {} | |
| | | | |
| | | | |
| skipping to change at line 82 | | skipping to change at line 82 | |
| | | | |
| private: | | private: | |
| QString m_data; | | QString m_data; | |
| Format m_format; | | Format m_format; | |
| | | | |
| }; | | }; | |
| | | | |
| typedef QList<AbstractMetaField *> AbstractMetaFieldList; | | typedef QList<AbstractMetaField *> AbstractMetaFieldList; | |
| typedef QList<AbstractMetaArgument *> AbstractMetaArgumentList; | | typedef QList<AbstractMetaArgument *> AbstractMetaArgumentList; | |
| typedef QList<AbstractMetaFunction *> AbstractMetaFunctionList; | | typedef QList<AbstractMetaFunction *> AbstractMetaFunctionList; | |
|
| class AbstractMetaClassList : public QList<AbstractMetaClass *> | | class APIEXTRACTOR_API AbstractMetaClassList : public QList<AbstractMetaCl
ass *> | |
| { | | { | |
| public: | | public: | |
| AbstractMetaClass *findClass(const QString &name) const; | | AbstractMetaClass *findClass(const QString &name) const; | |
| AbstractMetaEnumValue *findEnumValue(const QString &string) const; | | AbstractMetaEnumValue *findEnumValue(const QString &string) const; | |
| AbstractMetaEnum *findEnum(const EnumTypeEntry *entry) const; | | AbstractMetaEnum *findEnum(const EnumTypeEntry *entry) const; | |
| | | | |
| }; | | }; | |
| | | | |
|
| class AbstractMetaAttributes | | class APIEXTRACTOR_API AbstractMetaAttributes | |
| { | | { | |
| public: | | public: | |
| AbstractMetaAttributes() : m_attributes(0) {}; | | AbstractMetaAttributes() : m_attributes(0) {}; | |
| | | | |
| enum Attribute { | | enum Attribute { | |
| None = 0x00000000, | | None = 0x00000000, | |
| | | | |
| Private = 0x00000001, | | Private = 0x00000001, | |
| Protected = 0x00000002, | | Protected = 0x00000002, | |
| Public = 0x00000004, | | Public = 0x00000004, | |
| | | | |
| skipping to change at line 304 | | skipping to change at line 304 | |
| return m_doc; | | return m_doc; | |
| } | | } | |
| | | | |
| private: | | private: | |
| uint m_attributes; | | uint m_attributes; | |
| uint m_originalAttributes; | | uint m_originalAttributes; | |
| QString m_includeFile; | | QString m_includeFile; | |
| Documentation m_doc; | | Documentation m_doc; | |
| }; | | }; | |
| | | | |
|
| class AbstractMetaType | | class APIEXTRACTOR_API AbstractMetaType | |
| { | | { | |
| public: | | public: | |
| enum TypeUsagePattern { | | enum TypeUsagePattern { | |
| InvalidPattern, | | InvalidPattern, | |
| PrimitivePattern, | | PrimitivePattern, | |
| FlagsPattern, | | FlagsPattern, | |
| EnumPattern, | | EnumPattern, | |
| ValuePattern, | | ValuePattern, | |
| StringPattern, | | StringPattern, | |
| CharPattern, | | CharPattern, | |
| | | | |
| skipping to change at line 609 | | skipping to change at line 609 | |
| const AbstractMetaType *m_originalTemplateType; | | const AbstractMetaType *m_originalTemplateType; | |
| | | | |
| TypeUsagePattern m_pattern; | | TypeUsagePattern m_pattern; | |
| uint m_constant : 1; | | uint m_constant : 1; | |
| uint m_reference : 1; | | uint m_reference : 1; | |
| uint m_cppInstantiation : 1; | | uint m_cppInstantiation : 1; | |
| int m_indirections : 4; | | int m_indirections : 4; | |
| uint m_reserved : 25; // unused | | uint m_reserved : 25; // unused | |
| }; | | }; | |
| | | | |
|
| class AbstractMetaVariable | | class APIEXTRACTOR_API AbstractMetaVariable | |
| { | | { | |
| public: | | public: | |
| AbstractMetaVariable() : m_type(0) {} | | AbstractMetaVariable() : m_type(0) {} | |
| | | | |
| AbstractMetaType *type() const | | AbstractMetaType *type() const | |
| { | | { | |
| return m_type; | | return m_type; | |
| } | | } | |
| void setType(AbstractMetaType *type) | | void setType(AbstractMetaType *type) | |
| { | | { | |
| | | | |
| skipping to change at line 648 | | skipping to change at line 648 | |
| return m_doc; | | return m_doc; | |
| } | | } | |
| | | | |
| private: | | private: | |
| QString m_name; | | QString m_name; | |
| AbstractMetaType *m_type; | | AbstractMetaType *m_type; | |
| | | | |
| Documentation m_doc; | | Documentation m_doc; | |
| }; | | }; | |
| | | | |
|
| class AbstractMetaArgument : public AbstractMetaVariable | | class APIEXTRACTOR_API AbstractMetaArgument : public AbstractMetaVariable | |
| { | | { | |
| public: | | public: | |
| AbstractMetaArgument() : m_argumentIndex(0) {}; | | AbstractMetaArgument() : m_argumentIndex(0) {}; | |
| | | | |
| QString defaultValueExpression() const | | QString defaultValueExpression() const | |
| { | | { | |
| return m_expression; | | return m_expression; | |
| } | | } | |
| void setDefaultValueExpression(const QString &expr) | | void setDefaultValueExpression(const QString &expr) | |
| { | | { | |
| | | | |
| skipping to change at line 700 | | skipping to change at line 700 | |
| | | | |
| private: | | private: | |
| // Just to force people to call argumentName() And indexedName(); | | // Just to force people to call argumentName() And indexedName(); | |
| QString name() const; | | QString name() const; | |
| | | | |
| QString m_expression; | | QString m_expression; | |
| QString m_originalExpression; | | QString m_originalExpression; | |
| int m_argumentIndex; | | int m_argumentIndex; | |
| }; | | }; | |
| | | | |
|
| class AbstractMetaField : public AbstractMetaVariable, public AbstractMetaA
ttributes | | class APIEXTRACTOR_API AbstractMetaField : public AbstractMetaVariable, pub
lic AbstractMetaAttributes | |
| { | | { | |
| public: | | public: | |
| AbstractMetaField(); | | AbstractMetaField(); | |
| ~AbstractMetaField(); | | ~AbstractMetaField(); | |
| | | | |
| const AbstractMetaClass *enclosingClass() const | | const AbstractMetaClass *enclosingClass() const | |
| { | | { | |
| return m_class; | | return m_class; | |
| } | | } | |
| void setEnclosingClass(const AbstractMetaClass *cls) | | void setEnclosingClass(const AbstractMetaClass *cls) | |
| | | | |
| skipping to change at line 731 | | skipping to change at line 731 | |
| using AbstractMetaVariable::documentation; | | using AbstractMetaVariable::documentation; | |
| | | | |
| AbstractMetaField *copy() const; | | AbstractMetaField *copy() const; | |
| | | | |
| private: | | private: | |
| mutable AbstractMetaFunction *m_getter; | | mutable AbstractMetaFunction *m_getter; | |
| mutable AbstractMetaFunction *m_setter; | | mutable AbstractMetaFunction *m_setter; | |
| const AbstractMetaClass *m_class; | | const AbstractMetaClass *m_class; | |
| }; | | }; | |
| | | | |
|
| class AbstractMetaFunction : public AbstractMetaAttributes | | class APIEXTRACTOR_API AbstractMetaFunction : public AbstractMetaAttributes | |
| { | | { | |
| public: | | public: | |
| enum FunctionType { | | enum FunctionType { | |
| ConstructorFunction, | | ConstructorFunction, | |
| DestructorFunction, | | DestructorFunction, | |
| NormalFunction, | | NormalFunction, | |
| SignalFunction, | | SignalFunction, | |
| EmptyFunction, | | EmptyFunction, | |
| SlotFunction, | | SlotFunction, | |
|
| GlobalScopeFunction | | GlobalScopeFunction, | |
| | | UserAddedFunction, // Function added by the typesystem | |
| }; | | }; | |
| | | | |
| enum CompareResult { | | enum CompareResult { | |
| EqualName = 0x00000001, | | EqualName = 0x00000001, | |
| EqualArguments = 0x00000002, | | EqualArguments = 0x00000002, | |
| EqualAttributes = 0x00000004, | | EqualAttributes = 0x00000004, | |
| EqualImplementor = 0x00000008, | | EqualImplementor = 0x00000008, | |
| EqualReturnType = 0x00000010, | | EqualReturnType = 0x00000010, | |
| EqualDefaultValueOverload = 0x00000020, | | EqualDefaultValueOverload = 0x00000020, | |
| EqualModifiedName = 0x00000040, | | EqualModifiedName = 0x00000040, | |
| | | | |
| skipping to change at line 831 | | skipping to change at line 832 | |
| bool isConversionOperator() const | | bool isConversionOperator() const | |
| { | | { | |
| return isConversionOperator(originalName()); | | return isConversionOperator(originalName()); | |
| } | | } | |
| | | | |
| static bool isOperatorOverload(QString funcName); | | static bool isOperatorOverload(QString funcName); | |
| bool isOperatorOverload() const | | bool isOperatorOverload() const | |
| { | | { | |
| return isOperatorOverload(originalName()); | | return isOperatorOverload(originalName()); | |
| } | | } | |
|
| | | bool isCastOperator() const; | |
| | | | |
| bool isArithmeticOperator() const; | | bool isArithmeticOperator() const; | |
| bool isBitwiseOperator() const; | | bool isBitwiseOperator() const; | |
| bool isComparisonOperator() const; | | bool isComparisonOperator() const; | |
| bool isLogicalOperator() const; | | bool isLogicalOperator() const; | |
| bool isSubscriptOperator() const; | | bool isSubscriptOperator() const; | |
| bool isAssignmentOperator() const; | | bool isAssignmentOperator() const; | |
| bool isOtherOperator() const; | | bool isOtherOperator() const; | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 1043 | | skipping to change at line 1045 | |
| QString argumentReplaced(int key) const; | | QString argumentReplaced(int key) const; | |
| bool needsSuppressUncheckedWarning() const; | | bool needsSuppressUncheckedWarning() const; | |
| | | | |
| bool hasModifications(const AbstractMetaClass *implementor) const; | | bool hasModifications(const AbstractMetaClass *implementor) const; | |
| /** | | /** | |
| * Verifies if any modification to the function is an inject code. | | * Verifies if any modification to the function is an inject code. | |
| * \return true if there is inject code modifications to the function. | | * \return true if there is inject code modifications to the function. | |
| */ | | */ | |
| bool hasInjectedCode() const; | | bool hasInjectedCode() const; | |
| /** | | /** | |
|
| | | * Returns a list of code snips for this function. | |
| | | * The code snips can be filtered by position and language. | |
| | | * \return list of code snips | |
| | | */ | |
| | | CodeSnipList injectedCodeSnips(CodeSnip::Position position = CodeSnip:: | |
| | | Any, | |
| | | TypeSystem::Language language = TypeSyst | |
| | | em::All) const; | |
| | | /** | |
| * Verifies if any modification to the function alters/removes its | | * Verifies if any modification to the function alters/removes its | |
| * arguments types or default values. | | * arguments types or default values. | |
| * \return true if there is some modification to function signature | | * \return true if there is some modification to function signature | |
| */ | | */ | |
| bool hasSignatureModifications() const; | | bool hasSignatureModifications() const; | |
| FunctionModificationList modifications(const AbstractMetaClass *impleme
ntor) const; | | FunctionModificationList modifications(const AbstractMetaClass *impleme
ntor) const; | |
| | | | |
| // If this function stems from an interface, this returns the | | // If this function stems from an interface, this returns the | |
| // interface that declares it. | | // interface that declares it. | |
| const AbstractMetaClass *interfaceClass() const | | const AbstractMetaClass *interfaceClass() const | |
| | | | |
| skipping to change at line 1239 | | skipping to change at line 1248 | |
| AbstractMetaEnumValueList m_enumValues; | | AbstractMetaEnumValueList m_enumValues; | |
| EnumTypeEntry *m_typeEntry; | | EnumTypeEntry *m_typeEntry; | |
| AbstractMetaClass *m_class; | | AbstractMetaClass *m_class; | |
| | | | |
| uint m_hasQenumsDeclaration : 1; | | uint m_hasQenumsDeclaration : 1; | |
| uint m_reserved : 31; | | uint m_reserved : 31; | |
| }; | | }; | |
| | | | |
| typedef QList<AbstractMetaEnum *> AbstractMetaEnumList; | | typedef QList<AbstractMetaEnum *> AbstractMetaEnumList; | |
| | | | |
|
| class AbstractMetaClass : public AbstractMetaAttributes | | class APIEXTRACTOR_API AbstractMetaClass : public AbstractMetaAttributes | |
| { | | { | |
| public: | | public: | |
| enum FunctionQueryOption { | | enum FunctionQueryOption { | |
| Constructors = 0x0000001, // Only constructors | | Constructors = 0x0000001, // Only constructors | |
| //Destructors = 0x0000002, // Only destructors. No
t included in class. | | //Destructors = 0x0000002, // Only destructors. No
t included in class. | |
| VirtualFunctions = 0x0000004, // Only virtual functions
(virtual in both TargetLang and C++) | | VirtualFunctions = 0x0000004, // Only virtual functions
(virtual in both TargetLang and C++) | |
| FinalInTargetLangFunctions = 0x0000008, // Only functions that ar
e non-virtual in TargetLang | | FinalInTargetLangFunctions = 0x0000008, // Only functions that ar
e non-virtual in TargetLang | |
| FinalInCppFunctions = 0x0000010, // Only functions that ar
e non-virtual in C++ | | FinalInCppFunctions = 0x0000010, // Only functions that ar
e non-virtual in C++ | |
| ClassImplements = 0x0000020, // Only functions impleme
nted by the current class | | ClassImplements = 0x0000020, // Only functions impleme
nted by the current class | |
| Inconsistent = 0x0000040, // Only inconsistent func
tions (inconsistent virtualness in TargetLang/C++) | | Inconsistent = 0x0000040, // Only inconsistent func
tions (inconsistent virtualness in TargetLang/C++) | |
| | | | |
| skipping to change at line 1305 | | skipping to change at line 1314 | |
| m_forceShellClass(false), | | m_forceShellClass(false), | |
| m_hasHashFunction(false), | | m_hasHashFunction(false), | |
| m_hasEqualsOperator(false), | | m_hasEqualsOperator(false), | |
| m_hasCloneOperator(false), | | m_hasCloneOperator(false), | |
| m_isTypeAlias(false), | | m_isTypeAlias(false), | |
| m_enclosingClass(0), | | m_enclosingClass(0), | |
| m_baseClass(0), | | m_baseClass(0), | |
| m_templateBaseClass(0), | | m_templateBaseClass(0), | |
| m_extractedInterface(0), | | m_extractedInterface(0), | |
| m_primaryInterfaceImplementor(0), | | m_primaryInterfaceImplementor(0), | |
|
| m_typeEntry(0)//, | | m_typeEntry(0), | |
| //m_qDebugStreamFunction(0) | | //m_qDebugStreamFunction(0) | |
|
| | | m_stream(false) | |
| {} | | {} | |
| | | | |
| virtual ~AbstractMetaClass(); | | virtual ~AbstractMetaClass(); | |
| | | | |
| AbstractMetaClass *extractInterface(); | | AbstractMetaClass *extractInterface(); | |
| void fixFunctions(); | | void fixFunctions(); | |
| | | | |
| AbstractMetaFunctionList functions() const | | AbstractMetaFunctionList functions() const | |
| { | | { | |
| return m_functions; | | return m_functions; | |
| } | | } | |
| | | | |
| void setFunctions(const AbstractMetaFunctionList &functions); | | void setFunctions(const AbstractMetaFunctionList &functions); | |
| void addFunction(AbstractMetaFunction *function); | | void addFunction(AbstractMetaFunction *function); | |
| bool hasFunction(const AbstractMetaFunction *f) const; | | bool hasFunction(const AbstractMetaFunction *f) const; | |
| bool hasFunction(const QString &str) const; | | bool hasFunction(const QString &str) const; | |
|
| | | const AbstractMetaFunction* findFunction(const QString& functionName) c
onst; | |
| bool hasSignal(const AbstractMetaFunction *f) const; | | bool hasSignal(const AbstractMetaFunction *f) const; | |
| | | | |
| bool hasConstructors() const; | | bool hasConstructors() const; | |
| | | | |
| void addDefaultConstructor(); | | void addDefaultConstructor(); | |
| | | | |
| bool hasNonPrivateConstructor() const | | bool hasNonPrivateConstructor() const | |
| { | | { | |
| return m_hasNonPrivateConstructor; | | return m_hasNonPrivateConstructor; | |
| } | | } | |
| | | | |
| skipping to change at line 1722 | | skipping to change at line 1733 | |
| void setTypeAlias(bool typeAlias) | | void setTypeAlias(bool typeAlias) | |
| { | | { | |
| m_isTypeAlias = typeAlias; | | m_isTypeAlias = typeAlias; | |
| } | | } | |
| | | | |
| bool isTypeAlias() const | | bool isTypeAlias() const | |
| { | | { | |
| return m_isTypeAlias; | | return m_isTypeAlias; | |
| } | | } | |
| | | | |
|
| | | void setStream(bool stream) | |
| | | { | |
| | | m_stream = stream; | |
| | | } | |
| | | | |
| | | bool isStream() const | |
| | | { | |
| | | return m_stream; | |
| | | } | |
| | | | |
| private: | | private: | |
| uint m_namespace : 1; | | uint m_namespace : 1; | |
| uint m_qobject : 1; | | uint m_qobject : 1; | |
| uint m_hasVirtuals : 1; | | uint m_hasVirtuals : 1; | |
| uint m_isPolymorphic : 1; | | uint m_isPolymorphic : 1; | |
| uint m_hasNonpublic : 1; | | uint m_hasNonpublic : 1; | |
| uint m_hasVirtualSlots : 1; | | uint m_hasVirtualSlots : 1; | |
| uint m_hasNonPrivateConstructor : 1; | | uint m_hasNonPrivateConstructor : 1; | |
| uint m_functionsFixed : 1; | | uint m_functionsFixed : 1; | |
| uint m_hasPrivateDestructor : 1; | | uint m_hasPrivateDestructor : 1; | |
| | | | |
| skipping to change at line 1762 | | skipping to change at line 1783 | |
| | | | |
| AbstractMetaFunctionList m_lessThanFunctions; | | AbstractMetaFunctionList m_lessThanFunctions; | |
| AbstractMetaFunctionList m_greaterThanFunctions; | | AbstractMetaFunctionList m_greaterThanFunctions; | |
| AbstractMetaFunctionList m_lessThanEqFunctions; | | AbstractMetaFunctionList m_lessThanEqFunctions; | |
| AbstractMetaFunctionList m_greaterThanEqFunctions; | | AbstractMetaFunctionList m_greaterThanEqFunctions; | |
| | | | |
| QStringList m_baseClassNames; | | QStringList m_baseClassNames; | |
| QList<TypeEntry *> m_templateArgs; | | QList<TypeEntry *> m_templateArgs; | |
| ComplexTypeEntry *m_typeEntry; | | ComplexTypeEntry *m_typeEntry; | |
| // FunctionModelItem m_qDebugStreamFunction; | | // FunctionModelItem m_qDebugStreamFunction; | |
|
| | | | |
| | | bool m_stream; | |
| }; | | }; | |
| | | | |
| class QPropertySpec | | class QPropertySpec | |
| { | | { | |
| public: | | public: | |
| QPropertySpec(const TypeEntry *type) | | QPropertySpec(const TypeEntry *type) | |
| : m_type(type), | | : m_type(type), | |
| m_index(-1) | | m_index(-1) | |
| {} | | {} | |
| | | | |
| | | | |
End of changes. 17 change blocks. |
| 11 lines changed or deleted | | 36 lines changed or added | |
|
| typesystem.h | | typesystem.h | |
| | | | |
| skipping to change at line 32 | | skipping to change at line 32 | |
| */ | | */ | |
| | | | |
| #ifndef TYPESYSTEM_H | | #ifndef TYPESYSTEM_H | |
| #define TYPESYSTEM_H | | #define TYPESYSTEM_H | |
| | | | |
| #include <QtCore/QHash> | | #include <QtCore/QHash> | |
| #include <QtCore/QString> | | #include <QtCore/QString> | |
| #include <QtCore/QStringList> | | #include <QtCore/QStringList> | |
| #include <QtCore/QMap> | | #include <QtCore/QMap> | |
| #include <QtCore/QDebug> | | #include <QtCore/QDebug> | |
|
| | | #include "apiextractormacros.h" | |
| | | | |
| class Indentor; | | class Indentor; | |
| | | | |
| class AbstractMetaType; | | class AbstractMetaType; | |
| class QTextStream; | | class QTextStream; | |
| | | | |
| class EnumTypeEntry; | | class EnumTypeEntry; | |
| class FlagsTypeEntry; | | class FlagsTypeEntry; | |
| | | | |
|
| extern QString strings_Object; | | struct APIEXTRACTOR_API Include | |
| extern QString strings_String; | | | |
| extern QString strings_Thread; | | | |
| extern QString strings_char; | | | |
| extern QString stringsJavaLang; | | | |
| extern QString strings_jchar; | | | |
| extern QString strings_jobject; | | | |
| | | | |
| struct Include | | | |
| { | | { | |
| enum IncludeType { | | enum IncludeType { | |
| IncludePath, | | IncludePath, | |
| LocalPath, | | LocalPath, | |
| TargetLangImport | | TargetLangImport | |
| }; | | }; | |
| | | | |
| Include() : type(IncludePath) {} | | Include() : type(IncludePath) {} | |
| Include(IncludeType t, const QString &nam) : type(t), name(nam) {}; | | Include(IncludeType t, const QString &nam) : type(t), name(nam) {}; | |
| | | | |
| | | | |
| skipping to change at line 147 | | skipping to change at line 140 | |
| Invalid = 0x00, | | Invalid = 0x00, | |
| Add = 0x01, | | Add = 0x01, | |
| Remove = 0x02 | | Remove = 0x02 | |
| }; | | }; | |
| ArgumentOwner() : action(ArgumentOwner::Invalid), index(-2) {} | | ArgumentOwner() : action(ArgumentOwner::Invalid), index(-2) {} | |
| | | | |
| Action action; | | Action action; | |
| int index; | | int index; | |
| }; | | }; | |
| | | | |
|
| class CodeSnipFragment | | class APIEXTRACTOR_API CodeSnipFragment | |
| { | | { | |
| private: | | private: | |
| const QString m_code; | | const QString m_code; | |
| TemplateInstance *m_instance; | | TemplateInstance *m_instance; | |
| | | | |
| public: | | public: | |
| CodeSnipFragment(const QString &code) | | CodeSnipFragment(const QString &code) | |
| : m_code(code), | | : m_code(code), | |
| m_instance(0) {} | | m_instance(0) {} | |
| | | | |
| CodeSnipFragment(TemplateInstance *instance) | | CodeSnipFragment(TemplateInstance *instance) | |
| : m_instance(instance) {} | | : m_instance(instance) {} | |
| | | | |
| QString code() const; | | QString code() const; | |
| }; | | }; | |
| | | | |
|
| class CodeSnipAbstract | | class APIEXTRACTOR_API CodeSnipAbstract | |
| { | | { | |
| public: | | public: | |
| QString code() const; | | QString code() const; | |
| | | | |
| void addCode(const QString &code) | | void addCode(const QString &code) | |
| { | | { | |
| codeList.append(new CodeSnipFragment(code)); | | codeList.append(new CodeSnipFragment(code)); | |
| } | | } | |
| | | | |
| void addTemplateInstance(TemplateInstance *ti) | | void addTemplateInstance(TemplateInstance *ti) | |
| | | | |
| skipping to change at line 233 | | skipping to change at line 226 | |
| QString name() const | | QString name() const | |
| { | | { | |
| return m_name; | | return m_name; | |
| } | | } | |
| | | | |
| private: | | private: | |
| const QString m_name; | | const QString m_name; | |
| QHash<QString, QString> replaceRules; | | QHash<QString, QString> replaceRules; | |
| }; | | }; | |
| | | | |
|
| class CodeSnip : public CodeSnipAbstract | | class APIEXTRACTOR_API CodeSnip : public CodeSnipAbstract | |
| { | | { | |
| public: | | public: | |
| enum Position { | | enum Position { | |
| Beginning, | | Beginning, | |
| End, | | End, | |
| AfterThis, | | AfterThis, | |
| // QtScript | | // QtScript | |
| Declaration, | | Declaration, | |
| PrototypeInitialization, | | PrototypeInitialization, | |
| ConstructorInitialization, | | ConstructorInitialization, | |
|
| Constructor | | Constructor, | |
| | | Any | |
| }; | | }; | |
| | | | |
| CodeSnip() : language(TypeSystem::TargetLangCode) { } | | CodeSnip() : language(TypeSystem::TargetLangCode) { } | |
| CodeSnip(TypeSystem::Language lang) : language(lang) { } | | CodeSnip(TypeSystem::Language lang) : language(lang) { } | |
| | | | |
| TypeSystem::Language language; | | TypeSystem::Language language; | |
| Position position; | | Position position; | |
| ArgumentMap argumentMap; | | ArgumentMap argumentMap; | |
| }; | | }; | |
| typedef QList<CodeSnip> CodeSnipList; | | typedef QList<CodeSnip> CodeSnipList; | |
| | | | |
| skipping to change at line 298 | | skipping to change at line 292 | |
| // The new definition of ownership for a specific argument | | // The new definition of ownership for a specific argument | |
| QHash<TypeSystem::Language, TypeSystem::Ownership> ownerships; | | QHash<TypeSystem::Language, TypeSystem::Ownership> ownerships; | |
| | | | |
| // Different conversion rules | | // Different conversion rules | |
| CodeSnipList conversion_rules; | | CodeSnipList conversion_rules; | |
| | | | |
| //QObject parent(owner) of this argument | | //QObject parent(owner) of this argument | |
| ArgumentOwner owner; | | ArgumentOwner owner; | |
| }; | | }; | |
| | | | |
|
| struct Modification | | struct APIEXTRACTOR_API Modification | |
| { | | { | |
| enum Modifiers { | | enum Modifiers { | |
| Private = 0x0001, | | Private = 0x0001, | |
| Protected = 0x0002, | | Protected = 0x0002, | |
| Public = 0x0003, | | Public = 0x0003, | |
| Friendly = 0x0004, | | Friendly = 0x0004, | |
| AccessModifierMask = 0x000f, | | AccessModifierMask = 0x000f, | |
| | | | |
| Final = 0x0010, | | Final = 0x0010, | |
| NonFinal = 0x0020, | | NonFinal = 0x0020, | |
| | | | |
| skipping to change at line 383 | | skipping to change at line 377 | |
| } | | } | |
| bool isRenameModifier() const | | bool isRenameModifier() const | |
| { | | { | |
| return modifiers & Rename; | | return modifiers & Rename; | |
| } | | } | |
| | | | |
| uint modifiers; | | uint modifiers; | |
| QString renamedToName; | | QString renamedToName; | |
| }; | | }; | |
| | | | |
|
| struct FunctionModification: public Modification | | struct APIEXTRACTOR_API FunctionModification: public Modification | |
| { | | { | |
| FunctionModification() : removal(TypeSystem::NoLanguage), m_thread(fals
e), m_allowThread(false) {} | | FunctionModification() : removal(TypeSystem::NoLanguage), m_thread(fals
e), m_allowThread(false) {} | |
| | | | |
| bool isCodeInjection() const | | bool isCodeInjection() const | |
| { | | { | |
| return modifiers & CodeInjection; | | return modifiers & CodeInjection; | |
| } | | } | |
| bool isRemoveModifier() const | | bool isRemoveModifier() const | |
| { | | { | |
| return removal != TypeSystem::NoLanguage; | | return removal != TypeSystem::NoLanguage; | |
| | | | |
| skipping to change at line 441 | | skipping to change at line 435 | |
| { | | { | |
| return modifiers & Readable; | | return modifiers & Readable; | |
| } | | } | |
| bool isWritable() const | | bool isWritable() const | |
| { | | { | |
| return modifiers & Writable; | | return modifiers & Writable; | |
| } | | } | |
| | | | |
| QString name; | | QString name; | |
| }; | | }; | |
|
| | | | |
| typedef QList<FieldModification> FieldModificationList; | | typedef QList<FieldModification> FieldModificationList; | |
| | | | |
|
| | | /** | |
| | | * \internal | |
| | | * Struct used to store information about functions added by the typesyste | |
| | | m. | |
| | | * This info will be used later to create a fake AbstractMetaFunction whic | |
| | | h | |
| | | * will be inserted into the right AbstractMetaClass. | |
| | | */ | |
| | | struct APIEXTRACTOR_API AddedFunction | |
| | | { | |
| | | /// Function access types. | |
| | | enum Access { | |
| | | Protected = 0x1, | |
| | | Public = 0x2 | |
| | | }; | |
| | | | |
| | | /** | |
| | | * \internal | |
| | | * Internal struct used to store information about arguments and retur | |
| | | n type of the | |
| | | * functions added by the type system. This information is later used | |
| | | to create | |
| | | * AbstractMetaType and AbstractMetaArgument for the AbstractMetaFunct | |
| | | ions. | |
| | | */ | |
| | | struct TypeInfo { | |
| | | TypeInfo() : isConstant(false), indirections(0), isReference(false) | |
| | | {} | |
| | | QString name; | |
| | | bool isConstant; | |
| | | int indirections; | |
| | | bool isReference; | |
| | | QString defaultValue; | |
| | | }; | |
| | | | |
| | | /// Creates a new AddedFunction with a signature and a return type. | |
| | | AddedFunction(QString signature, QString returnType); | |
| | | | |
| | | /// Returns the function name. | |
| | | QString name() const | |
| | | { | |
| | | return m_name; | |
| | | } | |
| | | | |
| | | /// Set the function access type. | |
| | | void setAccess(Access access) | |
| | | { | |
| | | m_access = access; | |
| | | } | |
| | | | |
| | | /// Returns the function access type. | |
| | | Access access() const | |
| | | { | |
| | | return m_access; | |
| | | } | |
| | | | |
| | | /// Returns the function return type. | |
| | | TypeInfo returnType() const | |
| | | { | |
| | | return m_returnType; | |
| | | } | |
| | | | |
| | | /// Returns a list of argument type infos. | |
| | | QList<TypeInfo> arguments() const | |
| | | { | |
| | | return m_arguments; | |
| | | } | |
| | | | |
| | | /// Returns true if this is a constant method. | |
| | | bool isConstant() const | |
| | | { | |
| | | return m_isConst; | |
| | | } | |
| | | | |
| | | private: | |
| | | QString m_name; | |
| | | Access m_access; | |
| | | QList<TypeInfo> m_arguments; | |
| | | TypeInfo m_returnType; | |
| | | bool m_isConst; | |
| | | }; | |
| | | typedef QList<AddedFunction> AddedFunctionList; | |
| | | | |
| struct ExpensePolicy | | struct ExpensePolicy | |
| { | | { | |
| ExpensePolicy() : limit(-1) {} | | ExpensePolicy() : limit(-1) {} | |
| int limit; | | int limit; | |
| QString cost; | | QString cost; | |
| bool isValid() const | | bool isValid() const | |
| { | | { | |
| return limit >= 0; | | return limit >= 0; | |
| } | | } | |
| }; | | }; | |
| | | | |
| skipping to change at line 505 | | skipping to change at line 577 | |
| | | | |
| private: | | private: | |
| Mode m_mode; | | Mode m_mode; | |
| QString m_code; | | QString m_code; | |
| QString m_xpath; | | QString m_xpath; | |
| QString m_signature; | | QString m_signature; | |
| }; | | }; | |
| | | | |
| typedef QList<DocModification> DocModificationList; | | typedef QList<DocModification> DocModificationList; | |
| | | | |
|
| class TypeEntry | | class APIEXTRACTOR_API TypeEntry | |
| { | | { | |
| public: | | public: | |
| enum Type { | | enum Type { | |
| PrimitiveType, | | PrimitiveType, | |
| VoidType, | | VoidType, | |
| FlagsType, | | FlagsType, | |
| EnumType, | | EnumType, | |
| TemplateArgumentType, | | TemplateArgumentType, | |
| ThreadType, | | ThreadType, | |
| BasicValueType, | | BasicValueType, | |
| | | | |
| skipping to change at line 527 | | skipping to change at line 599 | |
| ContainerType, | | ContainerType, | |
| InterfaceType, | | InterfaceType, | |
| ObjectType, | | ObjectType, | |
| NamespaceType, | | NamespaceType, | |
| VariantType, | | VariantType, | |
| JObjectWrapperType, | | JObjectWrapperType, | |
| CharType, | | CharType, | |
| ArrayType, | | ArrayType, | |
| TypeSystemType, | | TypeSystemType, | |
| CustomType, | | CustomType, | |
|
| | | TargetLangType | |
| }; | | }; | |
| | | | |
| enum CodeGeneration { | | enum CodeGeneration { | |
| GenerateTargetLang = 0x0001, | | GenerateTargetLang = 0x0001, | |
| GenerateCpp = 0x0002, | | GenerateCpp = 0x0002, | |
| GenerateForSubclass = 0x0004, | | GenerateForSubclass = 0x0004, | |
| | | | |
| GenerateNothing = 0, | | GenerateNothing = 0, | |
| GenerateAll = 0xffff, | | GenerateAll = 0xffff, | |
| GenerateCode = GenerateTargetLang | GenerateCpp | | GenerateCode = GenerateTargetLang | GenerateCpp | |
| }; | | }; | |
| | | | |
| TypeEntry(const QString &name, Type t) | | TypeEntry(const QString &name, Type t) | |
| : m_name(name), | | : m_name(name), | |
| m_type(t), | | m_type(t), | |
| m_codeGeneration(GenerateAll), | | m_codeGeneration(GenerateAll), | |
|
| m_preferredConversion(true) | | m_preferredConversion(true), | |
| | | m_stream(false) | |
| { | | { | |
| }; | | }; | |
| | | | |
| virtual ~TypeEntry() { } | | virtual ~TypeEntry() { } | |
| | | | |
| Type type() const | | Type type() const | |
| { | | { | |
| return m_type; | | return m_type; | |
| } | | } | |
| bool isPrimitive() const | | bool isPrimitive() const | |
| | | | |
| skipping to change at line 635 | | skipping to change at line 709 | |
| | | | |
| virtual bool preferredConversion() const | | virtual bool preferredConversion() const | |
| { | | { | |
| return m_preferredConversion; | | return m_preferredConversion; | |
| } | | } | |
| virtual void setPreferredConversion(bool b) | | virtual void setPreferredConversion(bool b) | |
| { | | { | |
| m_preferredConversion = b; | | m_preferredConversion = b; | |
| } | | } | |
| | | | |
|
| | | bool stream() const | |
| | | { | |
| | | return m_stream; | |
| | | } | |
| | | | |
| | | void setStream(bool b) | |
| | | { | |
| | | m_stream = b; | |
| | | } | |
| | | | |
| // The type's name in C++, fully qualified | | // The type's name in C++, fully qualified | |
| QString name() const | | QString name() const | |
| { | | { | |
| return m_name; | | return m_name; | |
| } | | } | |
| | | | |
| uint codeGeneration() const | | uint codeGeneration() const | |
| { | | { | |
| return m_codeGeneration; | | return m_codeGeneration; | |
| } | | } | |
| | | | |
| skipping to change at line 790 | | skipping to change at line 874 | |
| | | | |
| Include include() const | | Include include() const | |
| { | | { | |
| return m_include; | | return m_include; | |
| } | | } | |
| void setInclude(const Include &inc) | | void setInclude(const Include &inc) | |
| { | | { | |
| m_include = inc; | | m_include = inc; | |
| } | | } | |
| | | | |
|
| | | /// Set the type convertion rule | |
| | | void setConversionRule(const QString& conversionRule) | |
| | | { | |
| | | m_conversionRule = conversionRule; | |
| | | } | |
| | | | |
| | | /// Returns the type convertion rule | |
| | | QString conversionRule() const | |
| | | { | |
| | | return m_conversionRule; | |
| | | } | |
| | | | |
| | | /// Returns true if there are any conversiton rule for this type, false | |
| | | otherwise. | |
| | | bool hasConversionRule() const | |
| | | { | |
| | | return !m_conversionRule.isEmpty(); | |
| | | } | |
| | | | |
| private: | | private: | |
| QString m_name; | | QString m_name; | |
| Type m_type; | | Type m_type; | |
| uint m_codeGeneration; | | uint m_codeGeneration; | |
| CustomFunction m_customConstructor; | | CustomFunction m_customConstructor; | |
| CustomFunction m_customDestructor; | | CustomFunction m_customDestructor; | |
| bool m_preferredConversion; | | bool m_preferredConversion; | |
| CodeSnipList m_codeSnips; | | CodeSnipList m_codeSnips; | |
| DocModificationList m_docModifications; | | DocModificationList m_docModifications; | |
| IncludeList m_extraIncludes; | | IncludeList m_extraIncludes; | |
| Include m_include; | | Include m_include; | |
| QHash<QString, bool> m_includesUsed; | | QHash<QString, bool> m_includesUsed; | |
|
| | | QString m_conversionRule; | |
| | | bool m_stream; | |
| }; | | }; | |
| typedef QHash<QString, QList<TypeEntry *> > TypeEntryHash; | | typedef QHash<QString, QList<TypeEntry *> > TypeEntryHash; | |
| typedef QHash<QString, TypeEntry *> SingleTypeEntryHash; | | typedef QHash<QString, TypeEntry *> SingleTypeEntryHash; | |
| | | | |
|
| class TypeSystemTypeEntry : public TypeEntry | | class APIEXTRACTOR_API TypeSystemTypeEntry : public TypeEntry | |
| { | | { | |
| public: | | public: | |
| TypeSystemTypeEntry(const QString &name) | | TypeSystemTypeEntry(const QString &name) | |
| : TypeEntry(name, TypeSystemType) | | : TypeEntry(name, TypeSystemType) | |
| { | | { | |
| }; | | }; | |
| }; | | }; | |
| | | | |
|
| class ThreadTypeEntry : public TypeEntry | | class APIEXTRACTOR_API VoidTypeEntry : public TypeEntry | |
| { | | | |
| public: | | | |
| ThreadTypeEntry() : TypeEntry("QThread", ThreadType) | | | |
| { | | | |
| setCodeGeneration(GenerateNothing); | | | |
| } | | | |
| | | | |
| QString targetLangApiName() const | | | |
| { | | | |
| return strings_jobject; | | | |
| } | | | |
| QString targetLangName() const | | | |
| { | | | |
| return strings_Thread; | | | |
| } | | | |
| QString targetLangPackage() const | | | |
| { | | | |
| return stringsJavaLang; | | | |
| } | | | |
| }; | | | |
| | | | |
| class VoidTypeEntry : public TypeEntry | | | |
| { | | { | |
| public: | | public: | |
| VoidTypeEntry() : TypeEntry("void", VoidType) { } | | VoidTypeEntry() : TypeEntry("void", VoidType) { } | |
| }; | | }; | |
| | | | |
|
| class TemplateArgumentEntry : public TypeEntry | | class APIEXTRACTOR_API TemplateArgumentEntry : public TypeEntry | |
| { | | { | |
| public: | | public: | |
| TemplateArgumentEntry(const QString &name) | | TemplateArgumentEntry(const QString &name) | |
| : TypeEntry(name, TemplateArgumentType), m_ordinal(0) | | : TypeEntry(name, TemplateArgumentType), m_ordinal(0) | |
| { | | { | |
| } | | } | |
| | | | |
| int ordinal() const | | int ordinal() const | |
| { | | { | |
| return m_ordinal; | | return m_ordinal; | |
| } | | } | |
| void setOrdinal(int o) | | void setOrdinal(int o) | |
| { | | { | |
| m_ordinal = o; | | m_ordinal = o; | |
| } | | } | |
| | | | |
| private: | | private: | |
| int m_ordinal; | | int m_ordinal; | |
| }; | | }; | |
| | | | |
|
| class ArrayTypeEntry : public TypeEntry | | class APIEXTRACTOR_API ArrayTypeEntry : public TypeEntry | |
| { | | { | |
| public: | | public: | |
| ArrayTypeEntry(const TypeEntry *nested_type) | | ArrayTypeEntry(const TypeEntry *nested_type) | |
| : TypeEntry("Array", ArrayType), m_nestedType(nested_type) | | : TypeEntry("Array", ArrayType), m_nestedType(nested_type) | |
| { | | { | |
| Q_ASSERT(m_nestedType); | | Q_ASSERT(m_nestedType); | |
| } | | } | |
| | | | |
| void setNestedTypeEntry(TypeEntry *nested) | | void setNestedTypeEntry(TypeEntry *nested) | |
| { | | { | |
| | | | |
| skipping to change at line 898 | | skipping to change at line 980 | |
| if (m_nestedType->isPrimitive()) | | if (m_nestedType->isPrimitive()) | |
| return m_nestedType->targetLangApiName() + "Array"; | | return m_nestedType->targetLangApiName() + "Array"; | |
| else | | else | |
| return "jobjectArray"; | | return "jobjectArray"; | |
| } | | } | |
| | | | |
| private: | | private: | |
| const TypeEntry *m_nestedType; | | const TypeEntry *m_nestedType; | |
| }; | | }; | |
| | | | |
|
| class PrimitiveTypeEntry : public TypeEntry | | class APIEXTRACTOR_API PrimitiveTypeEntry : public TypeEntry | |
| { | | { | |
| public: | | public: | |
| PrimitiveTypeEntry(const QString &name) | | PrimitiveTypeEntry(const QString &name) | |
| : TypeEntry(name, PrimitiveType), | | : TypeEntry(name, PrimitiveType), | |
| m_preferredConversion(true), | | m_preferredConversion(true), | |
| m_preferredTargetLangType(true), | | m_preferredTargetLangType(true), | |
| m_aliasedTypeEntry(0) | | m_aliasedTypeEntry(0) | |
| { | | { | |
| } | | } | |
| | | | |
| | | | |
| skipping to change at line 957 | | skipping to change at line 1039 | |
| * /return the most basic non-aliased primitive type represented | | * /return the most basic non-aliased primitive type represented | |
| * by this typedef | | * by this typedef | |
| */ | | */ | |
| PrimitiveTypeEntry* basicAliasedTypeEntry() const; | | PrimitiveTypeEntry* basicAliasedTypeEntry() const; | |
| | | | |
| QString javaObjectFullName() const | | QString javaObjectFullName() const | |
| { | | { | |
| return javaObjectPackage() + "." + javaObjectName(); | | return javaObjectPackage() + "." + javaObjectName(); | |
| } | | } | |
| QString javaObjectName() const; | | QString javaObjectName() const; | |
|
| QString javaObjectPackage() const | | QString javaObjectPackage() const; | |
| { | | | |
| return stringsJavaLang; | | | |
| } | | | |
| | | | |
| virtual bool preferredConversion() const | | virtual bool preferredConversion() const | |
| { | | { | |
| return m_preferredConversion; | | return m_preferredConversion; | |
| } | | } | |
| virtual void setPreferredConversion(bool b) | | virtual void setPreferredConversion(bool b) | |
| { | | { | |
| m_preferredConversion = b; | | m_preferredConversion = b; | |
| } | | } | |
| | | | |
| | | | |
| skipping to change at line 1001 | | skipping to change at line 1080 | |
| { | | { | |
| EnumValueRedirection(const QString &rej, const QString &us) | | EnumValueRedirection(const QString &rej, const QString &us) | |
| : rejected(rej), | | : rejected(rej), | |
| used(us) | | used(us) | |
| { | | { | |
| } | | } | |
| QString rejected; | | QString rejected; | |
| QString used; | | QString used; | |
| }; | | }; | |
| | | | |
|
| class EnumTypeEntry : public TypeEntry | | class APIEXTRACTOR_API EnumTypeEntry : public TypeEntry | |
| { | | { | |
| public: | | public: | |
| EnumTypeEntry(const QString &nspace, const QString &enumName) | | EnumTypeEntry(const QString &nspace, const QString &enumName) | |
| : TypeEntry(nspace.isEmpty() ? enumName : nspace + QLatin1Strin
g("::") + enumName, | | : TypeEntry(nspace.isEmpty() ? enumName : nspace + QLatin1Strin
g("::") + enumName, | |
| EnumType), | | EnumType), | |
| m_flags(0), | | m_flags(0), | |
| m_extensible(false) | | m_extensible(false) | |
| { | | { | |
| m_qualifier = nspace; | | m_qualifier = nspace; | |
| m_targetLangName = enumName; | | m_targetLangName = enumName; | |
| | | | |
| skipping to change at line 1142 | | skipping to change at line 1221 | |
| | | | |
| QStringList m_rejectedEnums; | | QStringList m_rejectedEnums; | |
| QList<EnumValueRedirection> m_enumRedirections; | | QList<EnumValueRedirection> m_enumRedirections; | |
| | | | |
| FlagsTypeEntry *m_flags; | | FlagsTypeEntry *m_flags; | |
| | | | |
| bool m_extensible; | | bool m_extensible; | |
| bool m_forceInteger; | | bool m_forceInteger; | |
| }; | | }; | |
| | | | |
|
| class FlagsTypeEntry : public TypeEntry | | class APIEXTRACTOR_API FlagsTypeEntry : public TypeEntry | |
| { | | { | |
| public: | | public: | |
| FlagsTypeEntry(const QString &name) : TypeEntry(name, FlagsType), m_enu
m(0) | | FlagsTypeEntry(const QString &name) : TypeEntry(name, FlagsType), m_enu
m(0) | |
| { | | { | |
| } | | } | |
| | | | |
| QString qualifiedTargetLangName() const; | | QString qualifiedTargetLangName() const; | |
| QString targetLangName() const | | QString targetLangName() const | |
| { | | { | |
| return m_targetLangName; | | return m_targetLangName; | |
| | | | |
| skipping to change at line 1203 | | skipping to change at line 1282 | |
| { | | { | |
| return m_enum->targetLangPackage(); | | return m_enum->targetLangPackage(); | |
| } | | } | |
| | | | |
| private: | | private: | |
| QString m_originalName; | | QString m_originalName; | |
| QString m_targetLangName; | | QString m_targetLangName; | |
| EnumTypeEntry *m_enum; | | EnumTypeEntry *m_enum; | |
| }; | | }; | |
| | | | |
|
| class ComplexTypeEntry : public TypeEntry | | class APIEXTRACTOR_API ComplexTypeEntry : public TypeEntry | |
| { | | { | |
| public: | | public: | |
| enum TypeFlag { | | enum TypeFlag { | |
| ForceAbstract = 0x1, | | ForceAbstract = 0x1, | |
| DeleteInMainThread = 0x2, | | DeleteInMainThread = 0x2, | |
| Deprecated = 0x4 | | Deprecated = 0x4 | |
| }; | | }; | |
| typedef QFlags<TypeFlag> TypeFlags; | | typedef QFlags<TypeFlag> TypeFlags; | |
| | | | |
| enum CopyableFlag { | | enum CopyableFlag { | |
| | | | |
| skipping to change at line 1241 | | skipping to change at line 1320 | |
| bool isComplex() const | | bool isComplex() const | |
| { | | { | |
| return true; | | return true; | |
| } | | } | |
| | | | |
| ComplexTypeEntry *copy() const | | ComplexTypeEntry *copy() const | |
| { | | { | |
| ComplexTypeEntry *centry = new ComplexTypeEntry(name(), type()); | | ComplexTypeEntry *centry = new ComplexTypeEntry(name(), type()); | |
| centry->setInclude(include()); | | centry->setInclude(include()); | |
| centry->setExtraIncludes(extraIncludes()); | | centry->setExtraIncludes(extraIncludes()); | |
|
| | | centry->setAddedFunctions(addedFunctions()); | |
| centry->setFunctionModifications(functionModifications()); | | centry->setFunctionModifications(functionModifications()); | |
| centry->setFieldModifications(fieldModifications()); | | centry->setFieldModifications(fieldModifications()); | |
| centry->setQObject(isQObject()); | | centry->setQObject(isQObject()); | |
| centry->setDefaultSuperclass(defaultSuperclass()); | | centry->setDefaultSuperclass(defaultSuperclass()); | |
| centry->setCodeSnips(codeSnips()); | | centry->setCodeSnips(codeSnips()); | |
| centry->setTargetLangPackage(targetLangPackage()); | | centry->setTargetLangPackage(targetLangPackage()); | |
| | | | |
| return centry; | | return centry; | |
| } | | } | |
| | | | |
| void setLookupName(const QString &name) | | void setLookupName(const QString &name) | |
| { | | { | |
| m_lookupName = name; | | m_lookupName = name; | |
| } | | } | |
| | | | |
| virtual QString lookupName() const | | virtual QString lookupName() const | |
| { | | { | |
| return m_lookupName.isEmpty() ? targetLangName() : m_lookupName; | | return m_lookupName.isEmpty() ? targetLangName() : m_lookupName; | |
| } | | } | |
| | | | |
|
| QString targetLangApiName() const | | QString targetLangApiName() const; | |
| { | | | |
| return strings_jobject; | | | |
| } | | | |
| | | | |
| void setTypeFlags(TypeFlags flags) | | void setTypeFlags(TypeFlags flags) | |
| { | | { | |
| m_typeFlags = flags; | | m_typeFlags = flags; | |
| } | | } | |
| | | | |
| TypeFlags typeFlags() const | | TypeFlags typeFlags() const | |
| { | | { | |
| return m_typeFlags; | | return m_typeFlags; | |
| } | | } | |
| | | | |
| skipping to change at line 1290 | | skipping to change at line 1367 | |
| void setFunctionModifications(const FunctionModificationList &functionM
odifications) | | void setFunctionModifications(const FunctionModificationList &functionM
odifications) | |
| { | | { | |
| m_functionMods = functionModifications; | | m_functionMods = functionModifications; | |
| } | | } | |
| void addFunctionModification(const FunctionModification &functionModifi
cation) | | void addFunctionModification(const FunctionModification &functionModifi
cation) | |
| { | | { | |
| m_functionMods << functionModification; | | m_functionMods << functionModification; | |
| } | | } | |
| FunctionModificationList functionModifications(const QString &signature
) const; | | FunctionModificationList functionModifications(const QString &signature
) const; | |
| | | | |
|
| | | AddedFunctionList addedFunctions() const | |
| | | { | |
| | | return m_addedFunctions; | |
| | | } | |
| | | void setAddedFunctions(const AddedFunctionList &addedFunctions) | |
| | | { | |
| | | m_addedFunctions = addedFunctions; | |
| | | } | |
| | | void addNewFunction(const AddedFunction &addedFunction) | |
| | | { | |
| | | m_addedFunctions << addedFunction; | |
| | | } | |
| | | | |
| FieldModification fieldModification(const QString &name) const; | | FieldModification fieldModification(const QString &name) const; | |
| void setFieldModifications(const FieldModificationList &mods) | | void setFieldModifications(const FieldModificationList &mods) | |
| { | | { | |
| m_fieldMods = mods; | | m_fieldMods = mods; | |
| } | | } | |
| FieldModificationList fieldModifications() const | | FieldModificationList fieldModifications() const | |
| { | | { | |
| return m_fieldMods; | | return m_fieldMods; | |
| } | | } | |
| | | | |
| | | | |
| skipping to change at line 1416 | | skipping to change at line 1506 | |
| QString hashFunction() const | | QString hashFunction() const | |
| { | | { | |
| return m_hashFunction; | | return m_hashFunction; | |
| } | | } | |
| void setHashFunction(QString hashFunction) | | void setHashFunction(QString hashFunction) | |
| { | | { | |
| m_hashFunction = hashFunction; | | m_hashFunction = hashFunction; | |
| } | | } | |
| | | | |
| private: | | private: | |
|
| | | AddedFunctionList m_addedFunctions; | |
| FunctionModificationList m_functionMods; | | FunctionModificationList m_functionMods; | |
| FieldModificationList m_fieldMods; | | FieldModificationList m_fieldMods; | |
| QString m_package; | | QString m_package; | |
| QString m_defaultSuperclass; | | QString m_defaultSuperclass; | |
| QString m_qualifiedCppName; | | QString m_qualifiedCppName; | |
| QString m_targetLangName; | | QString m_targetLangName; | |
| | | | |
| uint m_qobject : 1; | | uint m_qobject : 1; | |
| uint m_polymorphicBase : 1; | | uint m_polymorphicBase : 1; | |
| uint m_genericClass : 1; | | uint m_genericClass : 1; | |
| | | | |
| skipping to change at line 1437 | | skipping to change at line 1528 | |
| QString m_polymorphicIdValue; | | QString m_polymorphicIdValue; | |
| QString m_heldTypeValue; | | QString m_heldTypeValue; | |
| QString m_lookupName; | | QString m_lookupName; | |
| QString m_targetType; | | QString m_targetType; | |
| ExpensePolicy m_expensePolicy; | | ExpensePolicy m_expensePolicy; | |
| TypeFlags m_typeFlags; | | TypeFlags m_typeFlags; | |
| CopyableFlag m_copyableFlag; | | CopyableFlag m_copyableFlag; | |
| QString m_hashFunction; | | QString m_hashFunction; | |
| }; | | }; | |
| | | | |
|
| class ContainerTypeEntry : public ComplexTypeEntry | | class APIEXTRACTOR_API ContainerTypeEntry : public ComplexTypeEntry | |
| { | | { | |
| public: | | public: | |
| enum Type { | | enum Type { | |
| NoContainer, | | NoContainer, | |
| ListContainer, | | ListContainer, | |
| StringListContainer, | | StringListContainer, | |
| LinkedListContainer, | | LinkedListContainer, | |
| VectorContainer, | | VectorContainer, | |
| StackContainer, | | StackContainer, | |
| QueueContainer, | | QueueContainer, | |
| | | | |
| skipping to change at line 1496 | | skipping to change at line 1587 | |
| } | | } | |
| return m_stringToContainerType.value(typeName, NoContainer); | | return m_stringToContainerType.value(typeName, NoContainer); | |
| } | | } | |
| | | | |
| private: | | private: | |
| Type m_type; | | Type m_type; | |
| }; | | }; | |
| | | | |
| typedef QList<const ContainerTypeEntry*> ContainerTypeEntryList; | | typedef QList<const ContainerTypeEntry*> ContainerTypeEntryList; | |
| | | | |
|
| class NamespaceTypeEntry : public ComplexTypeEntry | | class APIEXTRACTOR_API NamespaceTypeEntry : public ComplexTypeEntry | |
| { | | { | |
| public: | | public: | |
| NamespaceTypeEntry(const QString &name) : ComplexTypeEntry(name, Namesp
aceType) { } | | NamespaceTypeEntry(const QString &name) : ComplexTypeEntry(name, Namesp
aceType) { } | |
| }; | | }; | |
| | | | |
| class ValueTypeEntry : public ComplexTypeEntry | | class ValueTypeEntry : public ComplexTypeEntry | |
| { | | { | |
| public: | | public: | |
| ValueTypeEntry(const QString &name) : ComplexTypeEntry(name, BasicValue
Type) { } | | ValueTypeEntry(const QString &name) : ComplexTypeEntry(name, BasicValue
Type) { } | |
| | | | |
| | | | |
| skipping to change at line 1530 | | skipping to change at line 1621 | |
| | | | |
| class StringTypeEntry : public ValueTypeEntry | | class StringTypeEntry : public ValueTypeEntry | |
| { | | { | |
| public: | | public: | |
| StringTypeEntry(const QString &name) | | StringTypeEntry(const QString &name) | |
| : ValueTypeEntry(name, StringType) | | : ValueTypeEntry(name, StringType) | |
| { | | { | |
| setCodeGeneration(GenerateNothing); | | setCodeGeneration(GenerateNothing); | |
| } | | } | |
| | | | |
|
| QString targetLangApiName() const | | QString targetLangApiName() const; | |
| { | | QString targetLangName() const; | |
| return strings_jobject; | | QString targetLangPackage() const; | |
| } | | | |
| QString targetLangName() const | | | |
| { | | | |
| return strings_String; | | | |
| } | | | |
| QString targetLangPackage() const | | | |
| { | | | |
| return stringsJavaLang; | | | |
| } | | | |
| | | | |
| virtual bool isNativeIdBased() const | | virtual bool isNativeIdBased() const | |
| { | | { | |
| return false; | | return false; | |
| } | | } | |
| }; | | }; | |
| | | | |
| class CharTypeEntry : public ValueTypeEntry | | class CharTypeEntry : public ValueTypeEntry | |
| { | | { | |
| public: | | public: | |
| CharTypeEntry(const QString &name) : ValueTypeEntry(name, CharType) | | CharTypeEntry(const QString &name) : ValueTypeEntry(name, CharType) | |
| { | | { | |
| setCodeGeneration(GenerateNothing); | | setCodeGeneration(GenerateNothing); | |
| } | | } | |
| | | | |
|
| QString targetLangApiName() const | | QString targetLangApiName() const; | |
| { | | QString targetLangName() const; | |
| return strings_jchar; | | | |
| } | | | |
| QString targetLangName() const | | | |
| { | | | |
| return strings_char; | | | |
| } | | | |
| QString targetLangPackage() const | | QString targetLangPackage() const | |
| { | | { | |
| return QString(); | | return QString(); | |
| } | | } | |
| | | | |
| virtual bool isNativeIdBased() const | | virtual bool isNativeIdBased() const | |
| { | | { | |
| return false; | | return false; | |
| } | | } | |
| }; | | }; | |
| | | | |
|
| class JObjectWrapperTypeEntry: public ValueTypeEntry | | | |
| { | | | |
| public: | | | |
| JObjectWrapperTypeEntry(const QString &name) : ValueTypeEntry(name, JOb | | | |
| jectWrapperType) { } | | | |
| | | | |
| QString targetLangApiName() const | | | |
| { | | | |
| return strings_jobject; | | | |
| } | | | |
| QString targetLangName() const | | | |
| { | | | |
| return strings_Object; | | | |
| } | | | |
| QString targetLangPackage() const | | | |
| { | | | |
| return stringsJavaLang; | | | |
| } | | | |
| | | | |
| bool isNativeIdBased() const | | | |
| { | | | |
| return false; | | | |
| } | | | |
| }; | | | |
| | | | |
| class VariantTypeEntry: public ValueTypeEntry | | class VariantTypeEntry: public ValueTypeEntry | |
| { | | { | |
| public: | | public: | |
| VariantTypeEntry(const QString &name) : ValueTypeEntry(name, VariantTyp
e) { } | | VariantTypeEntry(const QString &name) : ValueTypeEntry(name, VariantTyp
e) { } | |
| | | | |
|
| QString targetLangApiName() const | | QString targetLangApiName() const; | |
| { | | QString targetLangName() const; | |
| return strings_jobject; | | QString targetLangPackage() const; | |
| } | | | |
| QString targetLangName() const | | | |
| { | | | |
| return strings_Object; | | | |
| } | | | |
| QString targetLangPackage() const | | | |
| { | | | |
| return stringsJavaLang; | | | |
| } | | | |
| | | | |
| virtual bool isNativeIdBased() const | | virtual bool isNativeIdBased() const | |
| { | | { | |
| return false; | | return false; | |
| } | | } | |
| }; | | }; | |
| | | | |
|
| class InterfaceTypeEntry : public ComplexTypeEntry | | class APIEXTRACTOR_API InterfaceTypeEntry : public ComplexTypeEntry | |
| { | | { | |
| public: | | public: | |
| InterfaceTypeEntry(const QString &name) | | InterfaceTypeEntry(const QString &name) | |
| : ComplexTypeEntry(name, InterfaceType) {} | | : ComplexTypeEntry(name, InterfaceType) {} | |
| | | | |
| static QString interfaceName(const QString &name) | | static QString interfaceName(const QString &name) | |
| { | | { | |
| return name + "Interface"; | | return name + "Interface"; | |
| } | | } | |
| | | | |
| | | | |
| skipping to change at line 1657 | | skipping to change at line 1700 | |
| } | | } | |
| virtual QString qualifiedCppName() const | | virtual QString qualifiedCppName() const | |
| { | | { | |
| return ComplexTypeEntry::qualifiedCppName().left(ComplexTypeEntry::
qualifiedCppName().length() - interfaceName("").length()); | | return ComplexTypeEntry::qualifiedCppName().left(ComplexTypeEntry::
qualifiedCppName().length() - interfaceName("").length()); | |
| } | | } | |
| | | | |
| private: | | private: | |
| ObjectTypeEntry *m_origin; | | ObjectTypeEntry *m_origin; | |
| }; | | }; | |
| | | | |
|
| class ObjectTypeEntry : public ComplexTypeEntry | | class APIEXTRACTOR_API ObjectTypeEntry : public ComplexTypeEntry | |
| { | | { | |
| public: | | public: | |
| ObjectTypeEntry(const QString &name) | | ObjectTypeEntry(const QString &name) | |
| : ComplexTypeEntry(name, ObjectType), m_interface(0) {} | | : ComplexTypeEntry(name, ObjectType), m_interface(0) {} | |
| | | | |
| InterfaceTypeEntry *designatedInterface() const | | InterfaceTypeEntry *designatedInterface() const | |
| { | | { | |
| return m_interface; | | return m_interface; | |
| } | | } | |
| void setDesignatedInterface(InterfaceTypeEntry *entry) | | void setDesignatedInterface(InterfaceTypeEntry *entry) | |
| | | | |
| skipping to change at line 1681 | | skipping to change at line 1724 | |
| | | | |
| virtual bool isNativeIdBased() const | | virtual bool isNativeIdBased() const | |
| { | | { | |
| return true; | | return true; | |
| } | | } | |
| | | | |
| private: | | private: | |
| InterfaceTypeEntry *m_interface; | | InterfaceTypeEntry *m_interface; | |
| }; | | }; | |
| | | | |
|
| class CustomTypeEntry : public ComplexTypeEntry | | | |
| { | | | |
| public: | | | |
| CustomTypeEntry(const QString &name) : ComplexTypeEntry(name, CustomTyp | | | |
| e) {} | | | |
| | | | |
| virtual void generateCppTargetLangToQt(QTextStream &s, | | | |
| const AbstractMetaType* targetLa | | | |
| ngType, | | | |
| const QString &envName, | | | |
| const QString &qtName, | | | |
| const QString &targetLangName) c | | | |
| onst = 0; | | | |
| | | | |
| virtual void generateCppQtToTargetLang(QTextStream &s, | | | |
| const AbstractMetaType* targetLa | | | |
| ngType, | | | |
| const QString &envName, | | | |
| const QString &qtName, | | | |
| const QString &targetLangName) c | | | |
| onst = 0; | | | |
| }; | | | |
| | | | |
| struct TypeRejection | | struct TypeRejection | |
| { | | { | |
| QString class_name; | | QString class_name; | |
| QString function_name; | | QString function_name; | |
| QString field_name; | | QString field_name; | |
| QString enum_name; | | QString enum_name; | |
| }; | | }; | |
| | | | |
|
| class TypeDatabase | | class APIEXTRACTOR_API TypeDatabase | |
| { | | { | |
| TypeDatabase(); | | TypeDatabase(); | |
| TypeDatabase(const TypeDatabase&); | | TypeDatabase(const TypeDatabase&); | |
| TypeDatabase& operator=(const TypeDatabase&); | | TypeDatabase& operator=(const TypeDatabase&); | |
| public: | | public: | |
| | | | |
| /** | | /** | |
| * Return the type system instance. | | * Return the type system instance. | |
| * \param newInstance This parameter is usefull just for unit testing, b
ecause singletons causes | | * \param newInstance This parameter is usefull just for unit testing, b
ecause singletons causes | |
| * too many side effects on unit testing. | | * too many side effects on unit testing. | |
| | | | |
End of changes. 39 change blocks. |
| 140 lines changed or deleted | | 166 lines changed or added | |
|