From e4863ef97947b0355c6d3dc5b24f6c3bd0303a79 Mon Sep 17 00:00:00 2001 From: Juergen Bocklage-Ryannel Date: Wed, 19 Jul 2017 11:28:44 +0200 Subject: Added is_flag test type type symbol. A flag is an enum with and additional is flag is true. --- qface/idl/domain.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'qface/idl') diff --git a/qface/idl/domain.py b/qface/idl/domain.py index b48d636..f717fbc 100644 --- a/qface/idl/domain.py +++ b/qface/idl/domain.py @@ -220,8 +220,13 @@ class TypeSymbol(NamedElement): @property def is_enum(self): - '''checks if type is complex and enum''' - return self.is_complex and isinstance(self.reference, Enum) + '''checks if type is complex and enum (or flag)''' + return self.is_complex and isinstance(self.reference, Enum) and self.reference.is_enum + + @property + def is_flag(self): + '''checks if type is an enum and reference is flag ''' + return self.is_enum and self.reference.is_flag @property def is_struct(self): -- cgit v1.2.3