From 18a1658d6f5bcdbd118aa2649dcba56e61553c0f Mon Sep 17 00:00:00 2001 From: Marcelo Lira Date: Thu, 11 Aug 2011 16:05:41 -0300 Subject: Added a method to check if a TypeEntry should be generated or not. Reviewed by Hugo Parente Reviewed by Lauro Moura --- generator.cpp | 7 ++++++- generator.h | 5 ++++- 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. -- cgit v1.2.3