From 74d3c1bb12280ffb2b810ee4bd1272ba6fb8127f Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Wed, 14 Apr 2010 19:32:37 -0300 Subject: Added the "function" tag to ApiExtractor. This change the behaviour of ApiExtractor regarding to global functions. All global function you want to be exported to python *need* to be especified in the type system with the function tag, otherwise they wont be exported at all. The syntax for this new tag is: This is just the initial work for this tag, it is missign support for: - Function modifications. - Add a function overload with add-function tag. --- typesystem.h | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'typesystem.h') diff --git a/typesystem.h b/typesystem.h index 1c1c08299..662cb53e1 100644 --- a/typesystem.h +++ b/typesystem.h @@ -583,7 +583,8 @@ public: ArrayType, TypeSystemType, CustomType, - TargetLangType + TargetLangType, + FunctionType }; enum CodeGeneration { @@ -1699,6 +1700,32 @@ private: }; +class APIEXTRACTOR_API FunctionTypeEntry : public TypeEntry +{ +public: + FunctionTypeEntry(const QString& name, const QString& signature) + : TypeEntry(name, FunctionType) + { + addSignature(signature); + } + void addSignature(const QString& signature) + { + m_signatures << signature; + } + + QStringList signatures() + { + return m_signatures; + } + + inline bool hasSignature(const QString& signature) + { + return m_signatures.contains(signature); + } +private: + QStringList m_signatures; +}; + class APIEXTRACTOR_API ObjectTypeEntry : public ComplexTypeEntry { public: @@ -1779,6 +1806,7 @@ public: inline ObjectTypeEntry *findObjectType(const QString &name); inline NamespaceTypeEntry *findNamespaceType(const QString &name); ContainerTypeEntry *findContainerType(const QString &name); + FunctionTypeEntry* findFunctionType(const QString& name); TypeEntry *findType(const QString &name) const { -- cgit v1.2.3