aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/typesystem.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/ApiExtractor/typesystem.h')
-rw-r--r--sources/shiboken2/ApiExtractor/typesystem.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/sources/shiboken2/ApiExtractor/typesystem.h b/sources/shiboken2/ApiExtractor/typesystem.h
index f2b5a932..62d348f6 100644
--- a/sources/shiboken2/ApiExtractor/typesystem.h
+++ b/sources/shiboken2/ApiExtractor/typesystem.h
@@ -1045,6 +1045,12 @@ private:
class EnumTypeEntry : public TypeEntry
{
public:
+ enum EnumKind {
+ CEnum, // Standard C: enum Foo { value1, value2 }
+ AnonymousEnum, // enum { value1, value2 }
+ EnumClass // C++ 11 : enum class Foo { value1, value2 }
+ };
+
explicit EnumTypeEntry(const QString &nspace, const QString &enumName, double vr);
QString targetLangPackage() const override;
@@ -1065,6 +1071,9 @@ public:
m_qualifier = q;
}
+ EnumKind enumKind() const { return m_enumKind; }
+ void setEnumKind(EnumKind kind) { m_enumKind = kind; }
+
bool preferredConversion() const override;
bool isBoundsChecked() const
@@ -1108,7 +1117,7 @@ public:
m_extensible = is;
}
- bool isEnumValueRejected(const QString &name)
+ bool isEnumValueRejected(const QString &name) const
{
return m_rejectedEnums.contains(name);
}
@@ -1130,14 +1139,7 @@ public:
m_forceInteger = force;
}
- bool isAnonymous() const
- {
- return m_anonymous;
- }
- void setAnonymous(bool anonymous)
- {
- m_anonymous = anonymous;
- }
+ bool isAnonymous() const { return m_enumKind == AnonymousEnum; }
private:
QString m_packageName;
@@ -1151,9 +1153,10 @@ private:
FlagsTypeEntry *m_flags = nullptr;
+ EnumKind m_enumKind = CEnum;
+
bool m_extensible = false;
bool m_forceInteger = false;
- bool m_anonymous = false;
};
// EnumValueTypeEntry is used for resolving integer type templates