aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--abstractmetalang.cpp19
-rw-r--r--abstractmetalang.h18
2 files changed, 32 insertions, 5 deletions
diff --git a/abstractmetalang.cpp b/abstractmetalang.cpp
index 8d25a2319..068256528 100644
--- a/abstractmetalang.cpp
+++ b/abstractmetalang.cpp
@@ -1373,11 +1373,6 @@ const AbstractMetaFunction* AbstractMetaClass::findFunction(const QString& funct
return 0;
}
-/* Returns true if this class has one or more functions that are
- protected. If a class has protected members we need to generate a
- shell class with public accessors to the protected functions, so
- they can be called from the native functions.
-*/
bool AbstractMetaClass::hasProtectedFunctions() const
{
foreach (AbstractMetaFunction *func, m_functions) {
@@ -1387,6 +1382,20 @@ bool AbstractMetaClass::hasProtectedFunctions() const
return false;
}
+bool AbstractMetaClass::hasProtectedFields() const
+{
+ foreach (const AbstractMetaField *field, fields()) {
+ if (field->isProtected())
+ return true;
+ }
+ return false;
+}
+
+bool AbstractMetaClass::hasProtectedMembers() const
+{
+ return hasProtectedFields() || hasProtectedFunctions();
+}
+
bool AbstractMetaClass::generateShellClass() const
{
return m_forceShellClass ||
diff --git a/abstractmetalang.h b/abstractmetalang.h
index e4a81e810..6609eb936 100644
--- a/abstractmetalang.h
+++ b/abstractmetalang.h
@@ -1590,8 +1590,26 @@ public:
{
return m_isPolymorphic;
}
+
+ /**
+ * Tells if this class has one or more functions that are protected.
+ * \return true if the class has protected functions.
+ */
bool hasProtectedFunctions() const;
+ /**
+ * Tells if this class has one or more fields (member variables) that are protected.
+ * \return true if the class has protected fields.
+ */
+ bool hasProtectedFields() const;
+
+ /**
+ * Tells if this class has one or more members (functions or fields) that are protected.
+ * \return true if the class has protected members.
+ */
+ bool hasProtectedMembers() const;
+
+
QList<TypeEntry *> templateArguments() const
{
return m_templateArgs;