From c615b9c1db720d97034263081ad83f80496404a7 Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Wed, 28 Apr 2010 15:07:51 -0300 Subject: Add EnumValueTypeEntry. Enum values are in global namespace, so sometimes you need to get them from TypeDatabase, a use case for this is a template class where the template parameter is a enum value. --- typesystem.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'typesystem.h') diff --git a/typesystem.h b/typesystem.h index dc7ebc0a7..4c5570726 100644 --- a/typesystem.h +++ b/typesystem.h @@ -569,6 +569,7 @@ public: VarargsType, FlagsType, EnumType, + EnumValue, TemplateArgumentType, ThreadType, BasicValueType, @@ -688,6 +689,14 @@ public: { return m_type == TypeSystemType; } + bool isFunction() const + { + return m_type == FunctionType; + } + bool isEnumValue() const + { + return m_type == EnumValue; + } virtual bool preferredConversion() const { @@ -1211,6 +1220,21 @@ private: bool m_forceInteger; }; +class APIEXTRACTOR_API EnumValueTypeEntry : public TypeEntry +{ +public: + EnumValueTypeEntry(const QString& name, const QString& value, const EnumTypeEntry* enclosingEnum) + : TypeEntry(name, TypeEntry::EnumValue), m_value(value), m_enclosingEnum(enclosingEnum) + { + } + + QString value() const { return m_value; } + const EnumTypeEntry* enclosingEnum() const { return m_enclosingEnum; } +private: + QString m_value; + const EnumTypeEntry* m_enclosingEnum; +}; + class APIEXTRACTOR_API FlagsTypeEntry : public TypeEntry { public: -- cgit v1.2.3