(self, name, class_or_struct, clean_lines, linenum)
| 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 ':' |
nothing calls this directly
no test coverage detected