diff options
author | Juergen Bocklage-Ryannel <jbocklage-ryannel@luxoft.com> | 2017-07-19 11:28:44 +0200 |
---|---|---|
committer | Juergen Bocklage-Ryannel <jbocklage-ryannel@luxoft.com> | 2017-07-19 11:28:44 +0200 |
commit | e4863ef97947b0355c6d3dc5b24f6c3bd0303a79 (patch) | |
tree | 6e120507ee74348e7e307510270e38dda7731d7e /qface/idl | |
parent | d4a76a6333d13231fecb938474e583130929119a (diff) |
Added is_flag test type type symbol.
A flag is an enum with and additional is flag is true.
Diffstat (limited to 'qface/idl')
-rw-r--r-- | qface/idl/domain.py | 9 |
1 files changed, 7 insertions, 2 deletions
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): |