cppcheckdata.py: read more data from dumps

This commit is contained in:
Daniel Marjamäki 2018-10-28 20:47:44 +01:00
parent c03d32b429
commit 2730b16326
1 changed files with 25 additions and 3 deletions

View File

@ -445,23 +445,45 @@ class ValueFlow:
Value class
Attributes:
intvalue integer value
tokvalue token value
condition condition where this Value comes from
intvalue integer value
tokvalue token value
floatvalue float value
containerSize container size
condition condition where this Value comes from
valueKind 'known' or 'possible'
inconclusive Is value inconclusive?
"""
intvalue = None
tokvalue = None
floatvalue = None
containerSize = None
condition = None
valueKind = None
inconclusive = False
def isKnown(self):
return self.valueKind and self.valueKind == 'known'
def isPossible(self):
return self.valueKind and self.valueKind == 'possible'
def __init__(self, element):
self.intvalue = element.get('intvalue')
if self.intvalue:
self.intvalue = int(self.intvalue)
self.tokvalue = element.get('tokvalue')
self.floatvalue = element.get('floatvalue')
self.containerSize = element.get('container-size')
self.condition = element.get('condition-line')
if self.condition:
self.condition = int(self.condition)
if element.get('known'):
valueKind = 'known'
elif element.get('possible'):
valueKind = 'possible'
if element.get('inconclusive'):
inconclusive = 'known'
def __init__(self, element):
self.Id = element.get('id')