MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / __init__

Method __init__

util/cpplint.py:2170–2198  ·  view source on GitHub ↗
(self, name, class_or_struct, clean_lines, linenum)

Source from the content-addressed store, hash-verified

2168 """Stores information about a class."""
2169
2170 def __init__(self, name, class_or_struct, clean_lines, linenum):
2171 _BlockInfo.__init__(self, linenum, False)
2172 self.name = name
2173 self.is_derived = False
2174 self.check_namespace_indentation = True
2175 if class_or_struct == 'struct':
2176 self.access = 'public'
2177 self.is_struct = True
2178 else:
2179 self.access = 'private'
2180 self.is_struct = False
2181
2182 # Remember initial indentation level for this class. Using raw_lines here
2183 # instead of elided to account for leading comments.
2184 self.class_indent = GetIndentLevel(clean_lines.raw_lines[linenum])
2185
2186 # Try to find the end of the class. This will be confused by things like:
2187 # class A {
2188 # } *x = { ...
2189 #
2190 # But it's still good enough for CheckSectionSpacing.
2191 self.last_line = 0
2192 depth = 0
2193 for i in range(linenum, clean_lines.NumLines()):
2194 line = clean_lines.elided[i]
2195 depth += line.count('{') - line.count('}')
2196 if not depth:
2197 self.last_line = i
2198 break
2199
2200 def CheckBegin(self, filename, clean_lines, linenum, error):
2201 # Look for a bare ':'

Callers

nothing calls this directly

Calls 3

GetIndentLevelFunction · 0.85
NumLinesMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected