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

Method __init__

src/tests/coding/cpplint.py:2756–2784  ·  view source on GitHub ↗
(self, name, class_or_struct, clean_lines, linenum)

Source from the content-addressed store, hash-verified

2754 """Stores information about a class."""
2755
2756 def __init__(self, name, class_or_struct, clean_lines, linenum):
2757 _BlockInfo.__init__(self, linenum, False)
2758 self.name = name
2759 self.is_derived = False
2760 self.check_namespace_indentation = True
2761 if class_or_struct == 'struct':
2762 self.access = 'public'
2763 self.is_struct = True
2764 else:
2765 self.access = 'private'
2766 self.is_struct = False
2767
2768 # Remember initial indentation level for this class. Using raw_lines here
2769 # instead of elided to account for leading comments.
2770 self.class_indent = GetIndentLevel(clean_lines.raw_lines[linenum])
2771
2772 # Try to find the end of the class. This will be confused by things like:
2773 # class A {
2774 # } *x = { ...
2775 #
2776 # But it's still good enough for CheckSectionSpacing.
2777 self.last_line = 0
2778 depth = 0
2779 for i in range(linenum, clean_lines.NumLines()):
2780 line = clean_lines.elided[i]
2781 depth += line.count('{') - line.count('}')
2782 if not depth:
2783 self.last_line = i
2784 break
2785
2786 def CheckBegin(self, filename, clean_lines, linenum, error):
2787 # Look for a bare ':'

Callers

nothing calls this directly

Calls 4

GetIndentLevelFunction · 0.85
NumLinesMethod · 0.80
countMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected