abstractmetalang.h | abstractmetalang.h | |||
---|---|---|---|---|
skipping to change at line 321 | skipping to change at line 321 | |||
EnumPattern, | EnumPattern, | |||
ValuePattern, | ValuePattern, | |||
StringPattern, | StringPattern, | |||
CharPattern, | CharPattern, | |||
ObjectPattern, | ObjectPattern, | |||
QObjectPattern, | QObjectPattern, | |||
ValuePointerPattern, | ValuePointerPattern, | |||
NativePointerPattern, | NativePointerPattern, | |||
ContainerPattern, | ContainerPattern, | |||
VariantPattern, | VariantPattern, | |||
VarargsPattern, | ||||
JObjectWrapperPattern, | JObjectWrapperPattern, | |||
ArrayPattern, | ArrayPattern, | |||
ThreadPattern | ThreadPattern | |||
}; | }; | |||
AbstractMetaType() : | AbstractMetaType() : | |||
m_typeEntry(0), | m_typeEntry(0), | |||
m_arrayElementCount(0), | m_arrayElementCount(0), | |||
m_arrayElementType(0), | m_arrayElementType(0), | |||
m_originalTemplateType(0), | m_originalTemplateType(0), | |||
skipping to change at line 457 | skipping to change at line 458 | |||
{ | { | |||
return m_pattern == CharPattern; | return m_pattern == CharPattern; | |||
} | } | |||
// return true if the type was originally a QVariant or const QVariant & | // return true if the type was originally a QVariant or const QVariant & | |||
bool isVariant() const | bool isVariant() const | |||
{ | { | |||
return m_pattern == VariantPattern; | return m_pattern == VariantPattern; | |||
} | } | |||
// return true if the type was originally a varargs | ||||
bool isVarargs() const | ||||
{ | ||||
return m_pattern == VarargsPattern; | ||||
} | ||||
// return true if the type was originally a JObjectWrapper or const JOb jectWrapper & | // return true if the type was originally a JObjectWrapper or const JOb jectWrapper & | |||
bool isJObjectWrapper() const | bool isJObjectWrapper() const | |||
{ | { | |||
return m_pattern == JObjectWrapperPattern; | return m_pattern == JObjectWrapperPattern; | |||
} | } | |||
// returns true if the type was used as a container | // returns true if the type was used as a container | |||
bool isContainer() const | bool isContainer() const | |||
{ | { | |||
return m_pattern == ContainerPattern; | return m_pattern == ContainerPattern; | |||
skipping to change at line 741 | skipping to change at line 748 | |||
class APIEXTRACTOR_API 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 772 | skipping to change at line 778 | |||
: m_functionType(NormalFunction), | : m_functionType(NormalFunction), | |||
m_type(0), | m_type(0), | |||
m_class(0), | m_class(0), | |||
m_implementingClass(0), | m_implementingClass(0), | |||
m_declaringClass(0), | m_declaringClass(0), | |||
m_interfaceClass(0), | m_interfaceClass(0), | |||
m_propertySpec(0), | m_propertySpec(0), | |||
m_constant(false), | m_constant(false), | |||
m_invalid(false), | m_invalid(false), | |||
m_reverse(false), | m_reverse(false), | |||
m_userAdded(false), | ||||
m_explicit(false) | m_explicit(false) | |||
{ | { | |||
} | } | |||
~AbstractMetaFunction(); | ~AbstractMetaFunction(); | |||
QString name() const | QString name() const | |||
{ | { | |||
return m_name; | return m_name; | |||
} | } | |||
skipping to change at line 1000 | skipping to change at line 1007 | |||
bool isConstant() const | bool isConstant() const | |||
{ | { | |||
return m_constant; | return m_constant; | |||
} | } | |||
void setConstant(bool constant) | void setConstant(bool constant) | |||
{ | { | |||
m_constant = constant; | m_constant = constant; | |||
} | } | |||
/// Returns true if the AbstractMetaFunction was added by the user via | ||||
the type system description. | ||||
bool isUserAdded() const | ||||
{ | ||||
return m_userAdded; | ||||
} | ||||
void setUserAdded(bool userAdded) | ||||
{ | ||||
m_userAdded = userAdded; | ||||
} | ||||
QString toString() const | QString toString() const | |||
{ | { | |||
return m_name; | return m_name; | |||
} | } | |||
uint compareTo(const AbstractMetaFunction *other) const; | uint compareTo(const AbstractMetaFunction *other) const; | |||
bool operator <(const AbstractMetaFunction &a) const; | bool operator <(const AbstractMetaFunction &a) const; | |||
AbstractMetaFunction *copy() const; | AbstractMetaFunction *copy() const; | |||
skipping to change at line 1051 | skipping to change at line 1068 | |||
* \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. | * Returns a list of code snips for this function. | |||
* The code snips can be filtered by position and language. | * The code snips can be filtered by position and language. | |||
* \return list of code snips | * \return list of code snips | |||
*/ | */ | |||
CodeSnipList injectedCodeSnips(CodeSnip::Position position = CodeSnip:: Any, | CodeSnipList injectedCodeSnips(CodeSnip::Position position = CodeSnip:: Any, | |||
TypeSystem::Language language = TypeSyst em::All) const; | 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 = 0) 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 | |||
{ | { | |||
return m_interfaceClass; | return m_interfaceClass; | |||
} | } | |||
void setInterfaceClass(const AbstractMetaClass *cl) | void setInterfaceClass(const AbstractMetaClass *cl) | |||
{ | { | |||
skipping to change at line 1098 | skipping to change at line 1116 | |||
AbstractMetaType *m_type; | AbstractMetaType *m_type; | |||
const AbstractMetaClass *m_class; | const AbstractMetaClass *m_class; | |||
const AbstractMetaClass *m_implementingClass; | const AbstractMetaClass *m_implementingClass; | |||
const AbstractMetaClass *m_declaringClass; | const AbstractMetaClass *m_declaringClass; | |||
const AbstractMetaClass *m_interfaceClass; | const AbstractMetaClass *m_interfaceClass; | |||
QPropertySpec *m_propertySpec; | QPropertySpec *m_propertySpec; | |||
AbstractMetaArgumentList m_arguments; | AbstractMetaArgumentList m_arguments; | |||
uint m_constant : 1; | uint m_constant : 1; | |||
uint m_invalid : 1; | uint m_invalid : 1; | |||
uint m_reverse : 1; | uint m_reverse : 1; | |||
uint m_userAdded : 1; | ||||
uint m_explicit : 1; | uint m_explicit : 1; | |||
}; | }; | |||
class AbstractMetaEnumValue | class AbstractMetaEnumValue | |||
{ | { | |||
public: | public: | |||
AbstractMetaEnumValue() | AbstractMetaEnumValue() | |||
: m_valueSet(false), m_value(0) | : m_valueSet(false), m_value(0) | |||
{ | { | |||
} | } | |||
skipping to change at line 1304 | skipping to change at line 1323 | |||
AbstractMetaClass() | AbstractMetaClass() | |||
: m_namespace(false), | : m_namespace(false), | |||
m_qobject(false), | m_qobject(false), | |||
m_hasVirtuals(false), | m_hasVirtuals(false), | |||
m_isPolymorphic(false), | m_isPolymorphic(false), | |||
m_hasNonpublic(false), | m_hasNonpublic(false), | |||
m_hasVirtualSlots(false), | m_hasVirtualSlots(false), | |||
m_hasNonPrivateConstructor(false), | m_hasNonPrivateConstructor(false), | |||
m_functionsFixed(false), | m_functionsFixed(false), | |||
m_hasPrivateDestructor(false), | m_hasPrivateDestructor(false), | |||
m_hasProtectedDestructor(false), | ||||
m_hasVirtualDestructor(false), | ||||
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), | |||
skipping to change at line 1360 | skipping to change at line 1381 | |||
bool hasPrivateDestructor() const | bool hasPrivateDestructor() const | |||
{ | { | |||
return m_hasPrivateDestructor; | return m_hasPrivateDestructor; | |||
} | } | |||
void setHasPrivateDestructor(bool value) | void setHasPrivateDestructor(bool value) | |||
{ | { | |||
m_hasPrivateDestructor = value; | m_hasPrivateDestructor = value; | |||
} | } | |||
bool hasProtectedDestructor() const | ||||
{ | ||||
return m_hasProtectedDestructor; | ||||
} | ||||
void setHasProtectedDestructor(bool value) | ||||
{ | ||||
m_hasProtectedDestructor = value; | ||||
} | ||||
bool hasVirtualDestructor() const | ||||
{ | ||||
return m_hasVirtualDestructor; | ||||
} | ||||
void setHasVirtualDestructor(bool value) | ||||
{ | ||||
m_hasVirtualDestructor = value; | ||||
} | ||||
AbstractMetaFunctionList queryFunctionsByName(const QString &name) cons t; | AbstractMetaFunctionList queryFunctionsByName(const QString &name) cons t; | |||
AbstractMetaFunctionList queryFunctions(uint query) const; | AbstractMetaFunctionList queryFunctions(uint query) const; | |||
inline AbstractMetaFunctionList allVirtualFunctions() const; | inline AbstractMetaFunctionList allVirtualFunctions() const; | |||
inline AbstractMetaFunctionList allFinalFunctions() const; | inline AbstractMetaFunctionList allFinalFunctions() const; | |||
AbstractMetaFunctionList functionsInTargetLang() const; | AbstractMetaFunctionList functionsInTargetLang() const; | |||
AbstractMetaFunctionList functionsInShellClass() const; | AbstractMetaFunctionList functionsInShellClass() const; | |||
inline AbstractMetaFunctionList cppInconsistentFunctions() const; | inline AbstractMetaFunctionList cppInconsistentFunctions() const; | |||
inline AbstractMetaFunctionList cppSignalFunctions() const; | inline AbstractMetaFunctionList cppSignalFunctions() const; | |||
AbstractMetaFunctionList publicOverrideFunctions() const; | AbstractMetaFunctionList publicOverrideFunctions() const; | |||
AbstractMetaFunctionList virtualOverrideFunctions() const; | AbstractMetaFunctionList virtualOverrideFunctions() const; | |||
skipping to change at line 1753 | skipping to change at line 1794 | |||
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; | |||
uint m_hasProtectedDestructor : 1; | ||||
uint m_hasVirtualDestructor : 1; | ||||
uint m_forceShellClass : 1; | uint m_forceShellClass : 1; | |||
uint m_hasHashFunction : 1; | uint m_hasHashFunction : 1; | |||
uint m_hasEqualsOperator : 1; | uint m_hasEqualsOperator : 1; | |||
uint m_hasCloneOperator : 1; | uint m_hasCloneOperator : 1; | |||
uint m_isTypeAlias : 1; | uint m_isTypeAlias : 1; | |||
uint m_reserved : 18; | uint m_reserved : 18; | |||
const AbstractMetaClass *m_enclosingClass; | const AbstractMetaClass *m_enclosingClass; | |||
AbstractMetaClass *m_baseClass; | AbstractMetaClass *m_baseClass; | |||
const AbstractMetaClass *m_templateBaseClass; | const AbstractMetaClass *m_templateBaseClass; | |||
End of changes. 11 change blocks. | ||||
3 lines changed or deleted | 47 lines changed or added | |||
typesystem.h | typesystem.h | |||
---|---|---|---|---|
skipping to change at line 583 | skipping to change at line 583 | |||
}; | }; | |||
typedef QList<DocModification> DocModificationList; | typedef QList<DocModification> DocModificationList; | |||
class APIEXTRACTOR_API TypeEntry | class APIEXTRACTOR_API TypeEntry | |||
{ | { | |||
public: | public: | |||
enum Type { | enum Type { | |||
PrimitiveType, | PrimitiveType, | |||
VoidType, | VoidType, | |||
VarargsType, | ||||
FlagsType, | FlagsType, | |||
EnumType, | EnumType, | |||
TemplateArgumentType, | TemplateArgumentType, | |||
ThreadType, | ThreadType, | |||
BasicValueType, | BasicValueType, | |||
StringType, | StringType, | |||
ContainerType, | ContainerType, | |||
InterfaceType, | InterfaceType, | |||
ObjectType, | ObjectType, | |||
NamespaceType, | NamespaceType, | |||
skipping to change at line 683 | skipping to change at line 684 | |||
return m_type == ArrayType; | return m_type == ArrayType; | |||
} | } | |||
bool isTemplateArgument() const | bool isTemplateArgument() const | |||
{ | { | |||
return m_type == TemplateArgumentType; | return m_type == TemplateArgumentType; | |||
} | } | |||
bool isVoid() const | bool isVoid() const | |||
{ | { | |||
return m_type == VoidType; | return m_type == VoidType; | |||
} | } | |||
bool isVarargs() const | ||||
{ | ||||
return m_type == VarargsType; | ||||
} | ||||
bool isThread() const | bool isThread() const | |||
{ | { | |||
return m_type == ThreadType; | return m_type == ThreadType; | |||
} | } | |||
bool isCustom() const | bool isCustom() const | |||
{ | { | |||
return m_type == CustomType; | return m_type == CustomType; | |||
} | } | |||
bool isBasicValue() const | bool isBasicValue() const | |||
{ | { | |||
skipping to change at line 925 | skipping to change at line 930 | |||
{ | { | |||
}; | }; | |||
}; | }; | |||
class APIEXTRACTOR_API VoidTypeEntry : public TypeEntry | class APIEXTRACTOR_API VoidTypeEntry : public TypeEntry | |||
{ | { | |||
public: | public: | |||
VoidTypeEntry() : TypeEntry("void", VoidType) { } | VoidTypeEntry() : TypeEntry("void", VoidType) { } | |||
}; | }; | |||
class APIEXTRACTOR_API VarargsTypeEntry : public TypeEntry | ||||
{ | ||||
public: | ||||
VarargsTypeEntry() : TypeEntry("...", VarargsType) { } | ||||
}; | ||||
class APIEXTRACTOR_API 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 | |||
{ | { | |||
skipping to change at line 1746 | skipping to change at line 1757 | |||
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. | |||
*/ | */ | |||
static TypeDatabase *instance(bool newInstance = false); | static TypeDatabase *instance(bool newInstance = false); | |||
static QString normalizedSignature(const char* signature); | ||||
QStringList requiredTargetImports() | QStringList requiredTargetImports() | |||
{ | { | |||
return m_requiredTargetImports; | return m_requiredTargetImports; | |||
} | } | |||
void addRequiredTargetImport(const QString &moduleName) | void addRequiredTargetImport(const QString &moduleName) | |||
{ | { | |||
if (!m_requiredTargetImports.contains(moduleName)) | if (!m_requiredTargetImports.contains(moduleName)) | |||
m_requiredTargetImports << moduleName; | m_requiredTargetImports << moduleName; | |||
} | } | |||
skipping to change at line 1868 | skipping to change at line 1881 | |||
TemplateEntry *findTemplate(const QString &name) | TemplateEntry *findTemplate(const QString &name) | |||
{ | { | |||
return m_templates[name]; | return m_templates[name]; | |||
} | } | |||
void addTemplate(TemplateEntry *t) | void addTemplate(TemplateEntry *t) | |||
{ | { | |||
m_templates[t->name()] = t; | m_templates[t->name()] = t; | |||
} | } | |||
AddedFunctionList addedFunctions() const | ||||
{ | ||||
return m_addedFunctions; | ||||
} | ||||
void setAddedFunctions(const AddedFunctionList& addedFunctions) | ||||
{ | ||||
m_addedFunctions = addedFunctions; | ||||
} | ||||
AddedFunctionList findAddedFunctions(const QString& name) const; | ||||
void setFunctionModifications(const FunctionModificationList& functionM | ||||
odifications) | ||||
{ | ||||
m_functionMods = functionModifications; | ||||
} | ||||
void addFunctionModification(const FunctionModification& functionModifi | ||||
cation) | ||||
{ | ||||
m_functionMods << functionModification; | ||||
} | ||||
FunctionModificationList functionModifications(const QString& signature | ||||
) const; | ||||
void setSuppressWarnings(bool on) | void setSuppressWarnings(bool on) | |||
{ | { | |||
m_suppressWarnings = on; | m_suppressWarnings = on; | |||
} | } | |||
void addSuppressedWarning(const QString &s) | void addSuppressedWarning(const QString &s) | |||
{ | { | |||
m_suppressedWarnings.append(s); | m_suppressedWarnings.append(s); | |||
} | } | |||
bool isSuppressedWarning(const QString &s) | bool isSuppressedWarning(const QString &s) | |||
skipping to change at line 1924 | skipping to change at line 1957 | |||
bool parseFile(const QString &filename, bool generate = true); | bool parseFile(const QString &filename, bool generate = true); | |||
bool parseFile(QIODevice* device, bool generate = true); | bool parseFile(QIODevice* device, bool generate = true); | |||
private: | private: | |||
bool m_suppressWarnings; | bool m_suppressWarnings; | |||
TypeEntryHash m_entries; | TypeEntryHash m_entries; | |||
SingleTypeEntryHash m_flagsEntries; | SingleTypeEntryHash m_flagsEntries; | |||
TemplateEntryHash m_templates; | TemplateEntryHash m_templates; | |||
QStringList m_suppressedWarnings; | QStringList m_suppressedWarnings; | |||
AddedFunctionList m_addedFunctions; | ||||
FunctionModificationList m_functionMods; | ||||
QStringList m_requiredTargetImports; | QStringList m_requiredTargetImports; | |||
QStringList m_typesystemPaths; | QStringList m_typesystemPaths; | |||
QHash<QString, bool> m_parsedTypesystemFiles; | QHash<QString, bool> m_parsedTypesystemFiles; | |||
QList<TypeRejection> m_rejections; | QList<TypeRejection> m_rejections; | |||
QStringList m_rebuildClasses; | QStringList m_rebuildClasses; | |||
}; | }; | |||
inline PrimitiveTypeEntry *TypeDatabase::findPrimitiveType(const QString &n ame) | inline PrimitiveTypeEntry *TypeDatabase::findPrimitiveType(const QString &n ame) | |||
End of changes. 6 change blocks. | ||||
0 lines changed or deleted | 39 lines changed or added | |||