(self, name, class_or_struct, clean_lines, linenum)
| 3020 | """Stores information about a class.""" |
| 3021 | |
| 3022 | def __init__(self, name, class_or_struct, clean_lines, linenum): |
| 3023 | _BlockInfo.__init__(self, linenum, False) |
| 3024 | self.name = name |
| 3025 | self.is_derived = False |
| 3026 | self.check_namespace_indentation = True |
| 3027 | if class_or_struct == "struct": |
| 3028 | self.access = "public" |
| 3029 | self.is_struct = True |
| 3030 | else: |
| 3031 | self.access = "private" |
| 3032 | self.is_struct = False |
| 3033 | |
| 3034 | # Remember initial indentation level for this class. Using raw_lines here |
| 3035 | # instead of elided to account for leading comments. |
| 3036 | self.class_indent = GetIndentLevel(clean_lines.raw_lines[linenum]) |
| 3037 | |
| 3038 | # Try to find the end of the class. This will be confused by things like: |
| 3039 | # class A { |
| 3040 | # } *x = { ... |
| 3041 | # |
| 3042 | # But it's still good enough for CheckSectionSpacing. |
| 3043 | self.last_line = 0 |
| 3044 | depth = 0 |
| 3045 | for i in range(linenum, clean_lines.NumLines()): |
| 3046 | line = clean_lines.elided[i] |
| 3047 | depth += line.count("{") - line.count("}") |
| 3048 | if not depth: |
| 3049 | self.last_line = i |
| 3050 | break |
| 3051 | |
| 3052 | def CheckBegin(self, filename, clean_lines, linenum, error): |
| 3053 | # Look for a bare ':' |
nothing calls this directly
no test coverage detected