(self, name, class_or_struct, clean_lines, linenum)
| 2268 | """Stores information about a class.""" |
| 2269 | |
| 2270 | def __init__(self, name, class_or_struct, clean_lines, linenum): |
| 2271 | _BlockInfo.__init__(self, linenum, False) |
| 2272 | self.name = name |
| 2273 | self.is_derived = False |
| 2274 | self.check_namespace_indentation = True |
| 2275 | if class_or_struct == 'struct': |
| 2276 | self.access = 'public' |
| 2277 | self.is_struct = True |
| 2278 | else: |
| 2279 | self.access = 'private' |
| 2280 | self.is_struct = False |
| 2281 | |
| 2282 | # Remember initial indentation level for this class. Using raw_lines here |
| 2283 | # instead of elided to account for leading comments. |
| 2284 | self.class_indent = GetIndentLevel(clean_lines.raw_lines[linenum]) |
| 2285 | |
| 2286 | # Try to find the end of the class. This will be confused by things like: |
| 2287 | # class A { |
| 2288 | # } *x = { ... |
| 2289 | # |
| 2290 | # But it's still good enough for CheckSectionSpacing. |
| 2291 | self.last_line = 0 |
| 2292 | depth = 0 |
| 2293 | for i in range(linenum, clean_lines.NumLines()): |
| 2294 | line = clean_lines.elided[i] |
| 2295 | depth += line.count('{') - line.count('}') |
| 2296 | if not depth: |
| 2297 | self.last_line = i |
| 2298 | break |
| 2299 | |
| 2300 | def CheckBegin(self, filename, clean_lines, linenum, error): |
| 2301 | # Look for a bare ':' |
nothing calls this directly
no test coverage detected