Full Code of XadillaX/thmclrx for AI

master e2786255eb29 cached
81 files
2.7 MB
706.4k tokens
1445 symbols
1 requests
Download .txt
Showing preview only (2,827K chars total). Download the full file or copy to clipboard to get everything.
Repository: XadillaX/thmclrx
Branch: master
Commit: e2786255eb29
Files: 81
Total size: 2.7 MB

Directory structure:
gitextract_4v8b1k9q/

├── .clang-format
├── .cpplint
├── .editorconfig
├── .eslintrc
├── .gitignore
├── .gitmodules
├── CPPLINT.cfg
├── LICENSE
├── README.md
├── binding.gyp
├── deps/
│   └── cpplint/
│       ├── .flake8
│       ├── .gitignore
│       ├── .pylintrc
│       ├── .style.yapf
│       ├── .travis.yml
│       ├── CONTRIBUTING.rst
│       ├── LICENSE
│       ├── MANIFEST.in
│       ├── README.rst
│       ├── changelog.rst
│       ├── cpplint.py
│       ├── cpplint_clitest.py
│       ├── cpplint_unittest.py
│       ├── dev-requirements
│       ├── samples/
│       │   ├── boost-sample/
│       │   │   ├── LICENSE
│       │   │   ├── README.md
│       │   │   ├── exclude.def
│       │   │   ├── headers_inspect.def
│       │   │   ├── headers_simple.def
│       │   │   ├── simple.def
│       │   │   └── src/
│       │   │       ├── inspect/
│       │   │       │   └── unnamed_namespace_check.hpp
│       │   │       └── tr1/
│       │   │           └── c_policy.hpp
│       │   ├── chromium-sample/
│       │   │   ├── README.md
│       │   │   ├── simple.def
│       │   │   └── src/
│       │   │       ├── chrome_content_renderer_client.cc
│       │   │       ├── chrome_content_renderer_client.h
│       │   │       ├── io_thread.cc
│       │   │       └── io_thread.h
│       │   ├── codelite-sample/
│       │   │   ├── LICENSE
│       │   │   ├── README.md
│       │   │   ├── simple.def
│       │   │   └── src/
│       │   │       ├── pptable.cpp
│       │   │       └── pptable.h
│       │   ├── protobuf-sample/
│       │   │   ├── LICENSE
│       │   │   ├── README.md
│       │   │   ├── simple.def
│       │   │   └── src/
│       │   │       ├── descriptor.pb.cc
│       │   │       ├── descriptor.pb.h
│       │   │       └── descriptor_unittest.cc
│       │   ├── silly-sample/
│       │   │   ├── filters.def
│       │   │   ├── includeorder_cfirst.def
│       │   │   ├── sed.def
│       │   │   ├── simple.def
│       │   │   └── src/
│       │   │       └── sillycode.cpp
│       │   ├── v8-sample/
│       │   │   ├── LICENSE
│       │   │   ├── README.md
│       │   │   ├── simple.def
│       │   │   └── src/
│       │   │       └── interface-descriptors.h
│       │   └── vlc-sample/
│       │       ├── COPYING
│       │       ├── README.md
│       │       ├── simple.def
│       │       └── src/
│       │           ├── libvlc.c
│       │           ├── libvlc.h
│       │           └── missing.c
│       ├── setup.cfg
│       ├── setup.py
│       ├── test-requirements
│       └── tox.ini
├── index.d.ts
├── index.js
├── lib/
│   ├── default_palette.d.ts
│   ├── default_palette.js
│   ├── x.d.ts
│   └── x.js
├── package.json
├── src/
│   ├── common.cc
│   ├── common.h
│   └── thmclrx.cc
├── test/
│   └── test.js
├── tools/
│   └── clang_format.js
└── tsconfig.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .clang-format
================================================
---
Language:        Cpp
# BasedOnStyle:  Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands:   true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
  AfterClass:      false
  AfterControlStatement: false
  AfterEnum:       false
  AfterFunction:   false
  AfterNamespace:  false
  AfterObjCDeclaration: false
  AfterStruct:     false
  AfterUnion:      false
  AfterExternBlock: false
  BeforeCatch:     false
  BeforeElse:      false
  IndentBraces:    false
  SplitEmptyFunction: true
  SplitEmptyRecord: true
  SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit:      80
CommentPragmas:  '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat:   false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
  - foreach
  - Q_FOREACH
  - BOOST_FOREACH
IncludeBlocks:   Preserve
IncludeCategories:
  - Regex:           '^<ext/.*\.h>'
    Priority:        2
  - Regex:           '^<.*\.h>'
    Priority:        1
  - Regex:           '^<.*'
    Priority:        2
  - Regex:           '.*'
    Priority:        3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth:     2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd:   ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments:  true
SortIncludes:    true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles:  false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard:        Auto
TabWidth:        8
UseTab:          Never


================================================
FILE: .cpplint
================================================
set noparent
filter=-build/include_alpha,-build/include_subdir,-build/include_what_you_use,-legal/copyright,-readability/nolint
linelength=80


================================================
FILE: .editorconfig
================================================
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[vcbuild.bat]
end_of_line = crlf

[Makefile]
indent_size = 8
indent_style = tab

[{deps}/**]
charset = unset
end_of_line = unset
indent_size = unset
indent_style = unset
trim_trailing_whitespace = unset


================================================
FILE: .eslintrc
================================================
{
  "extends": [
    "eslint-config-egg"
  ]
}


================================================
FILE: .gitignore
================================================
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# Commenting this out is preferred by some people, see
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules

# Users Environment Variables
.lock-wscript

*.swp
*.jpg
*.png
*.html

.build
src/.ycm_*

.idea
build
.ropeproject

.DS_Store
*.bak
package-lock.json
compile_commands.json
.cache
.vscode


================================================
FILE: .gitmodules
================================================
[submodule "deps/byakuren"]
path = deps/byakuren
url = https://github.com/XadillaX/byakuren.git


================================================
FILE: CPPLINT.cfg
================================================
set noparent
filter=-build/include_alpha,-build/include_subdir,-build/include_what_you_use,-legal/copyright,-readability/nolint
linelength=80


================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2022 ZHU, Kaidi

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


================================================
FILE: README.md
================================================
<p align="center">
  <img src="https://github.com/XadillaX/thmclrx/raw/master/logo.svg" alt="Thmclrx" />
</p>

<p align="center">
  <a href="https://github.com/sponsors/XadillaX"><img src="https://github.com/XadillaX/vscode-language-viml/raw/master/assets/github_sponsor_btn.png" /></a>
</p>

<p align="center">
  <a href="https://www.npmjs.org/package/thmclrx">
    <img src="http://img.shields.io/npm/v/thmclrx.svg" />
  </a>

  <a href="https://www.npmjs.org/package/thmclrx">
    <img src="http://img.shields.io/npm/dm/thmclrx.svg" />
  </a>
</p>

<p align="center">
  A theme color extractor module for Node.js with ❤ and built on the top of <a href="https://github.com/XadillaX/byakuren">Byakuren</a>.
</p>

## Algorithm

- Minimum Differ Algorithm
- Octree Algorithm
- Mixed Algorithm

## Installation

```shell
$ npm install --save thmclrx
```

## API

There only three API in Node.js now.

### octree

`octree` is to get the theme colors in an octree. The colors are unsertain but fidelity.

The function is like below:

```javascript
var thmclrx = require("thmclrx");
thmclrx.octree(file, [maxColors], [callback], [frameNumber]);
```

+ `file`: it could be a local filename, remote url or even an image buffer.
+ `maxColors`: count of max theme colors you want to extract. Defaults to 256;
+ `callback`: it should be like `function(err, colors) {}`. Defaults to an empty function;
+ `frameNumber`: the frame you want to extract. Usually used in `gif`. Defaults to 0.

### minDiff

`minDiff` is to get theme colors in minimum differ algorithm by passing a palette. The result theme colors are certainlly in your palette.

```javascript
var thmclrx = require("thmclrx");
thmclrx.minDiff(file, [palette], [callback], [frameNumber]);
```

+ `file`: it could be a local filename, remote url or even an image buffer.
+ `palette`: palette is an array that in the struct of `[ { r: .., g: .., b: .., }, { r: .., g: .., b: .. } ]`. Default palette refers [here](https://github.com/XadillaX/thmclrx/blob/master/lib/default_palette.js).
+ `callback`: it should be like `function(err, colors) {}`. Defaults to an empty function;
+ `frameNumber`: the frame you want to extract. Usually used in `gif`. Defaults to 0.

### mixed

Using `mixed` get the basic fidelity theme colors and then using `minDiff` to standardize the fidelity theme colors to a certain palette.

```javascript
var thmclrx = require("thmclrx");
thmclrx.mixed(file, [firstStepMaxColors], [palette], [callback], [frameNumber]);
```

+ `file`: same as the two functions above.
+ `firstStepMaxColors`: same as the `maxColors` in `octreeGet`. Defaults to 256.
+ `palette`: same as the `palette` in `mindiffGet`. Same default value.
+ `callback`: same as the two functions above.
+ `frameNumber`: same as the two functions above.

## C++ API

If you want to use C++ API directly, you can refer to this.

### getByOctree

This function is called in `octree` in Node.js API.

```javascript
var thmclrx = require("thmclrx").cpp;
var colors = thmclrx.getByOctree(pixels, [maxColor]);
```

+ `pixels`: this is an array in the struct of `[ { r: .., g: .., b: .., }, { r: .., g: .., b: .. } ]`.
+ `maxColor`: same as the `maxColors` in `octreeGet` of Node.js API. Defaults to 256.
+ `@return`: this function will return the theme colors.

### getByMinDiff

This function is called in `minDiff` in Node.js API.

```javascript
var thmclrx = require("thmclrx").cpp;
var colors = thmclrx.getByMinDiff(pixels, [palette]);
```

+ `pixels`: this may be same as the `pixels` in `octreeGet` of C++ API. Otherwise, it may be the result of `octreeGet` of C++ API.
+ `palette`: same as the `palette` in `mindiffGet` of Node.js API. Same default value.
+ `@return`: this function will return the theme colors.

### getByMixed

This function is called in `mixed` in Node.js API.

```javascript
var thmclrx = require("thmclrx").cpp;
var colors = thmclrx.getByMixed(pixels, maxColors, palette);
```

+ `pixels`: this may be same as the `pixels` in `octreeGet` of C++ API. Otherwise, it may be the result of `octreeGet` of C++ API.
+ `maxColors`: same as the `maxColors` in `octreeGet` of Node.js API.
+ `palette`: same as the `palette` in `mindiffGet` of Node.js API.
+ `@return`: this function will return the theme colors.

## Migrate From 0.x To 1.x

thmclrx 0.x has three APIs which map three APIs in 1.x.

+ octreeGet
+ mindiffGet
+ mixGet

In 1.x, these three APIs still exist but deprecated. They are exactly shallow points of `octree` / `minDiff` and `mixed`.

You may do nothing but we recommend you to rename the functions you called.

But if you're using native APIs (C++ APIs), you should read the [new document](#c-api).

## Contribute

Issues and PRs are welcomed!

「雖然我覺得不怎麼可能有人會關注我」


================================================
FILE: binding.gyp
================================================
{
    "targets": [
        {
            "target_name": "xmempool",
            "type": "static_library",
            "sources": [
                "./deps/byakuren/third-party/xmempool/xmempool.c"
            ],
            "cflags": [
                "-std=c99"
            ]
        },
        {
            "target_name": "byakuren",
            "type": "static_library",
            "dependencies": [
                "xmempool"
            ],
            "sources": [
                "./deps/byakuren/byakuren.c",
                "./deps/byakuren/bkr_common.c",
                "./deps/byakuren/const/palette.c",
                "./deps/byakuren/lib/mindiff.c",
                "./deps/byakuren/lib/mix.c",
                "./deps/byakuren/lib/octree.c"
            ],
            "cflags": [
                "-std=c99"
            ]
        },
        {
            "target_name": "thmclrx",
            "dependencies": [
                "byakuren"
            ],
            "sources": [
                "./src/thmclrx.cc",
                "./src/common.cc"
            ],
            "include_dirs": [
                "<!(node -e \"require('nan')\")",
                "deps",
                "deps/byakuren/third-party"
            ]
        }
    ]
}


================================================
FILE: deps/cpplint/.flake8
================================================
[flake8]
ignore =
    # indentation is not a multiple of four,
    E111,E114,
    # visually indented line with same indent as next logical line,
    E129,
    # expected 2 blank lines, found 1
    E302,E305,
    # closing bracket does not match indentation of opening bracket's line
    E123,
    # multiple spaces before operator
    E221,
    # line break before binary operator
    W503,
    # line break after binary operator
    W504,
    # multiple statements on one line
    E701,
    # continuation line under-indented for hanging indent
    E121,
    # closing bracket does not match visual indentation
    E124,
    # continuation line with same indent as next logical line
    E125,
    # continuation line over-indented for visual indent
    E127,
    # continuation line under-indented for visual indent
    E128,
    # unexpected indentation
    E116,
    # too many blank lines
    E303,
    # missing whitespace around arithmetic operator
    E226,
    # test for membership should be 'not in'
    E713,
max-line-length=120


================================================
FILE: deps/cpplint/.gitignore
================================================
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

### Python Patch ###
.venv/

### Python.VirtualEnv Stack ###
# Virtualenv
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Ss]cripts
pyvenv.cfg
pip-selfcheck.json


================================================
FILE: deps/cpplint/.pylintrc
================================================
[BASIC]
include-naming-hint=yes
method-rgx=[A-Z_][A-Za-z0-9]{2,49}$
function-rgx=[A-Z_][A-Za-z0-9]{2,49}$|main|unicode_escape_decode
const-rgx=[a-zA-Z_][A-Za-z0-9_]{2,49}$
variable-rgx=[a-z_][a-z0-9_]{0,49}$
argument-rgx=[a-z_][a-z0-9_]{0,49}$
class-rgx=[A-Z_][a-zA-Z0-9]+$|basestring|unicode|long|xrange

[MESSAGES CONTROL]
disable=
  global-statement,
  multiple-statements,
  missing-docstring,
  no-else-return,
  no-self-use,
  consider-merging-isinstance,
  bad-continuation,
  fixme,
  bad-option-value,
  anomalous-unicode-escape-in-string,
  unused-argument,
  useless-object-inheritance,
  consider-using-dict-comprehension,
  consider-using-in,
  unnecessary-pass

[REPORTS]
output-format=colorized
reports=no
score=no

[FORMAT]
indent-string='  '
indent-after-paren=4
max-module-lines=10000

[DESIGN]
max-locals=25
max-line-length=100
max-attributes=10
max-branches=30
max-args=20
max-statements=75
max-returns=10
min-public-methods=0
max-bool-expr=10


================================================
FILE: deps/cpplint/.style.yapf
================================================
[style]
based_on_style = chromium
dedent_closing_brackets = True
coalesce_brackets = True
continuation_indent_width = 2


================================================
FILE: deps/cpplint/.travis.yml
================================================
language: python

python:
  - "3.8"
  - "3.7"
  - "3.6"
  - "3.5"
  - "2.7"
  - "pypy"
  - "pypy3"

install:
  - pip install --upgrade pip
  - pip install --upgrade setuptools
  - pip install -e .[dev]
  - pip install tox-travis

script:
  - tox


================================================
FILE: deps/cpplint/CONTRIBUTING.rst
================================================
Contributing guide
==================

Thanks for your interest in contributing to cpplint.

Any kinds of contributions are welcome: Bug reports, Documentation, Patches.

However cpplint is a bit special as a project because it aims to closely follow what Google does in the upstream repository.
That means Google remains the source of all major requirements and functionality of cpplint, where as this fork adds extensions to cpplint run on more environments and in more companies.
The difference between this cpplint and Google should remain so small that anyone can at a glance see there is no added change that could be regarded as a security vulnerability.

Here are some tips to make best use of your time:

1. Feature suggestions should initially be opened at the `upstream repository <https://github.com/google/styleguide>`_, but feel free to open an issue here to and link to the upstream issue.

2. Consider the goals and non-goals of this project:

Goals:

* Provides cpplint as a PyPI package for multiple python versions
* Add a few features and fixes aimed at usages outside Google

Non-Goals:

* Become an independent fork adding major features
* Fix python style issues in cpplint


Development
-----------

For many tasks, it is okay to just develop using a single installed python version. But if you need to test/debug the project in multiple python versions, you need to install those versions::

1. (Optional) Install multiple python versions

   1. (Optional) Install [pyenv](https://github.com/pyenv/pyenv-installer) to manage python versions
   2. (Optional) Using pyenv, install the python versions used in testing::

        pyenv install 2.7.16
        pyenv install 3.6.8

It may be okay to run and test python against locally installed libraries, but if you need to have a consistent build, it is recommended to manage your environment using virtualenv: [virtualenv](https://virtualenv.pypa.io/en/latest/ ), [virtualenvwrapper](https://pypi.org/project/virtualenvwrapper/ ):

1. (Optional) Setup a local virtual environment with all necessary tools and libraries::

      mkvirtualenv cpplint [-p /usr/bin/python3]
      pip install .[dev]

Alternatively you can locally install patches like this::

    pip install -e .[dev]
    # for usage without virtualenv, add --user

You can setup your local environment for developing patches for cpplint like this:

.. code-block:: bash

    # run a single test
    pytest --no-cov cpplint_unittest.py -k testExclude
    # run a single CLI integration test
    pytest --no-cov cpplint_clitest.py -k testSillySample
    # run all tests
    ./setup.py test
    ./setup.py lint
    ./setup.py style
    ./setup.py ci # all the above
    tox    # all of the above in all python environments

Releasing
---------

The release process first prepares the documentation, then publishes to testpypi to verify, then releases to real pypi. Testpypi acts like real pypi, so broken releases cannot be deleted. For a typical bugfixing release, no special issue on testpypi is expected (but it's still good practice).

To release a new version:

.. code-block:: bash

    # prepare files for release
    vi cpplint.py # increment the version
    vi changelog.rst # log changes
    git add cpplint.py changelog.rst
    git commit -m "Releasing x.y.z"
    # test-release (on env by mkvirtualenv -p /usr/bin/python3)
    pip install --upgrade setuptools wheel twine
    rm -rf dist
    # Test release, requires account on testpypi
    python3 setup.py sdist bdist_wheel
    twine upload --repository testpypi dist/*
    # ... Check website and downloads from https://test.pypi.org/project/cpplint/
    # Actual release
    twine upload dist/*
    git tag x.y.z
    git push
    git push --tags


Catching up with Upstream
-------------------------

For maintainers, it is a regular duty to look at what cpplint changes were merged upstream, to include them in this fork.

Checkout here and upstream google:

.. code-block:: bash

    git clone git@github.com:cpplint/cpplint.git
    cd cpplint
    git remote add google https://github.com/google/styleguide

To incorporate google's changes:

.. code-block:: bash

    git fetch google gh-pages

    ## Merge workflow (clean, no new commits)
    git checkout master -b updates
    git merge google/gh-pages # this will have a lot of conflicts
    # ... solve conflicts
    git merge -- continue
    
    ## Rebase workflow (dirty, creates new commits)
    git checkout -b updates FETCH_HEAD
    git rebase master # this will have a lot of conflicts, most of which can be solved with the next command (run repeatedly)
    # solve conflicts with files deleted in our fork (this is idempotent and safe to be called. when cpplint.py has conflicts, it will do nothing)
    git status | grep 'new file:' | awk '{print $3}' | xargs -r git rm --cached ; git status | grep 'deleted by us' | awk '{print $4}' | xargs -r git rm
    git status --untracked-files=no | grep 'nothing to commit' && git rebase --skip

    git push -u origin updates
    # check travis
    git push origin --delete updates

    git rebase updates master
    git branch -D updates
    git push

Setup fetching of pull requests in .git/config:

.. code-block:: bash

    [remote "origin"]
    	url = git@github.com:cpplint/cpplint.git
    	fetch = +refs/heads/*:refs/remotes/origin/*
    # following line should be new, fetches PRs from cpplint
    	fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
    [remote "google"]
    	url = https://github.com/google/styleguide
    	fetch = +refs/heads/*:refs/remotes/google/*
    # following line should be new, fetches PRs from google/styleguides
    	fetch = +refs/pull/*/head:refs/remotes/google/pr/*


To compare this for with upstream (after git fetch):

.. code-block:: bash

    git diff google/gh-pages:cpplint/cpplint.py master:cpplint.py
    git diff google/gh-pages:cpplint/cpplint_unittest.py master:cpplint_unittest.py


================================================
FILE: deps/cpplint/LICENSE
================================================
cpplint.py and its corresponding unit tests are Copyright (C) 2009 Google Inc.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

   * Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
   * Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
   * Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


================================================
FILE: deps/cpplint/MANIFEST.in
================================================
# MANIFEST.in file required to deliver test files with source tar
include *.py
include LICENSE
include test-requirements
include dev-requirements

# all samples for clitest
graft samples

global-exclude .tox
global-exclude *~
global-exclude __pycache__
global-exclude .coverage
global-exclude *.py[co]
global-exclude *.db
global-exclude .git*
global-exclude *.orig


================================================
FILE: deps/cpplint/README.rst
================================================
cpplint - static code checker for C++
=====================================

.. image:: https://travis-ci.org/cpplint/cpplint.svg?branch=master
    :target: https://travis-ci.org/cpplint/cpplint

.. image:: https://img.shields.io/pypi/v/cpplint.svg
    :target: https://pypi.python.org/pypi/cpplint

.. image:: https://img.shields.io/pypi/pyversions/cpplint.svg
    :target: https://pypi.python.org/pypi/cpplint

.. image:: https://img.shields.io/pypi/status/cpplint.svg
    :target: https://pypi.python.org/pypi/cpplint

.. image:: https://img.shields.io/pypi/l/cpplint.svg
    :target: https://pypi.python.org/pypi/cpplint

.. image:: https://img.shields.io/pypi/dd/cpplint.svg
    :target: https://pypi.python.org/pypi/cpplint

.. image:: https://img.shields.io/pypi/dw/cpplint.svg
    :target: https://pypi.python.org/pypi/cpplint

.. image:: https://img.shields.io/pypi/dm/cpplint.svg
    :target: https://pypi.python.org/pypi/cpplint

Cpplint is a command-line tool to check C/C++ files for style issues following `Google's C++ style guide <http://google.github.io/styleguide/cppguide.html>`_.
Cpplint is developed and maintained by Google Inc. at `google/styleguide <https://github.com/google/styleguide>`_, also see the `wikipedia entry <http://en.wikipedia.org/wiki/Cpplint>`_

While Google maintains cpplint, Google is not (very) responsive to issues and pull requests, this fork aims to be (somewhat) more open to add fixes to cpplint to enable fixes, when those fixes make cpplint usable in wider contexts.
Also see discussion here https://github.com/google/styleguide/pull/528.


Installation
============


To install cpplint from PyPI, run:

.. code-block:: bash

    $ pip install cpplint

Then run it with:

.. code-block:: bash

    $ cpplint [OPTIONS] files

For full usage instructions, run:

.. code-block:: bash

    $ cpplint --help

Changes
-------

The modifications in this fork are minor fixes and cosmetic changes, such as:

* python 3 compatibility
* more default file extensions
* customizable file extensions with the --extensions argument
* continuous integration on travis
* support for recursive file discovery via the --recursive argument
* support for excluding files via --exclude
* JUnit XML output format
* Overriding repository root auto-detection via --repository
* Support ``#pragma once`` as an alternative to header include guards
* ... and a few more (most of which are open PRs on upstream)


Acknowledgements
----------------

Thanks to Google Inc. for open-sourcing their in-house tool.
Thanks to maintainers of the fork

* `tkruse <https://github.com/tkruse>`_  
* `mattyclarkson <https://github.com/mattyclarkson>`_
* `theandrewdavis <https://github.com/theandrewdavis>`_


================================================
FILE: deps/cpplint/changelog.rst
================================================
Changelog
=========

1.5.4 (2020-08-18)
-----

* Fix google#166, Allow space before C++11 attributes

1.5.3 (2020-07-20)
-----

* Fix #156: sed/gsed output parameter rejected
* Fix #156: sed/gsed output without other stdout information
* improvements to regression tests

1.5.2 (2020-06-24)
-----

* Fix #83, output formats "sed" and "gsed" to auto-fix some issues
* Fix #92, new category "build/namespaces_headers" for unnamed namespaces in header file
* Sort list of files before processing
* Fix #144 Falso positive for indent when using QT macros "signals" and "slots"
* Fix #76 Parsing of class decorators that also use digits
* Fix #139 Add message "Relative paths like . and .. are not allowed"

1.5.1 (2020-06-05)
-----

* Revert #43 behavior change for include order from 1.5.0, and hide it behind command-line-flag `--includeorder=standardcfirst`.
  It turns out there is no easy objective way to tell c system headers from certain c++ library headers, and Google cpplint intentionally classifies some C++ header includes as C system header for simplicity.
* Libraries considered as C system headers using --includeorder=standardcfirst now also includes linux-specifc headers (glibc-devel, glibc-kernheaders, linux-libc-dev).


1.5.0 (2020-05-31)
-----

* Fix #43 false positives in header include order by checking includes against a list of c headers.
  Since this interprets certain include lines different than before, output about header include order changes.

1.4.6 (2020-05-31)
-----

* Fix #135: allow 'if constexpr' in readability/braces.
* Fix runtime warning: Close files after reading contents

1.4.5 (2020-01-13)
-----

* Avoid false positive for [build/include_what_you_use] in case of `foo.set<type>` and `foo->set<type>` usage.
* Avoid false positive for [build/include_what_you_use] in case of `map` is user defined function
* Escape backslashes in pydoc strings to get rid of DeprecationWarning.
* Fix false positive "should include its header" for 3rd party headers
* Add support for c++17 tuple destructuring
* fix #123: Inconsistent behavior of --headers and --extensions
* Fix #114: --exclude not working recursively
* fix #112, identifying of copy constructors should allow combinations of volatile and const

1.4.4 (2019-02-25)
-----

Another cleanup release

* NOBUG: fix unit/cli tests for source release
* NOBUG: reduce diff to upstream by intentionally using deprecated functions where upstream uses them
* add `--version` command (https://github.com/cpplint/cpplint/issues/27)

1.4.3 (2019-02-18)
-----

* Revert "Fix the `build/endif_comment` check", same as reverted in upstream

1.4.2 (2019-02-17)
-----

* Cleanup release, fixes further issues with tests and source distribution

1.4.1 (2019-02-17)
-----

* Cleanup release, only adds test support files to source dist

1.4.0 (2019-02-17)
-----

* Incorporate cpplint updates from google (e5d807c6a0d,  2018-05-03)
  * Fix the `build/endif_comment` check (https://github.com/google/styleguide/pull/169)
  * Teach the explicit constructor check about constexpr (#56)
  * Changed vs7 output format (#57)
  * Remove presubmit check for DISALLOW_* macros (#54)
  * add `--quiet` flag as in upstream (https://github.com/google/styleguide/pull/293)
  * support `--root` argument to run in different folder (https://github.com/google/styleguide/pull/291)
  * Fix 16bit Unicode issue (https://github.com/google/styleguide/issues/337)

1.3.0 (2016-07-12)
-----

* Incorporate cpplint updates from google (6d3a7d8a2, 2016-07-14)
* Add --headers flag to choose which extensions are header files.
* Add regression testsing.

1.2.2 (2016-04-07)
-----

* Fixes bug causing RValue detection with namespaces to fail.

1.2.1 (2016-03-19)
-----

* Fixes error in setup.py.

1.2.0 (2016-03-19)
-----

* Adds `.cu` and `.cuh` as supported file extensions by default.
* Moves the warning "Include the directory when naming .h files" from the `build/include` category to the `build/include_subdir` category.

1.1.0 (2016-02-24)
-----

* Adds quiet option to suppress non error-related output.

1.0.1 (2016-02-12)
-----

* Updates PyPi README.

1.0.0 (2016-02-03)
-----

* Fixes a --repository flag bug.

0.0.9 (2016-01-23)
-----

* Adds the --exclude flag to exclude files from being linted.

0.0.8 (2016-01-18)
-----

* Adds the --repository flag to set the location of the project root for header guard calculations.
* Adds support for ``#pragma once`` as an alternative to header include guards.

0.0.7 (2016-01-07)
-----

* Fixes a Windows include guard bug.
* Adds escaping and more detail to JUnit XML output.

0.0.6 (2015-12-15)
-----

* Adds the --recursive flag.
* Adds JUnit XML output.

0.0.5 (2015-01-04)
-----

* Maintenance release, undoes earlier project folder structure changes to remain as true to upstream as possible.

0.0.4 (2015-01-04)
-----

* Merged with upstream revision r141 (2014-12-04)
* This includes many new checks, see commit messages for details
* This also reverts some renaming of files, to stay close to the original project


0.0.3 (2012-11-24)
-----

* python 3 compatibility

0.0.2 (2012-11-06)
-----

* fixed and extended allowed extensions

0.0.1 (2012-10-13)
-----

* import from googlecode, added setup.py
* imported revision r83 (2012-05-11)


================================================
FILE: deps/cpplint/cpplint.py
================================================
#!/usr/bin/env python
#
# Copyright (c) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#    * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#    * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#    * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

"""Does google-lint on c++ files.

The goal of this script is to identify places in the code that *may*
be in non-compliance with google style.  It does not attempt to fix
up these problems -- the point is to educate.  It does also not
attempt to find all problems, or to ensure that everything it does
find is legitimately a problem.

In particular, we can get very confused by /* and // inside strings!
We do a small hack, which is to ignore //'s with "'s after them on the
same line, but it is far from perfect (in either direction).
"""

import codecs
import copy
import getopt
import glob
import itertools
import math  # for log
import os
import re
import sre_compile
import string
import sys
import sysconfig
import unicodedata
import xml.etree.ElementTree

# if empty, use defaults
_valid_extensions = set([])

__VERSION__ = '1.5.4'

try:
  xrange          # Python 2
except NameError:
  #  -- pylint: disable=redefined-builtin
  xrange = range  # Python 3


_USAGE = """
Syntax: cpplint.py [--verbose=#] [--output=emacs|eclipse|vs7|junit|sed|gsed]
                   [--filter=-x,+y,...]
                   [--counting=total|toplevel|detailed] [--root=subdir]
                   [--repository=path]
                   [--linelength=digits] [--headers=x,y,...]
                   [--recursive]
                   [--exclude=path]
                   [--extensions=hpp,cpp,...]
                   [--includeorder=default|standardcfirst]
                   [--quiet]
                   [--version]
        <file> [file] ...

  Style checker for C/C++ source files.
  This is a fork of the Google style checker with minor extensions.

  The style guidelines this tries to follow are those in
    https://google.github.io/styleguide/cppguide.html

  Every problem is given a confidence score from 1-5, with 5 meaning we are
  certain of the problem, and 1 meaning it could be a legitimate construct.
  This will miss some errors, and is not a substitute for a code review.

  To suppress false-positive errors of a certain category, add a
  'NOLINT(category)' comment to the line.  NOLINT or NOLINT(*)
  suppresses errors of all categories on that line.

  The files passed in will be linted; at least one file must be provided.
  Default linted extensions are %s.
  Other file types will be ignored.
  Change the extensions with the --extensions flag.

  Flags:

    output=emacs|eclipse|vs7|junit|sed|gsed
      By default, the output is formatted to ease emacs parsing.  Visual Studio
      compatible output (vs7) may also be used.  Further support exists for
      eclipse (eclipse), and JUnit (junit). XML parsers such as those used
      in Jenkins and Bamboo may also be used.
      The sed format outputs sed commands that should fix some of the errors.
      Note that this requires gnu sed. If that is installed as gsed on your
      system (common e.g. on macOS with homebrew) you can use the gsed output
      format. Sed commands are written to stdout, not stderr, so you should be
      able to pipe output straight to a shell to run the fixes.

    verbose=#
      Specify a number 0-5 to restrict errors to certain verbosity levels.
      Errors with lower verbosity levels have lower confidence and are more
      likely to be false positives.

    quiet
      Don't print anything if no errors are found.

    filter=-x,+y,...
      Specify a comma-separated list of category-filters to apply: only
      error messages whose category names pass the filters will be printed.
      (Category names are printed with the message and look like
      "[whitespace/indent]".)  Filters are evaluated left to right.
      "-FOO" and "FOO" means "do not print categories that start with FOO".
      "+FOO" means "do print categories that start with FOO".

      Examples: --filter=-whitespace,+whitespace/braces
                --filter=whitespace,runtime/printf,+runtime/printf_format
                --filter=-,+build/include_what_you_use

      To see a list of all the categories used in cpplint, pass no arg:
         --filter=

    counting=total|toplevel|detailed
      The total number of errors found is always printed. If
      'toplevel' is provided, then the count of errors in each of
      the top-level categories like 'build' and 'whitespace' will
      also be printed. If 'detailed' is provided, then a count
      is provided for each category like 'build/class'.

    repository=path
      The top level directory of the repository, used to derive the header
      guard CPP variable. By default, this is determined by searching for a
      path that contains .git, .hg, or .svn. When this flag is specified, the
      given path is used instead. This option allows the header guard CPP
      variable to remain consistent even if members of a team have different
      repository root directories (such as when checking out a subdirectory
      with SVN). In addition, users of non-mainstream version control systems
      can use this flag to ensure readable header guard CPP variables.

      Examples:
        Assuming that Alice checks out ProjectName and Bob checks out
        ProjectName/trunk and trunk contains src/chrome/ui/browser.h, then
        with no --repository flag, the header guard CPP variable will be:

        Alice => TRUNK_SRC_CHROME_BROWSER_UI_BROWSER_H_
        Bob   => SRC_CHROME_BROWSER_UI_BROWSER_H_

        If Alice uses the --repository=trunk flag and Bob omits the flag or
        uses --repository=. then the header guard CPP variable will be:

        Alice => SRC_CHROME_BROWSER_UI_BROWSER_H_
        Bob   => SRC_CHROME_BROWSER_UI_BROWSER_H_

    root=subdir
      The root directory used for deriving header guard CPP variable.
      This directory is relative to the top level directory of the repository
      which by default is determined by searching for a directory that contains
      .git, .hg, or .svn but can also be controlled with the --repository flag.
      If the specified directory does not exist, this flag is ignored.

      Examples:
        Assuming that src is the top level directory of the repository (and
        cwd=top/src), the header guard CPP variables for
        src/chrome/browser/ui/browser.h are:

        No flag => CHROME_BROWSER_UI_BROWSER_H_
        --root=chrome => BROWSER_UI_BROWSER_H_
        --root=chrome/browser => UI_BROWSER_H_
        --root=.. => SRC_CHROME_BROWSER_UI_BROWSER_H_

    linelength=digits
      This is the allowed line length for the project. The default value is
      80 characters.

      Examples:
        --linelength=120

    recursive
      Search for files to lint recursively. Each directory given in the list
      of files to be linted is replaced by all files that descend from that
      directory. Files with extensions not in the valid extensions list are
      excluded.

    exclude=path
      Exclude the given path from the list of files to be linted. Relative
      paths are evaluated relative to the current directory and shell globbing
      is performed. This flag can be provided multiple times to exclude
      multiple files.

      Examples:
        --exclude=one.cc
        --exclude=src/*.cc
        --exclude=src/*.cc --exclude=test/*.cc

    extensions=extension,extension,...
      The allowed file extensions that cpplint will check

      Examples:
        --extensions=%s

    includeorder=default|standardcfirst
      For the build/include_order rule, the default is to blindly assume angle
      bracket includes with file extension are c-system-headers (default),
      even knowing this will have false classifications.
      The default is established at google.
      standardcfirst means to instead use an allow-list of known c headers and
      treat all others as separate group of "other system headers". The C headers
      included are those of the C-standard lib and closely related ones.

    headers=x,y,...
      The header extensions that cpplint will treat as .h in checks. Values are
      automatically added to --extensions list.
     (by default, only files with extensions %s will be assumed to be headers)

      Examples:
        --headers=%s
        --headers=hpp,hxx
        --headers=hpp

    cpplint.py supports per-directory configurations specified in CPPLINT.cfg
    files. CPPLINT.cfg file can contain a number of key=value pairs.
    Currently the following options are supported:

      set noparent
      filter=+filter1,-filter2,...
      exclude_files=regex
      linelength=80
      root=subdir
      headers=x,y,...

    "set noparent" option prevents cpplint from traversing directory tree
    upwards looking for more .cfg files in parent directories. This option
    is usually placed in the top-level project directory.

    The "filter" option is similar in function to --filter flag. It specifies
    message filters in addition to the |_DEFAULT_FILTERS| and those specified
    through --filter command-line flag.

    "exclude_files" allows to specify a regular expression to be matched against
    a file name. If the expression matches, the file is skipped and not run
    through the linter.

    "linelength" allows to specify the allowed line length for the project.

    The "root" option is similar in function to the --root flag (see example
    above). Paths are relative to the directory of the CPPLINT.cfg.

    The "headers" option is similar in function to the --headers flag
    (see example above).

    CPPLINT.cfg has an effect on files in the same directory and all
    sub-directories, unless overridden by a nested configuration file.

      Example file:
        filter=-build/include_order,+build/include_alpha
        exclude_files=.*\\.cc

    The above example disables build/include_order warning and enables
    build/include_alpha as well as excludes all .cc from being
    processed by linter, in the current directory (where the .cfg
    file is located) and all sub-directories.
"""

# We categorize each error message we print.  Here are the categories.
# We want an explicit list so we can list them all in cpplint --filter=.
# If you add a new error message with a new category, add it to the list
# here!  cpplint_unittest.py should tell you if you forget to do this.
_ERROR_CATEGORIES = [
    'build/class',
    'build/c++11',
    'build/c++14',
    'build/c++tr1',
    'build/deprecated',
    'build/endif_comment',
    'build/explicit_make_pair',
    'build/forward_decl',
    'build/header_guard',
    'build/include',
    'build/include_subdir',
    'build/include_alpha',
    'build/include_order',
    'build/include_what_you_use',
    'build/namespaces_headers',
    'build/namespaces_literals',
    'build/namespaces',
    'build/printf_format',
    'build/storage_class',
    'legal/copyright',
    'readability/alt_tokens',
    'readability/braces',
    'readability/casting',
    'readability/check',
    'readability/constructors',
    'readability/fn_size',
    'readability/inheritance',
    'readability/multiline_comment',
    'readability/multiline_string',
    'readability/namespace',
    'readability/nolint',
    'readability/nul',
    'readability/strings',
    'readability/todo',
    'readability/utf8',
    'runtime/arrays',
    'runtime/casting',
    'runtime/explicit',
    'runtime/int',
    'runtime/init',
    'runtime/invalid_increment',
    'runtime/member_string_references',
    'runtime/memset',
    'runtime/indentation_namespace',
    'runtime/operator',
    'runtime/printf',
    'runtime/printf_format',
    'runtime/references',
    'runtime/string',
    'runtime/threadsafe_fn',
    'runtime/vlog',
    'whitespace/blank_line',
    'whitespace/braces',
    'whitespace/comma',
    'whitespace/comments',
    'whitespace/empty_conditional_body',
    'whitespace/empty_if_body',
    'whitespace/empty_loop_body',
    'whitespace/end_of_line',
    'whitespace/ending_newline',
    'whitespace/forcolon',
    'whitespace/indent',
    'whitespace/line_length',
    'whitespace/newline',
    'whitespace/operators',
    'whitespace/parens',
    'whitespace/semicolon',
    'whitespace/tab',
    'whitespace/todo',
    ]

# keywords to use with --outputs which generate stdout for machine processing
_MACHINE_OUTPUTS = [
  'junit',
  'sed',
  'gsed'
]

# These error categories are no longer enforced by cpplint, but for backwards-
# compatibility they may still appear in NOLINT comments.
_LEGACY_ERROR_CATEGORIES = [
    'readability/streams',
    'readability/function',
    ]

# The default state of the category filter. This is overridden by the --filter=
# flag. By default all errors are on, so only add here categories that should be
# off by default (i.e., categories that must be enabled by the --filter= flags).
# All entries here should start with a '-' or '+', as in the --filter= flag.
_DEFAULT_FILTERS = ['-build/include_alpha']

# The default list of categories suppressed for C (not C++) files.
_DEFAULT_C_SUPPRESSED_CATEGORIES = [
    'readability/casting',
    ]

# The default list of categories suppressed for Linux Kernel files.
_DEFAULT_KERNEL_SUPPRESSED_CATEGORIES = [
    'whitespace/tab',
    ]

# We used to check for high-bit characters, but after much discussion we
# decided those were OK, as long as they were in UTF-8 and didn't represent
# hard-coded international strings, which belong in a separate i18n file.

# C++ headers
_CPP_HEADERS = frozenset([
    # Legacy
    'algobase.h',
    'algo.h',
    'alloc.h',
    'builtinbuf.h',
    'bvector.h',
    'complex.h',
    'defalloc.h',
    'deque.h',
    'editbuf.h',
    'fstream.h',
    'function.h',
    'hash_map',
    'hash_map.h',
    'hash_set',
    'hash_set.h',
    'hashtable.h',
    'heap.h',
    'indstream.h',
    'iomanip.h',
    'iostream.h',
    'istream.h',
    'iterator.h',
    'list.h',
    'map.h',
    'multimap.h',
    'multiset.h',
    'ostream.h',
    'pair.h',
    'parsestream.h',
    'pfstream.h',
    'procbuf.h',
    'pthread_alloc',
    'pthread_alloc.h',
    'rope',
    'rope.h',
    'ropeimpl.h',
    'set.h',
    'slist',
    'slist.h',
    'stack.h',
    'stdiostream.h',
    'stl_alloc.h',
    'stl_relops.h',
    'streambuf.h',
    'stream.h',
    'strfile.h',
    'strstream.h',
    'tempbuf.h',
    'tree.h',
    'type_traits.h',
    'vector.h',
    # 17.6.1.2 C++ library headers
    'algorithm',
    'array',
    'atomic',
    'bitset',
    'chrono',
    'codecvt',
    'complex',
    'condition_variable',
    'deque',
    'exception',
    'forward_list',
    'fstream',
    'functional',
    'future',
    'initializer_list',
    'iomanip',
    'ios',
    'iosfwd',
    'iostream',
    'istream',
    'iterator',
    'limits',
    'list',
    'locale',
    'map',
    'memory',
    'mutex',
    'new',
    'numeric',
    'ostream',
    'queue',
    'random',
    'ratio',
    'regex',
    'scoped_allocator',
    'set',
    'sstream',
    'stack',
    'stdexcept',
    'streambuf',
    'string',
    'strstream',
    'system_error',
    'thread',
    'tuple',
    'typeindex',
    'typeinfo',
    'type_traits',
    'unordered_map',
    'unordered_set',
    'utility',
    'valarray',
    'vector',
    # 17.6.1.2 C++14 headers
    'shared_mutex',
    # 17.6.1.2 C++17 headers
    'any',
    'charconv',
    'codecvt',
    'execution',
    'filesystem',
    'memory_resource',
    'optional',
    'string_view',
    'variant',
    # 17.6.1.2 C++ headers for C library facilities
    'cassert',
    'ccomplex',
    'cctype',
    'cerrno',
    'cfenv',
    'cfloat',
    'cinttypes',
    'ciso646',
    'climits',
    'clocale',
    'cmath',
    'csetjmp',
    'csignal',
    'cstdalign',
    'cstdarg',
    'cstdbool',
    'cstddef',
    'cstdint',
    'cstdio',
    'cstdlib',
    'cstring',
    'ctgmath',
    'ctime',
    'cuchar',
    'cwchar',
    'cwctype',
    ])

# C headers
_C_HEADERS = frozenset([
    # System C headers
    'assert.h',
    'complex.h',
    'ctype.h',
    'errno.h',
    'fenv.h',
    'float.h',
    'inttypes.h',
    'iso646.h',
    'limits.h',
    'locale.h',
    'math.h',
    'setjmp.h',
    'signal.h',
    'stdalign.h',
    'stdarg.h',
    'stdatomic.h',
    'stdbool.h',
    'stddef.h',
    'stdint.h',
    'stdio.h',
    'stdlib.h',
    'stdnoreturn.h',
    'string.h',
    'tgmath.h',
    'threads.h',
    'time.h',
    'uchar.h',
    'wchar.h',
    'wctype.h',
    # additional POSIX C headers
    'aio.h',
    'arpa/inet.h',
    'cpio.h',
    'dirent.h',
    'dlfcn.h',
    'fcntl.h',
    'fmtmsg.h',
    'fnmatch.h',
    'ftw.h',
    'glob.h',
    'grp.h',
    'iconv.h',
    'langinfo.h',
    'libgen.h',
    'monetary.h',
    'mqueue.h',
    'ndbm.h',
    'net/if.h',
    'netdb.h',
    'netinet/in.h',
    'netinet/tcp.h',
    'nl_types.h',
    'poll.h',
    'pthread.h',
    'pwd.h',
    'regex.h',
    'sched.h',
    'search.h',
    'semaphore.h',
    'setjmp.h',
    'signal.h',
    'spawn.h',
    'strings.h',
    'stropts.h',
    'syslog.h',
    'tar.h',
    'termios.h',
    'trace.h',
    'ulimit.h',
    'unistd.h',
    'utime.h',
    'utmpx.h',
    'wordexp.h',
    # additional GNUlib headers
    'a.out.h',
    'aliases.h',
    'alloca.h',
    'ar.h',
    'argp.h',
    'argz.h',
    'byteswap.h',
    'crypt.h',
    'endian.h',
    'envz.h',
    'err.h',
    'error.h',
    'execinfo.h',
    'fpu_control.h',
    'fstab.h',
    'fts.h',
    'getopt.h',
    'gshadow.h',
    'ieee754.h',
    'ifaddrs.h',
    'libintl.h',
    'mcheck.h',
    'mntent.h',
    'obstack.h',
    'paths.h',
    'printf.h',
    'pty.h',
    'resolv.h',
    'shadow.h',
    'sysexits.h',
    'ttyent.h',
    # Additional linux glibc headers
    'dlfcn.h',
    'elf.h',
    'features.h',
    'gconv.h',
    'gnu-versions.h',
    'lastlog.h',
    'libio.h',
    'link.h',
    'malloc.h',
    'memory.h',
    'netash/ash.h',
    'netatalk/at.h',
    'netax25/ax25.h',
    'neteconet/ec.h',
    'netipx/ipx.h',
    'netiucv/iucv.h',
    'netpacket/packet.h',
    'netrom/netrom.h',
    'netrose/rose.h',
    'nfs/nfs.h',
    'nl_types.h',
    'nss.h',
    're_comp.h',
    'regexp.h',
    'sched.h',
    'sgtty.h',
    'stab.h',
    'stdc-predef.h',
    'stdio_ext.h',
    'syscall.h',
    'termio.h',
    'thread_db.h',
    'ucontext.h',
    'ustat.h',
    'utmp.h',
    'values.h',
    'wait.h',
    'xlocale.h',
    # Hardware specific headers
    'arm_neon.h',
    'emmintrin.h',
    'xmmintin.h',
    ])

# Folders of C libraries so commonly used in C++,
# that they have parity with standard C libraries.
C_STANDARD_HEADER_FOLDERS = frozenset([
    # standard C library
    "sys",
    # glibc for linux
    "arpa",
    "asm-generic",
    "bits",
    "gnu",
    "net",
    "netinet",
    "protocols",
    "rpc",
    "rpcsvc",
    "scsi",
    # linux kernel header
    "drm",
    "linux",
    "misc",
    "mtd",
    "rdma",
    "sound",
    "video",
    "xen",
  ])

# Type names
_TYPES = re.compile(
    r'^(?:'
    # [dcl.type.simple]
    r'(char(16_t|32_t)?)|wchar_t|'
    r'bool|short|int|long|signed|unsigned|float|double|'
    # [support.types]
    r'(ptrdiff_t|size_t|max_align_t|nullptr_t)|'
    # [cstdint.syn]
    r'(u?int(_fast|_least)?(8|16|32|64)_t)|'
    r'(u?int(max|ptr)_t)|'
    r')$')


# These headers are excluded from [build/include] and [build/include_order]
# checks:
# - Anything not following google file name conventions (containing an
#   uppercase character, such as Python.h or nsStringAPI.h, for example).
# - Lua headers.
_THIRD_PARTY_HEADERS_PATTERN = re.compile(
    r'^(?:[^/]*[A-Z][^/]*\.h|lua\.h|lauxlib\.h|lualib\.h)$')

# Pattern for matching FileInfo.BaseName() against test file name
_test_suffixes = ['_test', '_regtest', '_unittest']
_TEST_FILE_SUFFIX = '(' + '|'.join(_test_suffixes) + r')$'

# Pattern that matches only complete whitespace, possibly across multiple lines.
_EMPTY_CONDITIONAL_BODY_PATTERN = re.compile(r'^\s*$', re.DOTALL)

# Assertion macros.  These are defined in base/logging.h and
# testing/base/public/gunit.h.
_CHECK_MACROS = [
    'DCHECK', 'CHECK',
    'EXPECT_TRUE', 'ASSERT_TRUE',
    'EXPECT_FALSE', 'ASSERT_FALSE',
    ]

# Replacement macros for CHECK/DCHECK/EXPECT_TRUE/EXPECT_FALSE
_CHECK_REPLACEMENT = dict([(macro_var, {}) for macro_var in _CHECK_MACROS])

for op, replacement in [('==', 'EQ'), ('!=', 'NE'),
                        ('>=', 'GE'), ('>', 'GT'),
                        ('<=', 'LE'), ('<', 'LT')]:
  _CHECK_REPLACEMENT['DCHECK'][op] = 'DCHECK_%s' % replacement
  _CHECK_REPLACEMENT['CHECK'][op] = 'CHECK_%s' % replacement
  _CHECK_REPLACEMENT['EXPECT_TRUE'][op] = 'EXPECT_%s' % replacement
  _CHECK_REPLACEMENT['ASSERT_TRUE'][op] = 'ASSERT_%s' % replacement

for op, inv_replacement in [('==', 'NE'), ('!=', 'EQ'),
                            ('>=', 'LT'), ('>', 'LE'),
                            ('<=', 'GT'), ('<', 'GE')]:
  _CHECK_REPLACEMENT['EXPECT_FALSE'][op] = 'EXPECT_%s' % inv_replacement
  _CHECK_REPLACEMENT['ASSERT_FALSE'][op] = 'ASSERT_%s' % inv_replacement

# Alternative tokens and their replacements.  For full list, see section 2.5
# Alternative tokens [lex.digraph] in the C++ standard.
#
# Digraphs (such as '%:') are not included here since it's a mess to
# match those on a word boundary.
_ALT_TOKEN_REPLACEMENT = {
    'and': '&&',
    'bitor': '|',
    'or': '||',
    'xor': '^',
    'compl': '~',
    'bitand': '&',
    'and_eq': '&=',
    'or_eq': '|=',
    'xor_eq': '^=',
    'not': '!',
    'not_eq': '!='
    }

# Compile regular expression that matches all the above keywords.  The "[ =()]"
# bit is meant to avoid matching these keywords outside of boolean expressions.
#
# False positives include C-style multi-line comments and multi-line strings
# but those have always been troublesome for cpplint.
_ALT_TOKEN_REPLACEMENT_PATTERN = re.compile(
    r'[ =()](' + ('|'.join(_ALT_TOKEN_REPLACEMENT.keys())) + r')(?=[ (]|$)')


# These constants define types of headers for use with
# _IncludeState.CheckNextIncludeOrder().
_C_SYS_HEADER = 1
_CPP_SYS_HEADER = 2
_OTHER_SYS_HEADER = 3
_LIKELY_MY_HEADER = 4
_POSSIBLE_MY_HEADER = 5
_OTHER_HEADER = 6

# These constants define the current inline assembly state
_NO_ASM = 0       # Outside of inline assembly block
_INSIDE_ASM = 1   # Inside inline assembly block
_END_ASM = 2      # Last line of inline assembly block
_BLOCK_ASM = 3    # The whole block is an inline assembly block

# Match start of assembly blocks
_MATCH_ASM = re.compile(r'^\s*(?:asm|_asm|__asm|__asm__)'
                        r'(?:\s+(volatile|__volatile__))?'
                        r'\s*[{(]')

# Match strings that indicate we're working on a C (not C++) file.
_SEARCH_C_FILE = re.compile(r'\b(?:LINT_C_FILE|'
                            r'vim?:\s*.*(\s*|:)filetype=c(\s*|:|$))')

# Match string that indicates we're working on a Linux Kernel file.
_SEARCH_KERNEL_FILE = re.compile(r'\b(?:LINT_KERNEL_FILE)')

# Commands for sed to fix the problem
_SED_FIXUPS = {
  'Remove spaces around =': r's/ = /=/',
  'Remove spaces around !=': r's/ != /!=/',
  'Remove space before ( in if (': r's/if (/if(/',
  'Remove space before ( in for (': r's/for (/for(/',
  'Remove space before ( in while (': r's/while (/while(/',
  'Remove space before ( in switch (': r's/switch (/switch(/',
  'Should have a space between // and comment': r's/\/\//\/\/ /',
  'Missing space before {': r's/\([^ ]\){/\1 {/',
  'Tab found, replace by spaces': r's/\t/  /g',
  'Line ends in whitespace.  Consider deleting these extra spaces.': r's/\s*$//',
  'You don\'t need a ; after a }': r's/};/}/',
  'Missing space after ,': r's/,\([^ ]\)/, \1/g',
}

_regexp_compile_cache = {}

# {str, set(int)}: a map from error categories to sets of linenumbers
# on which those errors are expected and should be suppressed.
_error_suppressions = {}

# The root directory used for deriving header guard CPP variable.
# This is set by --root flag.
_root = None
_root_debug = False

# The top level repository directory. If set, _root is calculated relative to
# this directory instead of the directory containing version control artifacts.
# This is set by the --repository flag.
_repository = None

# Files to exclude from linting. This is set by the --exclude flag.
_excludes = None

# Whether to supress all PrintInfo messages, UNRELATED to --quiet flag
_quiet = False

# The allowed line length of files.
# This is set by --linelength flag.
_line_length = 80

# This allows to use different include order rule than default
_include_order = "default"

try:
  unicode
except NameError:
  #  -- pylint: disable=redefined-builtin
  basestring = unicode = str

try:
  long
except NameError:
  #  -- pylint: disable=redefined-builtin
  long = int

if sys.version_info < (3,):
  #  -- pylint: disable=no-member
  # BINARY_TYPE = str
  itervalues = dict.itervalues
  iteritems = dict.iteritems
else:
  # BINARY_TYPE = bytes
  itervalues = dict.values
  iteritems = dict.items

def unicode_escape_decode(x):
  if sys.version_info < (3,):
    return codecs.unicode_escape_decode(x)[0]
  else:
    return x

# Treat all headers starting with 'h' equally: .h, .hpp, .hxx etc.
# This is set by --headers flag.
_hpp_headers = set([])

# {str, bool}: a map from error categories to booleans which indicate if the
# category should be suppressed for every line.
_global_error_suppressions = {}

def ProcessHppHeadersOption(val):
  global _hpp_headers
  try:
    _hpp_headers = {ext.strip() for ext in val.split(',')}
  except ValueError:
    PrintUsage('Header extensions must be comma separated list.')

def ProcessIncludeOrderOption(val):
  if val is None or val == "default":
    pass
  elif val == "standardcfirst":
    global _include_order
    _include_order = val
  else:
    PrintUsage('Invalid includeorder value %s. Expected default|standardcfirst')

def IsHeaderExtension(file_extension):
  return file_extension in GetHeaderExtensions()

def GetHeaderExtensions():
  if _hpp_headers:
    return _hpp_headers
  if _valid_extensions:
    return {h for h in _valid_extensions if 'h' in h}
  return set(['h', 'hh', 'hpp', 'hxx', 'h++', 'cuh'])

# The allowed extensions for file names
# This is set by --extensions flag
def GetAllExtensions():
  return GetHeaderExtensions().union(_valid_extensions or set(
    ['c', 'cc', 'cpp', 'cxx', 'c++', 'cu']))

def ProcessExtensionsOption(val):
  global _valid_extensions
  try:
    extensions = [ext.strip() for ext in val.split(',')]
    _valid_extensions = set(extensions)
  except ValueError:
    PrintUsage('Extensions should be a comma-separated list of values;'
               'for example: extensions=hpp,cpp\n'
               'This could not be parsed: "%s"' % (val,))

def GetNonHeaderExtensions():
  return GetAllExtensions().difference(GetHeaderExtensions())

def ParseNolintSuppressions(filename, raw_line, linenum, error):
  """Updates the global list of line error-suppressions.

  Parses any NOLINT comments on the current line, updating the global
  error_suppressions store.  Reports an error if the NOLINT comment
  was malformed.

  Args:
    filename: str, the name of the input file.
    raw_line: str, the line of input text, with comments.
    linenum: int, the number of the current line.
    error: function, an error handler.
  """
  matched = Search(r'\bNOLINT(NEXTLINE)?\b(\([^)]+\))?', raw_line)
  if matched:
    if matched.group(1):
      suppressed_line = linenum + 1
    else:
      suppressed_line = linenum
    category = matched.group(2)
    if category in (None, '(*)'):  # => "suppress all"
      _error_suppressions.setdefault(None, set()).add(suppressed_line)
    else:
      if category.startswith('(') and category.endswith(')'):
        category = category[1:-1]
        if category in _ERROR_CATEGORIES:
          _error_suppressions.setdefault(category, set()).add(suppressed_line)
        elif category not in _LEGACY_ERROR_CATEGORIES:
          error(filename, linenum, 'readability/nolint', 5,
                'Unknown NOLINT error category: %s' % category)


def ProcessGlobalSuppresions(lines):
  """Updates the list of global error suppressions.

  Parses any lint directives in the file that have global effect.

  Args:
    lines: An array of strings, each representing a line of the file, with the
           last element being empty if the file is terminated with a newline.
  """
  for line in lines:
    if _SEARCH_C_FILE.search(line):
      for category in _DEFAULT_C_SUPPRESSED_CATEGORIES:
        _global_error_suppressions[category] = True
    if _SEARCH_KERNEL_FILE.search(line):
      for category in _DEFAULT_KERNEL_SUPPRESSED_CATEGORIES:
        _global_error_suppressions[category] = True


def ResetNolintSuppressions():
  """Resets the set of NOLINT suppressions to empty."""
  _error_suppressions.clear()
  _global_error_suppressions.clear()


def IsErrorSuppressedByNolint(category, linenum):
  """Returns true if the specified error category is suppressed on this line.

  Consults the global error_suppressions map populated by
  ParseNolintSuppressions/ProcessGlobalSuppresions/ResetNolintSuppressions.

  Args:
    category: str, the category of the error.
    linenum: int, the current line number.
  Returns:
    bool, True iff the error should be suppressed due to a NOLINT comment or
    global suppression.
  """
  return (_global_error_suppressions.get(category, False) or
          linenum in _error_suppressions.get(category, set()) or
          linenum in _error_suppressions.get(None, set()))


def Match(pattern, s):
  """Matches the string with the pattern, caching the compiled regexp."""
  # The regexp compilation caching is inlined in both Match and Search for
  # performance reasons; factoring it out into a separate function turns out
  # to be noticeably expensive.
  if pattern not in _regexp_compile_cache:
    _regexp_compile_cache[pattern] = sre_compile.compile(pattern)
  return _regexp_compile_cache[pattern].match(s)


def ReplaceAll(pattern, rep, s):
  """Replaces instances of pattern in a string with a replacement.

  The compiled regex is kept in a cache shared by Match and Search.

  Args:
    pattern: regex pattern
    rep: replacement text
    s: search string

  Returns:
    string with replacements made (or original string if no replacements)
  """
  if pattern not in _regexp_compile_cache:
    _regexp_compile_cache[pattern] = sre_compile.compile(pattern)
  return _regexp_compile_cache[pattern].sub(rep, s)


def Search(pattern, s):
  """Searches the string for the pattern, caching the compiled regexp."""
  if pattern not in _regexp_compile_cache:
    _regexp_compile_cache[pattern] = sre_compile.compile(pattern)
  return _regexp_compile_cache[pattern].search(s)


def _IsSourceExtension(s):
  """File extension (excluding dot) matches a source file extension."""
  return s in GetNonHeaderExtensions()


class _IncludeState(object):
  """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.

  """
  # self._section will move monotonically through this set. If it ever
  # needs to move backwards, CheckNextIncludeOrder will raise an error.
  _INITIAL_SECTION = 0
  _MY_H_SECTION = 1
  _C_SECTION = 2
  _CPP_SECTION = 3
  _OTHER_SYS_SECTION = 4
  _OTHER_H_SECTION = 5

  _TYPE_NAMES = {
      _C_SYS_HEADER: 'C system header',
      _CPP_SYS_HEADER: 'C++ system header',
      _OTHER_SYS_HEADER: 'other system header',
      _LIKELY_MY_HEADER: 'header this file implements',
      _POSSIBLE_MY_HEADER: 'header this file may implement',
      _OTHER_HEADER: 'other header',
      }
  _SECTION_NAMES = {
      _INITIAL_SECTION: "... nothing. (This can't be an error.)",
      _MY_H_SECTION: 'a header this file implements',
      _C_SECTION: 'C system header',
      _CPP_SECTION: 'C++ system header',
      _OTHER_SYS_SECTION: 'other system header',
      _OTHER_H_SECTION: 'other header',
      }

  def __init__(self):
    self.include_list = [[]]
    self._section = None
    self._last_header = None
    self.ResetSection('')

  def 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.
    """
    for section_list in self.include_list:
      for f in section_list:
        if f[0] == header:
          return f[1]
    return -1

  def ResetSection(self, directive):
    """Reset section checking for preprocessor directive.

    Args:
      directive: preprocessor directive (e.g. "if", "else").
    """
    # The name of the current section.
    self._section = self._INITIAL_SECTION
    # The path of last found header.
    self._last_header = ''

    # Update list of includes.  Note that we never pop from the
    # include list.
    if directive in ('if', 'ifdef', 'ifndef'):
      self.include_list.append([])
    elif directive in ('else', 'elif'):
      self.include_list[-1] = []

  def SetLastHeader(self, header_path):
    self._last_header = header_path

  def 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.
    """
    return header_path.replace('-inl.h', '.h').replace('-', '_').lower()

  def 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.
    """
    # If previous section is different from current section, _last_header will
    # be reset to empty string, so it's always less than current header.
    #
    # If previous line was a blank line, assume that the headers are
    # intentionally sorted the way they are.
    if (self._last_header > header_path and
        Match(r'^\s*#\s*include\b', clean_lines.elided[linenum - 1])):
      return False
    return True

  def 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.

    """
    error_message = ('Found %s after %s' %
                     (self._TYPE_NAMES[header_type],
                      self._SECTION_NAMES[self._section]))

    last_section = self._section

    if header_type == _C_SYS_HEADER:
      if self._section <= self._C_SECTION:
        self._section = self._C_SECTION
      else:
        self._last_header = ''
        return error_message
    elif header_type == _CPP_SYS_HEADER:
      if self._section <= self._CPP_SECTION:
        self._section = self._CPP_SECTION
      else:
        self._last_header = ''
        return error_message
    elif header_type == _OTHER_SYS_HEADER:
      if self._section <= self._OTHER_SYS_SECTION:
        self._section = self._OTHER_SYS_SECTION
      else:
        self._last_header = ''
        return error_message
    elif header_type == _LIKELY_MY_HEADER:
      if self._section <= self._MY_H_SECTION:
        self._section = self._MY_H_SECTION
      else:
        self._section = self._OTHER_H_SECTION
    elif header_type == _POSSIBLE_MY_HEADER:
      if self._section <= self._MY_H_SECTION:
        self._section = self._MY_H_SECTION
      else:
        # This will always be the fallback because we're not sure
        # enough that the header is associated with this file.
        self._section = self._OTHER_H_SECTION
    else:
      assert header_type == _OTHER_HEADER
      self._section = self._OTHER_H_SECTION

    if last_section != self._section:
      self._last_header = ''

    return ''


class _CppLintState(object):
  """Maintains module-wide state.."""

  def __init__(self):
    self.verbose_level = 1  # global setting.
    self.error_count = 0    # global count of reported errors
    # filters to apply when emitting error messages
    self.filters = _DEFAULT_FILTERS[:]
    # backup of filter list. Used to restore the state after each file.
    self._filters_backup = self.filters[:]
    self.counting = 'total'  # In what way are we counting errors?
    self.errors_by_category = {}  # string to int dict storing error counts
    self.quiet = False  # Suppress non-error messagess?

    # output format:
    # "emacs" - format that emacs can parse (default)
    # "eclipse" - format that eclipse can parse
    # "vs7" - format that Microsoft Visual Studio 7 can parse
    # "junit" - format that Jenkins, Bamboo, etc can parse
    # "sed" - returns a gnu sed command to fix the problem
    # "gsed" - like sed, but names the command gsed, e.g. for macOS homebrew users
    self.output_format = 'emacs'

    # For JUnit output, save errors and failures until the end so that they
    # can be written into the XML
    self._junit_errors = []
    self._junit_failures = []

  def SetOutputFormat(self, output_format):
    """Sets the output format for errors."""
    self.output_format = output_format

  def SetQuiet(self, quiet):
    """Sets the module's quiet settings, and returns the previous setting."""
    last_quiet = self.quiet
    self.quiet = quiet
    return last_quiet

  def SetVerboseLevel(self, level):
    """Sets the module's verbosity, and returns the previous setting."""
    last_verbose_level = self.verbose_level
    self.verbose_level = level
    return last_verbose_level

  def SetCountingStyle(self, counting_style):
    """Sets the module's counting options."""
    self.counting = counting_style

  def SetFilters(self, filters):
    """Sets the error-message filters.

    These filters are applied when deciding whether to emit a given
    error message.

    Args:
      filters: A string of comma-separated filters (eg "+whitespace/indent").
               Each filter should start with + or -; else we die.

    Raises:
      ValueError: The comma-separated filters did not all start with '+' or '-'.
                  E.g. "-,+whitespace,-whitespace/indent,whitespace/badfilter"
    """
    # Default filters always have less priority than the flag ones.
    self.filters = _DEFAULT_FILTERS[:]
    self.AddFilters(filters)

  def AddFilters(self, filters):
    """ Adds more filters to the existing list of error-message filters. """
    for filt in filters.split(','):
      clean_filt = filt.strip()
      if clean_filt:
        self.filters.append(clean_filt)
    for filt in self.filters:
      if not (filt.startswith('+') or filt.startswith('-')):
        raise ValueError('Every filter in --filters must start with + or -'
                         ' (%s does not)' % filt)

  def BackupFilters(self):
    """ Saves the current filter list to backup storage."""
    self._filters_backup = self.filters[:]

  def RestoreFilters(self):
    """ Restores filters previously backed up."""
    self.filters = self._filters_backup[:]

  def ResetErrorCounts(self):
    """Sets the module's error statistic back to zero."""
    self.error_count = 0
    self.errors_by_category = {}

  def IncrementErrorCount(self, category):
    """Bumps the module's error statistic."""
    self.error_count += 1
    if self.counting in ('toplevel', 'detailed'):
      if self.counting != 'detailed':
        category = category.split('/')[0]
      if category not in self.errors_by_category:
        self.errors_by_category[category] = 0
      self.errors_by_category[category] += 1

  def PrintErrorCounts(self):
    """Print a summary of errors by category, and the total."""
    for category, count in sorted(iteritems(self.errors_by_category)):
      self.PrintInfo('Category \'%s\' errors found: %d\n' %
                       (category, count))
    if self.error_count > 0:
      self.PrintInfo('Total errors found: %d\n' % self.error_count)

  def PrintInfo(self, message):
    # _quiet does not represent --quiet flag.
    # Hide infos from stdout to keep stdout pure for machine consumption
    if not _quiet and self.output_format not in _MACHINE_OUTPUTS:
      sys.stdout.write(message)

  def PrintError(self, message):
    if self.output_format == 'junit':
      self._junit_errors.append(message)
    else:
      sys.stderr.write(message)

  def AddJUnitFailure(self, filename, linenum, message, category, confidence):
    self._junit_failures.append((filename, linenum, message, category,
        confidence))

  def FormatJUnitXML(self):
    num_errors = len(self._junit_errors)
    num_failures = len(self._junit_failures)

    testsuite = xml.etree.ElementTree.Element('testsuite')
    testsuite.attrib['errors'] = str(num_errors)
    testsuite.attrib['failures'] = str(num_failures)
    testsuite.attrib['name'] = 'cpplint'

    if num_errors == 0 and num_failures == 0:
      testsuite.attrib['tests'] = str(1)
      xml.etree.ElementTree.SubElement(testsuite, 'testcase', name='passed')

    else:
      testsuite.attrib['tests'] = str(num_errors + num_failures)
      if num_errors > 0:
        testcase = xml.etree.ElementTree.SubElement(testsuite, 'testcase')
        testcase.attrib['name'] = 'errors'
        error = xml.etree.ElementTree.SubElement(testcase, 'error')
        error.text = '\n'.join(self._junit_errors)
      if num_failures > 0:
        # Group failures by file
        failed_file_order = []
        failures_by_file = {}
        for failure in self._junit_failures:
          failed_file = failure[0]
          if failed_file not in failed_file_order:
            failed_file_order.append(failed_file)
            failures_by_file[failed_file] = []
          failures_by_file[failed_file].append(failure)
        # Create a testcase for each file
        for failed_file in failed_file_order:
          failures = failures_by_file[failed_file]
          testcase = xml.etree.ElementTree.SubElement(testsuite, 'testcase')
          testcase.attrib['name'] = failed_file
          failure = xml.etree.ElementTree.SubElement(testcase, 'failure')
          template = '{0}: {1} [{2}] [{3}]'
          texts = [template.format(f[1], f[2], f[3], f[4]) for f in failures]
          failure.text = '\n'.join(texts)

    xml_decl = '<?xml version="1.0" encoding="UTF-8" ?>\n'
    return xml_decl + xml.etree.ElementTree.tostring(testsuite, 'utf-8').decode('utf-8')


_cpplint_state = _CppLintState()


def _OutputFormat():
  """Gets the module's output format."""
  return _cpplint_state.output_format


def _SetOutputFormat(output_format):
  """Sets the module's output format."""
  _cpplint_state.SetOutputFormat(output_format)

def _Quiet():
  """Return's the module's quiet setting."""
  return _cpplint_state.quiet

def _SetQuiet(quiet):
  """Set the module's quiet status, and return previous setting."""
  return _cpplint_state.SetQuiet(quiet)


def _VerboseLevel():
  """Returns the module's verbosity setting."""
  return _cpplint_state.verbose_level


def _SetVerboseLevel(level):
  """Sets the module's verbosity, and returns the previous setting."""
  return _cpplint_state.SetVerboseLevel(level)


def _SetCountingStyle(level):
  """Sets the module's counting options."""
  _cpplint_state.SetCountingStyle(level)


def _Filters():
  """Returns the module's list of output filters, as a list."""
  return _cpplint_state.filters


def _SetFilters(filters):
  """Sets the module's error-message filters.

  These filters are applied when deciding whether to emit a given
  error message.

  Args:
    filters: A string of comma-separated filters (eg "whitespace/indent").
             Each filter should start with + or -; else we die.
  """
  _cpplint_state.SetFilters(filters)

def _AddFilters(filters):
  """Adds more filter overrides.

  Unlike _SetFilters, this function does not reset the current list of filters
  available.

  Args:
    filters: A string of comma-separated filters (eg "whitespace/indent").
             Each filter should start with + or -; else we die.
  """
  _cpplint_state.AddFilters(filters)

def _BackupFilters():
  """ Saves the current filter list to backup storage."""
  _cpplint_state.BackupFilters()

def _RestoreFilters():
  """ Restores filters previously backed up."""
  _cpplint_state.RestoreFilters()

class _FunctionState(object):
  """Tracks current function name and the number of lines in its body."""

  _NORMAL_TRIGGER = 250  # for --v=0, 500 for --v=1, etc.
  _TEST_TRIGGER = 400    # about 50% more than _NORMAL_TRIGGER.

  def __init__(self):
    self.in_a_function = False
    self.lines_in_function = 0
    self.current_function = ''

  def Begin(self, function_name):
    """Start analyzing function body.

    Args:
      function_name: The name of the function being tracked.
    """
    self.in_a_function = True
    self.lines_in_function = 0
    self.current_function = function_name

  def Count(self):
    """Count line in current function body."""
    if self.in_a_function:
      self.lines_in_function += 1

  def Check(self, error, filename, linenum):
    """Report if too many lines in function body.

    Args:
      error: The function to call with any errors found.
      filename: The name of the current file.
      linenum: The number of the line to check.
    """
    if not self.in_a_function:
      return

    if Match(r'T(EST|est)', self.current_function):
      base_trigger = self._TEST_TRIGGER
    else:
      base_trigger = self._NORMAL_TRIGGER
    trigger = base_trigger * 2**_VerboseLevel()

    if self.lines_in_function > trigger:
      error_level = int(math.log(self.lines_in_function / base_trigger, 2))
      # 50 => 0, 100 => 1, 200 => 2, 400 => 3, 800 => 4, 1600 => 5, ...
      if error_level > 5:
        error_level = 5
      error(filename, linenum, 'readability/fn_size', error_level,
            'Small and focused functions are preferred:'
            ' %s has %d non-comment lines'
            ' (error triggered by exceeding %d lines).'  % (
                self.current_function, self.lines_in_function, trigger))

  def End(self):
    """Stop analyzing function body."""
    self.in_a_function = False


class _IncludeError(Exception):
  """Indicates a problem with the include order in a file."""
  pass


class FileInfo(object):
  """Provides utility functions for filenames.

  FileInfo provides easy access to the components of a file's path
  relative to the project root.
  """

  def __init__(self, filename):
    self._filename = filename

  def FullName(self):
    """Make Windows paths like Unix."""
    return os.path.abspath(self._filename).replace('\\', '/')

  def RepositoryName(self):
    r"""FullName after removing the local path to the repository.

    If we have a real absolute path name here we can try to do something smart:
    detecting the root of the checkout and truncating /path/to/checkout from
    the name so that we get header guards that don't include things like
    "C:\\Documents and Settings\\..." or "/home/username/..." in them and thus
    people on different computers who have checked the source out to different
    locations won't see bogus errors.
    """
    fullname = self.FullName()

    if os.path.exists(fullname):
      project_dir = os.path.dirname(fullname)

      # If the user specified a repository path, it exists, and the file is
      # contained in it, use the specified repository path
      if _repository:
        repo = FileInfo(_repository).FullName()
        root_dir = project_dir
        while os.path.exists(root_dir):
          # allow case insensitive compare on Windows
          if os.path.normcase(root_dir) == os.path.normcase(repo):
            return os.path.relpath(fullname, root_dir).replace('\\', '/')
          one_up_dir = os.path.dirname(root_dir)
          if one_up_dir == root_dir:
            break
          root_dir = one_up_dir

      if os.path.exists(os.path.join(project_dir, ".svn")):
        # If there's a .svn file in the current directory, we recursively look
        # up the directory tree for the top of the SVN checkout
        root_dir = project_dir
        one_up_dir = os.path.dirname(root_dir)
        while os.path.exists(os.path.join(one_up_dir, ".svn")):
          root_dir = os.path.dirname(root_dir)
          one_up_dir = os.path.dirname(one_up_dir)

        prefix = os.path.commonprefix([root_dir, project_dir])
        return fullname[len(prefix) + 1:]

      # Not SVN <= 1.6? Try to find a git, hg, or svn top level directory by
      # searching up from the current path.
      root_dir = current_dir = os.path.dirname(fullname)
      while current_dir != os.path.dirname(current_dir):
        if (os.path.exists(os.path.join(current_dir, ".git")) or
            os.path.exists(os.path.join(current_dir, ".hg")) or
            os.path.exists(os.path.join(current_dir, ".svn"))):
          root_dir = current_dir
        current_dir = os.path.dirname(current_dir)

      if (os.path.exists(os.path.join(root_dir, ".git")) or
          os.path.exists(os.path.join(root_dir, ".hg")) or
          os.path.exists(os.path.join(root_dir, ".svn"))):
        prefix = os.path.commonprefix([root_dir, project_dir])
        return fullname[len(prefix) + 1:]

    # Don't know what to do; header guard warnings may be wrong...
    return fullname

  def Split(self):
    """Splits the file into the directory, basename, and extension.

    For 'chrome/browser/browser.cc', Split() would
    return ('chrome/browser', 'browser', '.cc')

    Returns:
      A tuple of (directory, basename, extension).
    """

    googlename = self.RepositoryName()
    project, rest = os.path.split(googlename)
    return (project,) + os.path.splitext(rest)

  def BaseName(self):
    """File base name - text after the final slash, before the final period."""
    return self.Split()[1]

  def Extension(self):
    """File extension - text following the final period, includes that period."""
    return self.Split()[2]

  def NoExtension(self):
    """File has no source file extension."""
    return '/'.join(self.Split()[0:2])

  def IsSource(self):
    """File has a source file extension."""
    return _IsSourceExtension(self.Extension()[1:])


def _ShouldPrintError(category, confidence, linenum):
  """If confidence >= verbose, category passes filter and is not suppressed."""

  # There are three ways we might decide not to print an error message:
  # a "NOLINT(category)" comment appears in the source,
  # the verbosity level isn't high enough, or the filters filter it out.
  if IsErrorSuppressedByNolint(category, linenum):
    return False

  if confidence < _cpplint_state.verbose_level:
    return False

  is_filtered = False
  for one_filter in _Filters():
    if one_filter.startswith('-'):
      if category.startswith(one_filter[1:]):
        is_filtered = True
    elif one_filter.startswith('+'):
      if category.startswith(one_filter[1:]):
        is_filtered = False
    else:
      assert False  # should have been checked for in SetFilter.
  if is_filtered:
    return False

  return True


def Error(filename, linenum, category, confidence, message):
  """Logs the fact we've found a lint error.

  We log where the error was found, and also our confidence in the error,
  that is, how certain we are this is a legitimate style regression, and
  not a misidentification or a use that's sometimes justified.

  False positives can be suppressed by the use of
  "cpplint(category)"  comments on the offending line.  These are
  parsed into _error_suppressions.

  Args:
    filename: The name of the file containing the error.
    linenum: The number of the line containing the error.
    category: A string used to describe the "category" this bug
      falls under: "whitespace", say, or "runtime".  Categories
      may have a hierarchy separated by slashes: "whitespace/indent".
    confidence: A number from 1-5 representing a confidence score for
      the error, with 5 meaning that we are certain of the problem,
      and 1 meaning that it could be a legitimate construct.
    message: The error message.
  """
  if _ShouldPrintError(category, confidence, linenum):
    _cpplint_state.IncrementErrorCount(category)
    if _cpplint_state.output_format == 'vs7':
      _cpplint_state.PrintError('%s(%s): error cpplint: [%s] %s [%d]\n' % (
          filename, linenum, category, message, confidence))
    elif _cpplint_state.output_format == 'eclipse':
      sys.stderr.write('%s:%s: warning: %s  [%s] [%d]\n' % (
          filename, linenum, message, category, confidence))
    elif _cpplint_state.output_format == 'junit':
      _cpplint_state.AddJUnitFailure(filename, linenum, message, category,
          confidence)
    elif _cpplint_state.output_format in ['sed', 'gsed']:
      if message in _SED_FIXUPS:
        sys.stdout.write(_cpplint_state.output_format + " -i '%s%s' %s # %s  [%s] [%d]\n" % (
            linenum, _SED_FIXUPS[message], filename, message, category, confidence))
      else:
        sys.stderr.write('# %s:%s:  "%s"  [%s] [%d]\n' % (
            filename, linenum, message, category, confidence))
    else:
      final_message = '%s:%s:  %s  [%s] [%d]\n' % (
          filename, linenum, message, category, confidence)
      sys.stderr.write(final_message)

# Matches standard C++ escape sequences per 2.13.2.3 of the C++ standard.
_RE_PATTERN_CLEANSE_LINE_ESCAPES = re.compile(
    r'\\([abfnrtv?"\\\']|\d+|x[0-9a-fA-F]+)')
# Match a single C style comment on the same line.
_RE_PATTERN_C_COMMENTS = r'/\*(?:[^*]|\*(?!/))*\*/'
# Matches multi-line C style comments.
# This RE is a little bit more complicated than one might expect, because we
# have to take care of space removals tools so we can handle comments inside
# statements better.
# The current rule is: We only clear spaces from both sides when we're at the
# end of the line. Otherwise, we try to remove spaces from the right side,
# if this doesn't work we try on left side but only if there's a non-character
# on the right.
_RE_PATTERN_CLEANSE_LINE_C_COMMENTS = re.compile(
    r'(\s*' + _RE_PATTERN_C_COMMENTS + r'\s*$|' +
    _RE_PATTERN_C_COMMENTS + r'\s+|' +
    r'\s+' + _RE_PATTERN_C_COMMENTS + r'(?=\W)|' +
    _RE_PATTERN_C_COMMENTS + r')')


def IsCppString(line):
  """Does line terminate so, that the next symbol is in string constant.

  This function does not consider single-line nor multi-line comments.

  Args:
    line: is a partial line of code starting from the 0..n.

  Returns:
    True, if next character appended to 'line' is inside a
    string constant.
  """

  line = line.replace(r'\\', 'XX')  # after this, \\" does not match to \"
  return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1


def CleanseRawStrings(raw_lines):
  """Removes C++11 raw strings from lines.

    Before:
      static const char kData[] = R"(
          multi-line string
          )";

    After:
      static const char kData[] = ""
          (replaced by blank line)
          "";

  Args:
    raw_lines: list of raw lines.

  Returns:
    list of lines with C++11 raw strings replaced by empty strings.
  """

  delimiter = None
  lines_without_raw_strings = []
  for line in raw_lines:
    if delimiter:
      # Inside a raw string, look for the end
      end = line.find(delimiter)
      if end >= 0:
        # Found the end of the string, match leading space for this
        # line and resume copying the original lines, and also insert
        # a "" on the last line.
        leading_space = Match(r'^(\s*)\S', line)
        line = leading_space.group(1) + '""' + line[end + len(delimiter):]
        delimiter = None
      else:
        # Haven't found the end yet, append a blank line.
        line = '""'

    # Look for beginning of a raw string, and replace them with
    # empty strings.  This is done in a loop to handle multiple raw
    # strings on the same line.
    while delimiter is None:
      # Look for beginning of a raw string.
      # See 2.14.15 [lex.string] for syntax.
      #
      # Once we have matched a raw string, we check the prefix of the
      # line to make sure that the line is not part of a single line
      # comment.  It's done this way because we remove raw strings
      # before removing comments as opposed to removing comments
      # before removing raw strings.  This is because there are some
      # cpplint checks that requires the comments to be preserved, but
      # we don't want to check comments that are inside raw strings.
      matched = Match(r'^(.*?)\b(?:R|u8R|uR|UR|LR)"([^\s\\()]*)\((.*)$', line)
      if (matched and
          not Match(r'^([^\'"]|\'(\\.|[^\'])*\'|"(\\.|[^"])*")*//',
                    matched.group(1))):
        delimiter = ')' + matched.group(2) + '"'

        end = matched.group(3).find(delimiter)
        if end >= 0:
          # Raw string ended on same line
          line = (matched.group(1) + '""' +
                  matched.group(3)[end + len(delimiter):])
          delimiter = None
        else:
          # Start of a multi-line raw string
          line = matched.group(1) + '""'
      else:
        break

    lines_without_raw_strings.append(line)

  # TODO(unknown): if delimiter is not None here, we might want to
  # emit a warning for unterminated string.
  return lines_without_raw_strings


def FindNextMultiLineCommentStart(lines, lineix):
  """Find the beginning marker for a multiline comment."""
  while lineix < len(lines):
    if lines[lineix].strip().startswith('/*'):
      # Only return this marker if the comment goes beyond this line
      if lines[lineix].strip().find('*/', 2) < 0:
        return lineix
    lineix += 1
  return len(lines)


def FindNextMultiLineCommentEnd(lines, lineix):
  """We are inside a comment, find the end marker."""
  while lineix < len(lines):
    if lines[lineix].strip().endswith('*/'):
      return lineix
    lineix += 1
  return len(lines)


def RemoveMultiLineCommentsFromRange(lines, begin, end):
  """Clears a range of lines for multi-line comments."""
  # Having // <empty> comments makes the lines non-empty, so we will not get
  # unnecessary blank line warnings later in the code.
  for i in range(begin, end):
    lines[i] = '/**/'


def RemoveMultiLineComments(filename, lines, error):
  """Removes multiline (c-style) comments from lines."""
  lineix = 0
  while lineix < len(lines):
    lineix_begin = FindNextMultiLineCommentStart(lines, lineix)
    if lineix_begin >= len(lines):
      return
    lineix_end = FindNextMultiLineCommentEnd(lines, lineix_begin)
    if lineix_end >= len(lines):
      error(filename, lineix_begin + 1, 'readability/multiline_comment', 5,
            'Could not find end of multi-line comment')
      return
    RemoveMultiLineCommentsFromRange(lines, lineix_begin, lineix_end + 1)
    lineix = lineix_end + 1


def CleanseComments(line):
  """Removes //-comments and single-line C-style /* */ comments.

  Args:
    line: A line of C++ source.

  Returns:
    The line with single-line comments removed.
  """
  commentpos = line.find('//')
  if commentpos != -1 and not IsCppString(line[:commentpos]):
    line = line[:commentpos].rstrip()
  # get rid of /* ... */
  return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line)


class CleansedLines(object):
  """Holds 4 copies of all lines with different preprocessing applied to them.

  1) elided member contains lines without strings and comments.
  2) lines member contains lines without comments.
  3) raw_lines member contains all the lines without processing.
  4) lines_without_raw_strings member is same as raw_lines, but with C++11 raw
     strings removed.
  All these members are of <type 'list'>, and of the same length.
  """

  def __init__(self, lines):
    self.elided = []
    self.lines = []
    self.raw_lines = lines
    self.num_lines = len(lines)
    self.lines_without_raw_strings = CleanseRawStrings(lines)
    for linenum in range(len(self.lines_without_raw_strings)):
      self.lines.append(CleanseComments(
          self.lines_without_raw_strings[linenum]))
      elided = self._CollapseStrings(self.lines_without_raw_strings[linenum])
      self.elided.append(CleanseComments(elided))

  def NumLines(self):
    """Returns the number of lines represented."""
    return self.num_lines

  @staticmethod
  def _CollapseStrings(elided):
    """Collapses strings and chars on a line to simple "" or '' blocks.

    We nix strings first so we're not fooled by text like '"http://"'

    Args:
      elided: The line being processed.

    Returns:
      The line with collapsed strings.
    """
    if _RE_PATTERN_INCLUDE.match(elided):
      return elided

    # Remove escaped characters first to make quote/single quote collapsing
    # basic.  Things that look like escaped characters shouldn't occur
    # outside of strings and chars.
    elided = _RE_PATTERN_CLEANSE_LINE_ESCAPES.sub('', elided)

    # Replace quoted strings and digit separators.  Both single quotes
    # and double quotes are processed in the same loop, otherwise
    # nested quotes wouldn't work.
    collapsed = ''
    while True:
      # Find the first quote character
      match = Match(r'^([^\'"]*)([\'"])(.*)$', elided)
      if not match:
        collapsed += elided
        break
      head, quote, tail = match.groups()

      if quote == '"':
        # Collapse double quoted strings
        second_quote = tail.find('"')
        if second_quote >= 0:
          collapsed += head + '""'
          elided = tail[second_quote + 1:]
        else:
          # Unmatched double quote, don't bother processing the rest
          # of the line since this is probably a multiline string.
          collapsed += elided
          break
      else:
        # Found single quote, check nearby text to eliminate digit separators.
        #
        # There is no special handling for floating point here, because
        # the integer/fractional/exponent parts would all be parsed
        # correctly as long as there are digits on both sides of the
        # separator.  So we are fine as long as we don't see something
        # like "0.'3" (gcc 4.9.0 will not allow this literal).
        if Search(r'\b(?:0[bBxX]?|[1-9])[0-9a-fA-F]*$', head):
          match_literal = Match(r'^((?:\'?[0-9a-zA-Z_])*)(.*)$', "'" + tail)
          collapsed += head + match_literal.group(1).replace("'", '')
          elided = match_literal.group(2)
        else:
          second_quote = tail.find('\'')
          if second_quote >= 0:
            collapsed += head + "''"
            elided = tail[second_quote + 1:]
          else:
            # Unmatched single quote
            collapsed += elided
            break

    return collapsed


def FindEndOfExpressionInLine(line, startpos, stack):
  """Find the position just after the end of current parenthesized expression.

  Args:
    line: a CleansedLines line.
    startpos: start searching at this position.
    stack: nesting stack at startpos.

  Returns:
    On finding matching end: (index just after matching end, None)
    On finding an unclosed expression: (-1, None)
    Otherwise: (-1, new stack at end of this line)
  """
  for i in xrange(startpos, len(line)):
    char = line[i]
    if char in '([{':
      # Found start of parenthesized expression, push to expression stack
      stack.append(char)
    elif char == '<':
      # Found potential start of template argument list
      if i > 0 and line[i - 1] == '<':
        # Left shift operator
        if stack and stack[-1] == '<':
          stack.pop()
          if not stack:
            return (-1, None)
      elif i > 0 and Search(r'\boperator\s*$', line[0:i]):
        # operator<, don't add to stack
        continue
      else:
        # Tentative start of template argument list
        stack.append('<')
    elif char in ')]}':
      # Found end of parenthesized expression.
      #
      # If we are currently expecting a matching '>', the pending '<'
      # must have been an operator.  Remove them from expression stack.
      while stack and stack[-1] == '<':
        stack.pop()
      if not stack:
        return (-1, None)
      if ((stack[-1] == '(' and char == ')') or
          (stack[-1] == '[' and char == ']') or
          (stack[-1] == '{' and char == '}')):
        stack.pop()
        if not stack:
          return (i + 1, None)
      else:
        # Mismatched parentheses
        return (-1, None)
    elif char == '>':
      # Found potential end of template argument list.

      # Ignore "->" and operator functions
      if (i > 0 and
          (line[i - 1] == '-' or Search(r'\boperator\s*$', line[0:i - 1]))):
        continue

      # Pop the stack if there is a matching '<'.  Otherwise, ignore
      # this '>' since it must be an operator.
      if stack:
        if stack[-1] == '<':
          stack.pop()
          if not stack:
            return (i + 1, None)
    elif char == ';':
      # Found something that look like end of statements.  If we are currently
      # expecting a '>', the matching '<' must have been an operator, since
      # template argument list should not contain statements.
      while stack and stack[-1] == '<':
        stack.pop()
      if not stack:
        return (-1, None)

  # Did not find end of expression or unbalanced parentheses on this line
  return (-1, stack)


def CloseExpression(clean_lines, linenum, pos):
  """If input points to ( or { or [ or <, finds the position that closes it.

  If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
  linenum/pos that correspond to the closing of the expression.

  TODO(unknown): cpplint spends a fair bit of time matching parentheses.
  Ideally we would want to index all opening and closing parentheses once
  and have CloseExpression be just a simple lookup, but due to preprocessor
  tricks, this is not so easy.

  Args:
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    pos: A position on the line.

  Returns:
    A tuple (line, linenum, pos) pointer *past* the closing brace, or
    (line, len(lines), -1) if we never find a close.  Note we ignore
    strings and comments when matching; and the line we return is the
    'cleansed' line at linenum.
  """

  line = clean_lines.elided[linenum]
  if (line[pos] not in '({[<') or Match(r'<[<=]', line[pos:]):
    return (line, clean_lines.NumLines(), -1)

  # Check first line
  (end_pos, stack) = FindEndOfExpressionInLine(line, pos, [])
  if end_pos > -1:
    return (line, linenum, end_pos)

  # Continue scanning forward
  while stack and linenum < clean_lines.NumLines() - 1:
    linenum += 1
    line = clean_lines.elided[linenum]
    (end_pos, stack) = FindEndOfExpressionInLine(line, 0, stack)
    if end_pos > -1:
      return (line, linenum, end_pos)

  # Did not find end of expression before end of file, give up
  return (line, clean_lines.NumLines(), -1)


def FindStartOfExpressionInLine(line, endpos, stack):
  """Find position at the matching start of current expression.

  This is almost the reverse of FindEndOfExpressionInLine, but note
  that the input position and returned position differs by 1.

  Args:
    line: a CleansedLines line.
    endpos: start searching at this position.
    stack: nesting stack at endpos.

  Returns:
    On finding matching start: (index at matching start, None)
    On finding an unclosed expression: (-1, None)
    Otherwise: (-1, new stack at beginning of this line)
  """
  i = endpos
  while i >= 0:
    char = line[i]
    if char in ')]}':
      # Found end of expression, push to expression stack
      stack.append(char)
    elif char == '>':
      # Found potential end of template argument list.
      #
      # Ignore it if it's a "->" or ">=" or "operator>"
      if (i > 0 and
          (line[i - 1] == '-' or
           Match(r'\s>=\s', line[i - 1:]) or
           Search(r'\boperator\s*$', line[0:i]))):
        i -= 1
      else:
        stack.append('>')
    elif char == '<':
      # Found potential start of template argument list
      if i > 0 and line[i - 1] == '<':
        # Left shift operator
        i -= 1
      else:
        # If there is a matching '>', we can pop the expression stack.
        # Otherwise, ignore this '<' since it must be an operator.
        if stack and stack[-1] == '>':
          stack.pop()
          if not stack:
            return (i, None)
    elif char in '([{':
      # Found start of expression.
      #
      # If there are any unmatched '>' on the stack, they must be
      # operators.  Remove those.
      while stack and stack[-1] == '>':
        stack.pop()
      if not stack:
        return (-1, None)
      if ((char == '(' and stack[-1] == ')') or
          (char == '[' and stack[-1] == ']') or
          (char == '{' and stack[-1] == '}')):
        stack.pop()
        if not stack:
          return (i, None)
      else:
        # Mismatched parentheses
        return (-1, None)
    elif char == ';':
      # Found something that look like end of statements.  If we are currently
      # expecting a '<', the matching '>' must have been an operator, since
      # template argument list should not contain statements.
      while stack and stack[-1] == '>':
        stack.pop()
      if not stack:
        return (-1, None)

    i -= 1

  return (-1, stack)


def ReverseCloseExpression(clean_lines, linenum, pos):
  """If input points to ) or } or ] or >, finds the position that opens it.

  If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the
  linenum/pos that correspond to the opening of the expression.

  Args:
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    pos: A position on the line.

  Returns:
    A tuple (line, linenum, pos) pointer *at* the opening brace, or
    (line, 0, -1) if we never find the matching opening brace.  Note
    we ignore strings and comments when matching; and the line we
    return is the 'cleansed' line at linenum.
  """
  line = clean_lines.elided[linenum]
  if line[pos] not in ')}]>':
    return (line, 0, -1)

  # Check last line
  (start_pos, stack) = FindStartOfExpressionInLine(line, pos, [])
  if start_pos > -1:
    return (line, linenum, start_pos)

  # Continue scanning backward
  while stack and linenum > 0:
    linenum -= 1
    line = clean_lines.elided[linenum]
    (start_pos, stack) = FindStartOfExpressionInLine(line, len(line) - 1, stack)
    if start_pos > -1:
      return (line, linenum, start_pos)

  # Did not find start of expression before beginning of file, give up
  return (line, 0, -1)


def CheckForCopyright(filename, lines, error):
  """Logs an error if no Copyright message appears at the top of the file."""

  # We'll say it should occur by line 10. Don't forget there's a
  # placeholder line at the front.
  for line in xrange(1, min(len(lines), 11)):
    if re.search(r'Copyright', lines[line], re.I): break
  else:                       # means no copyright line was found
    error(filename, 0, 'legal/copyright', 5,
          'No copyright message found.  '
          'You should have a line: "Copyright [year] <Copyright Owner>"')


def GetIndentLevel(line):
  """Return the number of leading spaces in line.

  Args:
    line: A string to check.

  Returns:
    An integer count of leading spaces, possibly zero.
  """
  indent = Match(r'^( *)\S', line)
  if indent:
    return len(indent.group(1))
  else:
    return 0

def PathSplitToList(path):
  """Returns the path split into a list by the separator.

  Args:
    path: An absolute or relative path (e.g. '/a/b/c/' or '../a')

  Returns:
    A list of path components (e.g. ['a', 'b', 'c]).
  """
  lst = []
  while True:
    (head, tail) = os.path.split(path)
    if head == path:  # absolute paths end
      lst.append(head)
      break
    if tail == path:  # relative paths end
      lst.append(tail)
      break

    path = head
    lst.append(tail)

  lst.reverse()
  return lst

def GetHeaderGuardCPPVariable(filename):
  """Returns the CPP variable that should be used as a header guard.

  Args:
    filename: The name of a C++ header file.

  Returns:
    The CPP variable that should be used as a header guard in the
    named file.

  """

  # Restores original filename in case that cpplint is invoked from Emacs's
  # flymake.
  filename = re.sub(r'_flymake\.h$', '.h', filename)
  filename = re.sub(r'/\.flymake/([^/]*)$', r'/\1', filename)
  # Replace 'c++' with 'cpp'.
  filename = filename.replace('C++', 'cpp').replace('c++', 'cpp')

  fileinfo = FileInfo(filename)
  file_path_from_root = fileinfo.RepositoryName()

  def FixupPathFromRoot():
    if _root_debug:
      sys.stderr.write("\n_root fixup, _root = '%s', repository name = '%s'\n"
          % (_root, fileinfo.RepositoryName()))

    # Process the file path with the --root flag if it was set.
    if not _root:
      if _root_debug:
        sys.stderr.write("_root unspecified\n")
      return file_path_from_root

    def StripListPrefix(lst, prefix):
      # f(['x', 'y'], ['w, z']) -> None  (not a valid prefix)
      if lst[:len(prefix)] != prefix:
        return None
      # f(['a, 'b', 'c', 'd'], ['a', 'b']) -> ['c', 'd']
      return lst[(len(prefix)):]

    # root behavior:
    #   --root=subdir , lstrips subdir from the header guard
    maybe_path = StripListPrefix(PathSplitToList(file_path_from_root),
                                 PathSplitToList(_root))

    if _root_debug:
      sys.stderr.write(("_root lstrip (maybe_path=%s, file_path_from_root=%s," +
          " _root=%s)\n") % (maybe_path, file_path_from_root, _root))

    if maybe_path:
      return os.path.join(*maybe_path)

    #   --root=.. , will prepend the outer directory to the header guard
    full_path = fileinfo.FullName()
    root_abspath = os.path.abspath(_root)

    maybe_path = StripListPrefix(PathSplitToList(full_path),
                                 PathSplitToList(root_abspath))

    if _root_debug:
      sys.stderr.write(("_root prepend (maybe_path=%s, full_path=%s, " +
          "root_abspath=%s)\n") % (maybe_path, full_path, root_abspath))

    if maybe_path:
      return os.path.join(*maybe_path)

    if _root_debug:
      sys.stderr.write("_root ignore, returning %s\n" % (file_path_from_root))

    #   --root=FAKE_DIR is ignored
    return file_path_from_root

  file_path_from_root = FixupPathFromRoot()
  return re.sub(r'[^a-zA-Z0-9]', '_', file_path_from_root).upper() + '_'


def CheckForHeaderGuard(filename, clean_lines, error):
  """Checks that the file contains a header guard.

  Logs an error if no #ifndef header guard is present.  For other
  headers, checks that the full pathname is used.

  Args:
    filename: The name of the C++ header file.
    clean_lines: A CleansedLines instance containing the file.
    error: The function to call with any errors found.
  """

  # Don't check for header guards if there are error suppression
  # comments somewhere in this file.
  #
  # Because this is silencing a warning for a nonexistent line, we
  # only support the very specific NOLINT(build/header_guard) syntax,
  # and not the general NOLINT or NOLINT(*) syntax.
  raw_lines = clean_lines.lines_without_raw_strings
  for i in raw_lines:
    if Search(r'//\s*NOLINT\(build/header_guard\)', i):
      return

  # Allow pragma once instead of header guards
  for i in raw_lines:
    if Search(r'^\s*#pragma\s+once', i):
      return

  cppvar = GetHeaderGuardCPPVariable(filename)

  ifndef = ''
  ifndef_linenum = 0
  define = ''
  endif = ''
  endif_linenum = 0
  for linenum, line in enumerate(raw_lines):
    linesplit = line.split()
    if len(linesplit) >= 2:
      # find the first occurrence of #ifndef and #define, save arg
      if not ifndef and linesplit[0] == '#ifndef':
        # set ifndef to the header guard presented on the #ifndef line.
        ifndef = linesplit[1]
        ifndef_linenum = linenum
      if not define and linesplit[0] == '#define':
        define = linesplit[1]
    # find the last occurrence of #endif, save entire line
    if line.startswith('#endif'):
      endif = line
      endif_linenum = linenum

  if not ifndef or not define or ifndef != define:
    error(filename, 0, 'build/header_guard', 5,
          'No #ifndef header guard found, suggested CPP variable is: %s' %
          cppvar)
    return

  # The guard should be PATH_FILE_H_, but we also allow PATH_FILE_H__
  # for backward compatibility.
  if ifndef != cppvar:
    error_level = 0
    if ifndef != cppvar + '_':
      error_level = 5

    ParseNolintSuppressions(filename, raw_lines[ifndef_linenum], ifndef_linenum,
                            error)
    error(filename, ifndef_linenum, 'build/header_guard', error_level,
          '#ifndef header guard has wrong style, please use: %s' % cppvar)

  # Check for "//" comments on endif line.
  ParseNolintSuppressions(filename, raw_lines[endif_linenum], endif_linenum,
                          error)
  match = Match(r'#endif\s*//\s*' + cppvar + r'(_)?\b', endif)
  if match:
    if match.group(1) == '_':
      # Issue low severity warning for deprecated double trailing underscore
      error(filename, endif_linenum, 'build/header_guard', 0,
            '#endif line should be "#endif  // %s"' % cppvar)
    return

  # Didn't find the corresponding "//" comment.  If this file does not
  # contain any "//" comments at all, it could be that the compiler
  # only wants "/**/" comments, look for those instead.
  no_single_line_comments = True
  for i in xrange(1, len(raw_lines) - 1):
    line = raw_lines[i]
    if Match(r'^(?:(?:\'(?:\.|[^\'])*\')|(?:"(?:\.|[^"])*")|[^\'"])*//', line):
      no_single_line_comments = False
      break

  if no_single_line_comments:
    match = Match(r'#endif\s*/\*\s*' + cppvar + r'(_)?\s*\*/', endif)
    if match:
      if match.group(1) == '_':
        # Low severity warning for double trailing underscore
        error(filename, endif_linenum, 'build/header_guard', 0,
              '#endif line should be "#endif  /* %s */"' % cppvar)
      return

  # Didn't find anything
  error(filename, endif_linenum, 'build/header_guard', 5,
        '#endif line should be "#endif  // %s"' % cppvar)


def CheckHeaderFileIncluded(filename, include_state, error):
  """Logs an error if a source file does not include its header."""

  # Do not check test files
  fileinfo = FileInfo(filename)
  if Search(_TEST_FILE_SUFFIX, fileinfo.BaseName()):
    return

  for ext in GetHeaderExtensions():
    basefilename = filename[0:len(filename) - len(fileinfo.Extension())]
    headerfile = basefilename + '.' + ext
    if not os.path.exists(headerfile):
      continue
    headername = FileInfo(headerfile).RepositoryName()
    first_include = None
    include_uses_unix_dir_aliases = False
    for section_list in include_state.include_list:
      for f in section_list:
        include_text = f[0]
        if "./" in include_text:
          include_uses_unix_dir_aliases = True
        if headername in include_text or include_text in headername:
          return
        if not first_include:
          first_include = f[1]

    message = '%s should include its header file %s' % (fileinfo.RepositoryName(), headername)
    if include_uses_unix_dir_aliases:
      message += ". Relative paths like . and .. are not allowed."

    error(filename, first_include, 'build/include', 5, message)


def CheckForBadCharacters(filename, lines, error):
  """Logs an error for each line containing bad characters.

  Two kinds of bad characters:

  1. Unicode replacement characters: These indicate that either the file
  contained invalid UTF-8 (likely) or Unicode replacement characters (which
  it shouldn't).  Note that it's possible for this to throw off line
  numbering if the invalid UTF-8 occurred adjacent to a newline.

  2. NUL bytes.  These are problematic for some tools.

  Args:
    filename: The name of the current file.
    lines: An array of strings, each representing a line of the file.
    error: The function to call with any errors found.
  """
  for linenum, line in enumerate(lines):
    if unicode_escape_decode('\ufffd') in line:
      error(filename, linenum, 'readability/utf8', 5,
            'Line contains invalid UTF-8 (or Unicode replacement character).')
    if '\0' in line:
      error(filename, linenum, 'readability/nul', 5, 'Line contains NUL byte.')


def CheckForNewlineAtEOF(filename, lines, error):
  """Logs an error if there is no newline char at the end of the file.

  Args:
    filename: The name of the current file.
    lines: An array of strings, each representing a line of the file.
    error: The function to call with any errors found.
  """

  # The array lines() was created by adding two newlines to the
  # original file (go figure), then splitting on \n.
  # To verify that the file ends in \n, we just have to make sure the
  # last-but-two element of lines() exists and is empty.
  if len(lines) < 3 or lines[-2]:
    error(filename, len(lines) - 2, 'whitespace/ending_newline', 5,
          'Could not find a newline character at the end of the file.')


def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error):
  """Logs an error if we see /* ... */ or "..." that extend past one line.

  /* ... */ comments are legit inside macros, for one line.
  Otherwise, we prefer // comments, so it's ok to warn about the
  other.  Likewise, it's ok for strings to extend across multiple
  lines, as long as a line continuation character (backslash)
  terminates each line. Although not currently prohibited by the C++
  style guide, it's ugly and unnecessary. We don't do well with either
  in this lint program, so we warn about both.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """
  line = clean_lines.elided[linenum]

  # Remove all \\ (escaped backslashes) from the line. They are OK, and the
  # second (escaped) slash may trigger later \" detection erroneously.
  line = line.replace('\\\\', '')

  if line.count('/*') > line.count('*/'):
    error(filename, linenum, 'readability/multiline_comment', 5,
          'Complex multi-line /*...*/-style comment found. '
          'Lint may give bogus warnings.  '
          'Consider replacing these with //-style comments, '
          'with #if 0...#endif, '
          'or with more clearly structured multi-line comments.')

  if (line.count('"') - line.count('\\"')) % 2:
    error(filename, linenum, 'readability/multiline_string', 5,
          'Multi-line string ("...") found.  This lint script doesn\'t '
          'do well with such strings, and may give bogus warnings.  '
          'Use C++11 raw strings or concatenation instead.')


# (non-threadsafe name, thread-safe alternative, validation pattern)
#
# The validation pattern is used to eliminate false positives such as:
#  _rand();               // false positive due to substring match.
#  ->rand();              // some member function rand().
#  ACMRandom rand(seed);  // some variable named rand.
#  ISAACRandom rand();    // another variable named rand.
#
# Basically we require the return value of these functions to be used
# in some expression context on the same line by matching on some
# operator before the function name.  This eliminates constructors and
# member function calls.
_UNSAFE_FUNC_PREFIX = r'(?:[-+*/=%^&|(<]\s*|>\s+)'
_THREADING_LIST = (
    ('asctime(', 'asctime_r(', _UNSAFE_FUNC_PREFIX + r'asctime\([^)]+\)'),
    ('ctime(', 'ctime_r(', _UNSAFE_FUNC_PREFIX + r'ctime\([^)]+\)'),
    ('getgrgid(', 'getgrgid_r(', _UNSAFE_FUNC_PREFIX + r'getgrgid\([^)]+\)'),
    ('getgrnam(', 'getgrnam_r(', _UNSAFE_FUNC_PREFIX + r'getgrnam\([^)]+\)'),
    ('getlogin(', 'getlogin_r(', _UNSAFE_FUNC_PREFIX + r'getlogin\(\)'),
    ('getpwnam(', 'getpwnam_r(', _UNSAFE_FUNC_PREFIX + r'getpwnam\([^)]+\)'),
    ('getpwuid(', 'getpwuid_r(', _UNSAFE_FUNC_PREFIX + r'getpwuid\([^)]+\)'),
    ('gmtime(', 'gmtime_r(', _UNSAFE_FUNC_PREFIX + r'gmtime\([^)]+\)'),
    ('localtime(', 'localtime_r(', _UNSAFE_FUNC_PREFIX + r'localtime\([^)]+\)'),
    ('rand(', 'rand_r(', _UNSAFE_FUNC_PREFIX + r'rand\(\)'),
    ('strtok(', 'strtok_r(',
     _UNSAFE_FUNC_PREFIX + r'strtok\([^)]+\)'),
    ('ttyname(', 'ttyname_r(', _UNSAFE_FUNC_PREFIX + r'ttyname\([^)]+\)'),
    )


def CheckPosixThreading(filename, clean_lines, linenum, error):
  """Checks for calls to thread-unsafe functions.

  Much code has been originally written without consideration of
  multi-threading. Also, engineers are relying on their old experience;
  they have learned posix before threading extensions were added. These
  tests guide the engineers to use thread-safe functions (when using
  posix directly).

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """
  line = clean_lines.elided[linenum]
  for single_thread_func, multithread_safe_func, pattern in _THREADING_LIST:
    # Additional pattern matching check to confirm that this is the
    # function we are looking for
    if Search(pattern, line):
      error(filename, linenum, 'runtime/threadsafe_fn', 2,
            'Consider using ' + multithread_safe_func +
            '...) instead of ' + single_thread_func +
            '...) for improved thread safety.')


def CheckVlogArguments(filename, clean_lines, linenum, error):
  """Checks that VLOG() is only used for defining a logging level.

  For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and
  VLOG(FATAL) are not.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """
  line = clean_lines.elided[linenum]
  if Search(r'\bVLOG\((INFO|ERROR|WARNING|DFATAL|FATAL)\)', line):
    error(filename, linenum, 'runtime/vlog', 5,
          'VLOG() should be used with numeric verbosity level.  '
          'Use LOG() if you want symbolic severity levels.')

# Matches invalid increment: *count++, which moves pointer instead of
# incrementing a value.
_RE_PATTERN_INVALID_INCREMENT = re.compile(
    r'^\s*\*\w+(\+\+|--);')


def CheckInvalidIncrement(filename, clean_lines, linenum, error):
  """Checks for invalid increment *count++.

  For example following function:
  void increment_counter(int* count) {
    *count++;
  }
  is invalid, because it effectively does count++, moving pointer, and should
  be replaced with ++*count, (*count)++ or *count += 1.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """
  line = clean_lines.elided[linenum]
  if _RE_PATTERN_INVALID_INCREMENT.match(line):
    error(filename, linenum, 'runtime/invalid_increment', 5,
          'Changing pointer instead of value (or unused value of operator*).')


def IsMacroDefinition(clean_lines, linenum):
  if Search(r'^#define', clean_lines[linenum]):
    return True

  if linenum > 0 and Search(r'\\$', clean_lines[linenum - 1]):
    return True

  return False


def IsForwardClassDeclaration(clean_lines, linenum):
  return Match(r'^\s*(\btemplate\b)*.*class\s+\w+;\s*$', clean_lines[linenum])


class _BlockInfo(object):
  """Stores information about a generic block of code."""

  def __init__(self, linenum, seen_open_brace):
    self.starting_linenum = linenum
    self.seen_open_brace = seen_open_brace
    self.open_parentheses = 0
    self.inline_asm = _NO_ASM
    self.check_namespace_indentation = False

  def CheckBegin(self, filename, clean_lines, linenum, error):
    """Run checks that applies to text up to the opening brace.

    This is mostly for checking the text after the class identifier
    and the "{", usually where the base class is specified.  For other
    blocks, there isn't much to check, so we always pass.

    Args:
      filename: The name of the current file.
      clean_lines: A CleansedLines instance containing the file.
      linenum: The number of the line to check.
      error: The function to call with any errors found.
    """
    pass

  def CheckEnd(self, filename, clean_lines, linenum, error):
    """Run checks that applies to text after the closing brace.

    This is mostly used for checking end of namespace comments.

    Args:
      filename: The name of the current file.
      clean_lines: A CleansedLines instance containing the file.
      linenum: The number of the line to check.
      error: The function to call with any errors found.
    """
    pass

  def IsBlockInfo(self):
    """Returns true if this block is a _BlockInfo.

    This is convenient for verifying that an object is an instance of
    a _BlockInfo, but not an instance of any of the derived classes.

    Returns:
      True for this class, False for derived classes.
    """
    return self.__class__ == _BlockInfo


class _ExternCInfo(_BlockInfo):
  """Stores information about an 'extern "C"' block."""

  def __init__(self, linenum):
    _BlockInfo.__init__(self, linenum, True)


class _ClassInfo(_BlockInfo):
  """Stores information about a class."""

  def __init__(self, name, class_or_struct, clean_lines, linenum):
    _BlockInfo.__init__(self, linenum, False)
    self.name = name
    self.is_derived = False
    self.check_namespace_indentation = True
    if class_or_struct == 'struct':
      self.access = 'public'
      self.is_struct = True
    else:
      self.access = 'private'
      self.is_struct = False

    # Remember initial indentation level for this class.  Using raw_lines here
    # instead of elided to account for leading comments.
    self.class_indent = GetIndentLevel(clean_lines.raw_lines[linenum])

    # Try to find the end of the class.  This will be confused by things like:
    #   class A {
    #   } *x = { ...
    #
    # But it's still good enough for CheckSectionSpacing.
    self.last_line = 0
    depth = 0
    for i in range(linenum, clean_lines.NumLines()):
      line = clean_lines.elided[i]
      depth += line.count('{') - line.count('}')
      if not depth:
        self.last_line = i
        break

  def CheckBegin(self, filename, clean_lines, linenum, error):
    # Look for a bare ':'
    if Search('(^|[^:]):($|[^:])', clean_lines.elided[linenum]):
      self.is_derived = True

  def CheckEnd(self, filename, clean_lines, linenum, error):
    # If there is a DISALLOW macro, it should appear near the end of
    # the class.
    seen_last_thing_in_class = False
    for i in xrange(linenum - 1, self.starting_linenum, -1):
      match = Search(
          r'\b(DISALLOW_COPY_AND_ASSIGN|DISALLOW_IMPLICIT_CONSTRUCTORS)\(' +
          self.name + r'\)',
          clean_lines.elided[i])
      if match:
        if seen_last_thing_in_class:
          error(filename, i, 'readability/constructors', 3,
                match.group(1) + ' should be the last thing in the class')
        break

      if not Match(r'^\s*$', clean_lines.elided[i]):
        seen_last_thing_in_class = True

    # Check that closing brace is aligned with beginning of the class.
    # Only do this if the closing brace is indented by only whitespaces.
    # This means we will not check single-line class definitions.
    indent = Match(r'^( *)\}', clean_lines.elided[linenum])
    if indent and len(indent.group(1)) != self.class_indent:
      if self.is_struct:
        parent = 'struct ' + self.name
      else:
        parent = 'class ' + self.name
      error(filename, linenum, 'whitespace/indent', 3,
            'Closing brace should be aligned with beginning of %s' % parent)


class _NamespaceInfo(_BlockInfo):
  """Stores information about a namespace."""

  def __init__(self, name, linenum):
    _BlockInfo.__init__(self, linenum, False)
    self.name = name or ''
    self.check_namespace_indentation = True

  def CheckEnd(self, filename, clean_lines, linenum, error):
    """Check end of namespace comments."""
    line = clean_lines.raw_lines[linenum]

    # Check how many lines is enclosed in this namespace.  Don't issue
    # warning for missing namespace comments if there aren't enough
    # lines.  However, do apply checks if there is already an end of
    # namespace comment and it's incorrect.
    #
    # TODO(unknown): We always want to check end of namespace comments
    # if a namespace is large, but sometimes we also want to apply the
    # check if a short namespace contained nontrivial things (something
    # other than forward declarations).  There is currently no logic on
    # deciding what these nontrivial things are, so this check is
    # triggered by namespace size only, which works most of the time.
    if (linenum - self.starting_linenum < 10
        and not Match(r'^\s*};*\s*(//|/\*).*\bnamespace\b', line)):
      return

    # Look for matching comment at end of namespace.
    #
    # Note that we accept C style "/* */" comments for terminating
    # namespaces, so that code that terminate namespaces inside
    # preprocessor macros can be cpplint clean.
    #
    # We also accept stuff like "// end of namespace <name>." with the
    # period at the end.
    #
    # Besides these, we don't accept anything else, otherwise we might
    # get false negatives when existing comment is a substring of the
    # expected namespace.
    if self.name:
      # Named namespace
      if not Match((r'^\s*};*\s*(//|/\*).*\bnamespace\s+' +
                    re.escape(self.name) + r'[\*/\.\\\s]*$'),
                   line):
        error(filename, linenum, 'readability/namespace', 5,
              'Namespace should be terminated with "// namespace %s"' %
              self.name)
    else:
      # Anonymous namespace
      if not Match(r'^\s*};*\s*(//|/\*).*\bnamespace[\*/\.\\\s]*$', line):
        # If "// namespace anonymous" or "// anonymous namespace (more text)",
        # mention "// anonymous namespace" as an acceptable form
        if Match(r'^\s*}.*\b(namespace anonymous|anonymous namespace)\b', line):
          error(filename, linenum, 'readability/namespace', 5,
                'Anonymous namespace should be terminated with "// namespace"'
                ' or "// anonymous namespace"')
        else:
          error(filename, linenum, 'readability/namespace', 5,
                'Anonymous namespace should be terminated with "// namespace"')


class _PreprocessorInfo(object):
  """Stores checkpoints of nesting stacks when #if/#else is seen."""

  def __init__(self, stack_before_if):
    # The entire nesting stack before #if
    self.stack_before_if = stack_before_if

    # The entire nesting stack up to #else
    self.stack_before_else = []

    # Whether we have already seen #else or #elif
    self.seen_else = False


class NestingState(object):
  """Holds states related to parsing braces."""

  def __init__(self):
    # Stack for tracking all braces.  An object is pushed whenever we
    # see a "{", and popped when we see a "}".  Only 3 types of
    # objects are possible:
    # - _ClassInfo: a class or struct.
    # - _NamespaceInfo: a namespace.
    # - _BlockInfo: some other type of block.
    self.stack = []

    # Top of the previous stack before each Update().
    #
    # Because the nesting_stack is updated at the end of each line, we
    # had to do some convoluted checks to find out what is the current
    # scope at the beginning of the line.  This check is simplified by
    # saving the previous top of nesting stack.
    #
    # We could save the full stack, but we only need the top.  Copying
    # the full nesting stack would slow down cpplint by ~10%.
    self.previous_stack_top = []

    # Stack of _PreprocessorInfo objects.
    self.pp_stack = []

  def SeenOpenBrace(self):
    """Check if we have seen the opening brace for the innermost block.

    Returns:
      True if we have seen the opening brace, False if the innermost
      block is still expecting an opening brace.
    """
    return (not self.stack) or self.stack[-1].seen_open_brace

  def InNamespaceBody(self):
    """Check if we are currently one level inside a namespace body.

    Returns:
      True if top of the stack is a namespace block, False otherwise.
    """
    return self.stack and isinstance(self.stack[-1], _NamespaceInfo)

  def InExternC(self):
    """Check if we are currently one level inside an 'extern "C"' block.

    Returns:
      True if top of the stack is an extern block, False otherwise.
    """
    return self.stack and isinstance(self.stack[-1], _ExternCInfo)

  def InClassDeclaration(self):
    """Check if we are currently one level inside a class or struct declaration.

    Returns:
      True if top of the stack is a class/struct, False otherwise.
    """
    return self.stack and isinstance(self.stack[-1], _ClassInfo)

  def InAsmBlock(self):
    """Check if we are currently one level inside an inline ASM block.

    Returns:
      True if the top of the stack is a block containing inline ASM.
    """
    return self.stack and self.stack[-1].inline_asm != _NO_ASM

  def InTemplateArgumentList(self, clean_lines, linenum, pos):
    """Check if current position is inside template argument list.

    Args:
      clean_lines: A CleansedLines instance containing the file.
      linenum: The number of the line to check.
      pos: position just after the suspected template argument.
    Returns:
      True if (linenum, pos) is inside template arguments.
    """
    while linenum < clean_lines.NumLines():
      # Find the earliest character that might indicate a template argument
      line = clean_lines.elided[linenum]
      match = Match(r'^[^{};=\[\]\.<>]*(.)', line[pos:])
      if not match:
        linenum += 1
        pos = 0
        continue
      token = match.group(1)
      pos += len(match.group(0))

      # These things do not look like template argument list:
      #   class Suspect {
      #   class Suspect x; }
      if token in ('{', '}', ';'): return False

      # These things look like template argument list:
      #   template <class Suspect>
      #   template <class Suspect = default_value>
      #   template <class Suspect[]>
      #   template <class Suspect...>
      if token in ('>', '=', '[', ']', '.'): return True

      # Check if token is an unmatched '<'.
      # If not, move on to the next character.
      if token != '<':
        pos += 1
        if pos >= len(line):
          linenum += 1
          pos = 0
        continue

      # We can't be sure if we just find a single '<', and need to
      # find the matching '>'.
      (_, end_line, end_pos) = CloseExpression(clean_lines, linenum, pos - 1)
      if end_pos < 0:
        # Not sure if template argument list or syntax error in file
        return False
      linenum = end_line
      pos = end_pos
    return False

  def UpdatePreprocessor(self, line):
    """Update preprocessor stack.

    We need to handle preprocessors due to classes like this:
      #ifdef SWIG
      struct ResultDetailsPageElementExtensionPoint {
      #else
      struct ResultDetailsPageElementExtensionPoint : public Extension {
      #endif

    We make the following assumptions (good enough for most files):
    - Preprocessor condition evaluates to true from #if up to first
      #else/#elif/#endif.

    - Preprocessor condition evaluates to false from #else/#elif up
      to #endif.  We still perform lint checks on these lines, but
      these do not affect nesting stack.

    Args:
      line: current line to check.
    """
    if Match(r'^\s*#\s*(if|ifdef|ifndef)\b', line):
      # Beginning of #if block, save the nesting stack here.  The saved
      # stack will allow us to restore the parsing state in the #else case.
      self.pp_stack.append(_PreprocessorInfo(copy.deepcopy(self.stack)))
    elif Match(r'^\s*#\s*(else|elif)\b', line):
      # Beginning of #else block
      if self.pp_stack:
        if not self.pp_stack[-1].seen_else:
          # This is the first #else or #elif block.  Remember the
          # whole nesting stack up to this point.  This is what we
          # keep after the #endif.
          self.pp_stack[-1].seen_else = True
          self.pp_stack[-1].stack_before_else = copy.deepcopy(self.stack)

        # Restore the stack to how it was before the #if
        self.stack = copy.deepcopy(self.pp_stack[-1].stack_before_if)
      else:
        # TODO(unknown): unexpected #else, issue warning?
        pass
    elif Match(r'^\s*#\s*endif\b', line):
      # End of #if or #else blocks.
      if self.pp_stack:
        # If we saw an #else, we will need to restore the nesting
        # stack to its former state before the #else, otherwise we
        # will just continue from where we left off.
        if self.pp_stack[-1].seen_else:
          # Here we can just use a shallow copy since we are the last
          # reference to it.
          self.stack = self.pp_stack[-1].stack_before_else
        # Drop the corresponding #if
        self.pp_stack.pop()
      else:
        # TODO(unknown): unexpected #endif, issue warning?
        pass

  # TODO(unknown): Update() is too long, but we will refactor later.
  def Update(self, filename, clean_lines, linenum, error):
    """Update nesting state with current line.

    Args:
      filename: The name of the current file.
      clean_lines: A CleansedLines instance containing the file.
      linenum: The number of the line to check.
      error: The function to call with any errors found.
    """
    line = clean_lines.elided[linenum]

    # Remember top of the previous nesting stack.
    #
    # The stack is always pushed/popped and not modified in place, so
    # we can just do a shallow copy instead of copy.deepcopy.  Using
    # deepcopy would slow down cpplint by ~28%.
    if self.stack:
      self.previous_stack_top = self.stack[-1]
    else:
      self.previous_stack_top = None

    # Update pp_stack
    self.UpdatePreprocessor(line)

    # Count parentheses.  This is to avoid adding struct arguments to
    # the nesting stack.
    if self.stack:
      inner_block = self.stack[-1]
      depth_change = line.count('(') - line.count(')')
      inner_block.open_parentheses += depth_change

      # Also check if we are starting or ending an inline assembly block.
      if inner_block.inline_asm in (_NO_ASM, _END_ASM):
        if (depth_change != 0 and
            inner_block.open_parentheses == 1 and
            _MATCH_ASM.match(line)):
          # Enter assembly block
          inner_block.inline_asm = _INSIDE_ASM
        else:
          # Not entering assembly block.  If previous line was _END_ASM,
          # we will now shift to _NO_ASM state.
          inner_block.inline_asm = _NO_ASM
      elif (inner_block.inline_asm == _INSIDE_ASM and
            inner_block.open_parentheses == 0):
        # Exit assembly block
        inner_block.inline_asm = _END_ASM

    # Consume namespace declaration at the beginning of the line.  Do
    # this in a loop so that we catch same line declarations like this:
    #   namespace proto2 { namespace bridge { class MessageSet; } }
    while True:
      # Match start of namespace.  The "\b\s*" below catches namespace
      # declarations even if it weren't followed by a whitespace, this
      # is so that we don't confuse our namespace checker.  The
      # missing spaces will be flagged by CheckSpacing.
      namespace_decl_match = Match(r'^\s*namespace\b\s*([:\w]+)?(.*)$', line)
      if not namespace_decl_match:
        break

      new_namespace = _NamespaceInfo(namespace_decl_match.group(1), linenum)
      self.stack.append(new_namespace)

      line = namespace_decl_match.group(2)
      if line.find('{') != -1:
        new_namespace.seen_open_brace = True
        line = line[line.find('{') + 1:]

    # Look for a class declaration in whatever is left of the line
    # after parsing namespaces.  The regexp accounts for decorated classes
    # such as in:
    #   class LOCKABLE API Object {
    #   };
    class_decl_match = Match(
        r'^(\s*(?:template\s*<[\w\s<>,:=]*>\s*)?'
        r'(class|struct)\s+(?:[a-zA-Z0-9_]+\s+)*(\w+(?:::\w+)*))'
        r'(.*)$', line)
    if (class_decl_match and
        (not self.stack or self.stack[-1].open_parentheses == 0)):
      # We do not want to accept classes that are actually template arguments:
      #   template <class Ignore1,
      #             class Ignore2 = Default<Args>,
      #             template <Args> class Ignore3>
      #   void Function() {};
      #
      # To avoid template argument cases, we scan forward and look for
      # an unmatched '>'.  If we see one, assume we are inside a
      # template argument list.
      end_declaration = len(class_decl_match.group(1))
      if not self.InTemplateArgumentList(clean_lines, linenum, end_declaration):
        self.stack.append(_ClassInfo(
            class_decl_match.group(3), class_decl_match.group(2),
            clean_lines, linenum))
        line = class_decl_match.group(4)

    # If we have not yet seen the opening brace for the innermost block,
    # run checks here.
    if not self.SeenOpenBrace():
      self.stack[-1].CheckBegin(filename, clean_lines, linenum, error)

    # Update access control if we are inside a class/struct
    if self.stack and isinstance(self.stack[-1], _ClassInfo):
      classinfo = self.stack[-1]
      access_match = Match(
          r'^(.*)\b(public|private|protected|signals)(\s+(?:slots\s*)?)?'
          r':(?:[^:]|$)',
          line)
      if access_match:
        classinfo.access = access_match.group(2)

        # Check that access keywords are indented +1 space.  Skip this
        # check if the keywords are not preceded by whitespaces.
        indent = access_match.group(1)
        if (len(indent) != classinfo.class_indent + 1 and
            Match(r'^\s*$', indent)):
          if classinfo.is_struct:
            parent = 'struct ' + classinfo.name
          else:
            parent = 'class ' + classinfo.name
          slots = ''
          if access_match.group(3):
            slots = access_match.group(3)
          error(filename, linenum, 'whitespace/indent', 3,
                '%s%s: should be indented +1 space inside %s' % (
                    access_match.group(2), slots, parent))

    # Consume braces or semicolons from what's left of the line
    while True:
      # Match first brace, semicolon, or closed parenthesis.
      matched = Match(r'^[^{;)}]*([{;)}])(.*)$', line)
      if not matched:
        break

      token = matched.group(1)
      if token == '{':
        # If namespace or class hasn't seen a opening brace yet, mark
        # namespace/class head as complete.  Push a new block onto the
        # stack otherwise.
        if not self.SeenOpenBrace():
          self.stack[-1].seen_open_brace = True
        elif Match(r'^extern\s*"[^"]*"\s*\{', line):
          self.stack.append(_ExternCInfo(linenum))
        else:
          self.stack.append(_BlockInfo(linenum, True))
          if _MATCH_ASM.match(line):
            self.stack[-1].inline_asm = _BLOCK_ASM

      elif token == ';' or token == ')':
        # If we haven't seen an opening brace yet, but we already saw
        # a semicolon, this is probably a forward declaration.  Pop
        # the stack for these.
        #
        # Similarly, if we haven't seen an opening brace yet, but we
        # already saw a closing parenthesis, then these are probably
        # function arguments with extra "class" or "struct" keywords.
        # Also pop these stack for these.
        if not self.SeenOpenBrace():
          self.stack.pop()
      else:  # token == '}'
        # Perform end of block checks and pop the stack.
        if self.stack:
          self.stack[-1].CheckEnd(filename, clean_lines, linenum, error)
          self.stack.pop()
      line = matched.group(2)

  def InnermostClass(self):
    """Get class info on the top of the stack.

    Returns:
      A _ClassInfo object if we are inside a class, or None otherwise.
    """
    for i in range(len(self.stack), 0, -1):
      classinfo = self.stack[i - 1]
      if isinstance(classinfo, _ClassInfo):
        return classinfo
    return None

  def CheckCompletedBlocks(self, filename, error):
    """Checks that all classes and namespaces have been completely parsed.

    Call this when all lines in a file have been processed.
    Args:
      filename: The name of the current file.
      error: The function to call with any errors found.
    """
    # Note: This test can result in false positives if #ifdef constructs
    # get in the way of brace matching. See the testBuildClass test in
    # cpplint_unittest.py for an example of this.
    for obj in self.stack:
      if isinstance(obj, _ClassInfo):
        error(filename, obj.starting_linenum, 'build/class', 5,
              'Failed to find complete declaration of class %s' %
              obj.name)
      elif isinstance(obj, _NamespaceInfo):
        error(filename, obj.starting_linenum, 'build/namespaces', 5,
              'Failed to find complete declaration of namespace %s' %
              obj.name)


def CheckForNonStandardConstructs(filename, clean_lines, linenum,
                                  nesting_state, error):
  r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.

  Complain about several constructs which gcc-2 accepts, but which are
  not standard C++.  Warning about these in lint is one way to ease the
  transition to new compilers.
  - put storage class first (e.g. "static const" instead of "const static").
  - "%lld" instead of %qd" in printf-type functions.
  - "%1$d" is non-standard in printf-type functions.
  - "\%" is an undefined character escape sequence.
  - text after #endif is not allowed.
  - invalid inner-style forward declaration.
  - >? and <? operators, and their >?= and <?= cousins.

  Additionally, check for constructor/destructor style violations and reference
  members, as it is very convenient to do so while checking for
  gcc-2 compliance.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    nesting_state: A NestingState instance which maintains information about
                   the current stack of nested blocks being parsed.
    error: A callable to which errors are reported, which takes 4 arguments:
           filename, line number, error level, and message
  """

  # Remove comments from the line, but leave in strings for now.
  line = clean_lines.lines[linenum]

  if Search(r'printf\s*\(.*".*%[-+ ]?\d*q', line):
    error(filename, linenum, 'runtime/printf_format', 3,
          '%q in format strings is deprecated.  Use %ll instead.')

  if Search(r'printf\s*\(.*".*%\d+\$', line):
    error(filename, linenum, 'runtime/printf_format', 2,
          '%N$ formats are unconventional.  Try rewriting to avoid them.')

  # Remove escaped backslashes before looking for undefined escapes.
  line = line.replace('\\\\', '')

  if Search(r'("|\').*\\(%|\[|\(|{)', line):
    error(filename, linenum, 'build/printf_format', 3,
          '%, [, (, and { are undefined character escapes.  Unescape them.')

  # For the rest, work with both comments and strings removed.
  line = clean_lines.elided[linenum]

  if Search(r'\b(const|volatile|void|char|short|int|long'
            r'|float|double|signed|unsigned'
            r'|schar|u?int8|u?int16|u?int32|u?int64)'
            r'\s+(register|static|extern|typedef)\b',
            line):
    error(filename, linenum, 'build/storage_class', 5,
          'Storage-class specifier (static, extern, typedef, etc) should be '
          'at the beginning of the declaration.')

  if Match(r'\s*#\s*endif\s*[^/\s]+', line):
    error(filename, linenum, 'build/endif_comment', 5,
          'Uncommented text after #endif is non-standard.  Use a comment.')

  if Match(r'\s*class\s+(\w+\s*::\s*)+\w+\s*;', line):
    error(filename, linenum, 'build/forward_decl', 5,
          'Inner-style forward declarations are invalid.  Remove this line.')

  if Search(r'(\w+|[+-]?\d+(\.\d*)?)\s*(<|>)\?=?\s*(\w+|[+-]?\d+)(\.\d*)?',
            line):
    error(filename, linenum, 'build/deprecated', 3,
          '>? and <? (max and min) operators are non-standard and deprecated.')

  if Search(r'^\s*const\s*string\s*&\s*\w+\s*;', line):
    # TODO(unknown): Could it be expanded safely to arbitrary references,
    # without triggering too many false positives? The first
    # attempt triggered 5 warnings for mostly benign code in the regtest, hence
    # the restriction.
    # Here's the original regexp, for the reference:
    # type_name = r'\w+((\s*::\s*\w+)|(\s*<\s*\w+?\s*>))?'
    # r'\s*const\s*' + type_name + '\s*&\s*\w+\s*;'
    error(filename, linenum, 'runtime/member_string_references', 2,
          'const string& members are dangerous. It is much better to use '
          'alternatives, such as pointers or simple constants.')

  # Everything else in this function operates on class declarations.
  # Return early if the top of the nesting stack is not a class, or if
  # the class head is not completed yet.
  classinfo = nesting_state.InnermostClass()
  if not classinfo or not classinfo.seen_open_brace:
    return

  # The class may have been declared with namespace or classname qualifiers.
  # The constructor and destructor will not have those qualifiers.
  base_classname = classinfo.name.split('::')[-1]

  # Look for single-argument constructors that aren't marked explicit.
  # Technically a valid construct, but against style.
  explicit_constructor_match = Match(
      r'\s+(?:(?:inline|constexpr)\s+)*(explicit\s+)?'
      r'(?:(?:inline|constexpr)\s+)*%s\s*'
      r'\(((?:[^()]|\([^()]*\))*)\)'
      % re.escape(base_classname),
      line)

  if explicit_constructor_match:
    is_marked_explicit = explicit_constructor_match.group(1)

    if not explicit_constructor_match.group(2):
      constructor_args = []
    else:
      constructor_args = explicit_constructor_match.group(2).split(',')

    # collapse arguments so that commas in template parameter lists and function
    # argument parameter lists don't split arguments in two
    i = 0
    while i < len(constructor_args):
      constructor_arg = constructor_args[i]
      while (constructor_arg.count('<') > constructor_arg.count('>') or
             constructor_arg.count('(') > constructor_arg.count(')')):
        constructor_arg += ',' + constructor_args[i + 1]
        del constructor_args[i + 1]
      constructor_args[i] = constructor_arg
      i += 1

    variadic_args = [arg for arg in constructor_args if '&&...' in arg]
    defaulted_args = [arg for arg in constructor_args if '=' in arg]
    noarg_constructor = (not constructor_args or  # empty arg list
                         # 'void' arg specifier
                         (len(constructor_args) == 1 and
                          constructor_args[0].strip() == 'void'))
    onearg_constructor = ((len(constructor_args) == 1 and  # exactly one arg
                           not noarg_constructor) or
                          # all but at most one arg defaulted
                          (len(constructor_args) >= 1 and
                           not noarg_constructor and
                           len(defaulted_args) >= len(constructor_args) - 1) or
                          # variadic arguments with zero or one argument
                          (len(constructor_args) <= 2 and
                           len(variadic_args) >= 1))
    initializer_list_constructor = bool(
        onearg_constructor and
        Search(r'\bstd\s*::\s*initializer_list\b', constructor_args[0]))
    copy_constructor = bool(
        onearg_constructor and
        Match(r'((const\s+(volatile\s+)?)?|(volatile\s+(const\s+)?))?'
              r'%s(\s*<[^>]*>)?(\s+const)?\s*(?:<\w+>\s*)?&'
              % re.escape(base_classname), constructor_args[0].strip()))

    if (not is_marked_explicit and
        onearg_constructor and
        not initializer_list_constructor and
        not copy_constructor):
      if defaulted_args or variadic_args:
        error(filename, linenum, 'runtime/explicit', 5,
              'Constructors callable with one argument '
              'should be marked explicit.')
      else:
        error(filename, linenum, 'runtime/explicit', 5,
              'Single-parameter constructors should be marked explicit.')
    elif is_marked_explicit and not onearg_constructor:
      if noarg_constructor:
        error(filename, linenum, 'runtime/explicit', 5,
              'Zero-parameter constructors should not be marked explicit.')


def CheckSpacingForFunctionCall(filename, clean_lines, linenum, error):
  """Checks for the correctness of various spacing around function calls.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """
  line = clean_lines.elided[linenum]

  # Since function calls often occur inside if/for/while/switch
  # expressions - which have their own, more liberal conventions - we
  # first see if we should be looking inside such an expression for a
  # function call, to which we can apply more strict standards.
  fncall = line    # if there's no control flow construct, look at whole line
  for pattern in (r'\bif\s*\((.*)\)\s*{',
                  r'\bfor\s*\((.*)\)\s*{',
                  r'\bwhile\s*\((.*)\)\s*[{;]',
                  r'\bswitch\s*\((.*)\)\s*{'):
    match = Search(pattern, line)
    if match:
      fncall = match.group(1)    # look inside the parens for function calls
      break

  # Except in if/for/while/switch, there should never be space
  # immediately inside parens (eg "f( 3, 4 )").  We make an exception
  # for nested parens ( (a+b) + c ).  Likewise, there should never be
  # a space before a ( when it's a function argument.  I assume it's a
  # function argument when the char before the whitespace is legal in
  # a function name (alnum + _) and we're not starting a macro. Also ignore
  # pointers and references to arrays and functions coz they're too tricky:
  # we use a very simple way to recognize these:
  # " (something)(maybe-something)" or
  # " (something)(maybe-something," or
  # " (something)[something]"
  # Note that we assume the contents of [] to be short enough that
  # they'll never need to wrap.
  if (  # Ignore control structures.
      not Search(r'\b(if|for|while|switch|return|new|delete|catch|sizeof)\b',
                 fncall) and
      # Ignore pointers/references to functions.
      not Search(r' \([^)]+\)\([^)]*(\)|,$)', fncall) and
      # Ignore pointers/references to arrays.
      not Search(r' \([^)]+\)\[[^\]]+\]', fncall)):
    if Search(r'\w\s*\(\s(?!\s*\\$)', fncall):      # a ( used for a fn call
      error(filename, linenum, 'whitespace/parens', 4,
            'Extra space after ( in function call')
    elif Search(r'\(\s+(?!(\s*\\)|\()', fncall):
      error(filename, linenum, 'whitespace/parens', 2,
            'Extra space after (')
    if (Search(r'\w\s+\(', fncall) and
        not Search(r'_{0,2}asm_{0,2}\s+_{0,2}volatile_{0,2}\s+\(', fncall) and
        not Search(r'#\s*define|typedef|using\s+\w+\s*=', fncall) and
        not Search(r'\w\s+\((\w+::)*\*\w+\)\(', fncall) and
        not Search(r'\bcase\s+\(', fncall)):
      # TODO(unknown): Space after an operator function seem to be a common
      # error, silence those for now by restricting them to highest verbosity.
      if Search(r'\boperator_*\b', line):
        error(filename, linenum, 'whitespace/parens', 0,
              'Extra space before ( in function call')
      else:
        error(filename, linenum, 'whitespace/parens', 4,
              'Extra space before ( in function call')
    # If the ) is followed only by a newline or a { + newline, assume it's
    # part of a control statement (if/while/etc), and don't complain
    if Search(r'[^)]\s+\)\s*[^{\s]', fncall):
      # If the closing parenthesis is preceded by only whitespaces,
      # try to give a more descriptive error message.
      if Search(r'^\s+\)', fncall):
        error(filename, linenum, 'whitespace/parens', 2,
              'Closing ) should be moved to the previous line')
      else:
        error(filename, linenum, 'whitespace/parens', 2,
              'Extra space before )')


def IsBlankLine(line):
  """Returns true if the given line is blank.

  We consider a line to be blank if the line is empty or consists of
  only white spaces.

  Args:
    line: A line of a string.

  Returns:
    True, if the given line is blank.
  """
  return not line or line.isspace()


def CheckForNamespaceIndentation(filename, nesting_state, clean_lines, line,
                                 error):
  is_namespace_indent_item = (
      len(nesting_state.stack) > 1 and
      nesting_state.stack[-1].check_namespace_indentation and
      isinstance(nesting_state.previous_stack_top, _NamespaceInfo) and
      nesting_state.previous_stack_top == nesting_state.stack[-2])

  if ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item,
                                     clean_lines.elided, line):
    CheckItemIndentationInNamespace(filename, clean_lines.elided,
                                    line, error)


def CheckForFunctionLengths(filename, clean_lines, linenum,
                            function_state, error):
  """Reports for long function bodies.

  For an overview why this is done, see:
  https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions

  Uses a simplistic algorithm assuming other style guidelines
  (especially spacing) are followed.
  Only checks unindented functions, so class members are unchecked.
  Trivial bodies are unchecked, so constructors with huge initializer lists
  may be missed.
  Blank/comment lines are not counted so as to avoid encouraging the removal
  of vertical space and comments just to get through a lint check.
  NOLINT *on the last line of a function* disables this check.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    function_state: Current function name and lines in body so far.
    error: The function to call with any errors found.
  """
  lines = clean_lines.lines
  line = lines[linenum]
  joined_line = ''

  starting_func = False
  regexp = r'(\w(\w|::|\*|\&|\s)*)\('  # decls * & space::name( ...
  match_result = Match(regexp, line)
  if match_result:
    # If the name is all caps and underscores, figure it's a macro and
    # ignore it, unless it's TEST or TEST_F.
    function_name = match_result.group(1).split()[-1]
    if function_name == 'TEST' or function_name == 'TEST_F' or (
        not Match(r'[A-Z_]+$', function_name)):
      starting_func = True

  if starting_func:
    body_found = False
    for start_linenum in xrange(linenum, clean_lines.NumLines()):
      start_line = lines[start_linenum]
      joined_line += ' ' + start_line.lstrip()
      if Search(r'(;|})', start_line):  # Declarations and trivial functions
        body_found = True
        break                              # ... ignore
      if Search(r'{', start_line):
        body_found = True
        function = Search(r'((\w|:)*)\(', line).group(1)
        if Match(r'TEST', function):    # Handle TEST... macros
          parameter_regexp = Search(r'(\(.*\))', joined_line)
          if parameter_regexp:             # Ignore bad syntax
            function += parameter_regexp.group(1)
        else:
          function += '()'
        function_state.Begin(function)
        break
    if not body_found:
      # No body for the function (or evidence of a non-function) was found.
      error(filename, linenum, 'readability/fn_size', 5,
            'Lint failed to find start of function body.')
  elif Match(r'^\}\s*$', line):  # function end
    function_state.Check(error, filename, linenum)
    function_state.End()
  elif not Match(r'^\s*$', line):
    function_state.Count()  # Count non-blank/non-comment lines.


_RE_PATTERN_TODO = re.compile(r'^//(\s*)TODO(\(.+?\))?:?(\s|$)?')


def CheckComment(line, filename, linenum, next_line_start, error):
  """Checks for common mistakes in comments.

  Args:
    line: The line in question.
    filename: The name of the current file.
    linenum: The number of the line to check.
    next_line_start: The first non-whitespace column of the next line.
    error: The function to call with any errors found.
  """
  commentpos = line.find('//')
  if commentpos != -1:
    # Check if the // may be in quotes.  If so, ignore it
    if re.sub(r'\\.', '', line[0:commentpos]).count('"') % 2 == 0:
      # Allow one space for new scopes, two spaces otherwise:
      if (not (Match(r'^.*{ *//', line) and next_line_start == commentpos) and
          ((commentpos >= 1 and
            line[commentpos-1] not in string.whitespace) or
           (commentpos >= 2 and
            line[commentpos-2] not in string.whitespace))):
        error(filename, linenum, 'whitespace/comments', 2,
              'At least two spaces is best between code and comments')

      # Checks for common mistakes in TODO comments.
      comment = line[commentpos:]
      match = _RE_PATTERN_TODO.match(comment)
      if match:
        # One whitespace is correct; zero whitespace is handled elsewhere.
        leading_whitespace = match.group(1)
        if len(leading_whitespace) > 1:
          error(filename, linenum, 'whitespace/todo', 2,
                'Too many spaces before TODO')

        username = match.group(2)
        if not username:
          error(filename, linenum, 'readability/todo', 2,
                'Missing username in TODO; it should look like '
                '"// TODO(my_username): Stuff."')

        middle_whitespace = match.group(3)
        # Comparisons made explicit for correctness -- pylint: disable=g-explicit-bool-comparison
        if middle_whitespace != ' ' and middle_whitespace != '':
          error(filename, linenum, 'whitespace/todo', 2,
                'TODO(my_username) should be followed by a space')

      # If the comment contains an alphanumeric character, there
      # should be a space somewhere between it and the // unless
      # it's a /// or //! Doxygen comment.
      if (Match(r'//[^ ]*\w', comment) and
          not Match(r'(///|//\!)(\s+|$)', comment)):
        error(filename, linenum, 'whitespace/comments', 4,
              'Should have a space between // and comment')


def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
  """Checks for the correctness of various spacing issues in the code.

  Things we check for: spaces around operators, spaces after
  if/for/while/switch, no spaces around parens in function calls, two
  spaces between code and comment, don't start a block with a blank
  line, don't end a function with a blank line, don't add a blank line
  after public/protected/private, don't have too many blank lines in a row.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    nesting_state: A NestingState instance which maintains information about
                   the current stack of nested blocks being parsed.
    error: The function to call with any errors found.
  """

  # Don't use "elided" lines here, otherwise we can't check commented lines.
  # Don't want to use "raw" either, because we don't want to check inside C++11
  # raw strings,
  raw = clean_lines.lines_without_raw_strings
  line = raw[linenum]

  # Before nixing comments, check if the line is blank for no good
  # reason.  This includes the first line after a block is opened, and
  # blank lines at the end of a function (ie, right before a line like '}'
  #
  # Skip all the blank line checks if we are immediately inside a
  # namespace body.  In other words, don't issue blank line warnings
  # for this block:
  #   namespace {
  #
  #   }
  #
  # A warning about missing end of namespace comments will be issued instead.
  #
  # Also skip blank line checks for 'extern "C"' blocks, which are formatted
  # like namespaces.
  if (IsBlankLine(line) and
      not nesting_state.InNamespaceBody() and
      not nesting_state.InExternC()):
    elided = clean_lines.elided
    prev_line = elided[linenum - 1]
    prevbrace = prev_line.rfind('{')
    # TODO(unknown): Don't complain if line before blank line, and line after,
    #                both start with alnums and are indented the same amount.
    #                This ignores whitespace at the start of a namespace block
    #                because those are not usually indented.
    if prevbrace != -1 and prev_line[prevbrace:].find('}') == -1:
      # OK, we have a blank line at the start of a code block.  Before we
      # complain, we check if it is an exception to the rule: The previous
      # non-empty line has the parameters of a function header that are indented
      # 4 spaces (because they did not fit in a 80 column line when placed on
      # the same line as the function name).  We also check for the case where
      # the previous line is indented 6 spaces, which may happen when the
      # initializers of a constructor do not fit into a 80 column line.
      exception = False
      if Match(r' {6}\w', prev_line):  # Initializer list?
        # We are looking for the opening column of initializer list, which
        # should be indented 4 spaces to cause 6 space indentation afterwards.
        search_position = linenum-2
        while (search_position >= 0
               and Match(r' {6}\w', elided[search_position])):
          search_position -= 1
        exception = (search_position >= 0
                     and elided[search_position][:5] == '    :')
      else:
        # Search for the function arguments or an initializer list.  We use a
        # simple heuristic here: If the line is indented 4 spaces; and we have a
        # closing paren, without the opening paren, followed by an opening brace
        # or colon (for initializer lists) we assume that it is the last line of
        # a function header.  If we have a colon indented 4 spaces, it is an
        # initializer list.
        exception = (Match(r' {4}\w[^\(]*\)\s*(const\s*)?(\{\s*$|:)',
                           prev_line)
                     or Match(r' {4}:', prev_line))

      if not exception:
        error(filename, linenum, 'whitespace/blank_line', 2,
              'Redundant blank line at the start of a code block '
              'should be deleted.')
    # Ignore blank lines at the end of a block in a long if-else
    # chain, like this:
    #   if (condition1) {
    #     // Something followed by a blank line
    #
    #   } else if (condition2) {
    #     // Something else
    #   }
    if linenum + 1 < clean_lines.NumLines():
      next_line = raw[linenum + 1]
      if (next_line
          and Match(r'\s*}', next_line)
          and next_line.find('} else ') == -1):
        error(filename, linenum, 'whitespace/blank_line', 3,
              'Redundant blank line at the end of a code block '
              'should be deleted.')

    matched = Match(r'\s*(public|protected|private):', prev_line)
    if matched:
      error(filename, linenum, 'whitespace/blank_line', 3,
            'Do not leave a blank line after "%s:"' % matched.group(1))

  # Next, check comments
  next_line_start = 0
  if linenum + 1 < clean_lines.NumLines():
    next_line = raw[linenum + 1]
    next_line_start = len(next_line) - len(next_line.lstrip())
  CheckComment(line, filename, linenum, next_line_start, error)

  # get rid of comments and strings
  line = clean_lines.elided[linenum]

  # You shouldn't have spaces before your brackets, except for C++11 attributes
  # or maybe after 'delete []', 'return []() {};', or 'auto [abc, ...] = ...;'.
  if (Search(r'\w\s+\[(?!\[)', line) and
      not Search(r'(?:auto&?|delete|return)\s+\[', line)):
    error(filename, linenum, 'whitespace/braces', 5,
          'Extra space before [')

  # In range-based for, we wanted spaces before and after the colon, but
  # not around "::" tokens that might appear.
  if (Search(r'for *\(.*[^:]:[^: ]', line) or
      Search(r'for *\(.*[^: ]:[^:]', line)):
    error(filename, linenum, 'whitespace/forcolon', 2,
          'Missing space around colon in range-based for loop')


def CheckOperatorSpacing(filename, clean_lines, linenum, error):
  """Checks for horizontal spacing around operators.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """
  line = clean_lines.elided[linenum]

  # Don't try to do spacing checks for operator methods.  Do this by
  # replacing the troublesome characters with something else,
  # preserving column position for all other characters.
  #
  # The replacement is done repeatedly to avoid false positives from
  # operators that call operators.
  while True:
    match = Match(r'^(.*\boperator\b)(\S+)(\s*\(.*)$', line)
    if match:
      line = match.group(1) + ('_' * len(match.group(2))) + match.group(3)
    else:
      break

  # We allow no-spaces around = within an if: "if ( (a=Foo()) == 0 )".
  # Otherwise not.  Note we only check for non-spaces on *both* sides;
  # sometimes people put non-spaces on one side when aligning ='s among
  # many lines (not that this is behavior that I approve of...)
  if ((Search(r'[\w.]=', line) or
       Search(r'=[\w.]', line))
      and not Search(r'\b(if|while|for) ', line)
      # Operators taken from [lex.operators] in C++11 standard.
      and not Search(r'(>=|<=|==|!=|&=|\^=|\|=|\+=|\*=|\/=|\%=)', line)
      and not Search(r'operator=', line)):
    error(filename, linenum, 'whitespace/operators', 4,
          'Missing spaces around =')

  # It's ok not to have spaces around binary operators like + - * /, but if
  # there's too little whitespace, we get concerned.  It's hard to tell,
  # though, so we punt on this one for now.  TODO.

  # You should always have whitespace around binary operators.
  #
  # Check <= and >= first to avoid false positives with < and >, then
  # check non-include lines for spacing around < and >.
  #
  # If the operator is followed by a comma, assume it's be used in a
  # macro context and don't do any checks.  This avoids false
  # positives.
  #
  # Note that && is not included here.  This is because there are too
  # many false positives due to RValue references.
  match = Search(r'[^<>=!\s](==|!=|<=|>=|\|\|)[^<>=!\s,;\)]', line)
  if match:
    error(filename, linenum, 'whitespace/operators', 3,
          'Missing spaces around %s' % match.group(1))
  elif not Match(r'#.*include', line):
    # Look for < that is not surrounded by spaces.  This is only
    # triggered if both sides are missing spaces, even though
    # technically should should flag if at least one side is missing a
    # space.  This is done to avoid some false positives with shifts.
    match = Match(r'^(.*[^\s<])<[^\s=<,]', line)
    if match:
      (_, _, end_pos) = CloseExpression(
          clean_lines, linenum, len(match.group(1)))
      if end_pos <= -1:
        error(filename, linenum, 'whitespace/operators', 3,
              'Missing spaces around <')

    # Look for > that is not surrounded by spaces.  Similar to the
    # above, we only trigger if both sides are missing spaces to avoid
    # false positives with shifts.
    match = Match(r'^(.*[^-\s>])>[^\s=>,]', line)
    if match:
      (_, _, start_pos) = ReverseCloseExpression(
          clean_lines, linenum, len(match.group(1)))
      if start_pos <= -1:
        error(filename, linenum, 'whitespace/operators', 3,
              'Missing spaces around >')

  # We allow no-spaces around << when used like this: 10<<20, but
  # not otherwise (particularly, not when used as streams)
  #
  # We also allow operators following an opening parenthesis, since
  # those tend to be macros that deal with operators.
  match = Search(r'(operator|[^\s(<])(?:L|UL|LL|ULL|l|ul|ll|ull)?<<([^\s,=<])', line)
  if (match and not (match.group(1).isdigit() and match.group(2).isdigit()) and
      not (match.group(1) == 'operator' and match.group(2) == ';')):
    error(filename, linenum, 'whitespace/operators', 3,
          'Missing spaces around <<')

  # We allow no-spaces around >> for almost anything.  This is because
  # C++11 allows ">>" to close nested templates, which accounts for
  # most cases when ">>" is not followed by a space.
  #
  # We still warn on ">>" followed by alpha character, because that is
  # likely due to ">>" being used for right shifts, e.g.:
  #   value >> alpha
  #
  # When ">>" is used to close templates, the alphanumeric letter that
  # follows would be part of an identifier, and there should still be
  # a space separating the template type and the identifier.
  #   type<type<type>> alpha
  match = Search(r'>>[a-zA-Z_]', line)
  if match:
    error(filename, linenum, 'whitespace/operators', 3,
          'Missing spaces around >>')

  # There shouldn't be space around unary operators
  match = Search(r'(!\s|~\s|[\s]--[\s;]|[\s]\+\+[\s;])', line)
  if match:
    error(filename, linenum, 'whitespace/operators', 4,
          'Extra space for operator %s' % match.group(1))


def CheckParenthesisSpacing(filename, clean_lines, linenum, error):
  """Checks for horizontal spacing around parentheses.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """
  line = clean_lines.elided[linenum]

  # No spaces after an if, while, switch, or for
  match = Search(r' (if\(|for\(|while\(|switch\()', line)
  if match:
    error(filename, linenum, 'whitespace/parens', 5,
          'Missing space before ( in %s' % match.group(1))

  # For if/for/while/switch, the left and right parens should be
  # consistent about how many spaces are inside the parens, and
  # there should either be zero or one spaces inside the parens.
  # We don't want: "if ( foo)" or "if ( foo   )".
  # Exception: "for ( ; foo; bar)" and "for (foo; bar; )" are allowed.
  match = Search(r'\b(if|for|while|switch)\s*'
                 r'\(([ ]*)(.).*[^ ]+([ ]*)\)\s*{\s*$',
                 line)
  if match:
    if len(match.group(2)) != len(match.group(4)):
      if not (match.group(3) == ';' and
              len(match.group(2)) == 1 + len(match.group(4)) or
              not match.group(2) and Search(r'\bfor\s*\(.*; \)', line)):
        error(filename, linenum, 'whitespace/parens', 5,
              'Mismatching spaces inside () in %s' % match.group(1))
    if len(match.group(2)) not in [0, 1]:
      error(filename, linenum, 'whitespace/parens', 5,
            'Should have zero or one spaces inside ( and ) in %s' %
            match.group(1))


def CheckCommaSpacing(filename, clean_lines, linenum, error):
  """Checks for horizontal spacing near commas and semicolons.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """
  raw = clean_lines.lines_without_raw_strings
  line = clean_lines.elided[linenum]

  # You should always have a space after a comma (either as fn arg or operator)
  #
  # This does not apply when the non-space character following the
  # comma is another comma, since the only time when that happens is
  # for empty macro arguments.
  #
  # We run this check in two passes: first pass on elided lines to
  # verify that lines contain missing whitespaces, second pass on raw
  # lines to confirm that those missing whitespaces are not due to
  # elided comments.
  if (Search(r',[^,\s]', ReplaceAll(r'\boperator\s*,\s*\(', 'F(', line)) and
      Search(r',[^,\s]', raw[linenum])):
    error(filename, linenum, 'whitespace/comma', 3,
          'Missing space after ,')

  # You should always have a space after a semicolon
  # except for few corner cases
  # TODO(unknown): clarify if 'if (1) { return 1;}' is requires one more
  # space after ;
  if Search(r';[^\s};\\)/]', line):
    error(filename, linenum, 'whitespace/semicolon', 3,
          'Missing space after ;')


def _IsType(clean_lines, nesting_state, expr):
  """Check if expression looks like a type name, returns true if so.

  Args:
    clean_lines: A CleansedLines instance containing the file.
    nesting_state: A NestingState instance which maintains information about
                   the current stack of nested blocks being parsed.
    expr: The expression to check.
  Returns:
    True, if token looks like a type.
  """
  # Keep only the last token in the expression
  last_word = Match(r'^.*(\b\S+)$', expr)
  if last_word:
    token = last_word.group(1)
  else:
    token = expr

  # Match native types and stdint types
  if _TYPES.match(token):
    return True

  # Try a bit harder to match templated types.  Walk up the nesting
  # stack until we find something that resembles a typename
  # declaration for what we are looking for.
  typename_pattern = (r'\b(?:typename|class|struct)\s+' + re.escape(token) +
                      r'\b')
  block_index = len(nesting_state.stack) - 1
  while block_index >= 0:
    if isinstance(nesting_state.stack[block_index], _NamespaceInfo):
      return False

    # Found where the opening brace is.  We want to scan from this
    # line up to the beginning of the function, minus a few lines.
    #   template <typename Type1,  // stop scanning here
    #             ...>
    #   class C
    #     : public ... {  // start scanning here
    last_line = nesting_state.stack[block_index].starting_linenum

    next_block_start = 0
    if block_index > 0:
      next_block_start = nesting_state.stack[block_index - 1].starting_linenum
    first_line = last_line
    while first_line >= next_block_start:
      if clean_lines.elided[first_line].find('template') >= 0:
        break
      first_line -= 1
    if first_line < next_block_start:
      # Didn't find any "template" keyword before reaching the next block,
      # there are probably no template things to check for this block
      block_index -= 1
      continue

    # Look for typename in the specified range
    for i in xrange(first_line, last_line + 1, 1):
      if Search(typename_pattern, clean_lines.elided[i]):
        return True
    block_index -= 1

  return False


def CheckBracesSpacing(filename, clean_lines, linenum, nesting_state, error):
  """Checks for horizontal spacing near commas.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    nesting_state: A NestingState instance which maintains information about
                   the current stack of nested blocks being parsed.
    error: The function to call with any errors found.
  """
  line = clean_lines.elided[linenum]

  # Except after an opening paren, or after another opening brace (in case of
  # an initializer list, for instance), you should have spaces before your
  # braces when they are delimiting blocks, classes, namespaces etc.
  # And since you should never have braces at the beginning of a line,
  # this is an easy test.  Except that braces used for initialization don't
  # follow the same rule; we often don't want spaces before those.
  match = Match(r'^(.*[^ ({>]){', line)

  if match:
    # Try a bit harder to check for brace initialization.  This
    # happens in one of the following forms:
    #   Constructor() : initializer_list_{} { ... }
    #   Constructor{}.MemberFunction()
    #   Type variable{};
    #   FunctionCall(type{}, ...);
    #   LastArgument(..., type{});
    #   LOG(INFO) << type{} << " ...";
    #   map_of_type[{...}] = ...;
    #   ternary = expr ? new type{} : nullptr;
    #   OuterTemplate<InnerTemplateConstructor<Type>{}>
    #
    # We check for the character following the closing brace, and
    # silence the warning if it's one of those listed above, i.e.
    # "{.;,)<>]:".
    #
    # To account for nested initializer list, we allow any number of
    # closing braces up to "{;,)<".  We can't simply silence the
    # warning on first sight of closing brace, because that would
    # cause false negatives for things that are not initializer lists.
    #   Silence this:         But not this:
    #     Outer{                if (...) {
    #       Inner{...}            if (...){  // Missing space before {
    #     };                    }
    #
    # There is a false negative with this approach if people inserted
    # spurious semicolons, e.g. "if (cond){};", but we will catch the
    # spurious semicolon with a separate check.
    leading_text = match.group(1)
    (endline, endlinenum, endpos) = CloseExpression(
        clean_lines, linenum, len(match.group(1)))
    trailing_text = ''
    if endpos > -1:
      trailing_text = endline[endpos:]
    for offset in xrange(endlinenum + 1,
                         min(endlinenum + 3, clean_lines.NumLines() - 1)):
      trailing_text += clean_lines.elided[offset]
    # We also suppress warnings for `uint64_t{expression}` etc., as the style
    # guide recommends brace initialization for integral types to avoid
    # overflow/truncation.
    if (not Match(r'^[\s}]*[{.;,)<>\]:]', trailing_text)
        and not _IsType(clean_lines, nesting_state, leading_text)):
      error(filename, linenum, 'whitespace/braces', 5,
            'Missing space before {')

  # Make sure '} else {' has spaces.
  if Search(r'}else', line):
    error(filename, linenum, 'whitespace/braces', 5,
          'Missing space before else')

  # You shouldn't have a space before a semicolon at the end of the line.
  # There's a special case for "for" since the style guide allows space before
  # the semicolon there.
  if Search(r':\s*;\s*$', line):
    error(filename, linenum, 'whitespace/semicolon', 5,
          'Semicolon defining empty statement. Use {} instead.')
  elif Search(r'^\s*;\s*$', line):
    error(filename, linenum, 'whitespace/semicolon', 5,
          'Line contains only semicolon. If this should be an empty statement, '
          'use {} instead.')
  elif (Search(r'\s+;\s*$', line) and
        not Search(r'\bfor\b', line)):
    error(filename, linenum, 'whitespace/semicolon', 5,
          'Extra space before last semicolon. If this should be an empty '
          'statement, use {} instead.')


def IsDecltype(clean_lines, linenum, column):
  """Check if the token ending on (linenum, column) is decltype().

  Args:
    clean_lines: A CleansedLines instance containing the file.
    linenum: the number of the line to check.
    column: end column of the token to check.
  Returns:
    True if this token is decltype() expression, False otherwise.
  """
  (text, _, start_col) = ReverseCloseExpression(clean_lines, linenum, column)
  if start_col < 0:
    return False
  if Search(r'\bdecltype\s*$', text[0:start_col]):
    return True
  return False

def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error):
  """Checks for additional blank line issues related to sections.

  Currently the only thing checked here is blank line before protected/private.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    class_info: A _ClassInfo objects.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """
  # Skip checks if the class is small, where small means 25 lines or less.
  # 25 lines seems like a good cutoff since that's the usual height of
  # terminals, and any class that can't fit in one screen can't really
  # be considered "small".
  #
  # Also skip checks if we are on the first line.  This accounts for
  # classes that look like
  #   class Foo { public: ... };
  #
  # If we didn't find the end of the class, last_line would be zero,
  # and the check will be skipped by the first condition.
  if (class_info.last_line - class_info.starting_linenum <= 24 or
      linenum <= class_info.starting_linenum):
    return

  matched = Match(r'\s*(public|protected|private):', clean_lines.lines[linenum])
  if matched:
    # Issue warning if the line before public/protected/private was
    # not a blank line, but don't do this if the previous line contains
    # "class" or "struct".  This can happen two ways:
    #  - We are at the beginning of the class.
    #  - We are forward-declaring an inner class that is semantically
    #    private, but needed to be public for implementation reasons.
    # Also ignores cases where the previous line ends with a backslash as can be
    # common when defining classes in C macros.
    prev_line = clean_lines.lines[linenum - 1]
    if (not IsBlankLine(prev_line) and
        not Search(r'\b(class|struct)\b', prev_line) and
        not Search(r'\\$', prev_line)):
      # Try a bit harder to find the beginning of the class.  This is to
      # account for multi-line base-specifier lists, e.g.:
      #   class Derived
      #       : public Base {
      end_class_head = class_info.starting_linenum
      for i in range(class_info.starting_linenum, linenum):
        if Search(r'\{\s*$', clean_lines.lines[i]):
          end_class_head = i
          break
      if end_class_head < linenum - 1:
        error(filename, linenum, 'whitespace/blank_line', 3,
              '"%s:" should be preceded by a blank line' % matched.group(1))


def GetPreviousNonBlankLine(clean_lines, linenum):
  """Return the most recent non-blank line and its line number.

  Args:
    clean_lines: A CleansedLines instance containing the file contents.
    linenum: The number of the line to check.

  Returns:
    A tuple with two elements.  The first element is the contents of the last
    non-blank line before the current line, or the empty string if this is the
    first non-blank line.  The second is the line number of that line, or -1
    if this is the first non-blank line.
  """

  prevlinenum = linenum - 1
  while prevlinenum >= 0:
    prevline = clean_lines.elided[prevlinenum]
    if not IsBlankLine(prevline):     # if not a blank line...
      return (prevline, prevlinenum)
    prevlinenum -= 1
  return ('', -1)


def CheckBraces(filename, clean_lines, linenum, error):
  """Looks for misplaced braces (e.g. at the end of line).

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """

  line = clean_lines.elided[linenum]        # get rid of comments and strings

  if Match(r'\s*{\s*$', line):
    # We allow an open brace to start a line in the case where someone is using
    # braces in a block to explicitly create a new scope, which is commonly used
    # to control the lifetime of stack-allocated variables.  Braces are also
    # used for brace initializers inside function calls.  We don't detect this
    # perfectly: we just don't complain if the last non-whitespace character on
    # the previous non-blank line is ',', ';', ':', '(', '{', or '}', or if the
    # previous line starts a preprocessor block. We also allow a brace on the
    # following line if it is part of an array initialization and would not fit
    # within the 80 character limit of the preceding line.
    prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
    if (not Search(r'[,;:}{(]\s*$', prevline) and
        not Match(r'\s*#', prevline) and
        not (GetLineWidth(prevline) > _line_length - 2 and '[]' in prevline)):
      error(filename, linenum, 'whitespace/braces', 4,
            '{ should almost always be at the end of the previous line')

  # An else clause should be on the same line as the preceding closing brace.
  if Match(r'\s*else\b\s*(?:if\b|\{|$)', line):
    prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
    if Match(r'\s*}\s*$', prevline):
      error(filename, linenum, 'whitespace/newline', 4,
            'An else should appear on the same line as the preceding }')

  # If braces come on one side of an else, they should be on both.
  # However, we have to worry about "else if" that spans multiple lines!
  if Search(r'else if\s*\(', line):       # could be multi-line if
    brace_on_left = bool(Search(r'}\s*else if\s*\(', line))
    # find the ( after the if
    pos = line.find('else if')
    pos = line.find('(', pos)
    if pos > 0:
      (endline, _, endpos) = CloseExpression(clean_lines, linenum, pos)
      brace_on_right = endline[endpos:].find('{') != -1
      if brace_on_left != brace_on_right:    # must be brace after if
        error(filename, linenum, 'readability/braces', 5,
              'If an else has a brace on one side, it should have it on both')
  elif Search(r'}\s*else[^{]*$', line) or Match(r'[^}]*else\s*{', line):
    error(filename, linenum, 'readability/braces', 5,
          'If an else has a brace on one side, it should have it on both')

  # Likewise, an else should never have the else clause on the same line
  if Search(r'\belse [^\s{]', line) and not Search(r'\belse if\b', line):
    error(filename, linenum, 'whitespace/newline', 4,
          'Else clause should never be on same line as else (use 2 lines)')

  # In the same way, a do/while should never be on one line
  if Match(r'\s*do [^\s{]', line):
    error(filename, linenum, 'whitespace/newline', 4,
          'do/while clauses should not be on a single line')

  # Check single-line if/else bodies. The style guide says 'curly braces are not
  # required for single-line statements'. We additionally allow multi-line,
  # single statements, but we reject anything with more than one semicolon in
  # it. This means that the first semicolon after the if should be at the end of
  # its line, and the line after that should have an indent level equal to or
  # lower than the if. We also check for ambiguous if/else nesting without
  # braces.
  if_else_match = Search(r'\b(if\s*(|constexpr)\s*\(|else\b)', line)
  if if_else_match and not Match(r'\s*#', line):
    if_indent = GetIndentLevel(line)
    endline, endlinenum, endpos = line, linenum, if_else_match.end()
    if_match = Search(r'\bif\s*(|constexpr)\s*\(', line)
    if if_match:
      # This could be a multiline if condition, so find the end first.
      pos = if_match.end() - 1
      (endline, endlinenum, endpos) = CloseExpression(clean_lines, linenum, pos)
    # Check for an opening brace, either directly after the if or on the next
    # line. If found, this isn't a single-statement conditional.
    if (not Match(r'\s*{', endline[endpos:])
        and not (Match(r'\s*$', endline[endpos:])
                 and endlinenum < (len(clean_lines.elided) - 1)
                 and Match(r'\s*{', clean_lines.elided[endlinenum + 1]))):
      while (endlinenum < len(clean_lines.elided)
             and ';' not in clean_lines.elided[endlinenum][endpos:]):
        endlinenum += 1
        endpos = 0
      if endlinenum < len(clean_lines.elided):
        endline = clean_lines.elided[endlinenum]
        # We allow a mix of whitespace and closing braces (e.g. for one-liner
        # methods) and a single \ after the semicolon (for macros)
        endpos = endline.find(';')
        if not Match(r';[\s}]*(\\?)$', endline[endpos:]):
          # Semicolon isn't the last character, there's something trailing.
          # Output a warning if the semicolon is not contained inside
          # a lambda expression.
          if not Match(r'^[^{};]*\[[^\[\]]*\][^{}]*\{[^{}]*\}\s*\)*[;,]\s*$',
                       endline):
            error(filename, linenum, 'readability/braces', 4,
                  'If/else bodies with multiple statements require braces')
        elif endlinenum < len(clean_lines.elided) - 1:
          # Make sure the next line is dedented
          next_line = clean_lines.elided[endlinenum + 1]
          next_indent = GetIndentLevel(next_line)
          # With ambiguous nested if statements, this will error out on the
          # if that *doesn't* match the else, regardless of whether it's the
          # inner one or outer one.
          if (if_match and Match(r'\s*else\b', next_line)
              and next_indent != if_indent):
            error(filename, linenum, 'readability/braces', 4,
                  'Else clause should be indented at the same level as if. '
                  'Ambiguous nested if/else chains require braces.')
          elif next_indent > if_indent:
            error(filename, linenum, 'readability/braces', 4,
                  'If/else bodies with multiple statements require braces')


def CheckTrailingSemicolon(filename, clean_lines, linenum, error):
  """Looks for redundant trailing semicolon.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """

  line = clean_lines.elided[linenum]

  # Block bodies should not be followed by a semicolon.  Due to C++11
  # brace initialization, there are more places where semicolons are
  # required than not, so we explicitly list the allowed rules rather
  # than listing the disallowed ones.  These are the places where "};"
  # should be replaced by just "}":
  # 1. Some flavor of block following closing parenthesis:
  #    for (;;) {};
  #    while (...) {};
  #    switch (...) {};
  #    Function(...) {};
  #    if (...) {};
  #    if (...) else if (...) {};
  #
  # 2. else block:
  #    if (...) else {};
  #
  # 3. const member function:
  #    Function(...) const {};
  #
  # 4. Block following some statement:
  #    x = 42;
  #    {};
  #
  # 5. Block at the beginning of a function:
  #    Function(...) {
  #      {};
  #    }
  #
  #    Note that naively checking for the preceding "{" will also match
  #    braces inside multi-dimensional arrays, but this is fine since
  #    that expression will not contain semicolons.
  #
  # 6. Block following another block:
  #    while (true) {}
  #    {};
  #
  # 7. End of namespaces:
  #    namespace {};
  #
  #    These semicolons seems far more common than other kinds of
  #    redundant semicolons, possibly due to people converting classes
  #    to namespaces.  For now we do not warn for this case.
  #
  # Try matching case 1 first.
  match = Match(r'^(.*\)\s*)\{', line)
  if match:
    # Matched closing parenthesis (case 1).  Check the token before the
    # matching opening parenthesis, and don't warn if it looks like a
    # macro.  This avoids these false positives:
    #  - macro that defines a base class
    #  - multi-line macro that defines a base class
    #  - macro that defines the whole class-head
    #
    # But we still issue warnings for macros that we know are safe to
    # warn, specifically:
    #  - TEST, TEST_F, TEST_P, MATCHER, MATCHER_P
    #  - TYPED_TEST
    #  - INTERFACE_DEF
    #  - EXCLUSIVE_LOCKS_REQUIRED, SHARED_LOCKS_REQUIRED, LOCKS_EXCLUDED:
    #
    # We implement a list of safe macros instead of a list of
    # unsafe macros, even though the latter appears less frequently in
    # google code and would have been easier to implement.  This is because
    # the downside for getting the allowed checks wrong means some extra
    # semicolons, while the downside for getting disallowed checks wrong
    # would result in compile errors.
    #
    # In addition to macros, we also don't want to warn on
    #  - Compound literals
    #  - Lambdas
    #  - alignas specifier with anonymous structs
    #  - decltype
    closing_brace_pos = match.group(1).rfind(')')
    opening_parenthesis = ReverseCloseExpression(
        clean_lines, linenum, closing_brace_pos)
    if opening_parenthesis[2] > -1:
      line_prefix = opening_parenthesis[0][0:opening_parenthesis[2]]
      macro = Search(r'\b([A-Z_][A-Z0-9_]*)\s*$', line_prefix)
      func = Match(r'^(.*\])\s*$', line_prefix)
      if ((macro and
           macro.group(1) not in (
               'TEST', 'TEST_F', 'MATCHER', 'MATCHER_P', 'TYPED_TEST',
               'EXCLUSIVE_LOCKS_REQUIRED', 'SHARED_LOCKS_REQUIRED',
               'LOCKS_EXCLUDED', 'INTERFACE_DEF')) or
          (func and not Search(r'\boperator\s*\[\s*\]', func.group(1))) or
          Search(r'\b(?:struct|union)\s+alignas\s*$', line_prefix) or
          Search(r'\bdecltype$', line_prefix) or
          Search(r'\s+=\s*$', line_prefix)):
        match = None
    if (match and
        opening_parenthesis[1] > 1 and
        Search(r'\]\s*$', clean_lines.elided[opening_parenthesis[1] - 1])):
      # Multi-line lambda-expression
      match = None

  else:
    # Try matching cases 2-3.
    match = Match(r'^(.*(?:else|\)\s*const)\s*)\{', line)
    if not match:
      # Try matching cases 4-6.  These are always matched on separate lines.
      #
      # Note that we can't simply concatenate the previous line to the
      # current line and do a single match, otherwise we may output
      # duplicate warnings for the blank line case:
      #   if (cond) {
      #     // blank line
      #   }
      prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
      if prevline and Search(r'[;{}]\s*$', prevline):
        match = Match(r'^(\s*)\{', line)

  # Check matching closing brace
  if match:
    (endline, endlinenum, endpos) = CloseExpression(
        clean_lines, linenum, len(match.group(1)))
    if endpos > -1 and Match(r'^\s*;', endline[endpos:]):
      # Current {} pair is eligible for semicolon check, and we have found
      # the redundant semicolon, output warning here.
      #
      # Note: because we are scanning forward for opening braces, and
      # outputting warnings for the matching closing brace, if there are
      # nested blocks with trailing semicolons, we will get the error
      # messages in reversed order.

      # We need to check the line forward for NOLINT
      raw_lines = clean_lines.raw_lines
      ParseNolintSuppressions(filename, raw_lines[endlinenum-1], endlinenum-1,
                              error)
      ParseNolintSuppressions(filename, raw_lines[endlinenum], endlinenum,
                              error)

      error(filename, endlinenum, 'readability/braces', 4,
            "You don't need a ; after a }")


def CheckEmptyBlockBody(filename, clean_lines, linenum, error):
  """Look for empty loop/conditional body with only a single semicolon.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """

  # Search for loop keywords at the beginning of the line.  Because only
  # whitespaces are allowed before the keywords, this will also ignore most
  # do-while-loops, since those lines should start with closing brace.
  #
  # We also check "if" blocks here, since an empty conditional block
  # is likely an error.
  line = clean_lines.elided[linenum]
  matched = Match(r'\s*(for|while|if)\s*\(', line)
  if matched:
    # Find the e
Download .txt
gitextract_4v8b1k9q/

├── .clang-format
├── .cpplint
├── .editorconfig
├── .eslintrc
├── .gitignore
├── .gitmodules
├── CPPLINT.cfg
├── LICENSE
├── README.md
├── binding.gyp
├── deps/
│   └── cpplint/
│       ├── .flake8
│       ├── .gitignore
│       ├── .pylintrc
│       ├── .style.yapf
│       ├── .travis.yml
│       ├── CONTRIBUTING.rst
│       ├── LICENSE
│       ├── MANIFEST.in
│       ├── README.rst
│       ├── changelog.rst
│       ├── cpplint.py
│       ├── cpplint_clitest.py
│       ├── cpplint_unittest.py
│       ├── dev-requirements
│       ├── samples/
│       │   ├── boost-sample/
│       │   │   ├── LICENSE
│       │   │   ├── README.md
│       │   │   ├── exclude.def
│       │   │   ├── headers_inspect.def
│       │   │   ├── headers_simple.def
│       │   │   ├── simple.def
│       │   │   └── src/
│       │   │       ├── inspect/
│       │   │       │   └── unnamed_namespace_check.hpp
│       │   │       └── tr1/
│       │   │           └── c_policy.hpp
│       │   ├── chromium-sample/
│       │   │   ├── README.md
│       │   │   ├── simple.def
│       │   │   └── src/
│       │   │       ├── chrome_content_renderer_client.cc
│       │   │       ├── chrome_content_renderer_client.h
│       │   │       ├── io_thread.cc
│       │   │       └── io_thread.h
│       │   ├── codelite-sample/
│       │   │   ├── LICENSE
│       │   │   ├── README.md
│       │   │   ├── simple.def
│       │   │   └── src/
│       │   │       ├── pptable.cpp
│       │   │       └── pptable.h
│       │   ├── protobuf-sample/
│       │   │   ├── LICENSE
│       │   │   ├── README.md
│       │   │   ├── simple.def
│       │   │   └── src/
│       │   │       ├── descriptor.pb.cc
│       │   │       ├── descriptor.pb.h
│       │   │       └── descriptor_unittest.cc
│       │   ├── silly-sample/
│       │   │   ├── filters.def
│       │   │   ├── includeorder_cfirst.def
│       │   │   ├── sed.def
│       │   │   ├── simple.def
│       │   │   └── src/
│       │   │       └── sillycode.cpp
│       │   ├── v8-sample/
│       │   │   ├── LICENSE
│       │   │   ├── README.md
│       │   │   ├── simple.def
│       │   │   └── src/
│       │   │       └── interface-descriptors.h
│       │   └── vlc-sample/
│       │       ├── COPYING
│       │       ├── README.md
│       │       ├── simple.def
│       │       └── src/
│       │           ├── libvlc.c
│       │           ├── libvlc.h
│       │           └── missing.c
│       ├── setup.cfg
│       ├── setup.py
│       ├── test-requirements
│       └── tox.ini
├── index.d.ts
├── index.js
├── lib/
│   ├── default_palette.d.ts
│   ├── default_palette.js
│   ├── x.d.ts
│   └── x.js
├── package.json
├── src/
│   ├── common.cc
│   ├── common.h
│   └── thmclrx.cc
├── test/
│   └── test.js
├── tools/
│   └── clang_format.js
└── tsconfig.json
Download .txt
SYMBOL INDEX (1445 symbols across 26 files)

FILE: deps/cpplint/cpplint.py
  function unicode_escape_decode (line 896) | def unicode_escape_decode(x):
  function ProcessHppHeadersOption (line 910) | def ProcessHppHeadersOption(val):
  function ProcessIncludeOrderOption (line 917) | def ProcessIncludeOrderOption(val):
  function IsHeaderExtension (line 926) | def IsHeaderExtension(file_extension):
  function GetHeaderExtensions (line 929) | def GetHeaderExtensions():
  function GetAllExtensions (line 938) | def GetAllExtensions():
  function ProcessExtensionsOption (line 942) | def ProcessExtensionsOption(val):
  function GetNonHeaderExtensions (line 952) | def GetNonHeaderExtensions():
  function ParseNolintSuppressions (line 955) | def ParseNolintSuppressions(filename, raw_line, linenum, error):
  function ProcessGlobalSuppresions (line 987) | def ProcessGlobalSuppresions(lines):
  function ResetNolintSuppressions (line 1005) | def ResetNolintSuppressions():
  function IsErrorSuppressedByNolint (line 1011) | def IsErrorSuppressedByNolint(category, linenum):
  function Match (line 1029) | def Match(pattern, s):
  function ReplaceAll (line 1039) | def ReplaceAll(pattern, rep, s):
  function Search (line 1057) | def Search(pattern, s):
  function _IsSourceExtension (line 1064) | def _IsSourceExtension(s):
  class _IncludeState (line 1069) | class _IncludeState(object):
    method __init__ (line 1107) | def __init__(self):
    method FindHeader (line 1113) | def FindHeader(self, header):
    method ResetSection (line 1128) | def ResetSection(self, directive):
    method SetLastHeader (line 1146) | def SetLastHeader(self, header_path):
    method CanonicalizeAlphabeticalOrder (line 1149) | def CanonicalizeAlphabeticalOrder(self, header_path):
    method IsInAlphabeticalOrder (line 1164) | def IsInAlphabeticalOrder(self, clean_lines, linenum, header_path):
    method CheckNextIncludeOrder (line 1185) | def CheckNextIncludeOrder(self, header_type):
  class _CppLintState (line 1245) | class _CppLintState(object):
    method __init__ (line 1248) | def __init__(self):
    method SetOutputFormat (line 1273) | def SetOutputFormat(self, output_format):
    method SetQuiet (line 1277) | def SetQuiet(self, quiet):
    method SetVerboseLevel (line 1283) | def SetVerboseLevel(self, level):
    method SetCountingStyle (line 1289) | def SetCountingStyle(self, counting_style):
    method SetFilters (line 1293) | def SetFilters(self, filters):
    method AddFilters (line 1311) | def AddFilters(self, filters):
    method BackupFilters (line 1322) | def BackupFilters(self):
    method RestoreFilters (line 1326) | def RestoreFilters(self):
    method ResetErrorCounts (line 1330) | def ResetErrorCounts(self):
    method IncrementErrorCount (line 1335) | def IncrementErrorCount(self, category):
    method PrintErrorCounts (line 1345) | def PrintErrorCounts(self):
    method PrintInfo (line 1353) | def PrintInfo(self, message):
    method PrintError (line 1359) | def PrintError(self, message):
    method AddJUnitFailure (line 1365) | def AddJUnitFailure(self, filename, linenum, message, category, confid...
    method FormatJUnitXML (line 1369) | def FormatJUnitXML(self):
  function _OutputFormat (line 1416) | def _OutputFormat():
  function _SetOutputFormat (line 1421) | def _SetOutputFormat(output_format):
  function _Quiet (line 1425) | def _Quiet():
  function _SetQuiet (line 1429) | def _SetQuiet(quiet):
  function _VerboseLevel (line 1434) | def _VerboseLevel():
  function _SetVerboseLevel (line 1439) | def _SetVerboseLevel(level):
  function _SetCountingStyle (line 1444) | def _SetCountingStyle(level):
  function _Filters (line 1449) | def _Filters():
  function _SetFilters (line 1454) | def _SetFilters(filters):
  function _AddFilters (line 1466) | def _AddFilters(filters):
  function _BackupFilters (line 1478) | def _BackupFilters():
  function _RestoreFilters (line 1482) | def _RestoreFilters():
  class _FunctionState (line 1486) | class _FunctionState(object):
    method __init__ (line 1492) | def __init__(self):
    method Begin (line 1497) | def Begin(self, function_name):
    method Count (line 1507) | def Count(self):
    method Check (line 1512) | def Check(self, error, filename, linenum):
    method End (line 1540) | def End(self):
  class _IncludeError (line 1545) | class _IncludeError(Exception):
  class FileInfo (line 1550) | class FileInfo(object):
    method __init__ (line 1557) | def __init__(self, filename):
    method FullName (line 1560) | def FullName(self):
    method RepositoryName (line 1564) | def RepositoryName(self):
    method Split (line 1624) | def Split(self):
    method BaseName (line 1638) | def BaseName(self):
    method Extension (line 1642) | def Extension(self):
    method NoExtension (line 1646) | def NoExtension(self):
    method IsSource (line 1650) | def IsSource(self):
  function _ShouldPrintError (line 1655) | def _ShouldPrintError(category, confidence, linenum):
  function Error (line 1683) | def Error(filename, linenum, category, confidence, message):
  function IsCppString (line 1748) | def IsCppString(line):
  function CleanseRawStrings (line 1765) | def CleanseRawStrings(raw_lines):
  function FindNextMultiLineCommentStart (line 1841) | def FindNextMultiLineCommentStart(lines, lineix):
  function FindNextMultiLineCommentEnd (line 1852) | def FindNextMultiLineCommentEnd(lines, lineix):
  function RemoveMultiLineCommentsFromRange (line 1861) | def RemoveMultiLineCommentsFromRange(lines, begin, end):
  function RemoveMultiLineComments (line 1869) | def RemoveMultiLineComments(filename, lines, error):
  function CleanseComments (line 1885) | def CleanseComments(line):
  class CleansedLines (line 1901) | class CleansedLines(object):
    method __init__ (line 1912) | def __init__(self, lines):
    method NumLines (line 1924) | def NumLines(self):
    method _CollapseStrings (line 1929) | def _CollapseStrings(elided):
  function FindEndOfExpressionInLine (line 1996) | def FindEndOfExpressionInLine(line, startpos, stack):
  function CloseExpression (line 2074) | def CloseExpression(clean_lines, linenum, pos):
  function FindStartOfExpressionInLine (line 2118) | def FindStartOfExpressionInLine(line, endpos, stack):
  function ReverseCloseExpression (line 2195) | def ReverseCloseExpression(clean_lines, linenum, pos):
  function CheckForCopyright (line 2233) | def CheckForCopyright(filename, lines, error):
  function GetIndentLevel (line 2246) | def GetIndentLevel(line):
  function PathSplitToList (line 2261) | def PathSplitToList(path):
  function GetHeaderGuardCPPVariable (line 2286) | def GetHeaderGuardCPPVariable(filename):
  function CheckForHeaderGuard (line 2362) | def CheckForHeaderGuard(filename, clean_lines, error):
  function CheckHeaderFileIncluded (line 2465) | def CheckHeaderFileIncluded(filename, include_state, error):
  function CheckForBadCharacters (line 2498) | def CheckForBadCharacters(filename, lines, error):
  function CheckForNewlineAtEOF (line 2523) | def CheckForNewlineAtEOF(filename, lines, error):
  function CheckForMultilineCommentsAndStrings (line 2541) | def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, ...
  function CheckPosixThreading (line 2609) | def CheckPosixThreading(filename, clean_lines, linenum, error):
  function CheckVlogArguments (line 2635) | def CheckVlogArguments(filename, clean_lines, linenum, error):
  function CheckInvalidIncrement (line 2659) | def CheckInvalidIncrement(filename, clean_lines, linenum, error):
  function IsMacroDefinition (line 2681) | def IsMacroDefinition(clean_lines, linenum):
  function IsForwardClassDeclaration (line 2691) | def IsForwardClassDeclaration(clean_lines, linenum):
  class _BlockInfo (line 2695) | class _BlockInfo(object):
    method __init__ (line 2698) | def __init__(self, linenum, seen_open_brace):
    method CheckBegin (line 2705) | def CheckBegin(self, filename, clean_lines, linenum, error):
    method CheckEnd (line 2720) | def CheckEnd(self, filename, clean_lines, linenum, error):
    method IsBlockInfo (line 2733) | def IsBlockInfo(self):
  class _ExternCInfo (line 2745) | class _ExternCInfo(_BlockInfo):
    method __init__ (line 2748) | def __init__(self, linenum):
  class _ClassInfo (line 2752) | class _ClassInfo(_BlockInfo):
    method __init__ (line 2755) | def __init__(self, name, class_or_struct, clean_lines, linenum):
    method CheckBegin (line 2785) | def CheckBegin(self, filename, clean_lines, linenum, error):
    method CheckEnd (line 2790) | def CheckEnd(self, filename, clean_lines, linenum, error):
  class _NamespaceInfo (line 2821) | class _NamespaceInfo(_BlockInfo):
    method __init__ (line 2824) | def __init__(self, name, linenum):
    method CheckEnd (line 2829) | def CheckEnd(self, filename, clean_lines, linenum, error):
  class _PreprocessorInfo (line 2882) | class _PreprocessorInfo(object):
    method __init__ (line 2885) | def __init__(self, stack_before_if):
  class NestingState (line 2896) | class NestingState(object):
    method __init__ (line 2899) | def __init__(self):
    method SeenOpenBrace (line 2922) | def SeenOpenBrace(self):
    method InNamespaceBody (line 2931) | def InNamespaceBody(self):
    method InExternC (line 2939) | def InExternC(self):
    method InClassDeclaration (line 2947) | def InClassDeclaration(self):
    method InAsmBlock (line 2955) | def InAsmBlock(self):
    method InTemplateArgumentList (line 2963) | def InTemplateArgumentList(self, clean_lines, linenum, pos):
    method UpdatePreprocessor (line 3015) | def UpdatePreprocessor(self, line):
    method Update (line 3072) | def Update(self, filename, clean_lines, linenum, error):
    method InnermostClass (line 3236) | def InnermostClass(self):
    method CheckCompletedBlocks (line 3248) | def CheckCompletedBlocks(self, filename, error):
  function CheckForNonStandardConstructs (line 3270) | def CheckForNonStandardConstructs(filename, clean_lines, linenum,
  function CheckSpacingForFunctionCall (line 3435) | def CheckSpacingForFunctionCall(filename, clean_lines, linenum, error):
  function IsBlankLine (line 3512) | def IsBlankLine(line):
  function CheckForNamespaceIndentation (line 3527) | def CheckForNamespaceIndentation(filename, nesting_state, clean_lines, l...
  function CheckForFunctionLengths (line 3541) | def CheckForFunctionLengths(filename, clean_lines, linenum,
  function CheckComment (line 3612) | def CheckComment(line, filename, linenum, next_line_start, error):
  function CheckSpacing (line 3666) | def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
  function CheckOperatorSpacing (line 3795) | def CheckOperatorSpacing(filename, clean_lines, linenum, error):
  function CheckParenthesisSpacing (line 3910) | def CheckParenthesisSpacing(filename, clean_lines, linenum, error):
  function CheckCommaSpacing (line 3948) | def CheckCommaSpacing(filename, clean_lines, linenum, error):
  function _IsType (line 3984) | def _IsType(clean_lines, nesting_state, expr):
  function CheckBracesSpacing (line 4047) | def CheckBracesSpacing(filename, clean_lines, linenum, nesting_state, er...
  function IsDecltype (line 4136) | def IsDecltype(clean_lines, linenum, column):
  function CheckSectionSpacing (line 4153) | def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error):
  function GetPreviousNonBlankLine (line 4208) | def GetPreviousNonBlankLine(clean_lines, linenum):
  function CheckBraces (line 4231) | def CheckBraces(filename, clean_lines, linenum, error):
  function CheckTrailingSemicolon (line 4350) | def CheckTrailingSemicolon(filename, clean_lines, linenum, error):
  function CheckEmptyBlockBody (line 4497) | def CheckEmptyBlockBody(filename, clean_lines, linenum, error):
  function FindCheckMacro (line 4601) | def FindCheckMacro(line):
  function CheckCheck (line 4624) | def CheckCheck(filename, clean_lines, linenum, error):
  function CheckAltTokens (line 4742) | def CheckAltTokens(filename, clean_lines, linenum, error):
  function GetLineWidth (line 4774) | def GetLineWidth(line):
  function CheckStyle (line 4806) | def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_s...
  function _DropCommonSuffixes (line 4941) | def _DropCommonSuffixes(filename):
  function _ClassifyInclude (line 4971) | def _ClassifyInclude(fileinfo, include, used_angle_brackets, include_ord...
  function CheckIncludeLine (line 5046) | def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
  function _GetTextInside (line 5137) | def _GetTextInside(text, start_pattern):
  function CheckLanguage (line 5222) | def CheckLanguage(filename, clean_lines, linenum, file_extension,
  function CheckGlobalStatic (line 5383) | def CheckGlobalStatic(filename, clean_lines, linenum, error):
  function CheckPrintf (line 5444) | def CheckPrintf(filename, clean_lines, linenum, error):
  function IsDerivedFunction (line 5473) | def IsDerivedFunction(clean_lines, linenum):
  function IsOutOfLineMethodDefinition (line 5495) | def IsOutOfLineMethodDefinition(clean_lines, linenum):
  function IsInitializerList (line 5511) | def IsInitializerList(clean_lines, linenum):
  function CheckForNonConstReference (line 5553) | def CheckForNonConstReference(filename, clean_lines, linenum,
  function CheckCasts (line 5692) | def CheckCasts(filename, clean_lines, linenum, error):
  function CheckCStyleCast (line 5811) | def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, ...
  function ExpectingFunctionArgs (line 5864) | def ExpectingFunctionArgs(clean_lines, linenum):
  function FilesBelongToSameModule (line 5966) | def FilesBelongToSameModule(filename_cc, filename_h):
  function UpdateIncludeState (line 6024) | def UpdateIncludeState(filename, include_dict, io=codecs):
  function CheckForIncludeWhatYouUse (line 6052) | def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
  function CheckMakePairUsesDeduction (line 6156) | def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error):
  function CheckRedundantVirtual (line 6177) | def CheckRedundantVirtual(filename, clean_lines, linenum, error):
  function CheckRedundantOverrideOrFinal (line 6241) | def CheckRedundantOverrideOrFinal(filename, clean_lines, linenum, error):
  function IsBlockInNameSpace (line 6274) | def IsBlockInNameSpace(nesting_state, is_forward_declaration):
  function ShouldCheckNamespaceIndentation (line 6293) | def ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_i...
  function CheckItemIndentationInNamespace (line 6326) | def CheckItemIndentationInNamespace(filename, raw_lines_no_comments, lin...
  function ProcessLine (line 6334) | def ProcessLine(filename, file_extension, clean_lines, line,
  function FlagCxx11Features (line 6379) | def FlagCxx11Features(filename, clean_lines, linenum, error):
  function FlagCxx14Features (line 6431) | def FlagCxx14Features(filename, clean_lines, linenum, error):
  function ProcessFileData (line 6450) | def ProcessFileData(filename, file_extension, lines, error,
  function ProcessConfigOverrides (line 6501) | def ProcessConfigOverrides(filename):
  function ProcessFile (line 6590) | def ProcessFile(filename, vlevel, extra_check_functions=None):
  function PrintUsage (line 6683) | def PrintUsage(message):
  function PrintVersion (line 6699) | def PrintVersion():
  function PrintCategories (line 6705) | def PrintCategories():
  function ParseArguments (line 6714) | def ParseArguments(args):
  function _ExpandDirectories (line 6816) | def _ExpandDirectories(filenames):
  function _FilterExcludedFiles (line 6847) | def _FilterExcludedFiles(fnames):
  function _IsParentOrSame (line 6857) | def _IsParentOrSame(parent, child):
  function main (line 6875) | def main():

FILE: deps/cpplint/cpplint_clitest.py
  function RunShellCommand (line 44) | def RunShellCommand(cmd, cwd='.'):
  class UsageTest (line 64) | class UsageTest(unittest.TestCase):
    method testHelp (line 66) | def testHelp(self):
  class TemporaryFolderClassSetup (line 72) | class TemporaryFolderClassSetup(object):
    method setUpClass (line 83) | def setUpClass(cls):
    method tearDownClass (line 97) | def tearDownClass(cls):
    method prepare_directory (line 103) | def prepare_directory(cls, root):
    method get_extra_command_args (line 107) | def get_extra_command_args(self, cwd):
    method checkAllInFolder (line 111) | def checkAllInFolder(self, foldername, expectedDefs):
    method _checkDef (line 122) | def _checkDef(self, path):
    method _runAndCheck (line 134) | def _runAndCheck(
  class NoRepoSignatureTests (line 154) | class NoRepoSignatureTests(TemporaryFolderClassSetup, unittest.TestCase):
    method get_extra_command_args (line 157) | def get_extra_command_args(self, cwd):
    method testChromiumSample (line 160) | def testChromiumSample(self):
    method testVlcSample (line 163) | def testVlcSample(self):
    method testSillySample (line 166) | def testSillySample(self):
    method testBoostSample (line 169) | def testBoostSample(self):
    method testProtobufSample (line 172) | def testProtobufSample(self):
    method testCodeliteSample (line 175) | def testCodeliteSample(self):
    method testV8Sample (line 178) | def testV8Sample(self):
  class GitRepoSignatureTests (line 181) | class GitRepoSignatureTests(TemporaryFolderClassSetup, unittest.TestCase):
    method prepare_directory (line 185) | def prepare_directory(cls, root):
    method testCodeliteSample (line 189) | def testCodeliteSample(self):
  class MercurialRepoSignatureTests (line 192) | class MercurialRepoSignatureTests(TemporaryFolderClassSetup, unittest.Te...
    method prepare_directory (line 196) | def prepare_directory(cls, root):
    method testCodeliteSample (line 200) | def testCodeliteSample(self):
  class SvnRepoSignatureTests (line 203) | class SvnRepoSignatureTests(TemporaryFolderClassSetup, unittest.TestCase):
    method prepare_directory (line 207) | def prepare_directory(cls, root):
    method testCodeliteSample (line 211) | def testCodeliteSample(self):

FILE: deps/cpplint/cpplint_unittest.py
  function unicode_escape_decode (line 67) | def unicode_escape_decode(x):
  function codecs_latin_encode (line 73) | def codecs_latin_encode(x):
  class ErrorCollector (line 82) | class ErrorCollector(object):
    method __init__ (line 87) | def __init__(self, assert_fn):
    method __call__ (line 93) | def __call__(self, unused_filename, linenum,
    method Results (line 102) | def Results(self):
    method ResultList (line 108) | def ResultList(self):
    method VerifyAllCategoriesAreSeen (line 111) | def VerifyAllCategoriesAreSeen(self):
    method RemoveIfPresent (line 124) | def RemoveIfPresent(self, substr):
  class MockIo (line 132) | class MockIo(object):
    method __init__ (line 134) | def __init__(self, mock_file):
    method open (line 143) | def open(self,  # pylint: disable=C6409
  class CpplintTestBase (line 148) | class CpplintTestBase(unittest.TestCase):
    method setUp (line 151) | def setUp(self):
    method tearDown (line 155) | def tearDown(self):
    method PerformSingleLineLint (line 159) | def PerformSingleLineLint(self, code):
    method PerformMultiLineLint (line 177) | def PerformMultiLineLint(self, code):
    method PerformLanguageRulesCheck (line 194) | def PerformLanguageRulesCheck(self, file_name, code):
    method PerformFunctionLengthsCheck (line 207) | def PerformFunctionLengthsCheck(self, code):
    method PerformIncludeWhatYouUse (line 233) | def PerformIncludeWhatYouUse(self, code, filename='foo.h', io=codecs):
    method TestLint (line 254) | def TestLint(self, code, expected_message):
    method TestMultiLineLint (line 257) | def TestMultiLineLint(self, code, expected_message):
    method TestMultiLineLintRE (line 260) | def TestMultiLineLintRE(self, code, expected_message_re):
    method TestLanguageRulesCheck (line 266) | def TestLanguageRulesCheck(self, file_name, code, expected_message):
    method TestIncludeWhatYouUse (line 270) | def TestIncludeWhatYouUse(self, code, expected_message):
    method TestBlankLinesCheck (line 274) | def TestBlankLinesCheck(self, lines, start_errors, end_errors):
    method doTestBlankLinesCheck (line 278) | def doTestBlankLinesCheck(self, lines, start_errors, end_errors, exten...
  class CpplintTest (line 293) | class CpplintTest(CpplintTestBase):
    method GetNamespaceResults (line 295) | def GetNamespaceResults(self, lines):
    method testForwardDeclarationNameSpaceIndentation (line 307) | def testForwardDeclarationNameSpaceIndentation(self):
    method testNameSpaceIndentationForClass (line 316) | def testNameSpaceIndentationForClass(self):
    method testNameSpaceIndentationNoError (line 327) | def testNameSpaceIndentationNoError(self):
    method testWhitespaceBeforeNamespace (line 335) | def testWhitespaceBeforeNamespace(self):
    method testFalsePositivesNoError (line 343) | def testFalsePositivesNoError(self):
    method testGetLineWidth (line 356) | def testGetLineWidth(self):
    method testGetTextInside (line 364) | def testGetTextInside(self):
    method testFindNextMultiLineCommentStart (line 387) | def testFindNextMultiLineCommentStart(self):
    method testFindNextMultiLineCommentEnd (line 396) | def testFindNextMultiLineCommentEnd(self):
    method testRemoveMultiLineCommentsFromRange (line 401) | def testRemoveMultiLineCommentsFromRange(self):
    method testSpacesAtEndOfLine (line 406) | def testSpacesAtEndOfLine(self):
    method testLineLengthCheck (line 413) | def testLineLengthCheck(self):
    method testErrorSuppression (line 482) | def testErrorSuppression(self):
    method testVariableDeclarations (line 595) | def testVariableDeclarations(self):
    method testCStyleCast (line 609) | def testCStyleCast(self):
    method testRuntimeCasting (line 708) | def testRuntimeCasting(self):
    method testRuntimeSelfinit (line 743) | def testRuntimeSelfinit(self):
    method testCheckForUnnamedParams (line 760) | def testCheckForUnnamedParams(self):
    method testDeprecatedCast (line 793) | def testDeprecatedCast(self):
    method testMockMethod (line 859) | def testMockMethod(self):
    method testMockCallback (line 901) | def testMockCallback(self):
    method testIncludeFilenameFalseError (line 910) | def testIncludeFilenameFalseError(self):
    method testTypedefForPointerToFunction (line 921) | def testTypedefForPointerToFunction(self):
    method testIncludeWhatYouUseNoImplementationFiles (line 935) | def testIncludeWhatYouUseNoImplementationFiles(self):
    method testIncludeWhatYouUse (line 945) | def testIncludeWhatYouUse(self):
    method testFilesBelongToSameModule (line 1201) | def testFilesBelongToSameModule(self):
    method testCleanseLine (line 1232) | def testCleanseLine(self):
    method testRawStrings (line 1250) | def testRawStrings(self):
    method testMultiLineComments (line 1331) | def testMultiLineComments(self):
    method testMultilineStrings (line 1361) | def testMultilineStrings(self):
    method testExplicitSingleArgumentConstructors (line 1381) | def testExplicitSingleArgumentConstructors(self):
    method testSlashStarCommentOnSingleLine (line 1790) | def testSlashStarCommentOnSingleLine(self):
    method testSuspiciousUsageOfIf (line 1815) | def testSuspiciousUsageOfIf(self):
    method testSuspiciousUsageOfMemset (line 1826) | def testSuspiciousUsageOfMemset(self):
    method testRedundantVirtual (line 1860) | def testRedundantVirtual(self):
    method testCheckDeprecated (line 1916) | def testCheckDeprecated(self):
    method testCheckPosixThreading (line 1920) | def testCheckPosixThreading(self):
    method testVlogMisuse (line 1940) | def testVlogMisuse(self):
    method testFormatStrings (line 1966) | def testFormatStrings(self):
    method testIllegalOperatorOverloading (line 1995) | def testIllegalOperatorOverloading(self):
    method testConstStringReferenceMembers (line 2005) | def testConstStringReferenceMembers(self):
    method testVariableLengthArrayDetection (line 2037) | def testVariableLengthArrayDetection(self):
    method testDisallowMacrosAtEnd (line 2069) | def testDisallowMacrosAtEnd(self):
    method testBraces (line 2143) | def testBraces(self):
    method testCheckCheck (line 2168) | def testCheckCheck(self):
    method testCheckCheckFalsePositives (line 2275) | def testCheckCheckFalsePositives(self):
    method testCheckAltTokens (line 2309) | def testCheckAltTokens(self):
    method testNonConstReference (line 2356) | def testNonConstReference(self):
    method testBraceAtBeginOfLine (line 2539) | def testBraceAtBeginOfLine(self):
    method testMismatchingSpacesInParens (line 2578) | def testMismatchingSpacesInParens(self):
    method testSpacingForFncall (line 2592) | def testSpacingForFncall(self):
    method testSpacingBeforeBraces (line 2658) | def testSpacingBeforeBraces(self):
    method testSemiColonAfterBraces (line 2678) | def testSemiColonAfterBraces(self):
    method testSpacingBeforeBrackets (line 2708) | def testSpacingBeforeBrackets(self):
    method testLambda (line 2716) | def testLambda(self):
    method testBraceInitializerList (line 2737) | def testBraceInitializerList(self):
    method testSpacingAroundElse (line 2791) | def testSpacingAroundElse(self):
    method testSpacingWithInitializerLists (line 2799) | def testSpacingWithInitializerLists(self):
    method testSpacingForBinaryOps (line 2803) | def testSpacingForBinaryOps(self):
    method testSpacingBeforeLastSemicolon (line 2853) | def testSpacingBeforeLastSemicolon(self):
    method testEmptyBlockBody (line 2871) | def testEmptyBlockBody(self):
    method testSpacingForRangeBasedFor (line 2941) | def testSpacingForRangeBasedFor(self):
    method testStaticOrGlobalSTLStrings (line 2967) | def testStaticOrGlobalSTLStrings(self):
    method testNoSpacesInFunctionCalls (line 3086) | def testNoSpacesInFunctionCalls(self):
    method testToDoComments (line 3108) | def testToDoComments(self):
    method testTwoSpacesBetweenCodeAndComments (line 3138) | def testTwoSpacesBetweenCodeAndComments(self):
    method testSpaceAfterCommentMarker (line 3176) | def testSpaceAfterCommentMarker(self):
    method testLinePrecededByEmptyOrCommentLines (line 3205) | def testLinePrecededByEmptyOrCommentLines(self):
    method testUsingLiteralsNamespaces (line 3220) | def testUsingLiteralsNamespaces(self):
    method testNewlineAtEOF (line 3228) | def testNewlineAtEOF(self):
    method testInvalidUtf8 (line 3243) | def testInvalidUtf8(self):
    method testBadCharacters (line 3269) | def testBadCharacters(self):
    method testIsBlankLine (line 3299) | def testIsBlankLine(self):
    method testBlankLinesCheck (line 3306) | def testBlankLinesCheck(self):
    method testAllowBlankLineBeforeClosingNamespace (line 3322) | def testAllowBlankLineBeforeClosingNamespace(self):
    method testAllowBlankLineBeforeIfElseChain (line 3347) | def testAllowBlankLineBeforeIfElseChain(self):
    method testAllowBlankLineAfterExtern (line 3364) | def testAllowBlankLineAfterExtern(self):
    method testBlankLineBeforeSectionKeyword (line 3380) | def testBlankLineBeforeSectionKeyword(self):
    method testNoBlankLineAfterSectionKeyword (line 3416) | def testNoBlankLineAfterSectionKeyword(self):
    method testAllowBlankLinesInRawStrings (line 3440) | def testAllowBlankLinesInRawStrings(self):
    method testElseOnSameLineAsClosingBraces (line 3453) | def testElseOnSameLineAsClosingBraces(self):
    method testMultipleStatementsOnSameLine (line 3493) | def testMultipleStatementsOnSameLine(self):
    method testLambdasOnSameLine (line 3512) | def testLambdasOnSameLine(self):
    method testEndOfNamespaceComments (line 3560) | def testEndOfNamespaceComments(self):
    method testElseClauseNotOnSameLineAsElse (line 3627) | def testElseClauseNotOnSameLineAsElse(self):
    method testComma (line 3637) | def testComma(self):
    method testEqualsOperatorSpacing (line 3653) | def testEqualsOperatorSpacing(self):
    method testShiftOperatorSpacing (line 3695) | def testShiftOperatorSpacing(self):
    method testIndent (line 3704) | def testIndent(self):
    method testSectionIndent (line 3763) | def testSectionIndent(self):
    method testConditionals (line 3842) | def testConditionals(self):
    method testTab (line 4042) | def testTab(self):
    method testParseArguments (line 4048) | def testParseArguments(self):
    method testRecursiveArgument (line 4143) | def testRecursiveArgument(self):
    method testRecursiveExcludeInvalidFileExtension (line 4163) | def testRecursiveExcludeInvalidFileExtension(self):
    method testRecursiveExclude (line 4184) | def testRecursiveExclude(self):
    method testJUnitXML (line 4238) | def testJUnitXML(self):
    method testQuiet (line 4302) | def testQuiet(self):
    method testLineLength (line 4307) | def testLineLength(self):
    method testFilter (line 4329) | def testFilter(self):
    method testDefaultFilter (line 4342) | def testDefaultFilter(self):
    method testDuplicateHeader (line 4360) | def testDuplicateHeader(self):
    method testUnnamedNamespacesInHeaders (line 4379) | def testUnnamedNamespacesInHeaders(self):
    method doTestUnnamedNamespacesInHeaders (line 4383) | def doTestUnnamedNamespacesInHeaders(self, extension):
    method testUnnamedNamespacesInNonHeaders (line 4395) | def testUnnamedNamespacesInNonHeaders(self):
    method testBuildClass (line 4400) | def testBuildClass(self):
    method testBuildEndComment (line 4446) | def testBuildEndComment(self):
    method testBuildForwardDecl (line 4455) | def testBuildForwardDecl(self):
    method GetBuildHeaderGuardPreprocessorSymbol (line 4463) | def GetBuildHeaderGuardPreprocessorSymbol(self, file_path):
    method testBuildHeaderGuard (line 4475) | def testBuildHeaderGuard(self):
    method testPragmaOnce (line 4691) | def testPragmaOnce(self):
    method testBuildHeaderGuardWithRoot (line 4698) | def testBuildHeaderGuardWithRoot(self):
    method doTestBuildHeaderGuardWithRoot (line 4710) | def doTestBuildHeaderGuardWithRoot(self, header_directory):
    method testIncludeItsHeader (line 4804) | def testIncludeItsHeader(self):
    method testPathSplitToList (line 4889) | def testPathSplitToList(self):
    method testBuildHeaderGuardWithRepository (line 4905) | def testBuildHeaderGuardWithRepository(self):
    method testBuildInclude (line 4951) | def testBuildInclude(self):
    method testHppInclude (line 4959) | def testHppInclude(self):
    method testBuildPrintfFormat (line 4966) | def testBuildPrintfFormat(self):
    method testRuntimePrintfFormat (line 4992) | def testRuntimePrintfFormat(self):
    method TestLintLogCodeOnError (line 5023) | def TestLintLogCodeOnError(self, code, expected_message):
    method testBuildStorageClass (line 5030) | def testBuildStorageClass(self):
    method testLegalCopyright (line 5089) | def testLegalCopyright(self):
    method testInvalidIncrement (line 5131) | def testInvalidIncrement(self):
    method testSnprintfSize (line 5136) | def testSnprintfSize(self):
  class Cxx11Test (line 5141) | class Cxx11Test(CpplintTestBase):
    method Helper (line 5143) | def Helper(self, package, extension, lines, count):
    method TestCxx11Feature (line 5163) | def TestCxx11Feature(self, code, expected_error):
    method testBlockedHeaders (line 5171) | def testBlockedHeaders(self):
    method testBlockedClasses (line 5179) | def testBlockedClasses(self):
    method testBlockedFunctions (line 5190) | def testBlockedFunctions(self):
    method testExplicitMakePair (line 5204) | def testExplicitMakePair(self):
  class Cxx14Test (line 5219) | class Cxx14Test(CpplintTestBase):
    method TestCxx14Feature (line 5221) | def TestCxx14Feature(self, code, expected_error):
    method testBlockedHeaders (line 5229) | def testBlockedHeaders(self):
  class CleansedLinesTest (line 5238) | class CleansedLinesTest(unittest.TestCase):
    method testInit (line 5240) | def testInit(self):
    method testInitEmpty (line 5265) | def testInitEmpty(self):
    method testCollapseStrings (line 5270) | def testCollapseStrings(self):
  class OrderOfIncludesTest (line 5312) | class OrderOfIncludesTest(CpplintTestBase):
    method setUp (line 5314) | def setUp(self):
    method testCheckNextIncludeOrder_OtherThenCpp (line 5319) | def testCheckNextIncludeOrder_OtherThenCpp(self):
    method testCheckNextIncludeOrder_CppThenC (line 5326) | def testCheckNextIncludeOrder_CppThenC(self):
    method testCheckNextIncludeOrder_OtherSysThenC (line 5333) | def testCheckNextIncludeOrder_OtherSysThenC(self):
    method testCheckNextIncludeOrder_OtherSysThenCpp (line 5340) | def testCheckNextIncludeOrder_OtherSysThenCpp(self):
    method testCheckNextIncludeOrder_LikelyThenCpp (line 5347) | def testCheckNextIncludeOrder_LikelyThenCpp(self):
    method testCheckNextIncludeOrder_PossibleThenCpp (line 5353) | def testCheckNextIncludeOrder_PossibleThenCpp(self):
    method testCheckNextIncludeOrder_CppThenLikely (line 5359) | def testCheckNextIncludeOrder_CppThenLikely(self):
    method testCheckNextIncludeOrder_CppThenPossible (line 5366) | def testCheckNextIncludeOrder_CppThenPossible(self):
    method testCheckNextIncludeOrder_CppThenOtherSys (line 5372) | def testCheckNextIncludeOrder_CppThenOtherSys(self):
    method testCheckNextIncludeOrder_OtherSysThenPossible (line 5378) | def testCheckNextIncludeOrder_OtherSysThenPossible(self):
    method testClassifyInclude (line 5385) | def testClassifyInclude(self):
    method testTryDropCommonSuffixes (line 5454) | def testTryDropCommonSuffixes(self):
    method testRegression (line 5483) | def testRegression(self):
  class CheckForFunctionLengthsTest (line 5620) | class CheckForFunctionLengthsTest(CpplintTestBase):
    method setUp (line 5622) | def setUp(self):
    method tearDown (line 5630) | def tearDown(self):
    method TestFunctionLengthsCheck (line 5634) | def TestFunctionLengthsCheck(self, code, expected_message):
    method TriggerLines (line 5644) | def TriggerLines(self, error_level):
    method TestLines (line 5655) | def TestLines(self, error_level):
    method TestFunctionLengthCheckDefinition (line 5666) | def TestFunctionLengthCheckDefinition(self, lines, error_level):
    method TestFunctionLengthCheckDefinitionOK (line 5682) | def TestFunctionLengthCheckDefinitionOK(self, lines):
    method TestFunctionLengthCheckAtErrorLevel (line 5692) | def TestFunctionLengthCheckAtErrorLevel(self, error_level):
    method TestFunctionLengthCheckBelowErrorLevel (line 5701) | def TestFunctionLengthCheckBelowErrorLevel(self, error_level):
    method TestFunctionLengthCheckAboveErrorLevel (line 5710) | def TestFunctionLengthCheckAboveErrorLevel(self, error_level):
    method FunctionBody (line 5719) | def FunctionBody(self, number_of_lines):
    method FunctionBodyWithBlankLines (line 5722) | def FunctionBodyWithBlankLines(self, number_of_lines):
    method FunctionBodyWithNoLints (line 5725) | def FunctionBodyWithNoLints(self, number_of_lines):
    method testFunctionLengthCheckDeclaration (line 5730) | def testFunctionLengthCheckDeclaration(self):
    method testFunctionLengthCheckDeclarationWithBlockFollowing (line 5735) | def testFunctionLengthCheckDeclarationWithBlockFollowing(self):
    method testFunctionLengthCheckClassDefinition (line 5741) | def testFunctionLengthCheckClassDefinition(self):
    method testFunctionLengthCheckTrivial (line 5746) | def testFunctionLengthCheckTrivial(self):
    method testFunctionLengthCheckEmpty (line 5751) | def testFunctionLengthCheckEmpty(self):
    method testFunctionLengthCheckDefinitionBelowSeverity0 (line 5756) | def testFunctionLengthCheckDefinitionBelowSeverity0(self):
    method testFunctionLengthCheckDefinitionAtSeverity0 (line 5761) | def testFunctionLengthCheckDefinitionAtSeverity0(self):
    method testFunctionLengthCheckDefinitionAboveSeverity0 (line 5766) | def testFunctionLengthCheckDefinitionAboveSeverity0(self):
    method testFunctionLengthCheckDefinitionBelowSeverity1v0 (line 5771) | def testFunctionLengthCheckDefinitionBelowSeverity1v0(self):
    method testFunctionLengthCheckDefinitionAtSeverity1v0 (line 5776) | def testFunctionLengthCheckDefinitionAtSeverity1v0(self):
    method testFunctionLengthCheckDefinitionBelowSeverity1 (line 5781) | def testFunctionLengthCheckDefinitionBelowSeverity1(self):
    method testFunctionLengthCheckDefinitionAtSeverity1 (line 5784) | def testFunctionLengthCheckDefinitionAtSeverity1(self):
    method testFunctionLengthCheckDefinitionAboveSeverity1 (line 5787) | def testFunctionLengthCheckDefinitionAboveSeverity1(self):
    method testFunctionLengthCheckDefinitionSeverity1PlusBlanks (line 5790) | def testFunctionLengthCheckDefinitionSeverity1PlusBlanks(self):
    method testFunctionLengthCheckComplexDefinitionSeverity1 (line 5802) | def testFunctionLengthCheckComplexDefinitionSeverity1(self):
    method testFunctionLengthCheckDefinitionSeverity1ForTest (line 5817) | def testFunctionLengthCheckDefinitionSeverity1ForTest(self):
    method testFunctionLengthCheckDefinitionSeverity1ForSplitLineTest (line 5829) | def testFunctionLengthCheckDefinitionSeverity1ForSplitLineTest(self):
    method testFunctionLengthCheckDefinitionSeverity1ForBadTestDoesntBreak (line 5844) | def testFunctionLengthCheckDefinitionSeverity1ForBadTestDoesntBreak(se...
    method testFunctionLengthCheckDefinitionSeverity1WithEmbeddedNoLints (line 5857) | def testFunctionLengthCheckDefinitionSeverity1WithEmbeddedNoLints(self):
    method testFunctionLengthCheckDefinitionSeverity1WithNoLint (line 5869) | def testFunctionLengthCheckDefinitionSeverity1WithNoLint(self):
    method testFunctionLengthCheckDefinitionBelowSeverity2 (line 5875) | def testFunctionLengthCheckDefinitionBelowSeverity2(self):
    method testFunctionLengthCheckDefinitionSeverity2 (line 5878) | def testFunctionLengthCheckDefinitionSeverity2(self):
    method testFunctionLengthCheckDefinitionAboveSeverity2 (line 5881) | def testFunctionLengthCheckDefinitionAboveSeverity2(self):
    method testFunctionLengthCheckDefinitionBelowSeverity3 (line 5884) | def testFunctionLengthCheckDefinitionBelowSeverity3(self):
    method testFunctionLengthCheckDefinitionSeverity3 (line 5887) | def testFunctionLengthCheckDefinitionSeverity3(self):
    method testFunctionLengthCheckDefinitionAboveSeverity3 (line 5890) | def testFunctionLengthCheckDefinitionAboveSeverity3(self):
    method testFunctionLengthCheckDefinitionBelowSeverity4 (line 5893) | def testFunctionLengthCheckDefinitionBelowSeverity4(self):
    method testFunctionLengthCheckDefinitionSeverity4 (line 5896) | def testFunctionLengthCheckDefinitionSeverity4(self):
    method testFunctionLengthCheckDefinitionAboveSeverity4 (line 5899) | def testFunctionLengthCheckDefinitionAboveSeverity4(self):
    method testFunctionLengthCheckDefinitionBelowSeverity5 (line 5902) | def testFunctionLengthCheckDefinitionBelowSeverity5(self):
    method testFunctionLengthCheckDefinitionAtSeverity5 (line 5905) | def testFunctionLengthCheckDefinitionAtSeverity5(self):
    method testFunctionLengthCheckDefinitionAboveSeverity5 (line 5908) | def testFunctionLengthCheckDefinitionAboveSeverity5(self):
    method testFunctionLengthCheckDefinitionHugeLines (line 5911) | def testFunctionLengthCheckDefinitionHugeLines(self):
    method testFunctionLengthNotDeterminable (line 5915) | def testFunctionLengthNotDeterminable(self):
    method testFunctionLengthCheckWithNamespace (line 5931) | def testFunctionLengthCheckWithNamespace(self):
  function TrimExtraIndent (line 5946) | def TrimExtraIndent(text_block):
  class CloseExpressionTest (line 5972) | class CloseExpressionTest(unittest.TestCase):
    method setUp (line 5974) | def setUp(self):
    method testCloseExpression (line 6001) | def testCloseExpression(self):
    method testReverseCloseExpression (line 6021) | def testReverseCloseExpression(self):
  class NestingStateTest (line 6042) | class NestingStateTest(unittest.TestCase):
    method setUp (line 6044) | def setUp(self):
    method UpdateWithLines (line 6048) | def UpdateWithLines(self, lines):
    method testEmpty (line 6054) | def testEmpty(self):
    method testNamespace (line 6058) | def testNamespace(self):
    method testDecoratedClass (line 6081) | def testDecoratedClass(self):
    method testInnerClass (line 6091) | def testInnerClass(self):
    method testClass (line 6101) | def testClass(self):
    method testClassAccess (line 6142) | def testClassAccess(self):
    method testStruct (line 6170) | def testStruct(self):
    method testPreprocessor (line 6186) | def testPreprocessor(self):
    method testTemplate (line 6252) | def testTemplate(self):
    method testTemplateDefaultArg (line 6293) | def testTemplateDefaultArg(self):
    method testTemplateInnerClass (line 6299) | def testTemplateInnerClass(self):
    method testArguments (line 6311) | def testArguments(self):
    method testInlineAssembly (line 6358) | def testInlineAssembly(self):
  class QuietTest (line 6421) | class QuietTest(unittest.TestCase):
    method setUp (line 6423) | def setUp(self):
    method tearDown (line 6431) | def tearDown(self):
    method _runCppLint (line 6434) | def _runCppLint(self, *args):
    method testNonQuietWithErrors (line 6452) | def testNonQuietWithErrors(self):
    method testQuietWithErrors (line 6463) | def testQuietWithErrors(self):
    method testNonQuietWithoutErrors (line 6473) | def testNonQuietWithoutErrors(self):
    method testQuietWithoutErrors (line 6486) | def testQuietWithoutErrors(self):
  function setUp (line 6508) | def setUp():
  function tearDown (line 6517) | def tearDown():
  function run_around_tests (line 6533) | def run_around_tests():

FILE: deps/cpplint/samples/boost-sample/src/inspect/unnamed_namespace_check.hpp
  type boost (line 25) | namespace boost
    type inspect (line 27) | namespace inspect

FILE: deps/cpplint/samples/boost-sample/src/tr1/c_policy.hpp
  type boost (line 9) | namespace boost{ namespace math{ namespace policies{
    type math (line 9) | namespace math{ namespace policies{
      type policies (line 9) | namespace policies{
        type policy<
   domain_error<errno_on_error>, 
   pole_error<errno_on_error>, 
   overflow_error<errno_on_error>, 
   evaluation_error<errno_on_error>, 
   rounding_error<errno_on_error>, 
   default_policy, default_policy, default_policy, default_policy, default_policy, default_policy> (line 12) | struct policy<
        type policy<
   domain_error<errno_on_error>, 
   pole_error<errno_on_error>, 
   overflow_error<errno_on_error>, 
   evaluation_error<errno_on_error>, 
   rounding_error<errno_on_error>, 
   detail::forwarding_arg1, 
   detail::forwarding_arg2, 
   default_policy, default_policy, default_policy, default_policy, default_policy, default_policy> (line 43) | struct policy<
        type normalise<policy<domain_error<errno_on_error>, pole_error<errno_on_error>, overflow_error<errno_on_error>, evaluation_error<errno_on_error>, rounding_error<errno_on_error> > (line 76) | struct normalise<policy<domain_error<errno_on_error>, pole_error<e...
        type normalise<policy<domain_error<errno_on_error>, pole_error<errno_on_error>, overflow_error<errno_on_error>, evaluation_error<errno_on_error>, rounding_error<errno_on_error>, detail::forwarding_arg1, detail::forwarding_arg2 > (line 93) | struct normalise<policy<domain_error<errno_on_error>, pole_error<e...
  type c_policies (line 111) | namespace c_policies{

FILE: deps/cpplint/samples/chromium-sample/src/chrome_content_renderer_client.cc
  function AppendParams (line 202) | void AppendParams(const std::vector<base::string16>& additional_names,
  function ShouldUseJavaScriptSettingForPlugin (line 230) | bool ShouldUseJavaScriptSettingForPlugin(const WebPluginInfo& plugin) {
  class SpellCheckReplacer (line 255) | class SpellCheckReplacer : public content::RenderViewVisitor {
    method SpellCheckReplacer (line 257) | explicit SpellCheckReplacer(SpellCheck* spellcheck)
  function IsStandaloneExtensionProcess (line 275) | bool IsStandaloneExtensionProcess() {
  class MediaLoadDeferrer (line 283) | class MediaLoadDeferrer : public content::RenderFrameObserver {
    method MediaLoadDeferrer (line 285) | MediaLoadDeferrer(content::RenderFrame* render_frame,
    method WasShown (line 293) | void WasShown() override {
  function SkBitmap (line 545) | SkBitmap* ChromeContentRendererClient::GetSadPluginBitmap() {
  function SkBitmap (line 550) | SkBitmap* ChromeContentRendererClient::GetSadWebViewBitmap() {
  function WebPlugin (line 597) | WebPlugin* ChromeContentRendererClient::CreatePluginReplacement(
  function WebPlugin (line 628) | WebPlugin* ChromeContentRendererClient::CreatePlugin(
  function GURL (line 865) | GURL ChromeContentRendererClient::GetNaClContentHandlerURL(

FILE: deps/cpplint/samples/chromium-sample/src/chrome_content_renderer_client.h
  type ChromeViewHostMsg_GetPluginInfo_Output (line 33) | struct ChromeViewHostMsg_GetPluginInfo_Output
  function namespace (line 35) | namespace content {
  function namespace (line 40) | namespace network_hints {
  function namespace (line 44) | namespace extensions {
  function namespace (line 49) | namespace prerender {
  function namespace (line 53) | namespace safe_browsing {
  function namespace (line 57) | namespace visitedlink {
  function namespace (line 61) | namespace web_cache {
  function namespace (line 65) | namespace blink {
  function class (line 73) | class ChromeContentRendererClient : public content::ContentRendererClient {

FILE: deps/cpplint/samples/chromium-sample/src/io_thread.cc
  class SafeBrowsingURLRequestContext (line 137) | class SafeBrowsingURLRequestContext
  function ObserveKeychainEvents (line 194) | void ObserveKeychainEvents() {
  function GetSSLKeyLogFile (line 203) | base::FilePath GetSSLKeyLogFile(const base::CommandLine& command_line) {
  class SystemURLRequestContext (line 224) | class SystemURLRequestContext : public net::URLRequestContext {
    method SystemURLRequestContext (line 226) | SystemURLRequestContext() {
  function CreateGlobalHostResolver (line 241) | std::unique_ptr<net::HostResolver> CreateGlobalHostResolver(
  function GetSwitchValueAsInt (line 285) | int GetSwitchValueAsInt(const base::CommandLine& command_line,
  class IOThread::LoggingNetworkChangeObserver (line 309) | class IOThread::LoggingNetworkChangeObserver
    method LoggingNetworkChangeObserver (line 315) | explicit LoggingNetworkChangeObserver(net::NetLog* net_log)
    method OnIPAddressChanged (line 329) | void OnIPAddressChanged() override {
    method OnConnectionTypeChanged (line 336) | void OnConnectionTypeChanged(
    method OnNetworkChanged (line 350) | void OnNetworkChanged(
  class SystemURLRequestContextGetter (line 367) | class SystemURLRequestContextGetter : public net::URLRequestContextGetter {

FILE: deps/cpplint/samples/chromium-sample/src/io_thread.h
  function namespace (line 39) | namespace base {
  function namespace (line 44) | namespace chrome {
  function namespace (line 51) | namespace chrome_browser_net {
  function namespace (line 55) | namespace data_usage {
  function namespace (line 59) | namespace extensions {
  function namespace (line 63) | namespace net {
  function namespace (line 89) | namespace net_log {
  function namespace (line 93) | namespace policy {
  function namespace (line 97) | namespace test {
  function class (line 107) | class IOThread : public content::BrowserThreadDelegate {
  function class (line 193) | class NetworkSessionConfigurator {
  function Init (line 433) | void Init() override;

FILE: deps/cpplint/samples/codelite-sample/src/pptable.cpp
  function IsWordChar (line 5) | bool IsWordChar(const wxString &s, int strSize)
  function IsWordCharA (line 15) | bool IsWordCharA(char c, int strSize)
  function ReplaceWordA (line 30) | std::string ReplaceWordA(const std::string &str, const std::string &word...
  function wxString (line 74) | wxString ReplaceWord(const wxString &str, const wxString &word, const wx...
  function wxArrayString (line 114) | wxArrayString TokenizeWords(const wxString &str)
  function wxString (line 197) | wxString PPToken::fullname() const
  function wxString (line 401) | wxString PPToken::signature() const
  function PPTable (line 427) | PPTable* PPTable::Instance()
  function PPToken (line 443) | PPToken PPTable::Token(const wxString& name)
  function wxString (line 494) | wxString PPTable::Export()
  function CLReplacePattern (line 542) | bool CLReplacePattern(const wxString& in, const wxString& pattern, const...
  function CLReplacePatternA (line 584) | bool CLReplacePatternA(const std::string& in, const CLReplacement& repl,...

FILE: deps/cpplint/samples/codelite-sample/src/pptable.h
  function CLReplacement (line 26) | struct WXDLLIMPEXP_CL CLReplacement {
  type std (line 35) | typedef std::list<CLReplacement> CLReplacementList;
  function PPToken (line 68) | struct WXDLLIMPEXP_CL PPToken {

FILE: deps/cpplint/samples/protobuf-sample/src/descriptor.pb.cc
  type google (line 20) | namespace google {
    type protobuf (line 21) | namespace protobuf {
      function protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto (line 106) | void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto() {
      function protobuf_AssignDescriptorsOnce (line 567) | inline void protobuf_AssignDescriptorsOnce() {
      function protobuf_RegisterTypes (line 572) | void protobuf_RegisterTypes(const ::std::string&) {
      function protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto (line 626) | void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto() {
      function protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto (line 677) | void protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto() {
      type StaticDescriptorInitializer_google_2fprotobuf_2fdescriptor_2eproto (line 867) | struct StaticDescriptorInitializer_google_2fprotobuf_2fdescriptor_2e...
        method StaticDescriptorInitializer_google_2fprotobuf_2fdescriptor_2eproto (line 868) | StaticDescriptorInitializer_google_2fprotobuf_2fdescriptor_2eproto...
      function MergeFromFail (line 876) | static void MergeFromFail(int line) {
      function FileDescriptorSet (line 931) | const FileDescriptorSet& FileDescriptorSet::default_instance() {
      function FileDescriptorSet (line 938) | FileDescriptorSet* FileDescriptorSet::New(::google::protobuf::Arena*...
      function FileDescriptorProto (line 1230) | const FileDescriptorProto& FileDescriptorProto::default_instance() {
      function FileDescriptorProto (line 1237) | FileDescriptorProto* FileDescriptorProto::New(::google::protobuf::Ar...
      function DescriptorProto_ExtensionRange (line 2477) | const DescriptorProto_ExtensionRange& DescriptorProto_ExtensionRange...
      function DescriptorProto_ExtensionRange (line 2484) | DescriptorProto_ExtensionRange* DescriptorProto_ExtensionRange::New(...
      function DescriptorProto_ReservedRange (line 2776) | const DescriptorProto_ReservedRange& DescriptorProto_ReservedRange::...
      function DescriptorProto_ReservedRange (line 2783) | DescriptorProto_ReservedRange* DescriptorProto_ReservedRange::New(::...
      function DescriptorProto (line 3087) | const DescriptorProto& DescriptorProto::default_instance() {
      function DescriptorProto (line 3094) | DescriptorProto* DescriptorProto::New(::google::protobuf::Arena* are...
      function FieldDescriptorProto_Type_IsValid (line 4152) | bool FieldDescriptorProto_Type_IsValid(int value) {
      function FieldDescriptorProto_Label_IsValid (line 4205) | bool FieldDescriptorProto_Label_IsValid(int value) {
      function FieldDescriptorProto (line 4297) | const FieldDescriptorProto& FieldDescriptorProto::default_instance() {
      function FieldDescriptorProto (line 4304) | FieldDescriptorProto* FieldDescriptorProto::New(::google::protobuf::...
      function OneofDescriptorProto (line 5395) | const OneofDescriptorProto& OneofDescriptorProto::default_instance() {
      function OneofDescriptorProto (line 5402) | OneofDescriptorProto* OneofDescriptorProto::New(::google::protobuf::...
      function EnumDescriptorProto (line 5715) | const EnumDescriptorProto& EnumDescriptorProto::default_instance() {
      function EnumDescriptorProto (line 5722) | EnumDescriptorProto* EnumDescriptorProto::New(::google::protobuf::Ar...
      function EnumValueDescriptorProto (line 6199) | const EnumValueDescriptorProto& EnumValueDescriptorProto::default_in...
      function EnumValueDescriptorProto (line 6206) | EnumValueDescriptorProto* EnumValueDescriptorProto::New(::google::pr...
      function ServiceDescriptorProto (line 6671) | const ServiceDescriptorProto& ServiceDescriptorProto::default_instan...
      function ServiceDescriptorProto (line 6678) | ServiceDescriptorProto* ServiceDescriptorProto::New(::google::protob...
      function MethodDescriptorProto (line 7163) | const MethodDescriptorProto& MethodDescriptorProto::default_instance...
      function MethodDescriptorProto (line 7170) | MethodDescriptorProto* MethodDescriptorProto::New(::google::protobuf...
      function FileOptions_OptimizeMode_IsValid (line 7875) | bool FileOptions_OptimizeMode_IsValid(int value) {
      function FileOptions (line 7974) | const FileOptions& FileOptions::default_instance() {
      function FileOptions (line 7981) | FileOptions* FileOptions::New(::google::protobuf::Arena* arena) const {
      function MessageOptions (line 9377) | const MessageOptions& MessageOptions::default_instance() {
      function MessageOptions (line 9384) | MessageOptions* MessageOptions::New(::google::protobuf::Arena* arena...
      function FieldOptions_CType_IsValid (line 9886) | bool FieldOptions_CType_IsValid(int value) {
      function FieldOptions_JSType_IsValid (line 9909) | bool FieldOptions_JSType_IsValid(int value) {
      function FieldOptions (line 9986) | const FieldOptions& FieldOptions::default_instance() {
      function FieldOptions (line 9993) | FieldOptions* FieldOptions::New(::google::protobuf::Arena* arena) co...
      function EnumOptions (line 10678) | const EnumOptions& EnumOptions::default_instance() {
      function EnumOptions (line 10685) | EnumOptions* EnumOptions::New(::google::protobuf::Arena* arena) const {
      function EnumValueOptions (line 11115) | const EnumValueOptions& EnumValueOptions::default_instance() {
      function EnumValueOptions (line 11122) | EnumValueOptions* EnumValueOptions::New(::google::protobuf::Arena* a...
      function ServiceOptions (line 11472) | const ServiceOptions& ServiceOptions::default_instance() {
      function ServiceOptions (line 11479) | ServiceOptions* ServiceOptions::New(::google::protobuf::Arena* arena...
      function MethodOptions (line 11829) | const MethodOptions& MethodOptions::default_instance() {
      function MethodOptions (line 11836) | MethodOptions* MethodOptions::New(::google::protobuf::Arena* arena) ...
      function UninterpretedOption_NamePart (line 12189) | const UninterpretedOption_NamePart& UninterpretedOption_NamePart::de...
      function UninterpretedOption_NamePart (line 12196) | UninterpretedOption_NamePart* UninterpretedOption_NamePart::New(::go...
      function UninterpretedOption (line 12515) | const UninterpretedOption& UninterpretedOption::default_instance() {
      function UninterpretedOption (line 12522) | UninterpretedOption* UninterpretedOption::New(::google::protobuf::Ar...
      function SourceCodeInfo_Location (line 13395) | const SourceCodeInfo_Location& SourceCodeInfo_Location::default_inst...
      function SourceCodeInfo_Location (line 13402) | SourceCodeInfo_Location* SourceCodeInfo_Location::New(::google::prot...
      function SourceCodeInfo (line 13879) | const SourceCodeInfo& SourceCodeInfo::default_instance() {
      function SourceCodeInfo (line 13886) | SourceCodeInfo* SourceCodeInfo::New(::google::protobuf::Arena* arena...
      function GeneratedCodeInfo_Annotation (line 14388) | const GeneratedCodeInfo_Annotation& GeneratedCodeInfo_Annotation::de...
      function GeneratedCodeInfo_Annotation (line 14395) | GeneratedCodeInfo_Annotation* GeneratedCodeInfo_Annotation::New(::go...
      function GeneratedCodeInfo (line 14801) | const GeneratedCodeInfo& GeneratedCodeInfo::default_instance() {
      function GeneratedCodeInfo (line 14808) | GeneratedCodeInfo* GeneratedCodeInfo::New(::google::protobuf::Arena*...

FILE: deps/cpplint/samples/protobuf-sample/src/descriptor.pb.h
  function namespace (line 33) | namespace google {
  function set_has_input_type (line 5561) | inline void MethodDescriptorProto::set_has_input_type() {
  function clear_has_input_type (line 5564) | inline void MethodDescriptorProto::clear_has_input_type() {
  function clear_input_type (line 5567) | inline void MethodDescriptorProto::clear_input_type() {
  function set_input_type (line 5575) | inline void MethodDescriptorProto::set_input_type(const ::std::string& v...
  function set_input_type (line 5580) | inline void MethodDescriptorProto::set_input_type(const char* value) {
  function set_input_type (line 5585) | inline void MethodDescriptorProto::set_input_type(const char* value, siz...
  function std (line 5591) | inline ::std::string* MethodDescriptorProto::mutable_input_type() {
  function std (line 5596) | inline ::std::string* MethodDescriptorProto::release_input_type() {
  function set_allocated_input_type (line 5601) | inline void MethodDescriptorProto::set_allocated_input_type(::std::strin...
  function set_has_output_type (line 5615) | inline void MethodDescriptorProto::set_has_output_type() {
  function clear_has_output_type (line 5618) | inline void MethodDescriptorProto::clear_has_output_type() {
  function clear_output_type (line 5621) | inline void MethodDescriptorProto::clear_output_type() {
  function set_output_type (line 5629) | inline void MethodDescriptorProto::set_output_type(const ::std::string& ...
  function set_output_type (line 5634) | inline void MethodDescriptorProto::set_output_type(const char* value) {
  function set_output_type (line 5639) | inline void MethodDescriptorProto::set_output_type(const char* value, si...
  function std (line 5645) | inline ::std::string* MethodDescriptorProto::mutable_output_type() {
  function std (line 5650) | inline ::std::string* MethodDescriptorProto::release_output_type() {
  function set_allocated_output_type (line 5655) | inline void MethodDescriptorProto::set_allocated_output_type(::std::stri...
  function set_has_options (line 5669) | inline void MethodDescriptorProto::set_has_options() {
  function clear_has_options (line 5672) | inline void MethodDescriptorProto::clear_has_options() {
  function clear_options (line 5675) | inline void MethodDescriptorProto::clear_options() {
  function google (line 5683) | inline ::google::protobuf::MethodOptions* MethodDescriptorProto::mutable...
  function google (line 5691) | inline ::google::protobuf::MethodOptions* MethodDescriptorProto::release...
  function set_allocated_options (line 5698) | inline void MethodDescriptorProto::set_allocated_options(::google::proto...
  function set_has_client_streaming (line 5713) | inline void MethodDescriptorProto::set_has_client_streaming() {
  function clear_has_client_streaming (line 5716) | inline void MethodDescriptorProto::clear_has_client_streaming() {
  function clear_client_streaming (line 5719) | inline void MethodDescriptorProto::clear_client_streaming() {
  function set_client_streaming (line 5727) | inline void MethodDescriptorProto::set_client_streaming(bool value) {
  function set_has_server_streaming (line 5737) | inline void MethodDescriptorProto::set_has_server_streaming() {
  function clear_has_server_streaming (line 5740) | inline void MethodDescriptorProto::clear_has_server_streaming() {
  function clear_server_streaming (line 5743) | inline void MethodDescriptorProto::clear_server_streaming() {
  function set_server_streaming (line 5751) | inline void MethodDescriptorProto::set_server_streaming(bool value) {
  function set_has_java_package (line 5765) | inline void FileOptions::set_has_java_package() {
  function clear_has_java_package (line 5768) | inline void FileOptions::clear_has_java_package() {
  function clear_java_package (line 5771) | inline void FileOptions::clear_java_package() {
  function set_java_package (line 5779) | inline void FileOptions::set_java_package(const ::std::string& value) {
  function set_java_package (line 5784) | inline void FileOptions::set_java_package(const char* value) {
  function set_java_package (line 5789) | inline void FileOptions::set_java_package(const char* value, size_t size) {
  function std (line 5795) | inline ::std::string* FileOptions::mutable_java_package() {
  function std (line 5800) | inline ::std::string* FileOptions::release_java_package() {
  function set_allocated_java_package (line 5805) | inline void FileOptions::set_allocated_java_package(::std::string* java_...
  function set_has_java_outer_classname (line 5819) | inline void FileOptions::set_has_java_outer_classname() {
  function clear_has_java_outer_classname (line 5822) | inline void FileOptions::clear_has_java_outer_classname() {
  function clear_java_outer_classname (line 5825) | inline void FileOptions::clear_java_outer_classname() {
  function set_java_outer_classname (line 5833) | inline void FileOptions::set_java_outer_classname(const ::std::string& v...
  function set_java_outer_classname (line 5838) | inline void FileOptions::set_java_outer_classname(const char* value) {
  function set_java_outer_classname (line 5843) | inline void FileOptions::set_java_outer_classname(const char* value, siz...
  function std (line 5849) | inline ::std::string* FileOptions::mutable_java_outer_classname() {
  function std (line 5854) | inline ::std::string* FileOptions::release_java_outer_classname() {
  function set_allocated_java_outer_classname (line 5859) | inline void FileOptions::set_allocated_java_outer_classname(::std::strin...
  function set_has_java_multiple_files (line 5873) | inline void FileOptions::set_has_java_multiple_files() {
  function clear_has_java_multiple_files (line 5876) | inline void FileOptions::clear_has_java_multiple_files() {
  function clear_java_multiple_files (line 5879) | inline void FileOptions::clear_java_multiple_files() {
  function set_java_multiple_files (line 5887) | inline void FileOptions::set_java_multiple_files(bool value) {
  function set_has_java_generate_equals_and_hash (line 5897) | inline void FileOptions::set_has_java_generate_equals_and_hash() {
  function clear_has_java_generate_equals_and_hash (line 5900) | inline void FileOptions::clear_has_java_generate_equals_and_hash() {
  function clear_java_generate_equals_and_hash (line 5903) | inline void FileOptions::clear_java_generate_equals_and_hash() {
  function set_java_generate_equals_and_hash (line 5911) | inline void FileOptions::set_java_generate_equals_and_hash(bool value) {
  function set_has_java_string_check_utf8 (line 5921) | inline void FileOptions::set_has_java_string_check_utf8() {
  function clear_has_java_string_check_utf8 (line 5924) | inline void FileOptions::clear_has_java_string_check_utf8() {
  function clear_java_string_check_utf8 (line 5927) | inline void FileOptions::clear_java_string_check_utf8() {
  function set_java_string_check_utf8 (line 5935) | inline void FileOptions::set_java_string_check_utf8(bool value) {
  function set_has_optimize_for (line 5945) | inline void FileOptions::set_has_optimize_for() {
  function clear_has_optimize_for (line 5948) | inline void FileOptions::clear_has_optimize_for() {
  function clear_optimize_for (line 5951) | inline void FileOptions::clear_optimize_for() {
  function set_optimize_for (line 5959) | inline void FileOptions::set_optimize_for(::google::protobuf::FileOption...
  function set_has_go_package (line 5970) | inline void FileOptions::set_has_go_package() {
  function clear_has_go_package (line 5973) | inline void FileOptions::clear_has_go_package() {
  function clear_go_package (line 5976) | inline void FileOptions::clear_go_package() {
  function set_go_package (line 5984) | inline void FileOptions::set_go_package(const ::std::string& value) {
  function set_go_package (line 5989) | inline void FileOptions::set_go_package(const char* value) {
  function set_go_package (line 5994) | inline void FileOptions::set_go_package(const char* value, size_t size) {
  function std (line 6000) | inline ::std::string* FileOptions::mutable_go_package() {
  function std (line 6005) | inline ::std::string* FileOptions::release_go_package() {
  function set_allocated_go_package (line 6010) | inline void FileOptions::set_allocated_go_package(::std::string* go_pack...
  function set_has_cc_generic_services (line 6024) | inline void FileOptions::set_has_cc_generic_services() {
  function clear_has_cc_generic_services (line 6027) | inline void FileOptions::clear_has_cc_generic_services() {
  function clear_cc_generic_services (line 6030) | inline void FileOptions::clear_cc_generic_services() {
  function set_cc_generic_services (line 6038) | inline void FileOptions::set_cc_generic_services(bool value) {
  function set_has_java_generic_services (line 6048) | inline void FileOptions::set_has_java_generic_services() {
  function clear_has_java_generic_services (line 6051) | inline void FileOptions::clear_has_java_generic_services() {
  function clear_java_generic_services (line 6054) | inline void FileOptions::clear_java_generic_services() {
  function set_java_generic_services (line 6062) | inline void FileOptions::set_java_generic_services(bool value) {
  function set_has_py_generic_services (line 6072) | inline void FileOptions::set_has_py_generic_services() {
  function clear_has_py_generic_services (line 6075) | inline void FileOptions::clear_has_py_generic_services() {
  function clear_py_generic_services (line 6078) | inline void FileOptions::clear_py_generic_services() {
  function set_py_generic_services (line 6086) | inline void FileOptions::set_py_generic_services(bool value) {
  function set_has_deprecated (line 6096) | inline void FileOptions::set_has_deprecated() {
  function clear_has_deprecated (line 6099) | inline void FileOptions::clear_has_deprecated() {
  function clear_deprecated (line 6102) | inline void FileOptions::clear_deprecated() {
  function set_deprecated (line 6110) | inline void FileOptions::set_deprecated(bool value) {
  function set_has_cc_enable_arenas (line 6120) | inline void FileOptions::set_has_cc_enable_arenas() {
  function clear_has_cc_enable_arenas (line 6123) | inline void FileOptions::clear_has_cc_enable_arenas() {
  function clear_cc_enable_arenas (line 6126) | inline void FileOptions::clear_cc_enable_arenas() {
  function set_cc_enable_arenas (line 6134) | inline void FileOptions::set_cc_enable_arenas(bool value) {
  function set_has_objc_class_prefix (line 6144) | inline void FileOptions::set_has_objc_class_prefix() {
  function clear_has_objc_class_prefix (line 6147) | inline void FileOptions::clear_has_objc_class_prefix() {
  function clear_objc_class_prefix (line 6150) | inline void FileOptions::clear_objc_class_prefix() {
  function set_objc_class_prefix (line 6158) | inline void FileOptions::set_objc_class_prefix(const ::std::string& valu...
  function set_objc_class_prefix (line 6163) | inline void FileOptions::set_objc_class_prefix(const char* value) {
  function set_objc_class_prefix (line 6168) | inline void FileOptions::set_objc_class_prefix(const char* value, size_t...
  function std (line 6174) | inline ::std::string* FileOptions::mutable_objc_class_prefix() {
  function std (line 6179) | inline ::std::string* FileOptions::release_objc_class_prefix() {
  function set_allocated_objc_class_prefix (line 6184) | inline void FileOptions::set_allocated_objc_class_prefix(::std::string* ...
  function set_has_csharp_namespace (line 6198) | inline void FileOptions::set_has_csharp_namespace() {
  function clear_has_csharp_namespace (line 6201) | inline void FileOptions::clear_has_csharp_namespace() {
  function clear_csharp_namespace (line 6204) | inline void FileOptions::clear_csharp_namespace() {
  function set_csharp_namespace (line 6212) | inline void FileOptions::set_csharp_namespace(const ::std::string& value) {
  function set_csharp_namespace (line 6217) | inline void FileOptions::set_csharp_namespace(const char* value) {
  function set_csharp_namespace (line 6222) | inline void FileOptions::set_csharp_namespace(const char* value, size_t ...
  function std (line 6228) | inline ::std::string* FileOptions::mutable_csharp_namespace() {
  function std (line 6233) | inline ::std::string* FileOptions::release_csharp_namespace() {
  function set_allocated_csharp_namespace (line 6238) | inline void FileOptions::set_allocated_csharp_namespace(::std::string* c...
  function clear_uninterpreted_option (line 6252) | inline void FileOptions::clear_uninterpreted_option() {
  function google (line 6255) | inline const ::google::protobuf::UninterpretedOption& FileOptions::unint...
  function google (line 6259) | inline ::google::protobuf::UninterpretedOption* FileOptions::mutable_uni...
  function google (line 6263) | inline ::google::protobuf::UninterpretedOption* FileOptions::add_uninter...
  function google (line 6267) | inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Uninter...
  function google (line 6272) | inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::U...
  function clear_has_message_set_wire_format (line 6289) | inline void MessageOptions::clear_has_message_set_wire_format() {
  function clear_message_set_wire_format (line 6292) | inline void MessageOptions::clear_message_set_wire_format() {
  function set_message_set_wire_format (line 6300) | inline void MessageOptions::set_message_set_wire_format(bool value) {
  function set_has_no_standard_descriptor_accessor (line 6310) | inline void MessageOptions::set_has_no_standard_descriptor_accessor() {
  function clear_has_no_standard_descriptor_accessor (line 6313) | inline void MessageOptions::clear_has_no_standard_descriptor_accessor() {
  function clear_no_standard_descriptor_accessor (line 6316) | inline void MessageOptions::clear_no_standard_descriptor_accessor() {
  function set_no_standard_descriptor_accessor (line 6324) | inline void MessageOptions::set_no_standard_descriptor_accessor(bool val...
  function set_has_deprecated (line 6334) | inline void MessageOptions::set_has_deprecated() {
  function clear_has_deprecated (line 6337) | inline void MessageOptions::clear_has_deprecated() {
  function clear_deprecated (line 6340) | inline void MessageOptions::clear_deprecated() {
  function set_deprecated (line 6348) | inline void MessageOptions::set_deprecated(bool value) {
  function set_has_map_entry (line 6358) | inline void MessageOptions::set_has_map_entry() {
  function clear_has_map_entry (line 6361) | inline void MessageOptions::clear_has_map_entry() {
  function clear_map_entry (line 6364) | inline void MessageOptions::clear_map_entry() {
  function set_map_entry (line 6372) | inline void MessageOptions::set_map_entry(bool value) {
  function clear_uninterpreted_option (line 6382) | inline void MessageOptions::clear_uninterpreted_option() {
  function google (line 6385) | inline const ::google::protobuf::UninterpretedOption& MessageOptions::un...
  function google (line 6389) | inline ::google::protobuf::UninterpretedOption* MessageOptions::mutable_...
  function google (line 6393) | inline ::google::protobuf::UninterpretedOption* MessageOptions::add_unin...
  function google (line 6397) | inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Uninter...
  function google (line 6402) | inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::U...
  function clear_has_ctype (line 6419) | inline void FieldOptions::clear_has_ctype() {
  function clear_ctype (line 6422) | inline void FieldOptions::clear_ctype() {
  function set_ctype (line 6430) | inline void FieldOptions::set_ctype(::google::protobuf::FieldOptions_CTy...
  function set_has_packed (line 6441) | inline void FieldOptions::set_has_packed() {
  function clear_has_packed (line 6444) | inline void FieldOptions::clear_has_packed() {
  function clear_packed (line 6447) | inline void FieldOptions::clear_packed() {
  function set_packed (line 6455) | inline void FieldOptions::set_packed(bool value) {
  function set_has_jstype (line 6465) | inline void FieldOptions::set_has_jstype() {
  function clear_has_jstype (line 6468) | inline void FieldOptions::clear_has_jstype() {
  function clear_jstype (line 6471) | inline void FieldOptions::clear_jstype() {
  function set_jstype (line 6479) | inline void FieldOptions::set_jstype(::google::protobuf::FieldOptions_JS...
  function set_has_lazy (line 6490) | inline void FieldOptions::set_has_lazy() {
  function clear_has_lazy (line 6493) | inline void FieldOptions::clear_has_lazy() {
  function clear_lazy (line 6496) | inline void FieldOptions::clear_lazy() {
  function set_lazy (line 6504) | inline void FieldOptions::set_lazy(bool value) {
  function set_has_deprecated (line 6514) | inline void FieldOptions::set_has_deprecated() {
  function clear_has_deprecated (line 6517) | inline void FieldOptions::clear_has_deprecated() {
  function clear_deprecated (line 6520) | inline void FieldOptions::clear_deprecated() {
  function set_deprecated (line 6528) | inline void FieldOptions::set_deprecated(bool value) {
  function set_has_weak (line 6538) | inline void FieldOptions::set_has_weak() {
  function clear_has_weak (line 6541) | inline void FieldOptions::clear_has_weak() {
  function clear_weak (line 6544) | inline void FieldOptions::clear_weak() {
  function set_weak (line 6552) | inline void FieldOptions::set_weak(bool value) {
  function clear_uninterpreted_option (line 6562) | inline void FieldOptions::clear_uninterpreted_option() {
  function google (line 6565) | inline const ::google::protobuf::UninterpretedOption& FieldOptions::unin...
  function google (line 6569) | inline ::google::protobuf::UninterpretedOption* FieldOptions::mutable_un...
  function google (line 6573) | inline ::google::protobuf::UninterpretedOption* FieldOptions::add_uninte...
  function google (line 6577) | inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Uninter...
  function google (line 6582) | inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::U...
  function clear_has_allow_alias (line 6599) | inline void EnumOptions::clear_has_allow_alias() {
  function clear_allow_alias (line 6602) | inline void EnumOptions::clear_allow_alias() {
  function set_allow_alias (line 6610) | inline void EnumOptions::set_allow_alias(bool value) {
  function set_has_deprecated (line 6620) | inline void EnumOptions::set_has_deprecated() {
  function clear_has_deprecated (line 6623) | inline void EnumOptions::clear_has_deprecated() {
  function clear_deprecated (line 6626) | inline void EnumOptions::clear_deprecated() {
  function set_deprecated (line 6634) | inline void EnumOptions::set_deprecated(bool value) {
  function clear_uninterpreted_option (line 6644) | inline void EnumOptions::clear_uninterpreted_option() {
  function google (line 6647) | inline const ::google::protobuf::UninterpretedOption& EnumOptions::unint...
  function google (line 6651) | inline ::google::protobuf::UninterpretedOption* EnumOptions::mutable_uni...
  function google (line 6655) | inline ::google::protobuf::UninterpretedOption* EnumOptions::add_uninter...
  function google (line 6659) | inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Uninter...
  function google (line 6664) | inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::U...
  function clear_has_deprecated (line 6681) | inline void EnumValueOptions::clear_has_deprecated() {
  function clear_deprecated (line 6684) | inline void EnumValueOptions::clear_deprecated() {
  function set_deprecated (line 6692) | inline void EnumValueOptions::set_deprecated(bool value) {
  function clear_uninterpreted_option (line 6702) | inline void EnumValueOptions::clear_uninterpreted_option() {
  function google (line 6705) | inline const ::google::protobuf::UninterpretedOption& EnumValueOptions::...
  function google (line 6709) | inline ::google::protobuf::UninterpretedOption* EnumValueOptions::mutabl...
  function google (line 6713) | inline ::google::protobuf::UninterpretedOption* EnumValueOptions::add_un...
  function google (line 6717) | inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Uninter...
  function google (line 6722) | inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::U...
  function clear_has_deprecated (line 6739) | inline void ServiceOptions::clear_has_deprecated() {
  function clear_deprecated (line 6742) | inline void ServiceOptions::clear_deprecated() {
  function set_deprecated (line 6750) | inline void ServiceOptions::set_deprecated(bool value) {
  function clear_uninterpreted_option (line 6760) | inline void ServiceOptions::clear_uninterpreted_option() {
  function google (line 6763) | inline const ::google::protobuf::UninterpretedOption& ServiceOptions::un...
  function google (line 6767) | inline ::google::protobuf::UninterpretedOption* ServiceOptions::mutable_...
  function google (line 6771) | inline ::google::protobuf::UninterpretedOption* ServiceOptions::add_unin...
  function google (line 6775) | inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Uninter...
  function google (line 6780) | inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::U...
  function clear_has_deprecated (line 6797) | inline void MethodOptions::clear_has_deprecated() {
  function clear_deprecated (line 6800) | inline void MethodOptions::clear_deprecated() {
  function set_deprecated (line 6808) | inline void MethodOptions::set_deprecated(bool value) {
  function clear_uninterpreted_option (line 6818) | inline void MethodOptions::clear_uninterpreted_option() {
  function google (line 6821) | inline const ::google::protobuf::UninterpretedOption& MethodOptions::uni...
  function google (line 6825) | inline ::google::protobuf::UninterpretedOption* MethodOptions::mutable_u...
  function google (line 6829) | inline ::google::protobuf::UninterpretedOption* MethodOptions::add_unint...
  function google (line 6833) | inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Uninter...
  function google (line 6838) | inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::U...
  function clear_has_name_part (line 6855) | inline void UninterpretedOption_NamePart::clear_has_name_part() {
  function clear_name_part (line 6858) | inline void UninterpretedOption_NamePart::clear_name_part() {
  function set_name_part (line 6866) | inline void UninterpretedOption_NamePart::set_name_part(const ::std::str...
  function set_name_part (line 6871) | inline void UninterpretedOption_NamePart::set_name_part(const char* valu...
  function set_name_part (line 6876) | inline void UninterpretedOption_NamePart::set_name_part(const char* valu...
  function std (line 6882) | inline ::std::string* UninterpretedOption_NamePart::mutable_name_part() {
  function std (line 6887) | inline ::std::string* UninterpretedOption_NamePart::release_name_part() {
  function set_allocated_name_part (line 6892) | inline void UninterpretedOption_NamePart::set_allocated_name_part(::std:...
  function set_has_is_extension (line 6906) | inline void UninterpretedOption_NamePart::set_has_is_extension() {
  function clear_has_is_extension (line 6909) | inline void UninterpretedOption_NamePart::clear_has_is_extension() {
  function clear_is_extension (line 6912) | inline void UninterpretedOption_NamePart::clear_is_extension() {
  function set_is_extension (line 6920) | inline void UninterpretedOption_NamePart::set_is_extension(bool value) {
  function clear_name (line 6934) | inline void UninterpretedOption::clear_name() {
  function google (line 6937) | inline const ::google::protobuf::UninterpretedOption_NamePart& Uninterpr...
  function google (line 6941) | inline ::google::protobuf::UninterpretedOption_NamePart* UninterpretedOp...
  function google (line 6945) | inline ::google::protobuf::UninterpretedOption_NamePart* UninterpretedOp...
  function google (line 6949) | inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Uninter...
  function google (line 6954) | inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::U...
  function clear_has_identifier_value (line 6967) | inline void UninterpretedOption::clear_has_identifier_value() {
  function clear_identifier_value (line 6970) | inline void UninterpretedOption::clear_identifier_value() {
  function set_identifier_value (line 6978) | inline void UninterpretedOption::set_identifier_value(const ::std::strin...
  function set_identifier_value (line 6983) | inline void UninterpretedOption::set_identifier_value(const char* value) {
  function set_identifier_value (line 6988) | inline void UninterpretedOption::set_identifier_value(const char* value,...
  function std (line 6994) | inline ::std::string* UninterpretedOption::mutable_identifier_value() {
  function std (line 6999) | inline ::std::string* UninterpretedOption::release_identifier_value() {
  function set_allocated_identifier_value (line 7004) | inline void UninterpretedOption::set_allocated_identifier_value(::std::s...
  function set_has_positive_int_value (line 7018) | inline void UninterpretedOption::set_has_positive_int_value() {
  function clear_has_positive_int_value (line 7021) | inline void UninterpretedOption::clear_has_positive_int_value() {
  function clear_positive_int_value (line 7024) | inline void UninterpretedOption::clear_positive_int_value() {
  function set_positive_int_value (line 7032) | inline void UninterpretedOption::set_positive_int_value(::google::protob...
  function set_has_negative_int_value (line 7042) | inline void UninterpretedOption::set_has_negative_int_value() {
  function clear_has_negative_int_value (line 7045) | inline void UninterpretedOption::clear_has_negative_int_value() {
  function clear_negative_int_value (line 7048) | inline void UninterpretedOption::clear_negative_int_value() {
  function set_negative_int_value (line 7056) | inline void UninterpretedOption::set_negative_int_value(::google::protob...
  function set_has_double_value (line 7066) | inline void UninterpretedOption::set_has_double_value() {
  function clear_has_double_value (line 7069) | inline void UninterpretedOption::clear_has_double_value() {
  function clear_double_value (line 7072) | inline void UninterpretedOption::clear_double_value() {
  function set_double_value (line 7080) | inline void UninterpretedOption::set_double_value(double value) {
  function set_has_string_value (line 7090) | inline void UninterpretedOption::set_has_string_value() {
  function clear_has_string_value (line 7093) | inline void UninterpretedOption::clear_has_string_value() {
  function clear_string_value (line 7096) | inline void UninterpretedOption::clear_string_value() {
  function set_string_value (line 7104) | inline void UninterpretedOption::set_string_value(const ::std::string& v...
  function set_string_value (line 7109) | inline void UninterpretedOption::set_string_value(const char* value) {
  function set_string_value (line 7114) | inline void UninterpretedOption::set_string_value(const void* value, siz...
  function std (line 7120) | inline ::std::string* UninterpretedOption::mutable_string_value() {
  function std (line 7125) | inline ::std::string* UninterpretedOption::release_string_value() {
  function set_allocated_string_value (line 7130) | inline void UninterpretedOption::set_allocated_string_value(::std::strin...
  function set_has_aggregate_value (line 7144) | inline void UninterpretedOption::set_has_aggregate_value() {
  function clear_has_aggregate_value (line 7147) | inline void UninterpretedOption::clear_has_aggregate_value() {
  function clear_aggregate_value (line 7150) | inline void UninterpretedOption::clear_aggregate_value() {
  function set_aggregate_value (line 7158) | inline void UninterpretedOption::set_aggregate_value(const ::std::string...
  function set_aggregate_value (line 7163) | inline void UninterpretedOption::set_aggregate_value(const char* value) {
  function set_aggregate_value (line 7168) | inline void UninterpretedOption::set_aggregate_value(const char* value, ...
  function std (line 7174) | inline ::std::string* UninterpretedOption::mutable_aggregate_value() {
  function std (line 7179) | inline ::std::string* UninterpretedOption::release_aggregate_value() {
  function set_allocated_aggregate_value (line 7184) | inline void UninterpretedOption::set_allocated_aggregate_value(::std::st...
  function clear_path (line 7202) | inline void SourceCodeInfo_Location::clear_path() {
  function set_path (line 7209) | inline void SourceCodeInfo_Location::set_path(int index, ::google::proto...
  function add_path (line 7213) | inline void SourceCodeInfo_Location::add_path(::google::protobuf::int32 ...
  function google (line 7222) | inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
  function clear_span (line 7232) | inline void SourceCodeInfo_Location::clear_span() {
  function set_span (line 7239) | inline void SourceCodeInfo_Location::set_span(int index, ::google::proto...
  function add_span (line 7243) | inline void SourceCodeInfo_Location::add_span(::google::protobuf::int32 ...
  function google (line 7252) | inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
  function set_has_leading_comments (line 7262) | inline void SourceCodeInfo_Location::set_has_leading_comments() {
  function clear_has_leading_comments (line 7265) | inline void SourceCodeInfo_Location::clear_has_leading_comments() {
  function clear_leading_comments (line 7268) | inline void SourceCodeInfo_Location::clear_leading_comments() {
  function set_leading_comments (line 7276) | inline void SourceCodeInfo_Location::set_leading_comments(const ::std::s...
  function set_leading_comments (line 7281) | inline void SourceCodeInfo_Location::set_leading_comments(const char* va...
  function set_leading_comments (line 7286) | inline void SourceCodeInfo_Location::set_leading_comments(const char* va...
  function std (line 7292) | inline ::std::string* SourceCodeInfo_Location::mutable_leading_comments() {
  function std (line 7297) | inline ::std::string* SourceCodeInfo_Location::release_leading_comments() {
  function set_allocated_leading_comments (line 7302) | inline void SourceCodeInfo_Location::set_allocated_leading_comments(::st...
  function set_has_trailing_comments (line 7316) | inline void SourceCodeInfo_Location::set_has_trailing_comments() {
  function clear_has_trailing_comments (line 7319) | inline void SourceCodeInfo_Location::clear_has_trailing_comments() {
  function clear_trailing_comments (line 7322) | inline void SourceCodeInfo_Location::clear_trailing_comments() {
  function set_trailing_comments (line 7330) | inline void SourceCodeInfo_Location::set_trailing_comments(const ::std::...
  function set_trailing_comments (line 7335) | inline void SourceCodeInfo_Location::set_trailing_comments(const char* v...
  function set_trailing_comments (line 7340) | inline void SourceCodeInfo_Location::set_trailing_comments(const char* v...
  function std (line 7346) | inline ::std::string* SourceCodeInfo_Location::mutable_trailing_comments...
  function std (line 7351) | inline ::std::string* SourceCodeInfo_Location::release_trailing_comments...
  function set_allocated_trailing_comments (line 7356) | inline void SourceCodeInfo_Location::set_allocated_trailing_comments(::s...
  function clear_leading_detached_comments (line 7370) | inline void SourceCodeInfo_Location::clear_leading_detached_comments() {
  function std (line 7373) | inline const ::std::string& SourceCodeInfo_Location::leading_detached_co...
  function std (line 7377) | inline ::std::string* SourceCodeInfo_Location::mutable_leading_detached_...
  function set_leading_detached_comments (line 7381) | inline void SourceCodeInfo_Location::set_leading_detached_comments(int i...
  function set_leading_detached_comments (line 7385) | inline void SourceCodeInfo_Location::set_leading_detached_comments(int i...
  function set_leading_detached_comments (line 7389) | inline void SourceCodeInfo_Location::set_leading_detached_comments(int i...
  function std (line 7394) | inline ::std::string* SourceCodeInfo_Location::add_leading_detached_comm...
  function add_leading_detached_comments (line 7398) | inline void SourceCodeInfo_Location::add_leading_detached_comments(const...
  function add_leading_detached_comments (line 7402) | inline void SourceCodeInfo_Location::add_leading_detached_comments(const...
  function add_leading_detached_comments (line 7406) | inline void SourceCodeInfo_Location::add_leading_detached_comments(const...
  function google (line 7415) | inline ::google::protobuf::RepeatedPtrField< ::std::string>*
  function clear_location (line 7429) | inline void SourceCodeInfo::clear_location() {
  function google (line 7432) | inline const ::google::protobuf::SourceCodeInfo_Location& SourceCodeInfo...
  function google (line 7436) | inline ::google::protobuf::SourceCodeInfo_Location* SourceCodeInfo::muta...
  function google (line 7440) | inline ::google::protobuf::SourceCodeInfo_Location* SourceCodeInfo::add_...
  function google (line 7444) | inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceC...
  function google (line 7449) | inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::S...
  function set_path (line 7470) | inline void GeneratedCodeInfo_Annotation::set_path(int index, ::google::...
  function add_path (line 7474) | inline void GeneratedCodeInfo_Annotation::add_path(::google::protobuf::i...
  function google (line 7483) | inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
  function set_has_source_file (line 7493) | inline void GeneratedCodeInfo_Annotation::set_has_source_file() {
  function clear_has_source_file (line 7496) | inline void GeneratedCodeInfo_Annotation::clear_has_source_file() {
  function clear_source_file (line 7499) | inline void GeneratedCodeInfo_Annotation::clear_source_file() {
  function set_source_file (line 7507) | inline void GeneratedCodeInfo_Annotation::set_source_file(const ::std::s...
  function set_source_file (line 7512) | inline void GeneratedCodeInfo_Annotation::set_source_file(const char* va...
  function set_source_file (line 7517) | inline void GeneratedCodeInfo_Annotation::set_source_file(const char* va...
  function std (line 7523) | inline ::std::string* GeneratedCodeInfo_Annotation::mutable_source_file() {
  function std (line 7528) | inline ::std::string* GeneratedCodeInfo_Annotation::release_source_file() {
  function set_allocated_source_file (line 7533) | inline void GeneratedCodeInfo_Annotation::set_allocated_source_file(::st...
  function set_has_begin (line 7547) | inline void GeneratedCodeInfo_Annotation::set_has_begin() {
  function clear_has_begin (line 7550) | inline void GeneratedCodeInfo_Annotation::clear_has_begin() {
  function clear_begin (line 7553) | inline void GeneratedCodeInfo_Annotation::clear_begin() {
  function set_begin (line 7561) | inline void GeneratedCodeInfo_Annotation::set_begin(::google::protobuf::...
  function set_has_end (line 7571) | inline void GeneratedCodeInfo_Annotation::set_has_end() {
  function clear_has_end (line 7574) | inline void GeneratedCodeInfo_Annotation::clear_has_end() {
  function clear_end (line 7577) | inline void GeneratedCodeInfo_Annotation::clear_end() {
  function set_end (line 7585) | inline void GeneratedCodeInfo_Annotation::set_end(::google::protobuf::in...
  function clear_annotation (line 7599) | inline void GeneratedCodeInfo::clear_annotation() {
  function google (line 7602) | inline const ::google::protobuf::GeneratedCodeInfo_Annotation& Generated...
  function google (line 7606) | inline ::google::protobuf::GeneratedCodeInfo_Annotation* GeneratedCodeIn...
  function google (line 7610) | inline ::google::protobuf::GeneratedCodeInfo_Annotation* GeneratedCodeIn...
  function google (line 7614) | inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::Generat...
  function namespace (line 7679) | namespace google {

FILE: deps/cpplint/samples/protobuf-sample/src/descriptor_unittest.cc
  type google (line 62) | namespace google {
    type protobuf (line 63) | namespace protobuf {
      type descriptor_unittest (line 66) | namespace descriptor_unittest {
        function DescriptorProto (line 69) | DescriptorProto* AddMessage(FileDescriptorProto* file, const strin...
        function DescriptorProto (line 75) | DescriptorProto* AddNestedMessage(DescriptorProto* parent, const s...
        function EnumDescriptorProto (line 81) | EnumDescriptorProto* AddEnum(FileDescriptorProto* file, const stri...
        function EnumDescriptorProto (line 87) | EnumDescriptorProto* AddNestedEnum(DescriptorProto* parent,
        function ServiceDescriptorProto (line 94) | ServiceDescriptorProto* AddService(FileDescriptorProto* file,
        function FieldDescriptorProto (line 101) | FieldDescriptorProto* AddField(DescriptorProto* parent,
        function FieldDescriptorProto (line 113) | FieldDescriptorProto* AddExtension(FileDescriptorProto* file,
        function FieldDescriptorProto (line 127) | FieldDescriptorProto* AddNestedExtension(DescriptorProto* parent,
        function EnumValueDescriptorProto (line 157) | EnumValueDescriptorProto* AddEnumValue(EnumDescriptorProto* enum_p...
        function MethodDescriptorProto (line 165) | MethodDescriptorProto* AddMethod(ServiceDescriptorProto* service,
        function AddEmptyEnum (line 178) | void AddEmptyEnum(FileDescriptorProto* file, const string& name) {
        class MockErrorCollector (line 182) | class MockErrorCollector : public DescriptorPool::ErrorCollector {
          method MockErrorCollector (line 184) | MockErrorCollector() {}
          method AddError (line 191) | void AddError(const string& filename,
          method AddWarning (line 214) | void AddWarning(const string& filename, const string& element_name,
        class FileDescriptorTest (line 240) | class FileDescriptorTest : public testing::Test {
          method SetUp (line 242) | virtual void SetUp() {
        function TEST_F (line 337) | TEST_F(FileDescriptorTest, Name) {
        function TEST_F (line 343) | TEST_F(FileDescriptorTest, Package) {
        function TEST_F (line 348) | TEST_F(FileDescriptorTest, Dependencies) {
        function TEST_F (line 354) | TEST_F(FileDescriptorTest, FindMessageTypeByName) {
        function TEST_F (line 366) | TEST_F(FileDescriptorTest, FindEnumTypeByName) {
        function TEST_F (line 378) | TEST_F(FileDescriptorTest, FindEnumValueByName) {
        function TEST_F (line 390) | TEST_F(FileDescriptorTest, FindServiceByName) {
        function TEST_F (line 402) | TEST_F(FileDescriptorTest, FindExtensionByName) {
        function TEST_F (line 414) | TEST_F(FileDescriptorTest, FindExtensionByNumber) {
        function TEST_F (line 421) | TEST_F(FileDescriptorTest, BuildAgain) {
        function TEST_F (line 433) | TEST_F(FileDescriptorTest, BuildAgainWithSyntax) {
        function TEST_F (line 464) | TEST_F(FileDescriptorTest, Syntax) {
        class DescriptorTest (line 495) | class DescriptorTest : public testing::Test {
          method SetUp (line 497) | virtual void SetUp() {
          method CopyWithJsonName (line 667) | void CopyWithJsonName(const Descriptor* message, DescriptorProto...
        function TEST_F (line 698) | TEST_F(DescriptorTest, Name) {
        function TEST_F (line 708) | TEST_F(DescriptorTest, ContainingType) {
        function TEST_F (line 713) | TEST_F(DescriptorTest, FieldsByIndex) {
        function TEST_F (line 721) | TEST_F(DescriptorTest, FindFieldByName) {
        function TEST_F (line 741) | TEST_F(DescriptorTest, FindFieldByNumber) {
        function TEST_F (line 756) | TEST_F(DescriptorTest, FieldName) {
        function TEST_F (line 763) | TEST_F(DescriptorTest, FieldFullName) {
        function TEST_F (line 774) | TEST_F(DescriptorTest, FieldJsonName) {
        function TEST_F (line 803) | TEST_F(DescriptorTest, FieldFile) {
        function TEST_F (line 814) | TEST_F(DescriptorTest, FieldIndex) {
        function TEST_F (line 821) | TEST_F(DescriptorTest, FieldNumber) {
        function TEST_F (line 828) | TEST_F(DescriptorTest, FieldType) {
        function TEST_F (line 835) | TEST_F(DescriptorTest, FieldLabel) {
        function TEST_F (line 854) | TEST_F(DescriptorTest, IsMap) {
        function TEST_F (line 860) | TEST_F(DescriptorTest, FieldHasDefault) {
        function TEST_F (line 867) | TEST_F(DescriptorTest, FieldContainingType) {
        function TEST_F (line 878) | TEST_F(DescriptorTest, FieldMessageType) {
        function TEST_F (line 886) | TEST_F(DescriptorTest, FieldEnumType) {
        class OneofDescriptorTest (line 897) | class OneofDescriptorTest : public testing::Test {
          method SetUp (line 899) | virtual void SetUp() {
        function TEST_F (line 974) | TEST_F(OneofDescriptorTest, Normal) {
        function TEST_F (line 986) | TEST_F(OneofDescriptorTest, FindByName) {
        class StylizedFieldNamesTest (line 994) | class StylizedFieldNamesTest : public testing::Test {
          method SetUp (line 996) | void SetUp() {
        function TEST_F (line 1066) | TEST_F(StylizedFieldNamesTest, LowercaseName) {
        function TEST_F (line 1086) | TEST_F(StylizedFieldNamesTest, CamelcaseName) {
        function TEST_F (line 1106) | TEST_F(StylizedFieldNamesTest, FindByLowercaseName) {
        function TEST_F (line 1140) | TEST_F(StylizedFieldNamesTest, FindByCamelcaseName) {
        class EnumDescriptorTest (line 1177) | class EnumDescriptorTest : public testing::Test {
          method SetUp (line 1179) | virtual void SetUp() {
        function TEST_F (line 1253) | TEST_F(EnumDescriptorTest, Name) {
        function TEST_F (line 1263) | TEST_F(EnumDescriptorTest, ContainingType) {
        function TEST_F (line 1268) | TEST_F(EnumDescriptorTest, ValuesByIndex) {
        function TEST_F (line 1274) | TEST_F(EnumDescriptorTest, FindValueByName) {
        function TEST_F (line 1285) | TEST_F(EnumDescriptorTest, FindValueByNumber) {
        function TEST_F (line 1296) | TEST_F(EnumDescriptorTest, ValueName) {
        function TEST_F (line 1301) | TEST_F(EnumDescriptorTest, ValueFullName) {
        function TEST_F (line 1308) | TEST_F(EnumDescriptorTest, ValueIndex) {
        function TEST_F (line 1313) | TEST_F(EnumDescriptorTest, ValueNumber) {
        function TEST_F (line 1318) | TEST_F(EnumDescriptorTest, ValueType) {
        class ServiceDescriptorTest (line 1328) | class ServiceDescriptorTest : public testing::Test {
          method SetUp (line 1330) | virtual void SetUp() {
        function TEST_F (line 1427) | TEST_F(ServiceDescriptorTest, Name) {
        function TEST_F (line 1437) | TEST_F(ServiceDescriptorTest, MethodsByIndex) {
        function TEST_F (line 1443) | TEST_F(ServiceDescriptorTest, FindMethodByName) {
        function TEST_F (line 1454) | TEST_F(ServiceDescriptorTest, MethodName) {
        function TEST_F (line 1459) | TEST_F(ServiceDescriptorTest, MethodFullName) {
        function TEST_F (line 1466) | TEST_F(ServiceDescriptorTest, MethodIndex) {
        function TEST_F (line 1471) | TEST_F(ServiceDescriptorTest, MethodParent) {
        function TEST_F (line 1476) | TEST_F(ServiceDescriptorTest, MethodInputType) {
        function TEST_F (line 1481) | TEST_F(ServiceDescriptorTest, MethodOutputType) {
        class NestedDescriptorTest (line 1489) | class NestedDescriptorTest : public testing::Test {
          method SetUp (line 1491) | virtual void SetUp() {
        function TEST_F (line 1604) | TEST_F(NestedDescriptorTest, MessageName) {
        function TEST_F (line 1616) | TEST_F(NestedDescriptorTest, MessageContainingType) {
        function TEST_F (line 1623) | TEST_F(NestedDescriptorTest, NestedMessagesByIndex) {
        function TEST_F (line 1629) | TEST_F(NestedDescriptorTest, FindFieldByNameDoesntFindNestedTypes) {
        function TEST_F (line 1636) | TEST_F(NestedDescriptorTest, FindNestedTypeByName) {
        function TEST_F (line 1649) | TEST_F(NestedDescriptorTest, EnumName) {
        function TEST_F (line 1661) | TEST_F(NestedDescriptorTest, EnumContainingType) {
        function TEST_F (line 1668) | TEST_F(NestedDescriptorTest, NestedEnumsByIndex) {
        function TEST_F (line 1674) | TEST_F(NestedDescriptorTest, FindEnumTypeByName) {
        function TEST_F (line 1687) | TEST_F(NestedDescriptorTest, FindEnumValueByName) {
        class ExtensionDescriptorTest (line 1703) | class ExtensionDescriptorTest : public testing::Test {
          method SetUp (line 1705) | virtual void SetUp() {
        function TEST_F (line 1774) | TEST_F(ExtensionDescriptorTest, ExtensionRanges) {
        function TEST_F (line 1785) | TEST_F(ExtensionDescriptorTest, Extensions) {
        function TEST_F (line 1830) | TEST_F(ExtensionDescriptorTest, IsExtensionNumber) {
        function TEST_F (line 1841) | TEST_F(ExtensionDescriptorTest, FindExtensionByName) {
        function TEST_F (line 1854) | TEST_F(ExtensionDescriptorTest, FindAllExtensions) {
        function TEST_F (line 1864) | TEST_F(ExtensionDescriptorTest, DuplicateFieldNumber) {
        class ReservedDescriptorTest (line 1901) | class ReservedDescriptorTest : public testing::Test {
          method SetUp (line 1903) | virtual void SetUp() {
        function TEST_F (line 1935) | TEST_F(ReservedDescriptorTest, ReservedRanges) {
        function TEST_F (line 1948) | TEST_F(ReservedDescriptorTest, IsReservedNumber) {
        function TEST_F (line 1963) | TEST_F(ReservedDescriptorTest, ReservedNames) {
        function TEST_F (line 1970) | TEST_F(ReservedDescriptorTest, IsReservedName) {
        class MiscTest (line 1978) | class MiscTest : public testing::Test {
          method FieldDescriptor (line 1981) | const FieldDescriptor* GetFieldDescriptorOfType(FieldDescriptor:...
          method GetCppTypeForFieldType (line 2016) | FieldDescriptor::CppType GetCppTypeForFieldType(FieldDescriptor:...
          method Descriptor (line 2027) | const Descriptor* GetMessageDescriptorForFieldType(
          method EnumDescriptor (line 2033) | const EnumDescriptor* GetEnumDescriptorForFieldType(
        function TEST_F (line 2042) | TEST_F(MiscTest, TypeNames) {
        function TEST_F (line 2067) | TEST_F(MiscTest, StaticTypeNames) {
        function TEST_F (line 2092) | TEST_F(MiscTest, CppTypes) {
        function TEST_F (line 2117) | TEST_F(MiscTest, CppTypeNames) {
        function TEST_F (line 2142) | TEST_F(MiscTest, StaticCppTypeNames) {
        function TEST_F (line 2159) | TEST_F(MiscTest, MessageType) {
        function TEST_F (line 2184) | TEST_F(MiscTest, EnumType) {
        function TEST_F (line 2210) | TEST_F(MiscTest, DefaultValues) {
        function TEST_F (line 2333) | TEST_F(MiscTest, FieldOptions) {
        type DescriptorPoolMode (line 2373) | enum DescriptorPoolMode {
        class AllowUnknownDependenciesTest (line 2378) | class AllowUnknownDependenciesTest
          method DescriptorPoolMode (line 2381) | DescriptorPoolMode mode() {
          method SetUp (line 2385) | virtual void SetUp() {
          method FileDescriptor (line 2446) | const FileDescriptor* BuildFile(const FileDescriptorProto& proto) {
        function TEST_P (line 2472) | TEST_P(AllowUnknownDependenciesTest, PlaceholderFile) {
        function TEST_P (line 2493) | TEST_P(AllowUnknownDependenciesTest, PlaceholderTypes) {
        function TEST_P (line 2517) | TEST_P(AllowUnknownDependenciesTest, CopyTo) {
        function TEST_P (line 2540) | TEST_P(AllowUnknownDependenciesTest, CustomOptions) {
        function TEST_P (line 2549) | TEST_P(AllowUnknownDependenciesTest, UnknownExtendee) {
        function TEST_P (line 2573) | TEST_P(AllowUnknownDependenciesTest, CustomOption) {
        function TEST_P (line 2626) | TEST_P(AllowUnknownDependenciesTest,
        function TEST (line 2703) | TEST(CustomOptions, OptionLocations) {
        function TEST (line 2737) | TEST(CustomOptions, OptionTypes) {
        function TEST (line 2795) | TEST(CustomOptions, ComplexExtensionOptions) {
        function TEST (line 2831) | TEST(CustomOptions, OptionsFromOtherFile) {
        function TEST (line 2887) | TEST(CustomOptions, MessageOptionThreeFieldsSet) {
        function TEST (line 2964) | TEST(CustomOptions, MessageOptionRepeatedLeafFieldSet) {
        function TEST (line 3044) | TEST(CustomOptions, MessageOptionRepeatedMsgFieldSet) {
        function TEST (line 3130) | TEST(CustomOptions, AggregateOptions) {
        function TEST (line 3168) | TEST(CustomOptions, UnusedImportWarning) {
        function TEST (line 3194) | TEST(CustomOptions, OptionsWithRequiredEnums) {
        class ValidationErrorTest (line 3269) | class ValidationErrorTest : public testing::Test {
          method FileDescriptor (line 3273) | const FileDescriptor* BuildFile(const string& file_text) {
          method BuildFileWithErrors (line 3282) | void BuildFileWithErrors(const string& file_text,
          method BuildFileWithWarnings (line 3296) | void BuildFileWithWarnings(const string& file_text,
          method BuildFileInTestPool (line 3307) | void BuildFileInTestPool(const FileDescriptor* file) {
          method BuildDescriptorMessagesInTestPool (line 3315) | void BuildDescriptorMessagesInTestPool() {
        function TEST_F (line 3322) | TEST_F(ValidationErrorTest, AlreadyDefined) {
        function TEST_F (line 3331) | TEST_F(ValidationErrorTest, AlreadyDefinedInPackage) {
        function TEST_F (line 3342) | TEST_F(ValidationErrorTest, AlreadyDefinedInOtherFile) {
        function TEST_F (line 3355) | TEST_F(ValidationErrorTest, PackageAlreadyDefined) {
        function TEST_F (line 3367) | TEST_F(ValidationErrorTest, EnumValueAlreadyDefinedInParent) {
        function TEST_F (line 3380) | TEST_F(ValidationErrorTest, EnumValueAlreadyDefinedInParentNonGlob...
        function TEST_F (line 3394) | TEST_F(ValidationErrorTest, MissingName) {
        function TEST_F (line 3402) | TEST_F(ValidationErrorTest, InvalidName) {
        function TEST_F (line 3410) | TEST_F(ValidationErrorTest, InvalidPackageName) {
        function TEST_F (line 3418) | TEST_F(ValidationErrorTest, MissingFileName) {
        function TEST_F (line 3425) | TEST_F(ValidationErrorTest, DupeDependency) {
        function TEST_F (line 3435) | TEST_F(ValidationErrorTest, UnknownDependency) {
        function TEST_F (line 3443) | TEST_F(ValidationErrorTest, InvalidPublicDependencyIndex) {
        function TEST_F (line 3452) | TEST_F(ValidationErrorTest, ForeignUnimportedPackageNoCrash) {
        function TEST_F (line 3476) | TEST_F(ValidationErrorTest, DupeFile) {
        function TEST_F (line 3493) | TEST_F(ValidationErrorTest, FieldInExtensionRange) {
        function TEST_F (line 3511) | TEST_F(ValidationErrorTest, OverlappingExtensionRanges) {
        function TEST_F (line 3527) | TEST_F(ValidationErrorTest, ReservedFieldError) {
        function TEST_F (line 3539) | TEST_F(ValidationErrorTest, ReservedExtensionRangeError) {
        function TEST_F (line 3552) | TEST_F(ValidationErrorTest, ReservedExtensionRangeAdjacent) {
        function TEST_F (line 3562) | TEST_F(ValidationErrorTest, ReservedRangeOverlap) {
        function TEST_F (line 3575) | TEST_F(ValidationErrorTest, ReservedNameError) {
        function TEST_F (line 3591) | TEST_F(ValidationErrorTest, ReservedNameRedundant) {
        function TEST_F (line 3603) | TEST_F(ValidationErrorTest, ReservedFieldsDebugString) {
        function TEST_F (line 3623) | TEST_F(ValidationErrorTest, InvalidDefaults) {
        function TEST_F (line 3668) | TEST_F(ValidationErrorTest, NegativeFieldNumber) {
        function TEST_F (line 3679) | TEST_F(ValidationErrorTest, HugeFieldNumber) {
        function TEST_F (line 3692) | TEST_F(ValidationErrorTest, ReservedFieldNumber) {
        function TEST_F (line 3709) | TEST_F(ValidationErrorTest, ExtensionMissingExtendee) {
        function TEST_F (line 3722) | TEST_F(ValidationErrorTest, NonExtensionWithExtendee) {
        function TEST_F (line 3739) | TEST_F(ValidationErrorTest, FieldOneofIndexTooLarge) {
        function TEST_F (line 3755) | TEST_F(ValidationErrorTest, FieldOneofIndexNegative) {
        function TEST_F (line 3771) | TEST_F(ValidationErrorTest, OneofFieldsConsecutiveDefinition) {
        function TEST_F (line 3832) | TEST_F(ValidationErrorTest, FieldNumberConflict) {
        function TEST_F (line 3845) | TEST_F(ValidationErrorTest, BadMessageSetExtensionType) {
        function TEST_F (line 3863) | TEST_F(ValidationErrorTest, BadMessageSetExtensionLabel) {
        function TEST_F (line 3881) | TEST_F(ValidationErrorTest, FieldInMessageSet) {
        function TEST_F (line 3894) | TEST_F(ValidationErrorTest, NegativeExtensionRangeNumber) {
        function TEST_F (line 3905) | TEST_F(ValidationErrorTest, HugeExtensionRangeNumber) {
        function TEST_F (line 3917) | TEST_F(ValidationErrorTest, ExtensionRangeEndBeforeStart) {
        function TEST_F (line 3932) | TEST_F(ValidationErrorTest, EmptyEnum) {
        function TEST_F (line 3951) | TEST_F(ValidationErrorTest, UndefinedExtendee) {
        function TEST_F (line 3963) | TEST_F(ValidationErrorTest, NonMessageExtendee) {
        function TEST_F (line 3976) | TEST_F(ValidationErrorTest, NotAnExtensionNumber) {
        function TEST_F (line 3992) | TEST_F(ValidationErrorTest, RequiredExtension) {
        function TEST_F (line 4014) | TEST_F(ValidationErrorTest, UndefinedFieldType) {
        function TEST_F (line 4025) | TEST_F(ValidationErrorTest, UndefinedFieldTypeWithDefault) {
        function TEST_F (line 4041) | TEST_F(ValidationErrorTest, UndefinedNestedFieldType) {
        function TEST_F (line 4055) | TEST_F(ValidationErrorTest, FieldTypeDefinedInUndeclaredDependency) {
        function TEST_F (line 4071) | TEST_F(ValidationErrorTest, FieldTypeDefinedInIndirectDependency) {
        function TEST_F (line 4106) | TEST_F(ValidationErrorTest, FieldTypeDefinedInPublicDependency) {
        function TEST_F (line 4141) | TEST_F(ValidationErrorTest, FieldTypeDefinedInTransitivePublicDepe...
        function TEST_F (line 4182) | TEST_F(ValidationErrorTest,
        function TEST_F (line 4229) | TEST_F(ValidationErrorTest, SearchMostLocalFirst) {
        function TEST_F (line 4263) | TEST_F(ValidationErrorTest, SearchMostLocalFirst2) {
        function TEST_F (line 4281) | TEST_F(ValidationErrorTest, PackageOriginallyDeclaredInTransitiveD...
        function TEST_F (line 4322) | TEST_F(ValidationErrorTest, FieldTypeNotAType) {
        function TEST_F (line 4335) | TEST_F(ValidationErrorTest, RelativeFieldTypeNotAType) {
        function TEST_F (line 4350) | TEST_F(ValidationErrorTest, FieldTypeMayBeItsName) {
        function TEST_F (line 4362) | TEST_F(ValidationErrorTest, EnumFieldTypeIsMessage) {
        function TEST_F (line 4375) | TEST_F(ValidationErrorTest, MessageFieldTypeIsEnum) {
        function TEST_F (line 4388) | TEST_F(ValidationErrorTest, BadEnumDefaultValue) {
        function TEST_F (line 4402) | TEST_F(ValidationErrorTest, EnumDefaultValueIsInteger) {
        function TEST_F (line 4416) | TEST_F(ValidationErrorTest, PrimitiveWithTypeName) {
        function TEST_F (line 4428) | TEST_F(ValidationErrorTest, NonPrimitiveWithoutTypeName) {
        function TEST_F (line 4440) | TEST_F(ValidationErrorTest, OneofWithNoFields) {
        function TEST_F (line 4451) | TEST_F(ValidationErrorTest, OneofLabelMismatch) {
        function TEST_F (line 4465) | TEST_F(ValidationErrorTest, InputTypeNotDefined) {
        function TEST_F (line 4478) | TEST_F(ValidationErrorTest, InputTypeNotAMessage) {
        function TEST_F (line 4492) | TEST_F(ValidationErrorTest, OutputTypeNotDefined) {
        function TEST_F (line 4505) | TEST_F(ValidationErrorTest, OutputTypeNotAMessage) {
        function TEST_F (line 4520) | TEST_F(ValidationErrorTest, IllegalPackedField) {
        function TEST_F (line 4551) | TEST_F(ValidationErrorTest, OptionWrongType) {
        function TEST_F (line 4568) | TEST_F(ValidationErrorTest, OptionExtendsAtomicType) {
        function TEST_F (line 4587) | TEST_F(ValidationErrorTest, DupOption) {
        function TEST_F (line 4607) | TEST_F(ValidationErrorTest, InvalidOptionName) {
        function TEST_F (line 4626) | TEST_F(ValidationErrorTest, RepeatedMessageOption) {
        function TEST_F (line 4649) | TEST_F(ValidationErrorTest, ResolveUndefinedOption) {
        function TEST_F (line 4694) | TEST_F(ValidationErrorTest, UnknownOption) {
        function TEST_F (line 4707) | TEST_F(ValidationErrorTest, CustomOptionConflictingFieldNumber) {
        function TEST_F (line 4722) | TEST_F(ValidationErrorTest, Int32OptionValueOutOfPositiveRange) {
        function TEST_F (line 4739) | TEST_F(ValidationErrorTest, Int32OptionValueOutOfNegativeRange) {
        function TEST_F (line 4756) | TEST_F(ValidationErrorTest, Int32OptionValueIsNotPositiveInt) {
        function TEST_F (line 4772) | TEST_F(ValidationErrorTest, Int64OptionValueOutOfRange) {
        function TEST_F (line 4789) | TEST_F(ValidationErrorTest, Int64OptionValueIsNotPositiveInt) {
        function TEST_F (line 4805) | TEST_F(ValidationErrorTest, UInt32OptionValueOutOfRange) {
        function TEST_F (line 4821) | TEST_F(ValidationErrorTest, UInt32OptionValueIsNotPositiveInt) {
        function TEST_F (line 4837) | TEST_F(ValidationErrorTest, UInt64OptionValueIsNotPositiveInt) {
        function TEST_F (line 4853) | TEST_F(ValidationErrorTest, FloatOptionValueIsNotNumber) {
        function TEST_F (line 4869) | TEST_F(ValidationErrorTest, DoubleOptionValueIsNotNumber) {
        function TEST_F (line 4885) | TEST_F(ValidationErrorTest, BoolOptionValueIsNotTrueOrFalse) {
        function TEST_F (line 4901) | TEST_F(ValidationErrorTest, EnumOptionValueIsNotIdentifier) {
        function TEST_F (line 4920) | TEST_F(ValidationErrorTest, EnumOptionValueIsNotEnumValueName) {
        function TEST_F (line 4939) | TEST_F(ValidationErrorTest, EnumOptionValueIsSiblingEnumValueName) {
        function TEST_F (line 4961) | TEST_F(ValidationErrorTest, StringOptionValueIsNotString) {
        function TEST_F (line 4977) | TEST_F(ValidationErrorTest, DuplicateExtensionFieldNumber) {
        function string (line 4999) | static string EmbedAggregateValue(const char* value) {
        function TEST_F (line 5013) | TEST_F(ValidationErrorTest, AggregateValueNotFound) {
        function TEST_F (line 5024) | TEST_F(ValidationErrorTest, AggregateValueParseError) {
        function TEST_F (line 5033) | TEST_F(ValidationErrorTest, AggregateValueUnknownFields) {
        function TEST_F (line 5042) | TEST_F(ValidationErrorTest, NotLiteImportsLite) {
        function TEST_F (line 5056) | TEST_F(ValidationErrorTest, LiteExtendsNotLite) {
        function TEST_F (line 5076) | TEST_F(ValidationErrorTest, NoLiteServices) {
        function TEST_F (line 5100) | TEST_F(ValidationErrorTest, RollbackAfterError) {
        function TEST_F (line 5149) | TEST_F(ValidationErrorTest, ErrorsReportedToLogError) {
        function TEST_F (line 5174) | TEST_F(ValidationErrorTest, DisallowEnumAlias) {
        function TEST_F (line 5188) | TEST_F(ValidationErrorTest, AllowEnumAlias) {
        function TEST_F (line 5199) | TEST_F(ValidationErrorTest, UnusedImportWarning) {
        function FillValidMapEntry (line 5246) | void FillValidMapEntry(FileDescriptorProto* file_proto) {
        function TEST_F (line 5281) | TEST_F(ValidationErrorTest, MapEntryBase) {
        function TEST_F (line 5287) | TEST_F(ValidationErrorTest, MapEntryExtensionRange) {
        function TEST_F (line 5298) | TEST_F(ValidationErrorTest, MapEntryExtension) {
        function TEST_F (line 5309) | TEST_F(ValidationErrorTest, MapEntryNestedType) {
        function TEST_F (line 5320) | TEST_F(ValidationErrorTest, MapEntryEnumTypes) {
        function TEST_F (line 5332) | TEST_F(ValidationErrorTest, MapEntryExtraField) {
        function TEST_F (line 5346) | TEST_F(ValidationErrorTest, MapEntryMessageName) {
        function TEST_F (line 5356) | TEST_F(ValidationErrorTest, MapEntryNoneRepeatedMapEntry) {
        function TEST_F (line 5364) | TEST_F(ValidationErrorTest, MapEntryDifferentContainingType) {
        function TEST_F (line 5374) | TEST_F(ValidationErrorTest, MapEntryKeyName) {
        function TEST_F (line 5384) | TEST_F(ValidationErrorTest, MapEntryKeyLabel) {
        function TEST_F (line 5394) | TEST_F(ValidationErrorTest, MapEntryKeyNumber) {
        function TEST_F (line 5404) | TEST_F(ValidationErrorTest, MapEntryValueName) {
        function TEST_F (line 5414) | TEST_F(ValidationErrorTest, MapEntryValueLabel) {
        function TEST_F (line 5424) | TEST_F(ValidationErrorTest, MapEntryValueNumber) {
        function TEST_F (line 5434) | TEST_F(ValidationErrorTest, MapEntryKeyTypeFloat) {
        function TEST_F (line 5444) | TEST_F(ValidationErrorTest, MapEntryKeyTypeDouble) {
        function TEST_F (line 5454) | TEST_F(ValidationErrorTest, MapEntryKeyTypeBytes) {
        function TEST_F (line 5464) | TEST_F(ValidationErrorTest, MapEntryKeyTypeEnum) {
        function TEST_F (line 5490) | TEST_F(ValidationErrorTest, MapEntryKeyTypeMessage) {
        function TEST_F (line 5501) | TEST_F(ValidationErrorTest, MapEntryConflictsWithField) {
        function TEST_F (line 5521) | TEST_F(ValidationErrorTest, MapEntryConflictsWithMessage) {
        function TEST_F (line 5537) | TEST_F(ValidationErrorTest, MapEntryConflictsWithEnum) {
        function TEST_F (line 5554) | TEST_F(ValidationErrorTest, MapEntryConflictsWithOneof) {
        function TEST_F (line 5578) | TEST_F(ValidationErrorTest, MapEntryUsesNoneZeroEnumDefaultValue) {
        function TEST_F (line 5607) | TEST_F(ValidationErrorTest, Proto3RequiredFields) {
        function TEST_F (line 5643) | TEST_F(ValidationErrorTest, ValidateProto3DefaultValue) {
        function TEST_F (line 5670) | TEST_F(ValidationErrorTest, ValidateProto3ExtensionRange) {
        function TEST_F (line 5697) | TEST_F(ValidationErrorTest, ValidateProto3MessageSetWireFormat) {
        function TEST_F (line 5709) | TEST_F(ValidationErrorTest, ValidateProto3Enum) {
        function TEST_F (line 5743) | TEST_F(ValidationErrorTest, ValidateProto3Group) {
        function TEST_F (line 5760) | TEST_F(ValidationErrorTest, ValidateProto3EnumFromProto2) {
        function TEST_F (line 5786) | TEST_F(ValidationErrorTest, ValidateProto3Extension) {
        function TEST_F (line 5827) | TEST_F(ValidationErrorTest, ValidateProto3JsonName) {
        function AddToDatabase (line 5855) | static void AddToDatabase(SimpleDescriptorDatabase* database,
        class DatabaseBackedPoolTest (line 5862) | class DatabaseBackedPoolTest : public testing::Test {
          method DatabaseBackedPoolTest (line 5864) | DatabaseBackedPoolTest() {}
          method SetUp (line 5868) | virtual void SetUp() {
          class ErrorDescriptorDatabase (line 5891) | class ErrorDescriptorDatabase : public DescriptorDatabase {
            method ErrorDescriptorDatabase (line 5893) | ErrorDescriptorDatabase() {}
            method FindFileByName (line 5897) | bool FindFileByName(const string& filename,
            method FindFileContainingSymbol (line 5914) | bool FindFileContainingSymbol(const string& symbol_name,
            method FindFileContainingExtension (line 5918) | bool FindFileContainingExtension(const string& containing_type,
          class CallCountingDatabase (line 5927) | class CallCountingDatabase : public DescriptorDatabase {
            method CallCountingDatabase (line 5929) | CallCountingDatabase(DescriptorDatabase* wrapped_db)
            method Clear (line 5939) | void Clear() {
            method FindFileByName (line 5944) | bool FindFileByName(const string& filename,
            method FindFileContainingSymbol (line 5949) | bool FindFileContainingSymbol(const string& symbol_name,
            method FindFileContainingExtension (line 5954) | bool FindFileContainingExtension(const string& containing_type,
          class FalsePositiveDatabase (line 5966) | class FalsePositiveDatabase : public DescriptorDatabase {
            method FalsePositiveDatabase (line 5968) | FalsePositiveDatabase(DescriptorDatabase* wrapped_db)
            method FindFileByName (line 5975) | bool FindFileByName(const string& filename,
            method FindFileContainingSymbol (line 5979) | bool FindFileContainingSymbol(const string& symbol_name,
            method FindFileContainingExtension (line 5983) | bool FindFileContainingExtension(const string& containing_type,
        function TEST_F (line 5991) | TEST_F(DatabaseBackedPoolTest, FindFileByName) {
        function TEST_F (line 6005) | TEST_F(DatabaseBackedPoolTest, FindDependencyBeforeDependent) {
        function TEST_F (line 6024) | TEST_F(DatabaseBackedPoolTest, FindDependentBeforeDependency) {
        function TEST_F (line 6043) | TEST_F(DatabaseBackedPoolTest, FindFileContainingSymbol) {
        function TEST_F (line 6054) | TEST_F(DatabaseBackedPoolTest, FindMessageTypeByName) {
        function TEST_F (line 6065) | TEST_F(DatabaseBackedPoolTest, FindExtensionByNumber) {
        function TEST_F (line 6079) | TEST_F(DatabaseBackedPoolTest, FindAllExtensions) {
        function TEST_F (line 6094) | TEST_F(DatabaseBackedPoolTest, ErrorWithoutErrorCollector) {
        function TEST_F (line 6109) | TEST_F(DatabaseBackedPoolTest, ErrorWithErrorCollector) {
        function TEST_F (line 6125) | TEST_F(DatabaseBackedPoolTest, UndeclaredDependencyOnUnbuiltType) {
        function TEST_F (line 6138) | TEST_F(DatabaseBackedPoolTest, RollbackAfterError) {
        function TEST_F (line 6152) | TEST_F(DatabaseBackedPoolTest, UnittestProto) {
        function TEST_F (line 6180) | TEST_F(DatabaseBackedPoolTest, DoesntRetryDbUnnecessarily) {
        function TEST_F (line 6225) | TEST_F(DatabaseBackedPoolTest, DoesntReloadFilesUncesessarily) {
        class ExponentialErrorDatabase (line 6255) | class ExponentialErrorDatabase : public DescriptorDatabase {
          method ExponentialErrorDatabase (line 6257) | ExponentialErrorDatabase() {}
          method FindFileByName (line 6261) | bool FindFileByName(const string& filename,
          method FindFileContainingSymbol (line 6271) | bool FindFileContainingSymbol(const string& symbol_name,
          method FindFileContainingExtension (line 6281) | bool FindFileContainingExtension(const string& containing_type,
          method FullMatch (line 6288) | void FullMatch(const string& name,
          method PopulateFile (line 6302) | bool PopulateFile(int file_num, FileDescriptorProto* output) {
        function TEST_F (line 6325) | TEST_F(DatabaseBackedPoolTest, DoesntReloadKnownBadFiles) {
        function TEST_F (line 6335) | TEST_F(DatabaseBackedPoolTest, DoesntFallbackOnWrongType) {
        class AbortingErrorCollector (line 6365) | class AbortingErrorCollector : public DescriptorPool::ErrorCollect...
          method AbortingErrorCollector (line 6367) | AbortingErrorCollector() {}
          method AddError (line 6369) | virtual void AddError(
        class SingletonSourceTree (line 6383) | class SingletonSourceTree : public compiler::SourceTree {
          method SingletonSourceTree (line 6385) | SingletonSourceTree(const string& filename, const string& contents)
        class SourceLocationTest (line 6430) | class SourceLocationTest : public testing::Test {
          method SourceLocationTest (line 6432) | SourceLocationTest()
          method string (line 6437) | static string PrintSourceLocation(const SourceLocation &loc) {
        function TEST_F (line 6457) | TEST_F(SourceLocationTest, GetSourceLocation) {
        function TEST_F (line 6489) | TEST_F(SourceLocationTest, ExtensionSourceLocation) {
        function TEST_F (line 6511) | TEST_F(SourceLocationTest, GetSourceLocation_MissingSourceCodeInfo) {
        function TEST_F (line 6529) | TEST_F(SourceLocationTest, GetSourceLocation_BogusSourceCodeInfo) {
        class CopySourceCodeInfoToTest (line 6562) | class CopySourceCodeInfoToTest : public testing::Test {
          method CopySourceCodeInfoToTest (line 6564) | CopySourceCodeInfoToTest()
        function TEST_F (line 6578) | TEST_F(CopySourceCodeInfoToTest, CopyTo_DoesNotCopySourceCodeInfo) {
        function TEST_F (line 6588) | TEST_F(CopySourceCodeInfoToTest, CopySourceCodeInfoTo) {

FILE: deps/cpplint/samples/silly-sample/src/sillycode.cpp
  class Date (line 6) | class Date {
  function do_something (line 14) | void do_something(vector<string>& v)
  type X (line 28) | struct X {
    method X (line 65) | X() :i{666}, s{"qqq"} { }
    method X (line 66) | X(int ii) :i{ii} {}
  function X (line 38) | X waste(const char* p)
    method X (line 65) | X() :i{666}, s{"qqq"} { }
    method X (line 66) | X(int ii) :i{ii} {}
  function driver (line 54) | void driver()
  class X (line 60) | class X {	// BAD
    method X (line 65) | X() :i{666}, s{"qqq"} { }
    method X (line 66) | X(int ii) :i{ii} {}
  class X2 (line 70) | class X2 {
    method X2 (line 75) | X2() = default;
    method X2 (line 76) | X2(int ii) :i{ii} {}
  class X3 (line 80) | class X3 {	// BAD: inexplicit, argument passing overhead
    method X3 (line 85) | X3(int ii = 666, const string& ss = "qqq", int jj = 0)
  class Foo (line 91) | class Foo {
  function Foo (line 99) | Foo& Foo::operator=(Foo&& a)       // OK, but there is a cost
  class Vector2 (line 108) | class Vector2 {
    method Vector2 (line 110) | Vector2(Vector2&& a) { *this = a; }
    method Vector2 (line 111) | Vector2& operator=(Vector2&& a) { *this = a; }
  function f2 (line 118) | void f2(N::X& a, N::X& b)
  function f3 (line 123) | void f3(N::X& a, N::X& b)
  type Webcolor (line 143) | enum class Webcolor { red=0xFF0000, green=0x00FF00, blue=0x0000FF }
  type Productinfo (line 144) | enum class Productinfo { red=0, purple=1, blue=2 }
  type Webcolor (line 149) | enum Webcolor { red=0xFF0000, green=0x00FF00, blue=0x0000FF }
  type Productinfo (line 150) | enum Productinfo { red=0, purple=1, blue=2 }
  type Webcolor (line 155) | enum class Webcolor { red=0xFF0000, green=0x00FF00, blue=0x0000FF }
  type Productinfo (line 156) | enum class Productinfo { red=0, purple=1, blue=2 }
  function use (line 216) | void use(int n)
  class base (line 230) | class base { public: virtual ~base() = 0; }
  class derived1 (line 232) | class derived1 : public base { }
  class derived2 (line 234) | class derived2 : public base {
    method get_s (line 237) | std::string get_s() { return s; }
  function f (line 246) | void f(const int& i) {

FILE: deps/cpplint/samples/v8-sample/src/interface-descriptors.h
  function namespace (line 15) | namespace v8 {
  type VoidDescriptor (line 485) | typedef VoidDescriptor DummyDescriptor;
  type VoidDescriptor (line 488) | typedef VoidDescriptor CCallDescriptor;
  function class (line 490) | class AllocateDescriptor : public CallInterfaceDescriptor {
  function class (line 539) | class LoadGlobalDescriptor : public CallInterfaceDescriptor {
  function class (line 555) | class StoreDescriptor : public CallInterfaceDescriptor {
  function class (line 579) | class StoreTransitionDescriptor : public StoreDescriptor {
  function class (line 598) | class StoreWithVectorDescriptor : public StoreDescriptor {
  function class (line 614) | class StoreGlobalDescriptor : public CallInterfaceDescriptor {
  function class (line 640) | class StoreGlobalWithVectorDescriptor : public StoreGlobalDescriptor {
  function class (line 657) | class LoadWithVectorDescriptor : public LoadDescriptor {
  function class (line 678) | class LoadGlobalWithVectorDescriptor : public LoadGlobalDescriptor {
  function class (line 697) | class FastNewFunctionContextDescriptor : public CallInterfaceDescriptor {
  function class (line 708) | class FastNewObjectDescriptor : public CallInterfaceDescriptor {
  function class (line 1016) | class ApiGetterDescriptor : public CallInterfaceDescriptor {
  function class (line 1030) | class GrowArrayElementsDescriptor : public CallInterfaceDescriptor {
  function class (line 1072) | class InterpreterPushArgsThenConstructDescriptor

FILE: deps/cpplint/samples/vlc-sample/src/libvlc.c
  function libvlc_int_t (line 92) | libvlc_int_t * libvlc_InternalCreate( void )
  function libvlc_InternalInit (line 120) | int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
  function libvlc_InternalCleanup (line 507) | void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
  function libvlc_InternalDestroy (line 563) | void libvlc_InternalDestroy( libvlc_int_t *p_libvlc )
  function GetFilenames (line 579) | static void GetFilenames( libvlc_int_t *p_vlc, unsigned n,
  function libvlc_MetaRequest (line 616) | int libvlc_MetaRequest(libvlc_int_t *libvlc, input_item_t *item,
  function libvlc_ArtRequest (line 638) | int libvlc_ArtRequest(libvlc_int_t *libvlc, input_item_t *item,

FILE: deps/cpplint/samples/vlc-sample/src/libvlc.h
  type variable_t (line 30) | typedef struct variable_t variable_t;
  type vlc_actions (line 33) | struct vlc_actions
  type vlc_actions (line 34) | struct vlc_actions
  type vlc_actions (line 35) | struct vlc_actions
  type vlc_logger_t (line 74) | typedef struct vlc_logger_t vlc_logger_t;
  type vlc_exit_t (line 83) | typedef struct vlc_exit
  type vlc_object_t (line 122) | struct vlc_object_t
  type vlc_dialog_provider (line 136) | typedef struct vlc_dialog_provider vlc_dialog_provider;
  type vlc_keystore (line 137) | typedef struct vlc_keystore vlc_keystore;
  type libvlc_priv_t (line 139) | typedef struct libvlc_priv_t
  function libvlc_priv_t (line 159) | static inline libvlc_priv_t *libvlc_priv (libvlc_int_t *libvlc)
  type counter_sample_t (line 184) | typedef struct counter_sample_t
  type counter_t (line 190) | typedef struct counter_t

FILE: deps/cpplint/samples/vlc-sample/src/missing.c
  function httpd_file_sys_t (line 50) | httpd_file_sys_t *httpd_FileDelete (httpd_file_t *file)
  function httpd_file_t (line 56) | httpd_file_t *httpd_FileNew (httpd_host_t *host,
  function httpd_handler_sys_t (line 68) | httpd_handler_sys_t *httpd_HandlerDelete (httpd_handler_t *handler)
  function httpd_handler_t (line 74) | httpd_handler_t *httpd_HandlerNew (httpd_host_t *host, const char *url,
  function httpd_HostDelete (line 85) | void httpd_HostDelete (httpd_host_t *h)
  function httpd_host_t (line 91) | httpd_host_t *vlc_http_HostNew (vlc_object_t *obj)
  function httpd_host_t (line 97) | httpd_host_t *vlc_https_HostNew (vlc_object_t *obj)
  function httpd_host_t (line 103) | httpd_host_t *vlc_rtsp_HostNew (vlc_object_t *obj)
  function httpd_MsgAdd (line 109) | void httpd_MsgAdd (httpd_message_t *m, const char *name, const char *fmt...
  function httpd_RedirectDelete (line 121) | void httpd_RedirectDelete (httpd_redirect_t *r)
  function httpd_redirect_t (line 127) | httpd_redirect_t *httpd_RedirectNew (httpd_host_t *host,
  function httpd_StreamDelete (line 140) | void httpd_StreamDelete (httpd_stream_t *stream)
  function httpd_StreamHeader (line 146) | int httpd_StreamHeader (httpd_stream_t *stream, uint8_t *data, int count)
  function httpd_stream_t (line 152) | httpd_stream_t *httpd_StreamNew (httpd_host_t *host,
  function httpd_StreamSend (line 161) | int httpd_StreamSend (httpd_stream_t *stream, const block_t *p_block)
  function httpd_StreamSetHTTPHeaders (line 167) | int httpd_StreamSetHTTPHeaders (httpd_stream_t * stream,
  function httpd_UrlCatch (line 175) | int httpd_UrlCatch (httpd_url_t *url, int request, httpd_callback_t cb,
  function httpd_UrlDelete (line 182) | void httpd_UrlDelete (httpd_url_t *url)
  function httpd_url_t (line 188) | httpd_url_t *httpd_UrlNew (httpd_host_t *host, const char *url,
  function sout_AccessOutControl (line 217) | int sout_AccessOutControl (sout_access_out_t *out, int query, ...)
  function sout_AccessOutDelete (line 223) | void sout_AccessOutDelete (sout_access_out_t *out)
  function sout_access_out_t (line 230) | sout_access_out_t *sout_AccessOutNew (vlc_object_t *obj,
  function sout_AccessOutRead (line 238) | ssize_t sout_AccessOutRead (sout_access_out_t *out, block_t *block)
  function sout_AccessOutSeek (line 244) | int sout_AccessOutSeek (sout_access_out_t *out, off_t offset)
  function sout_AccessOutWrite (line 250) | ssize_t sout_AccessOutWrite (sout_access_out_t *out, block_t *block)
  function session_descriptor_t (line 257) | session_descriptor_t *sout_AnnounceRegisterSDP (vlc_object_t *obj,
  function sout_AnnounceUnRegister (line 267) | void sout_AnnounceUnRegister (vlc_object_t *obj, session_descriptor_t *d)
  function encoder_t (line 274) | encoder_t *sout_EncoderCreate( vlc_object_t *p_this )
  function sout_input_t (line 280) | sout_input_t *sout_MuxAddStream( sout_mux_t *mux, const es_format_t *fmt )
  function sout_MuxDelete (line 286) | void sout_MuxDelete (sout_mux_t *mux)
  function sout_MuxDeleteStream (line 292) | void sout_MuxDeleteStream (sout_mux_t *mux, sout_input_t *input)
  function sout_MuxGetStream (line 298) | int sout_MuxGetStream (sout_mux_t *p_mux, unsigned int i_blocks, mtime_t...
  function sout_mux_t (line 304) | sout_mux_t *sout_MuxNew (sout_instance_t *instance, const char *mux,
  function sout_MuxSendBuffer (line 311) | int sout_MuxSendBuffer (sout_mux_t *mux, sout_input_t *input, block_t *b...
  function sout_MuxFlush (line 317) | void sout_MuxFlush( sout_mux_t *mux, sout_input_t *input )
  function sout_StreamChainDelete (line 323) | void sout_StreamChainDelete (sout_stream_t *p_first, sout_stream_t *p_last)
  function sout_stream_t (line 329) | sout_stream_t *sout_StreamChainNew (sout_instance_t *p_sout, const char ...
  type sockaddr (line 339) | struct sockaddr
  type sockaddr (line 340) | struct sockaddr
  function vlm_Control (line 351) | int vlm_Control (vlm_t *vlm, int query, ...)
  function vlm_Delete (line 358) | void vlm_Delete (vlm_t *vlm)
  function vlm_ExecuteCommand (line 364) | int vlm_ExecuteCommand (vlm_t *vlm, const char *cmd, vlm_message_t **pm)
  function vlm_message_t (line 372) | vlm_message_t *vlm_MessageAdd (vlm_message_t *a, vlm_message_t *b)
  function vlm_MessageDelete (line 379) | void vlm_MessageDelete (vlm_message_t *m)
  function vlm_message_t (line 385) | vlm_message_t *vlm_MessageSimpleNew (const char *a)
  function vlm_message_t (line 391) | vlm_message_t *vlm_MessageNew (const char *a, const char *fmt, ...)
  function vlm_t (line 399) | vlm_t *vlm_New (vlc_object_t *obj)

FILE: deps/cpplint/setup.py
  class Cmd (line 8) | class Cmd(Command):
    method initialize_options (line 17) | def initialize_options(self):
    method finalize_options (line 20) | def finalize_options(self):
    method execute (line 23) | def execute(self, *k):
  class Lint (line 27) | class Lint(Cmd):
    method run (line 35) | def run(self):
  function read_without_comments (line 39) | def read_without_comments(filename):

FILE: lib/default_palette.d.ts
  type ColorVector (line 1) | type ColorVector = [ number, number, number ];

FILE: lib/x.d.ts
  type Color (line 1) | type Color = { r: number, g: number, b: number };
  type Callback (line 2) | type Callback = (err: Error | undefined, colors: Color[]) => void;

FILE: src/common.cc
  type __thmclrx__ (line 22) | namespace __thmclrx__ {
    function Palette (line 70) | const Palette* Palette::GetDefaultPalette() {
    function StatsToV8 (line 178) | Local<Array> StatsToV8(bkr_color_stats stats[], size_t count) {

FILE: src/common.h
  function namespace (line 24) | namespace __thmclrx__ {
  type PicturePixels (line 39) | typedef struct PicturePixels {

FILE: src/thmclrx.cc
  type __thmclrx__ (line 21) | namespace __thmclrx__ {
    function NAN_METHOD (line 28) | NAN_METHOD(GetByOctree) {
    function NAN_METHOD (line 61) | NAN_METHOD(GetByMinDiff) {
    function NAN_METHOD (line 99) | NAN_METHOD(GetByMixed) {
    function NAN_MODULE_INIT (line 142) | NAN_MODULE_INIT(Init) {

FILE: test/test.js
  function genCallback (line 24) | function genCallback(id) {
Condensed preview — 81 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,897K chars).
[
  {
    "path": ".clang-format",
    "chars": 3187,
    "preview": "---\nLanguage:        Cpp\n# BasedOnStyle:  Google\nAccessModifierOffset: -1\nAlignAfterOpenBracket: Align\nAlignConsecutiveA"
  },
  {
    "path": ".cpplint",
    "chars": 142,
    "preview": "set noparent\nfilter=-build/include_alpha,-build/include_subdir,-build/include_what_you_use,-legal/copyright,-readability"
  },
  {
    "path": ".editorconfig",
    "chars": 351,
    "preview": "root = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\nindent_size = 2\nindent_style = space\ninsert_final_newline = true\ntrim_"
  },
  {
    "path": ".eslintrc",
    "chars": 47,
    "preview": "{\n  \"extends\": [\n    \"eslint-config-egg\"\n  ]\n}\n"
  },
  {
    "path": ".gitignore",
    "chars": 730,
    "preview": "# Logs\nlogs\n*.log\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nl"
  },
  {
    "path": ".gitmodules",
    "chars": 96,
    "preview": "[submodule \"deps/byakuren\"]\npath = deps/byakuren\nurl = https://github.com/XadillaX/byakuren.git\n"
  },
  {
    "path": "CPPLINT.cfg",
    "chars": 142,
    "preview": "set noparent\nfilter=-build/include_alpha,-build/include_subdir,-build/include_what_you_use,-legal/copyright,-readability"
  },
  {
    "path": "LICENSE",
    "chars": 1077,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2022 ZHU, Kaidi\n\nPermission is hereby granted, free of charge, to any person obtain"
  },
  {
    "path": "README.md",
    "chars": 4737,
    "preview": "<p align=\"center\">\n  <img src=\"https://github.com/XadillaX/thmclrx/raw/master/logo.svg\" alt=\"Thmclrx\" />\n</p>\n\n<p align="
  },
  {
    "path": "binding.gyp",
    "chars": 1259,
    "preview": "{\n    \"targets\": [\n        {\n            \"target_name\": \"xmempool\",\n            \"type\": \"static_library\",\n            \"s"
  },
  {
    "path": "deps/cpplint/.flake8",
    "chars": 1041,
    "preview": "[flake8]\nignore =\n    # indentation is not a multiple of four,\n    E111,E114,\n    # visually indented line with same ind"
  },
  {
    "path": "deps/cpplint/.gitignore",
    "chars": 1507,
    "preview": "### Python ###\n# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\n# C extensions\n*.so\n\n# Distrib"
  },
  {
    "path": "deps/cpplint/.pylintrc",
    "chars": 964,
    "preview": "[BASIC]\ninclude-naming-hint=yes\nmethod-rgx=[A-Z_][A-Za-z0-9]{2,49}$\nfunction-rgx=[A-Z_][A-Za-z0-9]{2,49}$|main|unicode_e"
  },
  {
    "path": "deps/cpplint/.style.yapf",
    "chars": 120,
    "preview": "[style]\nbased_on_style = chromium\ndedent_closing_brackets = True\ncoalesce_brackets = True\ncontinuation_indent_width = 2\n"
  },
  {
    "path": "deps/cpplint/.travis.yml",
    "chars": 246,
    "preview": "language: python\n\npython:\n  - \"3.8\"\n  - \"3.7\"\n  - \"3.6\"\n  - \"3.5\"\n  - \"2.7\"\n  - \"pypy\"\n  - \"pypy3\"\n\ninstall:\n  - pip ins"
  },
  {
    "path": "deps/cpplint/CONTRIBUTING.rst",
    "chars": 5942,
    "preview": "Contributing guide\n==================\n\nThanks for your interest in contributing to cpplint.\n\nAny kinds of contributions "
  },
  {
    "path": "deps/cpplint/LICENSE",
    "chars": 1502,
    "preview": "cpplint.py and its corresponding unit tests are Copyright (C) 2009 Google Inc.\n\nRedistribution and use in source and bin"
  },
  {
    "path": "deps/cpplint/MANIFEST.in",
    "chars": 365,
    "preview": "# MANIFEST.in file required to deliver test files with source tar\ninclude *.py\ninclude LICENSE\ninclude test-requirements"
  },
  {
    "path": "deps/cpplint/README.rst",
    "chars": 2722,
    "preview": "cpplint - static code checker for C++\n=====================================\n\n.. image:: https://travis-ci.org/cpplint/cp"
  },
  {
    "path": "deps/cpplint/changelog.rst",
    "chars": 5259,
    "preview": "Changelog\n=========\n\n1.5.4 (2020-08-18)\n-----\n\n* Fix google#166, Allow space before C++11 attributes\n\n1.5.3 (2020-07-20)"
  },
  {
    "path": "deps/cpplint/cpplint.py",
    "chars": 262019,
    "preview": "#!/usr/bin/env python\n#\n# Copyright (c) 2009 Google Inc. All rights reserved.\n#\n# Redistribution and use in source and b"
  },
  {
    "path": "deps/cpplint/cpplint_clitest.py",
    "chars": 7992,
    "preview": "#!/usr/bin/env python\n# -*- coding: utf-8; -*-\n#\n# Copyright (c) 2009 Google Inc. All rights reserved.\n#\n# Redistributio"
  },
  {
    "path": "deps/cpplint/cpplint_unittest.py",
    "chars": 266204,
    "preview": "#!/usr/bin/env python\n# -*- coding: utf-8; -*-\n#\n# Copyright (c) 2009 Google Inc. All rights reserved.\n#\n# Redistributio"
  },
  {
    "path": "deps/cpplint/dev-requirements",
    "chars": 197,
    "preview": "# requirements to run development steps\n\n# also change in tox.ini\nflake8>=3.7.8\npylint>=1.8.4\ntox>=3.0.0\ntox-pyenv\n\n# Be"
  },
  {
    "path": "deps/cpplint/samples/boost-sample/LICENSE",
    "chars": 1339,
    "preview": "Boost Software License - Version 1.0 - August 17th, 2003\n\nPermission is hereby granted, free of charge, to any person or"
  },
  {
    "path": "deps/cpplint/samples/boost-sample/README.md",
    "chars": 81,
    "preview": "# VLC sample\n\ncode taken for regression testing from https://github.com/boostorg\n"
  },
  {
    "path": "deps/cpplint/samples/boost-sample/exclude.def",
    "chars": 12627,
    "preview": "--recursive --exclude=headers/* src\n1\n4\nDone processing src/inspect/unnamed_namespace_check.hpp\nDone processing src/tr1/"
  },
  {
    "path": "deps/cpplint/samples/boost-sample/headers_inspect.def",
    "chars": 4893,
    "preview": "src/inspect/*\n1\n3\nDone processing src/inspect/unnamed_namespace_check.hpp\nTotal errors found: 40\n\nsrc/inspect/unnamed_na"
  },
  {
    "path": "deps/cpplint/samples/boost-sample/headers_simple.def",
    "chars": 7750,
    "preview": "src/tr1/*\n1\n3\nDone processing src/tr1/c_policy.hpp\nTotal errors found: 66\n\nsrc/tr1/c_policy.hpp:0:  No #ifndef header gu"
  },
  {
    "path": "deps/cpplint/samples/boost-sample/simple.def",
    "chars": 301418,
    "preview": "include/boost/math/*\n1\n3\nDone processing include/boost/math/octonion.hpp\nTotal errors found: 2572\n\ninclude/boost/math/oc"
  },
  {
    "path": "deps/cpplint/samples/boost-sample/src/inspect/unnamed_namespace_check.hpp",
    "chars": 1628,
    "preview": "//  unnamed_namespace_check -----------------------------------------//\n\n//  Copyright Gennaro Prota 2006.\n//\n//  Distri"
  },
  {
    "path": "deps/cpplint/samples/boost-sample/src/tr1/c_policy.hpp",
    "chars": 5181,
    "preview": "//  Copyright John Maddock 2008.\n//  Use, modification and distribution are subject to the\n//  Boost Software License, V"
  },
  {
    "path": "deps/cpplint/samples/chromium-sample/README.md",
    "chars": 90,
    "preview": "# VLC sample\n\ncode taken for regression testing from https://github.com/chromium/chromium\n"
  },
  {
    "path": "deps/cpplint/samples/chromium-sample/simple.def",
    "chars": 1945,
    "preview": "src/*\n1\n6\nDone processing src/chrome_content_renderer_client.cc\nDone processing src/chrome_content_renderer_client.h\nDon"
  },
  {
    "path": "deps/cpplint/samples/chromium-sample/src/chrome_content_renderer_client.cc",
    "chars": 55685,
    "preview": "// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style l"
  },
  {
    "path": "deps/cpplint/samples/chromium-sample/src/chrome_content_renderer_client.h",
    "chars": 8592,
    "preview": "// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style l"
  },
  {
    "path": "deps/cpplint/samples/chromium-sample/src/io_thread.cc",
    "chars": 69013,
    "preview": "// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style l"
  },
  {
    "path": "deps/cpplint/samples/chromium-sample/src/io_thread.h",
    "chars": 22325,
    "preview": "// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style l"
  },
  {
    "path": "deps/cpplint/samples/codelite-sample/LICENSE",
    "chars": 18298,
    "preview": "\t\t    GNU GENERAL PUBLIC LICENSE\n\t\t       Version 2, June 1991\n\n Copyright (C) 1989, 1991 Free Software Foundation, Inc."
  },
  {
    "path": "deps/cpplint/samples/codelite-sample/README.md",
    "chars": 120,
    "preview": "Canary sample taken from codelite https://github.com/eranif/codelite\nLicense applies as per LICENSE file in this folder\n"
  },
  {
    "path": "deps/cpplint/samples/codelite-sample/simple.def",
    "chars": 54945,
    "preview": "src/*\n1\n4\nDone processing src/pptable.cpp\nDone processing src/pptable.h\nTotal errors found: 680\n\nsrc/pptable.cpp:0:  No "
  },
  {
    "path": "deps/cpplint/samples/codelite-sample/src/pptable.cpp",
    "chars": 15505,
    "preview": "#include \"pptable.h\"\r\n#include <wx/tokenzr.h>\r\n#include <set>\r\n\r\nbool IsWordChar(const wxString &s, int strSize)\r\n{\r\n\tif"
  },
  {
    "path": "deps/cpplint/samples/codelite-sample/src/pptable.h",
    "chars": 3424,
    "preview": "#ifndef PPTABLE_H\r\n#define PPTABLE_H\r\n\r\n#include <wx/arrstr.h>\r\n#include <map>\r\n#include <wx/ffile.h>\r\n#include <vector>"
  },
  {
    "path": "deps/cpplint/samples/protobuf-sample/LICENSE",
    "chars": 1733,
    "preview": "Copyright 2008 Google Inc.  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmod"
  },
  {
    "path": "deps/cpplint/samples/protobuf-sample/README.md",
    "chars": 97,
    "preview": "# VLC sample\n\ncode taken for regression testing from https://github.com/protocolbuffers/protobuf\n"
  },
  {
    "path": "deps/cpplint/samples/protobuf-sample/simple.def",
    "chars": 268082,
    "preview": "src/*\n1\n5\nDone processing src/descriptor.pb.cc\nDone processing src/descriptor.pb.h\nDone processing src/descriptor_unitte"
  },
  {
    "path": "deps/cpplint/samples/protobuf-sample/src/descriptor.pb.cc",
    "chars": 591964,
    "preview": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: google/protobuf/descriptor.proto\n\n#define INTERNA"
  },
  {
    "path": "deps/cpplint/samples/protobuf-sample/src/descriptor.pb.h",
    "chars": 319543,
    "preview": "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n// source: google/protobuf/descriptor.proto\n\n#ifndef PROTOBU"
  },
  {
    "path": "deps/cpplint/samples/protobuf-sample/src/descriptor_unittest.cc",
    "chars": 240602,
    "preview": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://de"
  },
  {
    "path": "deps/cpplint/samples/silly-sample/filters.def",
    "chars": 2544,
    "preview": "--counting=toplevel --filter=-whitespace,-build/include_what_you_use src/*.cpp\n1\n7\nDone processing src/sillycode.cpp\nCat"
  },
  {
    "path": "deps/cpplint/samples/silly-sample/includeorder_cfirst.def",
    "chars": 10361,
    "preview": "--includeorder=standardcfirst src/*.cpp\n1\n3\nDone processing src/sillycode.cpp\nTotal errors found: 106\n\nsrc/sillycode.cpp"
  },
  {
    "path": "deps/cpplint/samples/silly-sample/sed.def",
    "chars": 10944,
    "preview": "--output=sed src/*.cpp\n1\n5\nsed -i '120s/,\\([^ ]\\)/, \\1/g' src/sillycode.cpp # Missing space after ,  [whitespace/comma] "
  },
  {
    "path": "deps/cpplint/samples/silly-sample/simple.def",
    "chars": 10480,
    "preview": "src/*.cpp\n1\n3\nDone processing src/sillycode.cpp\nTotal errors found: 107\n\nsrc/sillycode.cpp:0:  No copyright message foun"
  },
  {
    "path": "deps/cpplint/samples/silly-sample/src/sillycode.cpp",
    "chars": 5517,
    "preview": "#include <vector>\n\n#include <gtest/test.h>\n\n\nclass Date {\n    // ...\npublic:\n    Month month() const;  // do\n    int mon"
  },
  {
    "path": "deps/cpplint/samples/v8-sample/LICENSE",
    "chars": 1528,
    "preview": "Copyright 2006-2011, the V8 project authors. All rights reserved.\nRedistribution and use in source and binary forms, wit"
  },
  {
    "path": "deps/cpplint/samples/v8-sample/README.md",
    "chars": 77,
    "preview": "# V8 sample\n\ncode taken for regression testing from https://github.com/v8/v8\n"
  },
  {
    "path": "deps/cpplint/samples/v8-sample/simple.def",
    "chars": 376,
    "preview": "src/*\n1\n3\nDone processing src/interface-descriptors.h\nTotal errors found: 2\n\nsrc/interface-descriptors.h:5:  #ifndef hea"
  },
  {
    "path": "deps/cpplint/samples/v8-sample/src/interface-descriptors.h",
    "chars": 52186,
    "preview": "// Copyright 2014 the V8 project authors. All rights reserved.\n// Use of this source code is governed by a BSD-style lic"
  },
  {
    "path": "deps/cpplint/samples/vlc-sample/COPYING",
    "chars": 18093,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 2, June 1991\n\n Copyright (C) 1989, 1991 Fr"
  },
  {
    "path": "deps/cpplint/samples/vlc-sample/README.md",
    "chars": 85,
    "preview": "# VLC sample\n\ncode taken for regression testing from https://github.com/videolan/vlc\n"
  },
  {
    "path": "deps/cpplint/samples/vlc-sample/simple.def",
    "chars": 49635,
    "preview": "src/*\n1\n5\nDone processing src/libvlc.c\nDone processing src/libvlc.h\nDone processing src/missing.c\nTotal errors found: 60"
  },
  {
    "path": "deps/cpplint/samples/vlc-sample/src/libvlc.c",
    "chars": 21134,
    "preview": "/*****************************************************************************\n * libvlc.c: libvlc instances creation an"
  },
  {
    "path": "deps/cpplint/samples/vlc-sample/src/libvlc.h",
    "chars": 6562,
    "preview": "/*****************************************************************************\n * libvlc.h: Internal libvlc generic/misc"
  },
  {
    "path": "deps/cpplint/samples/vlc-sample/src/missing.c",
    "chars": 11071,
    "preview": "/*****************************************************************************\n * missing.c: missing libvlccore symbols\n"
  },
  {
    "path": "deps/cpplint/setup.cfg",
    "chars": 243,
    "preview": "[aliases]\ntest = pytest\nstyle = flake8\nci = lint style test\n\n[tool:pytest]\npython_files = *test.py\ntestpaths = .\n# runni"
  },
  {
    "path": "deps/cpplint/setup.py",
    "chars": 2955,
    "preview": "#! /usr/bin/env python\n\nfrom setuptools import setup, Command\nfrom subprocess import check_call\nfrom distutils.spawn imp"
  },
  {
    "path": "deps/cpplint/test-requirements",
    "chars": 210,
    "preview": "# minimal requirements to run python setup.py test\n# 5.x requires python 3.5\npytest>=4.6,<5.0\npytest-cov\n# freeze versio"
  },
  {
    "path": "deps/cpplint/tox.ini",
    "chars": 244,
    "preview": "[tox]\nenvlist = py27, py36, py37, py38, pypy, pypy3\n\n[testenv]\ndeps =\n  py36: flake8>=3.7.8\n  py36: radon>=2.4.0\n  py36:"
  },
  {
    "path": "index.d.ts",
    "chars": 192,
    "preview": "import {\n  octree,\n  minDiff,\n  mixed,\n  octreeGet,\n  minDiffGet,\n  mixedGet,\n} from './lib/x';\n\nexport = {\n  octree,\n  "
  },
  {
    "path": "index.js",
    "chars": 886,
    "preview": "/**\n *\n *    ▄▄▄▄▀ ▄  █ █▀▄▀█ ▄█▄    █    █▄▄▄▄     ▄            ,ae,\n * ▀▀▀ █   █   █ █ █ █ █▀ ▀▄  █    █  ▄▀ ▀▄   █   "
  },
  {
    "path": "lib/default_palette.d.ts",
    "chars": 104,
    "preview": "type ColorVector = [ number, number, number ];\ndeclare const palette: ColorVector[];\n\nexport = palette;\n"
  },
  {
    "path": "lib/default_palette.js",
    "chars": 6958,
    "preview": "/**\n *\n *    ▄▄▄▄▀ ▄  █ █▀▄▀█ ▄█▄    █    █▄▄▄▄     ▄            ,ae,\n * ▀▀▀ █   █   █ █ █ █ █▀ ▀▄  █    █  ▄▀ ▀▄   █   "
  },
  {
    "path": "lib/x.d.ts",
    "chars": 1060,
    "preview": "type Color = { r: number, g: number, b: number };\ntype Callback = (err: Error | undefined, colors: Color[]) => void;\n\nde"
  },
  {
    "path": "lib/x.js",
    "chars": 4931,
    "preview": "/**\n *\n *    ▄▄▄▄▀ ▄  █ █▀▄▀█ ▄█▄    █    █▄▄▄▄     ▄            ,ae,\n * ▀▀▀ █   █   █ █ █ █ █▀ ▀▄  █    █  ▄▀ ▀▄   █   "
  },
  {
    "path": "package.json",
    "chars": 1566,
    "preview": "{\n  \"name\": \"thmclrx\",\n  \"version\": \"2.0.3\",\n  \"description\": \"A theme color extractor module for Node.js.\",\n  \"main\": \""
  },
  {
    "path": "src/common.cc",
    "chars": 6325,
    "preview": "/**\n *\n *    ▄▄▄▄▀ ▄  █ █▀▄▀█ ▄█▄    █    █▄▄▄▄     ▄            ,ae,\n * ▀▀▀ █   █   █ █ █ █ █▀ ▀▄  █    █  ▄▀ ▀▄   █   "
  },
  {
    "path": "src/common.h",
    "chars": 1653,
    "preview": "/**\n *\n *    ▄▄▄▄▀ ▄  █ █▀▄▀█ ▄█▄    █    █▄▄▄▄     ▄            ,ae,\n * ▀▀▀ █   █   █ █ █ █ █▀ ▀▄  █    █  ▄▀ ▀▄   █   "
  },
  {
    "path": "src/thmclrx.cc",
    "chars": 5147,
    "preview": "/**\n *\n *    ▄▄▄▄▀ ▄  █ █▀▄▀█ ▄█▄    █    █▄▄▄▄     ▄            ,ae,\n * ▀▀▀ █   █   █ █ █ █ █▀ ▀▄  █    █  ▄▀ ▀▄   █   "
  },
  {
    "path": "test/test.js",
    "chars": 1782,
    "preview": "/**\n *\n *    ▄▄▄▄▀ ▄  █ █▀▄▀█ ▄█▄    █    █▄▄▄▄     ▄            ,ae,\n * ▀▀▀ █   █   █ █ █ █ █▀ ▀▄  █    █  ▄▀ ▀▄   █   "
  },
  {
    "path": "tools/clang_format.js",
    "chars": 189,
    "preview": "#!/usr/bin/env node\n'use strict';\n\nconst cp = require('child_process');\n\nconst bin = require.resolve('clang-format/index"
  },
  {
    "path": "tsconfig.json",
    "chars": 77,
    "preview": "{\n  \"extends\": \"@artus/tsconfig\",\n  \"exclude\": [\n    \"lib\",\n    \"test\"\n  ]\n}\n"
  }
]

About this extraction

This page contains the full source code of the XadillaX/thmclrx GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 81 files (2.7 MB), approximately 706.4k tokens, and a symbol index with 1445 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!