aboutsummaryrefslogtreecommitdiffstats
path: root/abstractmetalang.cpp
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2009-10-30 18:29:19 -0200
committerHugo Lima <hugo.lima@openbossa.org>2009-10-30 19:48:22 -0200
commite0a5b65fd9213f77eabf95fcd25b591e3d7966c0 (patch)
tree86ab580e59ca8261dc313a4c45ce84495442193c /abstractmetalang.cpp
parentfd82ee68418264b9b88f1c32411b8c6bbcc03c76 (diff)
Added convenience method AbstractMetaFunction::injectedCodeSnips.
It returns all code snips in a function.
Diffstat (limited to 'abstractmetalang.cpp')
-rw-r--r--abstractmetalang.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/abstractmetalang.cpp b/abstractmetalang.cpp
index 351abea0..68f6adec 100644
--- a/abstractmetalang.cpp
+++ b/abstractmetalang.cpp
@@ -697,6 +697,21 @@ bool AbstractMetaFunction::hasInjectedCode() const
return false;
}
+CodeSnipList AbstractMetaFunction::injectedCodeSnips(CodeSnip::Position position, TypeSystem::Language language) const
+{
+ CodeSnipList result;
+ foreach (const FunctionModification mod, modifications(ownerClass())) {
+ if (mod.isCodeInjection()) {
+ QList<CodeSnip>::const_iterator it = mod.snips.constBegin();
+ for (;it != mod.snips.constEnd(); ++it) {
+ if ((it->language & language) && (it->position == position || position == CodeSnip::Any))
+ result << *it;
+ }
+ }
+ }
+ return result;
+}
+
bool AbstractMetaFunction::hasSignatureModifications() const
{
foreach (const FunctionModification mod, modifications(ownerClass())) {