summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-08-11 16:05:41 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2011-08-18 19:20:46 -0300
commit18a1658d6f5bcdbd118aa2649dcba56e61553c0f (patch)
tree15274001b20355ac84dbba79633e0305f9fc91d4
parentcb5be10109fc64d2e77f064164cac4da0d3d8396 (diff)
downloadgeneratorrunner-18a1658d6f5bcdbd118aa2649dcba56e61553c0f.tar.gz
generatorrunner-18a1658d6f5bcdbd118aa2649dcba56e61553c0f.tar.xz
generatorrunner-18a1658d6f5bcdbd118aa2649dcba56e61553c0f.zip
Added a method to check if a TypeEntry should be generated or not.
Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Lauro Moura <lauro.neto@openbossa.org>
-rw-r--r--generator.cpp7
-rw-r--r--generator.h5
2 files changed, 10 insertions, 2 deletions
diff --git a/generator.cpp b/generator.cpp
index 70f62e6..ee15d2f 100644
--- a/generator.cpp
+++ b/generator.cpp
@@ -193,9 +193,14 @@ void Generator::generate()
finishGeneration();
}
+bool Generator::shouldGenerateTypeEntry(const TypeEntry* type) const
+{
+ return type->codeGeneration() & TypeEntry::GenerateTargetLang;
+}
+
bool Generator::shouldGenerate(const AbstractMetaClass* metaClass) const
{
- return metaClass->typeEntry()->codeGeneration() & TypeEntry::GenerateTargetLang;
+ return shouldGenerateTypeEntry(metaClass->typeEntry());
}
void verifyDirectoryFor(const QFile &file)
diff --git a/generator.h b/generator.h
index d748397..4c20268 100644
--- a/generator.h
+++ b/generator.h
@@ -151,7 +151,10 @@ public:
/// Returns the generator's name. Used for cosmetic purposes.
virtual const char* name() const = 0;
- /// Returns true if the generator should generate any code for the AbstractMetaClass
+ /// Returns true if the generator should generate any code for the TypeEntry.
+ bool shouldGenerateTypeEntry(const TypeEntry*) const;
+
+ /// Returns true if the generator should generate any code for the AbstractMetaClass.
virtual bool shouldGenerate(const AbstractMetaClass *) const;
/// Returns the subdirectory used to write the binding code of an AbstractMetaClass.