aboutsummaryrefslogtreecommitdiffstats
path: root/abstractmetalang.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-06-02 15:53:37 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:10:04 -0300
commit576c9b5c6045940da2586500b7c6bec44d00da69 (patch)
tree1bca89c5a1914c347a9b3405d693b58ac045a992 /abstractmetalang.cpp
parentbf5dbc2df39d014860a21884f55209ace04d2846 (diff)
Added methods to AbstractMetaClass to verify the presence of protected members.
Added methods to verify the presence of protected fields and members in general in a class. Reviewed by Renato Araújo <renato.filho@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'abstractmetalang.cpp')
-rw-r--r--abstractmetalang.cpp19
1 files changed, 14 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 ||