MCPcopy Create free account
hub / github.com/SIPp/sipp / _ClassInfo

Class _ClassInfo

cpplint.py:1394–1424  ·  view source on GitHub ↗

Stores information about a class.

Source from the content-addressed store, hash-verified

1392
1393
1394class _ClassInfo(_BlockInfo):
1395 """Stores information about a class."""
1396
1397 def __init__(self, name, class_or_struct, clean_lines, linenum):
1398 _BlockInfo.__init__(self, False)
1399 self.name = name
1400 self.starting_linenum = linenum
1401 self.is_derived = False
1402 if class_or_struct == 'struct':
1403 self.access = 'public'
1404 else:
1405 self.access = 'private'
1406
1407 # Try to find the end of the class. This will be confused by things like:
1408 # class A {
1409 # } *x = { ...
1410 #
1411 # But it's still good enough for CheckSectionSpacing.
1412 self.last_line = 0
1413 depth = 0
1414 for i in range(linenum, clean_lines.NumLines()):
1415 line = clean_lines.elided[i]
1416 depth += line.count('{') - line.count('}')
1417 if not depth:
1418 self.last_line = i
1419 break
1420
1421 def CheckBegin(self, filename, clean_lines, linenum, error):
1422 # Look for a bare ':'
1423 if Search('(^|[^:]):($|[^:])', clean_lines.elided[linenum]):
1424 self.is_derived = True
1425
1426
1427class _NamespaceInfo(_BlockInfo):

Callers 1

UpdateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected