Public Member Functions | |
def | __init__ (self) |
def | CanonicalizeAlphabeticalOrder (self, header_path) |
def | CheckNextIncludeOrder (self, header_type) |
def | FindHeader (self, header) |
def | IsInAlphabeticalOrder (self, clean_lines, linenum, header_path) |
def | ResetSection (self, directive) |
def | SetLastHeader (self, header_path) |
Public Attributes | |
include_list | |
Private Attributes | |
_last_header | |
_section | |
Static Private Attributes | |
int | _C_SECTION = 2 |
int | _CPP_SECTION = 3 |
int | _INITIAL_SECTION = 0 |
int | _MY_H_SECTION = 1 |
int | _OTHER_H_SECTION = 4 |
dictionary | _SECTION_NAMES |
dictionary | _TYPE_NAMES |
Tracks line numbers for includes, and the order in which includes appear. include_list contains list of lists of (header, line number) pairs. It's a lists of lists rather than just one flat list to make it easier to update across preprocessor boundaries. Call CheckNextIncludeOrder() once for each header in the file, passing in the type constants defined above. Calls in an illegal order will raise an _IncludeError with an appropriate error message.
Definition at line 700 of file cpplint.py.
def roslint.cpplint._IncludeState.__init__ | ( | self | ) |
Definition at line 735 of file cpplint.py.
def roslint.cpplint._IncludeState.CanonicalizeAlphabeticalOrder | ( | self, | |
header_path | |||
) |
Returns a path canonicalized for alphabetical comparison. - replaces "-" with "_" so they both cmp the same. - removes '-inl' since we don't require them to be after the main header. - lowercase everything, just in case. Args: header_path: Path to be canonicalized. Returns: Canonicalized path.
Definition at line 775 of file cpplint.py.
def roslint.cpplint._IncludeState.CheckNextIncludeOrder | ( | self, | |
header_type | |||
) |
Returns a non-empty error message if the next header is out of order. This function also updates the internal state to be ready to check the next include. Args: header_type: One of the _XXX_HEADER constants defined above. Returns: The empty string if the header is in the right order, or an error message describing what's wrong.
Definition at line 811 of file cpplint.py.
def roslint.cpplint._IncludeState.FindHeader | ( | self, | |
header | |||
) |
Check if a header has already been included. Args: header: header to check. Returns: Line number of previous occurrence, or -1 if the header has not been seen before.
Definition at line 739 of file cpplint.py.
def roslint.cpplint._IncludeState.IsInAlphabeticalOrder | ( | self, | |
clean_lines, | |||
linenum, | |||
header_path | |||
) |
Check if a header is in alphabetical order with the previous header. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. header_path: Canonicalized header to be checked. Returns: Returns true if the header is in alphabetical order.
Definition at line 790 of file cpplint.py.
def roslint.cpplint._IncludeState.ResetSection | ( | self, | |
directive | |||
) |
Reset section checking for preprocessor directive. Args: directive: preprocessor directive (e.g. "if", "else").
Definition at line 754 of file cpplint.py.
def roslint.cpplint._IncludeState.SetLastHeader | ( | self, | |
header_path | |||
) |
Definition at line 772 of file cpplint.py.
|
staticprivate |
Definition at line 716 of file cpplint.py.
|
staticprivate |
Definition at line 717 of file cpplint.py.
|
staticprivate |
Definition at line 714 of file cpplint.py.
|
private |
Definition at line 763 of file cpplint.py.
|
staticprivate |
Definition at line 715 of file cpplint.py.
|
staticprivate |
Definition at line 718 of file cpplint.py.
|
private |
Definition at line 761 of file cpplint.py.
|
staticprivate |
Definition at line 727 of file cpplint.py.
|
staticprivate |
Definition at line 720 of file cpplint.py.
roslint.cpplint._IncludeState.include_list |
Definition at line 736 of file cpplint.py.