MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / __init__

Method __init__

steps/cpplint.py:2770–2798  ·  view source on GitHub ↗
(self, name, class_or_struct, clean_lines, linenum)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

GetIndentLevelFunction · 0.85
NumLinesMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected