third_party/blink/tools/blinkpy/style/checkers/cpp.py
def update_include_state(filename, include_state):
    """Fill up the include_state with new includes found from the file.

    Args:
      filename: the name of the header to read.
      include_state: an _IncludeState instance in which the headers are inserted.
      io: The io factory to use to read the file. Provided for testability.

    Returns:
      True if a header was succesfully added. False otherwise.
    """
    header_file = None
    try:
        header_file = CppChecker.fs.read_text_file(filename)
    except IOError:
        return False
    line_number = 0
    for line in header_file:
        line_number += 1
        clean_line = cleanse_comments(line)
        matched = _RE_PATTERN_INCLUDE.search(clean_line)
        if matched:
            include = matched.group(2)
            # The value formatting is cute, but not really used right now.
            # What matters here is that the key is in include_state.
            include_state.setdefault(include,
                                     '%s:%d' % (filename, line_number))
    return True
Fill up the include_state with new includes found from the file.

    Args:
      filename: the name of the header to read.
      include_state: an _IncludeState instance in which the headers are inserted.
      io: The io factory to use to read the file. Provided for testability.

    Returns:
      True if a header was succesfully added. False otherwise.
    
Fill up the include_state with new includes found from the file.
Fill up the include_state with new includes found from the file .
def update_include_state(filename, include_state):
    header_file = None
    try:
        header_file = CppChecker.fs.read_text_file(filename)
    except IOError:
        return False
    line_number = 0
    for line in header_file:
        line_number += 1
        clean_line = cleanse_comments(line)
        matched = _RE_PATTERN_INCLUDE.search(clean_line)
        if matched:
            include = matched.group(2)
            include_state.setdefault(include,
                                     '%s:%d' % (filename, line_number))
    return True
def update_include_state ( filename , include_state ) : header_file = None try : header_file = CppChecker . fs . read_text_file ( filename ) except IOError : return False line_number = 0 for line in header_file : line_number += 1 clean_line = cleanse_comments ( line ) matched = _RE_PATTERN_INCLUDE . search ( clean_line ) if matched : include = matched . group ( 2 ) include_state . setdefault ( include , '%s:%d' % ( filename , line_number ) ) return True
Fill up the include_state with new includes found from the file.
Fill up the include_state with new includes found from the file .
"""Fill up the include_state with new includes found from the file.

    Args:
      filename: the name of the header to read.
      include_state: an _IncludeState instance in which the headers are inserted.
      io: The io factory to use to read the file. Provided for testability.

    Returns:
      True if a header was succesfully added. False otherwise.
    """ # The value formatting is cute, but not really used right now. # What matters here is that the key is in include_state.
True if a header was succesfully added. False otherwise.
True if a header was succesfully added . False otherwise .
filename
the name of the header to read.
the name of the header to read .
include_state
an _IncludeState instance in which the headers are inserted.
an _IncludeState instance in which the headers are inserted .
io
The io factory to use to read the file. Provided for testability.
The io factory to use to read the file . Provided for testability .