aboutsummaryrefslogtreecommitdiffstats
path: root/typesystem.h
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.lima@openbossa.org>2010-04-28 15:07:51 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:10:01 -0300
commitc615b9c1db720d97034263081ad83f80496404a7 (patch)
treecc519df93fab2170b5decaf311a44494fe70bc00 /typesystem.h
parent3026fe34cabf67394c7d45becccf30e8fd9e0a2e (diff)
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.
Diffstat (limited to 'typesystem.h')
-rw-r--r--typesystem.h24
1 files changed, 24 insertions, 0 deletions
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: