(self, name, class_or_struct, clean_lines, linenum)
| 3080 | """Stores information about a class.""" |
| 3081 | |
| 3082 | def __init__(self, name, class_or_struct, clean_lines, linenum): |
| 3083 | _BlockInfo.__init__(self, linenum, False) |
| 3084 | self.name = name |
| 3085 | self.is_derived = False |
| 3086 | self.check_namespace_indentation = True |
| 3087 | if class_or_struct == "struct": |
| 3088 | self.access = "public" |
| 3089 | self.is_struct = True |
| 3090 | else: |
| 3091 | self.access = "private" |
| 3092 | self.is_struct = False |
| 3093 | |
| 3094 | # Remember initial indentation level for this class. Using raw_lines here |
| 3095 | # instead of elided to account for leading comments. |
| 3096 | self.class_indent = GetIndentLevel(clean_lines.raw_lines[linenum]) |
| 3097 | |
| 3098 | # Try to find the end of the class. This will be confused by things like: |
| 3099 | # class A { |
| 3100 | # } *x = { ... |
| 3101 | # |
| 3102 | # But it's still good enough for CheckSectionSpacing. |
| 3103 | self.last_line = 0 |
| 3104 | depth = 0 |
| 3105 | for i in range(linenum, clean_lines.NumLines()): |
| 3106 | line = clean_lines.elided[i] |
| 3107 | depth += line.count("{") - line.count("}") |
| 3108 | if not depth: |
| 3109 | self.last_line = i |
| 3110 | break |
| 3111 | |
| 3112 | def CheckBegin(self, filename, clean_lines, linenum, error): |
| 3113 | # Look for a bare ':' |
nothing calls this directly
no test coverage detected