[
  {
    "path": ".gitignore",
    "content": "tags\n*.sw*\n*~\n*.pyc\n"
  },
  {
    "path": ".rspec",
    "content": "--color\n--require spec_helper\n--format documentation\n-I ~/.vim-flavor/repos/LucHermitte_vim-UT/spec\n"
  },
  {
    "path": ".travis.yml",
    "content": "dist: xenial\nlanguage: ruby\ncache: bundler\nrvm:\n    - 2.1.5\nscript: bundle exec rake ci\ncompiler:\n    - gcc # for ctags\naddons:\n    apt:\n        packages:\n            - vim-gtk\naddons:\n    apt:\n        packages:\n            - vim-gtk\nbefore_install:\n    - git clone https://github.com/universal-ctags/ctags.git\n    - (cd ctags && ./autogen.sh && ./configure --prefix=\"$HOME\" && make -j 4 install)\nbefore_script:\n    - \"export PATH=$PATH:$HOME/bin\"\nservices:\n  - xvfb\n"
  },
  {
    "path": "CONTRIBUTORS",
    "content": "The following people have contributed to lh-cpp\n\n# Direct contributors\nLuc Hermitte, maintainer, 2002(?)-2018\nLeif Wickland, original mapping for `GOTOIMPL` (VIM-TIP#335)\nRobert KellyIV, first plugin version of `GOTOIMPL`, plus contributions to present code, 2002\nOlivier Teuliere, highlight function definitions, 2004 (https://vim.wikia.com/wiki/Highlighting_of_method_names_in_the_definition)\nSven Speckmaier, Apply styles to `GOTOIMPL`, 2016, PR#4\nfwSmit, Fix missing dep in doc, 2018, PR#9\n\nDiscl. I'm likely to have forgottent old contributors, drop me an email\nif you're one of them.\n\n# Plugins imported from other projects:\nCharles E. Campbell, Jr., initial flistmaps definition\nGeorgi Slavchev <goyko at gbg dot bg>, previewWord initial definition, 2002 (https://vim.wikia.com/wiki/Function_signature_previewer)\n\n\n"
  },
  {
    "path": "Gemfile",
    "content": "source 'https://rubygems.org'\n\ngem 'rspec', '~> 3.1.0'\ngem 'vimrunner', '~> 0.3.1'\ngem 'rake', '~> 10.3.2'\ngem 'vim-flavor', '~> 2.1.1'\n"
  },
  {
    "path": "License.md",
    "content": "Copyright 2001-2015, Luc Hermitte\n\n# Scripts License\n\nAll scripts (VimL, templates, bash, perl, etc.) from lh-vim are\ndistributed under FSF's GPLv3 license.\n\nSee http://www.gnu.org/licenses/gpl.txt for more information.\n\n\n# License exception for generated code\n\nMany lh-vim scripts generate code. Unless specified otherwise, the code generated is under the following license exception.\n\n\nEveryone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\n\nThis Exception is an additional permission under section 7 of the GNU General Public License, version 3 (\"GPLv3\"). It applies to a given file that bears a notice placed by the copyright holder of the file stating that the file is governed by GPLv3 along with this Exception.\n\nThe purpose of this Exception is to allow distribution of lh-vim's typical output under terms of the recipient's choice (including proprietary).\n\n## 0. Definitions.\n\"Covered Code\" is the source or object code of a version of lh-vim that is a covered work under this License.\n\n\"Normally Copied Code\" for a version of lh-vim means all parts of its Covered Code which that version can copy from its code (i.e., not from its input file) into its minimally verbose, non-debugging and non-tracing output.\n\n\"Ineligible Code\" is Covered Code that is not Normally Copied Code.\n\n## 1. Grant of Additional Permission.\nYou have permission to propagate output of lh-vim, even if such propagation would otherwise violate the terms of GPLv3. However, if by modifying lh-vim you cause any Ineligible Code of the version you received to become Normally Copied Code of your modified version, then you void this Exception for the resulting covered work. If you convey that resulting covered work, you must remove this Exception in accordance with the second paragraph of Section 7 of GPLv3.\n\n## 2. No Weakening of lh-vim Copyleft.\n\nThe availability of this Exception does not imply any general presumption that third-party software is unaffected by the copyleft requirements of the license of lh-vim.\n\nDisclaimer: This lh-vim license exception is directly derived from [AUTOCONF CONFIGURE SCRIPT EXCEPTION](http://www.gnu.org/licenses/autoconf-exception.html) to GPLv3 license.\n\n# License for documentation\n\nThe documentation of lh-vim scripts distributed along the scripts, and of the wiki pages here are under the Creative Commons license ([CC by SA 3.0](http://creativecommons.org/licenses/by-sa/3.0/))\n"
  },
  {
    "path": "README.md",
    "content": "# lh-cpp [![Build Status](https://secure.travis-ci.org/LucHermitte/lh-cpp.png?branch=master)](http://travis-ci.org/LucHermitte/lh-cpp) [![Project Stats](https://www.openhub.net/p/21020/widgets/project_thin_badge.gif)](https://www.openhub.net/p/21020)\n## Features\n\nlh-cpp is an heterogeneous suite of helpers for C and C++ programming.\n\nIt provides the following things:\n  * Smart snippets for [brackets pairs](#brackets), [control statements](#code-snippets)\n  * a few [templates](#templates)\n  * a few [advanced wizards, and high-level features](#wizards-and-other-high-level-features) to Generate classes and singletons, to Generate ready to fill-in function comments for Doxygen, Jump to a function implementation, Search for un-implemented or undeclared functions, _etc._\n  * [syntax highlighting](#syntax-highlighting) for identified counter-idioms and bad practices (catch by value, assignments in conditions, throw specifications)\n  * an [API](doc/API.md) to build even more complex wizards and advanced features\n\n  An exhaustive [list of all options](doc/options.md) is also available.\n  For help using this plugin for the first time, please take a look at `:h lh-cpp-first-steps`\n\n### Text insertion facilities\n\n\n#### Brackets\n\nThe insertion of pair of brackets-like characters is eased thanks to [lh-brackets](http://github.com/LucHermitte/lh-brackets).\n\n|   In mode               |   INSERT                                                            |   VISUAL                                      |   NORMAL                  |\n|:------------------------|:--------------------------------------------------------------------|:----------------------------------------------|:--------------------------|\n| **keys**                | Expands into ..                                                     | Surrounds the selection with ... <sup>2</sup> | Surrounds the current ... |\n| `(`                     | `(<cursor>)«»`                                                      | `(<selection>)`                               | word                      |\n| `[`                     | `[<cursor>]«»`                                                      | <sup>1</sup>                                  | <sup>1</sup>              |\n| `[` after a `[`         | `[[<cursor>]]«»`                                                    | n/a                                           | n/a                       |\n| `]` before `]]`         | close all `]]`                                                      | n/a                                           | n/a                       |\n| `<localleader>[`        |                                                                     | `[<selection>]`                               | word                      |\n| `{`                     | `{<cursor>}«»`<sup>3</sup>                                          | `{<selection>}`                               | word                      |\n| `<localleader>{`        |                                                                     | `{\\n<selection>\\n}«»`                         | line                      |\n| <                       | `<<cursor>>«»` after `#include`, or `template` on the same line     |                                               |                           |\n| `\"` (1 double quote)    | `\"<cursor>\"«»`                                                      | <sup>1</sup>                                  | <sup>1</sup>              |\n| `\"\"`                    |                                                                     | `\"<selection>\"`                               | word                      |\n| `'`                     | `'<cursor>'«»`                                                      | <sup>1</sup>                                  | <sup>1</sup>              |\n| `''` (2 single quotes)  |                                                                     | `'<selection>'`                               | word                      |\n| `;`                     | closes all parenthesis after the cursor -- if there is nothing else |                                               |                           |\n\n##### Notes:\n  * <sup>1</sup> Not defined to avoid hijacking default vim key bindings.\n  * <sup>2</sup> The visual mode mappings do not surround the current marker/placeholder selected, but trigger the INSERT-mode mappings instead.\n  * <sup>3</sup> The exact behavior of this mapping has changed with release r719 (on Google Code). Now, no newline is inserted by default. However, hitting `<cr>` in the middle of a pair of curly-bracket will expand into `{\\n<cursor>\\n}`.\n  * `«»` represents a marker/placeholder, it may be expanded with other characters like `<++>` depending on your preferences.\n  * There is no way (yet) to deactivate this feature from the `.vimrc`\n\n\n#### Code snippets\n\n##### INSERT-mode snippets abbreviations\nThere exist, over the WWW, a lot of configurations and mappings regarding C programming. Once again you will find shortcuts for `if`, `else`, `elif`  (I know it is not a C keyword, but `else if` are), `for`, `while`, `do`, `switch`, and `main`. In C++, snippets are also provided for `try`, `catch`, and `namespace`.\nWhat is unique is the fact that when you type `if` in insert mode, it will automatically expand into ...\n```C++\nif () {\n}\n```\n... in respect of the context. I.e.: within comments or strings (delimited by single or double quotes) `if` is not expanded. If keyword characters precede the typing, `if` is not expanded as well. Thus variables like `tarif` can be used without getting any headache.\n\n\nMost of these same snippets, and a few variations, are\n[also provided](doc/snippets.md#control-statements) as template-files for\n[mu-template](http://github.com/LucHermitte/mu-template).\nThis time, you just need to type the first letters of the snippet/template\nname, and trigger the expansion (with `<c-r><tab>` by default). If several\nsnippets match (like _c/for_, _c/fori_, _cpp/fori_ and _cpp/for-iterator_ when\nyou try to expand `fo`), mu-template will ask you to choose which (matching)\nsnippet you want to expand.\n\n##### Instruction surrounding mappings\nIn visual mode, `,if` wraps the selection within the curly brackets and inserts `if ()` just before. In normal mode `,if` does the same thing under the consideration that the selection is considered to be the current line under the cursor. Actually, it is not `,if` but `<LocalLeader>if,` with `maplocalleader` assigned by default to the coma `,`.\n\n##### Expression-condition surrounding mappings\nIn the same idea, `<LocalLeader><LocalLeader>if` surrounds the selection with `if (` and `) {\\n«»\\n}«»`.\n\n##### Other notes\nAll the three mode oriented mappings respect and force the indentation regarding the current setting and what was typed.\n\nMore precisely, regarding the value of the buffer relative option b:usemarks (_cf._ [lh-brackets](http://github.com/LucHermitte/lh-brackets)), `if` could be expanded into:\n```C++\nif () {\n    «»\n}«»\n```\n\nThe exact style (Alman, Stroustroup, ...) regarding whether brackets are on a\nnew line, or not, can be tuned thanks to [lh-dev `:AddStyle` feature](http://github.com/LucHermitte/lh-dev#formatting-of-brackets-characters).\n\n#### Miscellaneous shortcuts\nNote: in all the following mappings, `,` is actually the localleader that\nlh-cpp sets to the comma characcter if it isn't set already.\n\n  * `tpl` expands into `template <<cursor>>«»` ;\n  * `<m-t>` inserts `typedef`, or `typename` depending on what is before the cursor ;\n  * `<m-r>` inserts `return`, and tries to correctly place the semicolon, and a placeholder, depending on what follows the cursor ;\n  * `<c-x>be`, `<c-x>rbe` replace `(foo<cursor>)` with `(foo.begin(),foo.end()<cursor>)` (or `rbegin`/`rend`) ;\n  * `<c->se`: attempt to fill-in a `switch-case` from an enumerated type ;\n  * `,sc` | `,dc` | `,rc` | `,cc` | `,lc` surround the selection with ; `static_cast<<cursor>>(<selection>)`, `dynamic_cast`, `reinterpret_cast`, `const_cast`, or `boost::lexical_cast` ;\n  * `,,sc` | `,,dc` | `,,rc` | `,,cc` try to convert the C-cast selected into the C++-cast requested ;\n  * `#d` expands into `#define`, `#i` into `#ifdef`, `#e` into `endif`, `#n` into `#include` ;\n  * `,0` surrounds the selected lines with `#if 0 ... #endif` ;\n  * `,1` surrounds the selected lines with `#if 0 ... #else ... #endif` ;\n  * `:KeepPoundIfPath 0` (or `1`) will clean a `#if 0/1...#else...#endif`\n    construct to match either the true or the false path.\n  * `pub` expands into `public:\\n`, `pro` expands into `protected:\\n`, `pri` expands into `private:\\n` ;\n  * `vir` expands into `virtual` ;\n  * `firend` is replaced by `friend` ;\n  * `<m-s>` inserts `std::`, `<m-b>` inserts `boost:` ;\n  * `?:` expands into `<cursor>? «» : «»;` ;\n  * `<C-X>i` will look for the symbol under the cursor (or selected) in the current ctag database and it will try to automatically include the header file where the symbol is defined.\n  * `<M-i>` will look for the symbol under the cursor (or selected) in the current ctag database and it will try to automatically prepend it with its missing complete scope.\n  *  `[[` and `][` and been overridden to jump to the start/end of the current\n     function -- the default mappings were defined in C in mind, and they are\n     unable of this. See the related `v_if` and `o_if` mappings from [lh-dev](http://github.com/LucHermitte/lh-dev/#function) -- [see the demo](blob/master/doc/screencast-select-function.gif).\n\n#### Templates\n  * All templates, snippets and wizards respect the naming convention set for\n    the current project thanks to\n    [lh-dev styling feature](http://github.com/LucHermitte/lh-dev#naming-conventions)\n    -- see my [project style template](http://github.com/LucHermitte/mu-template/blob/master/after/template/vim/internals/vim-rc-local-cpp-style.template)\n    for an idea of what is supported and possible.\n  * stream inserters, stream extractor, binary operators.\n  * [bool operator](doc/snippets.md#cppbool-operator): almost portable hack to\n    provide a boolean operator, strongly inspired by Matthew Wilson's\n    _Imperfect C++_.\n  * Generation of [enums](doc/Enums.md), and of switch-case statements from enum\n    definition.\n  * constructors: [`copy-constructor`](doc/snippets.md#cppcopy-constructor),\n    [`default-constructor`](doc/snippets.md#cppdefault-constructor),\n    [`destructor`](doc/snippets.md#cppdestructor),\n    [`assignment-operator`](doc/snippets.md#cppassignment-operator)\n    (see `:h :Constructor`).\n  * Various [standard types](doc/snippets.md#standard-and-boost-types) and\n    [functions](doc/snippets.md#standard-and-boost-functions-and-idioms) (and a\n    few from boost) have a snippet that'll automatically include the related\n    header file there are are defined. NB: at this time, inclusions are not\n    optimized as IncludeWhatYouUse would optimize them for us.\n  * When a snippet/template requires header files, they will get included\n    automatically (as long as the snippet specifies the headers files required)\n    ; note: so far this feature cannot detect whether a required header file is\n    already indirectly included through other included files.\n  * Some snippets will try to detect the C++11 dialect (98/03/11/14/17) in\n    order to adapt the result produced -- it will be done through the analysis\n    of the [option `(bg):cpp_std_flavour`](doc/option.md#bgcpp_std_flavour-and-cxxflags) , or\n    the analysis of `$CXXFLAGS`, or through the analysis of CMake `CXXFLAGS`\n    variables (this will require\n    [lh-cmake](http://github.com/LucHermitte/lh-cmake), and the project to be\n    configured to CMake.)\n\nI'll try to maintain an up-to-date [documentation](doc/snippets.md) of the\nsnippets as most of them have options.\n\n#### Wizards and other high-level features\n  * [class](doc/snippets.md#cppclass): builds a class skeleton based on the selected (simplified) semantics (value copyable, stack-based non copyable, entity non-copyable, entity clonable)\n  * [singleton](doc/snippets.md#cppsingleton): my very own way to define singletons based on my conclusions on this anti-pattern -- you may prefer Loki's or ACE's solutions\n  * [:DOX](doc/Doxygen.md): analyses a function signature (parameters, return type, throw specification) and provide a default Doxygenized documentation\n  * [:GOTOIMPL](doc/GotoImplementation.md), :MOVETOIMPL: search and jump to a function definition from its declaration, provide a default one in the _ad'hoc_ implementation file if no definition is found\n  * [:ADDATTRIBUTE](doc/Accessors.md): old facility that helps define const-correct accessors and mutator, will be reworked. [lh-refactor](http://github.com/LucHermitte/vim-refactor) provides more ergonomic mappings for this purpose.\n  * [:CppDisplayUnmatchedFunctions](doc/UmatchedFunctions.md), `<c-x>u`: shows the list of functions for which there is neither a declaration, nor a definition\n  * [:Override](doc/Override.md): Ask which inherited virtual function should be overridden in the current class (feature still in its very early stages)\n  * `:Constructor` (that takes the following parameters: `init`, `default`, `copy`, `assign`), or `:ConstructorInit`, `:ConstructorDefault`, `:ConstructorCopy`, `AssignmentOperator`. They'll analyse the list of know attributes (from a ctags database) to generate the related construction functions.\n\n### Syntax highlighting\n  * assign in condition (bad practice)\n  * catch by value (bad practice)\n  * throw specifications ([do you really know what they are about, and still want them?](http://www.gotw.ca/gotw/082.htm)), BTW they have been deprecated in C++11\n  * C casts in C++ (bad practice)\n  * cases that fall through the next one (code smell -- disabled by default)\n  * function definitions\n\n### Miscellaneous\n  * home like VC++: mappings that override `<home>` and `<end>` to mimic how these keys behave in VC++.\n  * omap-param: defines the o-mappings `,i` and `,a` to select the current parameter (in a list of parameters).\n  * SiR,\n  * lh-cpp imports a [C&C++ Folding plugin](https://github.com/LucHermitte/VimFold4C),\n    which is still experimental.\n  * [lh-dev](http://github.com/LucHermitte/lh-dev), which is required by\n    lh-cpp, provides a few commands like `:NameConvert` that permits to change\n    the naming style of a symbol. The possible styles are: `upper_camel_case`,\n    `lower_camel_case`, `snake`/`underscore`, `variable`, `local`, `global`,\n    `member`, `constant`, `static`, `param`, `getter`, `setter`)\n\n### Installation\n  * Requirements: Vim 7.+, [lh-vim-lib](https://github.com/LucHermitte/lh-vim-lib), [lh-style](https://github.com/LucHermitte/lh-style), [lh-brackets](https://github.com/LucHermitte/lh-brackets), [mu-template](https://github.com/LucHermitte/mu-template), [lh-dev](https://github.com/LucHermitte/lh-dev), [alternate-lite](https://github.com/LucHermitte/alternate-lite).\n  * With [vim-addon-manager](https://github.com/MarcWeber/vim-addon-manager), install lh-cpp. This is the preferred method because of the various dependencies.\n```vim\nActivateAddons lh-cpp\n```\n  * or with [vim-flavor](https://github.com/kana/vim-flavor) which also supports\n    dependencies:\n```\nflavor 'LucHermitte/lh-cpp'\n```\n  * or you can clone the git repositories (expecting I haven't forgotten anything):\n```\ngit clone git@github.com:LucHermitte/lh-vim-lib.git\ngit clone git@github.com:LucHermitte/lh-style.git\ngit clone git@github.com:LucHermitte/lh-tags.git\ngit clone git@github.com:LucHermitte/lh-dev.git\ngit clone git@github.com:LucHermitte/lh-brackets.git\ngit clone git@github.com:LucHermitte/searchInRuntime.git\ngit clone git@github.com:LucHermitte/mu-template.git\ngit clone git@github.com:tomtom/stakeholders_vim.git\ngit clone git@github.com:LucHermitte/alternate-lite.git\ngit clone git@github.com:LucHermitte/lh-cpp.git\n```\n  * or with Vundle/NeoBundle (expecting I haven't forgotten anything):\n```vim\nBundle 'LucHermitte/lh-vim-lib'\nBundle 'LucHermitte/lh-style'\nBundle 'LucHermitte/lh-tags'\nBundle 'LucHermitte/lh-dev'\nBundle 'LucHermitte/lh-brackets'\nBundle 'LucHermitte/searchInRuntime'\nBundle 'LucHermitte/mu-template'\nBundle 'tomtom/stakeholders_vim'\nBundle 'LucHermitte/alternate-lite'\nBundle 'LucHermitte/lh-cpp'\n```\n\n## Credits\n\nMany people have to be credited:\n  * the Vim & VimL gurus ;\n  * the people I've stolen scripts and functions from: Stephen Riehm, Michael\n    Sharpe, Georgi Slavchev, Johannes Zellner, Saul Lubkin ;\n  * the people that gave me many great ideas and even feedback: Gergely Kontra,\n    Leif Wickland, Robert Kelly IV [I've also stolen scripts from them] ;\n  * Thomas Ribo for his feedback and features-requirements.\n  * and many more that I have probably forgotten.\n\n## License\n\n  * Documentation is under CC-BY-SA 3.0\n  * lh-cpp is under GPLv3 with exceptions. See acompagning [license file](License.md), i.e.\n      * Plugin, snippets and templates are under GPLv3\n      * Most code generated from snippets (for control statements, proto\n        -> definition, accessors, ...) are under the License Exception\n        detailled in the [license file](License.md).\n      * However, code generated from the following wizards: `class`,\n        `singleton`, `enum` (1&2, switch, for), `abs-rel` -> is under Boost\n        Software Licence\n\n\n## See also\n  * [C++ tips on vim.wikia](http://vim.wikia.com/wiki/Category:C%2B%2B)\n  * c.vim\n  * **Project Management**: [local\\_vimrc](https://github.com/LucHermitte/local_vimrc)\n  * **Compilation**: [BuildToolsWrappers](http://github.com/LucHermitte/vim-build-tools-wrapper)\n  * **Errors Highlighting**: syntastic, [compil-hints](http://github.com/LucHermitte/vim-compil-hints) (a non-dynamic syntastic-lite plugin that'll only highlight errors found after a compilation stage)\n  * **CMake Integration**: [lh-cmake](https://github.com/LucHermitte/lh-cmake) + [local\\_vimrc](https://github.com/LucHermitte/local_vimrc) + [BuildToolsWrappers](http://github.com/LucHermitte/vim-build-tools-wrapper)\n  * **Refactoring**: refactor.vim, [my generic refactoring plugin](http://github.com/LucHermitte/vim-refactor)\n  * **Code Completion**: [YouCompleteMe](https://github.com/Valloric/YouCompleteMe), really, check this one!, or [OmniCppComplete](http://www.vim.org/scripts/script.php?script_id=1520), or [clang\\_complete](https://github.com/Rip-Rip/clang_complete)\n  * **Code Indexing**: [clang\\_indexer](https://github.com/LucHermitte/clang_indexer) and [vim-clang](https://github.com/LucHermitte/vim-clang), [lh-tags](http://github.com/LucHermitte/lh-tags)\n\n"
  },
  {
    "path": "Rakefile",
    "content": "#!/usr/bin/env rake\n\nrequire 'rspec/core/rake_task'\n\nRSpec::Core::RakeTask.new(:spec)\n\ntask :ci => [:dump, :install, :test]\n\ntask :default => :spec\n\ntask :dump do\n  sh 'vim --version'\nend\n\ntask :test    => :spec\n\ntask :spec do\n  # 'spec' is implicitly run as well\n  sh 'rspec ~/.vim-flavor/repos/LucHermitte_vim-UT/spec'\nend\n\n\ntask :install do\n  sh 'cat VimFlavor >> tests/VimFlavor'\n  sh 'cd tests && bundle exec vim-flavor install'\nend\n"
  },
  {
    "path": "VimFlavor",
    "content": "flavor 'LucHermitte/lh-vim-lib', '>= 4.1.0'\nflavor 'LucHermitte/lh-brackets', '>= 3.1.1'\nflavor 'LucHermitte/lh-style'\nflavor 'LucHermitte/lh-dev'\nflavor 'LucHermitte/mu-template', '>= 4.3.1'\nflavor 'LucHermitte/VimFold4C', '>= 3.0.9'\nflavor 'LucHermitte/alternate-lite', '>= 0.1.0'\n"
  },
  {
    "path": "addon-info.json",
    "content": "{\n  \"name\" : \"lh-cpp\",\n  \"version\" : \"dev\",\n  \"author\" : \"Luc Hermitte <http://github.com/LucHermitte>\",\n  \"maintainer\" : \"Luc Hermitte <http://github.com/LucHermitte>\",\n  \"repository\" : {\"type\": \"git\", \"url\": \"git@github.com:LucHermitte/lh-cpp.git\"},\n  \"dependencies\" : {\n      \"lh-vim-lib\" : {\"type\" : \"git\", \"url\" : \"git@github.com:LucHermitte/lh-vim-lib.git\"},\n      \"lh-brackets\" : {\"type\": \"git\", \"url\": \"git@github.com:LucHermitte/lh-brackets.git\"},\n      \"lh-dev\" : {\"type\": \"git\", \"git\": \"git@github.com:LucHermitte/lh-dev.git\"},\n      \"mu-template@lh\" : {\"type\": \"git\", \"url\": \"git@github.com:LucHermitte/mu-template.git\"},\n      \"alternate-lite\" : {\"type\": \"git\", \"url\": \"git@github.com:LucHermitte/alternate-lite.git\"},\n      \"VimFold4C\" : {\"type\": \"git\", \"url\": \"git@github.com:LucHermitte/VimFold4C.git\"}\n  },\n  \"description\" : \"C&C++ ftplugins suite\",\n  \"homepage\" : \"http://github.com/LucHermitte/lh-cpp\"\n}\n\n"
  },
  {
    "path": "after/template/c/assert.template",
    "content": "VimL:\" assert File Template, Luc Hermitte, 24th Sep 2015\nVimL:\" hint: assert()\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(&ft == \"cpp\" ? \"<cassert>\" : \"<assert.h>\")')\nassert(¡s:Surround(1, '<+assertion+>')¡);<+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/c/comment.template",
    "content": "VimL:\" comment File Template, Luc Hermitte <hermitte {at} free {dot} fr>, mer. 20 juil. 2016 11:30:01 CEST\nVimL:\" hint: #if 0 (#else) #endif\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:reindent     = 1\nMuT:  if s:content.count0 == 0\n#if 0\n<+s:Surround(1, lh#marker#txt(\"code;\"))+>\n#endif\nMuT:  else\nMuT:  let s:commented_lines = split(s:SurroundRaw(s:content.count0, lh#marker#txt(\"code;\")), \"\\n\")\nVimL: \" We store the lines into surround1&2 in order to avoid style application as s:Surround disables it\nVimL: let s:content.surround1 = join(s:commented_lines[: (s:content.count0-1)], \"\\n\")\nVimL: let s:content.surround2 = join(s:commented_lines[(s:content.count0) :], \"\\n\")\n#if 1\n<+s:Surround(1, lh#marker#txt(\"code;\"))+>\n#else\n<+s:Surround(2, lh#marker#txt(\"code;\"))+>\n#endif\nMuT:  endif\n\n"
  },
  {
    "path": "after/template/c/internals/c-header-content.template",
    "content": "VimL:\" Typical C++ header content, Luc Hermitte, 05th Sep 2019\nVimL:\" override content for header files for OTK like projects\nVimL: let s:default_text = empty(s:Args()) ? \"\" : (s:Args()[0])\nVimL: call s:Include('namespace-name', 'cpp/internals')\nMuT:  if !empty(s:namespace)\nVimL:   call s:Include('namespace', 'cpp', {'content': s:default_text, 'included': 1})\nMuT:  else\n<+default_text+>\nMuT:  endif\nVimL: call s:Include('post-namespace-header-content', 'cpp/internals')\n"
  },
  {
    "path": "after/template/c/rand_init.template",
    "content": "VimL:\" rand_init File Template, Luc Hermitte, 28th Oct 2014\nVimL:\" hint: srand(time(NULL));\nVimL: let s:reindent     = 1\nVimL: call s:AddPostExpandCallback('lh#dev#import#add_c_std(\"time\")')\nVimL: call s:AddPostExpandCallback('lh#dev#import#add_c_std(\"stdlib\")')\nsrand(time(NULL));\n"
  },
  {
    "path": "after/template/c/realloc.template",
    "content": "VimL:\" realloc File Template, Luc Hermitte, 20th Aug 2012\nVimL:\" hint: new_p = realloc(pn size); if (!new_p) {free(p); +reset all \nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:reindent     = 1\nVimL: silent! unlet s:_args\nVimL: let s:_args = empty(s:Args()) ? {} : (s:Args()[0])\nVimL: if (! has_key(s:_args, \"ptr\"))     | let s:_args.ptr     = lh#marker#txt(\"p\")    | endif\nVimL: if (! has_key(s:_args, \"lhs\"))     | let s:_args.lhs     = \"new_\".s:_args.ptr | endif\nVimL: if (! has_key(s:_args, \"type\"))    | let s:_args.type    = lh#marker#txt(\"T\")    | endif\nVimL: if (! has_key(s:_args, \"count\"))   | let s:_args.count   = lh#marker#txt(\"count\")| endif\nVimL: if (! has_key(s:_args, \"size\"))    | let s:_args.size    = s:_args.count.\" * sizeof(\".s:_args.type.\")\" | endif\nVimL: if (! has_key(s:_args, \"realloc\")) | let s:_args.realloc = \"realloc\"          | endif\nVimL: if (! has_key(s:_args, \"free\"))    | let s:_args.free    = \"free\"             | endif\nVimL: if (! has_key(s:_args, \"macro\"))   | let s:_args.macro   = \"\"                 | endif\nVimL: if (! has_key(s:_args, \"false\"))   | let s:_args.false   = \"false\"            | endif\n<+s:_args.type+> *<+s:_args.lhs+> = (<+s:_args.type+> *) <+s:_args.realloc+>(<+s:_args.ptr+>, <+s:_args.size+>);<+s:_args.macro+>\nif (! <+s:_args.lhs+>) {<+s:_args.macro+>\n\t<+s:_args.free+>(<+s:_args.ptr+>);<+s:_args.macro+>\n\t<+s:_args.ptr+> = NULL;<+s:_args.macro+>\n\t<+s:_args.count+> = 0;<+s:_args.macro+>\n\t<+error_message+>;<+s:_args.macro+>\n\treturn <+s:_args.false+>;<+s:_args.macro+>\n}<+s:_args.macro+>\n<+s:_args.ptr+> = <+s:_args.lhs+>;\n"
  },
  {
    "path": "after/template/cpp/abs-rel.template",
    "content": "VimL:\" Absolute and relative Classes Template, Luc Hermitte\nVimL:\" Used to define Date and Duration, Point and Distance, ...\nVimL:\" hint: Absolute/Relative classes (e.g. point/distance, date/duration, ...)\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = '¡'\nVimL: let s:reindent = 1\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:absclsname = inputdialog('Name of the \"absolute\" class ?')\nVimL: let s:relclsname = inputdialog('Name of the \"relative\" class ?')\nVimL: let s:sharedclsname = inputdialog('Name of the \"shared\" class ? (empty=none)', s:absclsname . lh#naming#param(\"Impl\"))\nVimL: let s:issharingimpl = ! empty(s:sharedclsname)\nVimL: let s:defaultisenough = lh#ui#confirm( \"Are the implicitly generated default constructor, copy-constructor, destructor, and assignement operatror enough?\", \"&Yes\\n&No\", 1) == 1\nVimL: let s:istemplate = lh#ui#confirm(\"Are the classes template ?\", \"&Yes\\n&No\", 2) == 1\nVimL: let s:tmpl_type = lh#marker#txt(\"T\")\nVimL: let s:tmpl_decl = lh#ui#if(s:istemplate, \"template <\".lh#marker#txt(\"typename\").\" \".s:tmpl_type.\"> \", \"\")\nVimL: let s:tmpl = lh#ui#if(s:istemplate, \"<\".s:tmpl_type.\">\", \"\")\nVimL: let s:tmpl2_type = lh#marker#txt(\"U\")\nVimL: let s:tmpl2_decl = lh#ui#if(s:istemplate, \"template <\".lh#marker#txt(\"typename\").\" \".s:tmpl2_type.\">\\n\", \"\")\nVimL: let s:tmpl2 = lh#ui#if(s:istemplate, \"<\".s:tmpl2_type.\">\", \"\")\nVimL: let s:typename = lh#ui#if(s:istemplate, \"typename \", \"\")\nVimL: let s:lhs = lh#naming#param(\"lhs\")\nVimL: let s:rhs = lh#naming#param(\"rhs\")\nVimL: let s:coeff = lh#naming#param(\"coeff\")\nVimL:\"\nVimL:\"\n<+s:tmpl_decl+>class <+s:absclsname+>;\n<+s:tmpl_decl+>class <+s:relclsname+>;\nVimL: if s:issharingimpl | call s:Include('abs-rel-shared', 'cpp/internals') | endif\n/**\n * <+lh#dox#brief('')+>\n *\n * <+doc+>\n *\n * <+@invariants+>\n *\n * <p><b>Semantics</b><br>\n * <li> Value, mathematical: it's an absolute position\n * <li> <+absolute position+>\n * <+ <li> sem+>\n *\n * @version ¡'$'¡revision$\n * <+lh#dox#author()+>\n */\nVimL: let s:super = \"DETAILS::\".s:sharedclsname.s:tmpl\nVimL: let s:inh = lh#ui#if(s:issharingimpl, \"\\n: \".s:super.\"(\".lh#marker#txt(\"params\").\")\", \"\\n\".lh#marker#txt(\" \"))\n<+s:tmpl_decl+>class ¡s:absclsname.lh#ui#if(s:issharingimpl, \" : protected \".s:super, \"\")¡\n{\npublic:\n    friend class <+s:relclsname+><+s:tmpl+>;\n    typedef ¡lh#ui#if(s:issharingimpl, s:typename.s:super.\"::scalar_type\", \"<+scalar_type+>\")¡ scalar_type;\n\n    /**@name Construction/destruction\n     */\n    //@{\n    /** Initialisation constructor.\n     */\n    <+s:absclsname+>(<+parameters+>)¡lh#ui#if(s:istemplate, s:inh.\"{<++>}\", \";\")¡\n    ¡lh#cpp#abs_rel#canonicalortodoxform(s:absclsname, ! s:defaultisenough)¡\n    //@}\n\n    /**@name Operators\n     */\n    //@{\n    <+s:absclsname+> & operator+=(¡s:relclsname.s:tmpl¡ const& <+s:rhs+>)¡lh#ui#if(s:issharingimpl, \" { this->add(\".(s:rhs).\"); return *this; }\", lh#ui#if(s:istemplate, \"<++>\", \";\"))¡\n    <+s:absclsname+> & operator-=(¡s:relclsname.s:tmpl¡ const& <+s:rhs+>)¡lh#ui#if(s:issharingimpl, \" { this->dec(\".(s:rhs).\"); return *this; }\", lh#ui#if(s:istemplate, \"<++>\", \";\"))¡\n\n    static <+s:super+> const diff(<+s:absclsname+> const& <+s:lhs+>, <+s:absclsname+> const& <+s:rhs+>)\n    {\n        <+s:super+> tmp(<+s:lhs+>);\n        tmp.dec(<+s:rhs+>);\n        return tmp;\n    }\n    friend bool operator==(<+s:absclsname+> const& <+s:rhs+>, <+s:absclsname+> const& <+s:lhs+>)¡lh#ui#if(s:issharingimpl, \"\\n{ return \".s:absclsname.\"::isEqual(\".(s:rhs).\", \".(s:lhs).\"); }\", ';')¡\n    //@}\n};\n\n/**\n * <+lh#dox#brief('')+>\n *\n * <+doc+>\n *\n * <+@invariants+>\n *\n * <p><b>Semantics</b><br>\n * <li> Value, mathematical: it's relative position\n * <li> <+relative position+>\n * <+ <li> sem+>\n *\n * @version ¡'$'¡revision$\n * <+lh#dox#author()+>\n */\n<+s:tmpl_decl+>class ¡s:relclsname.lh#ui#if(s:issharingimpl, \" : protected \".s:super, \"\")¡\n{\npublic:\n    friend class <+s:absclsname+><+s:tmpl+>;\n    typedef ¡lh#ui#if(s:issharingimpl, s:typename.s:super.\"::scalar_type\", \"<+scalar_type+>\")¡ scalar_type;\n\n    /**@name Construction/destruction\n     */\n    //@{\n    /** Initialisation constructor.\n     */\n    <+s:relclsname+>(<+parameters+>)¡lh#ui#if(s:istemplate, s:inh.\"{<++>}\", \";\")¡\n    ¡lh#cpp#abs_rel#canonicalortodoxform(s:relclsname, ! s:defaultisenough)¡\n    //@}\n\n    /**@name Operators\n     */\n    //@{\n    <+s:relclsname+> & operator+=(<+s:relclsname+> const& <+s:rhs+>)¡lh#ui#if(s:issharingimpl, \" { this->add(\".(s:rhs).\"); return *this; }\", \";\")¡\n    <+s:relclsname+> & operator-=(<+s:relclsname+> const& <+s:rhs+>)¡lh#ui#if(s:issharingimpl, \" { this->dec(\".(s:rhs).\"); return *this; }\", \";\")¡\n    <+s:relclsname+> & operator*=(scalar_type <+s:coeff+>)¡lh#ui#if(s:issharingimpl, \"{ this->mult(\".(s:coeff).\"); return *this; }\", \";\")¡\n    <+s:relclsname+> & operator/=(scalar_type <+s:coeff+>)¡lh#ui#if(s:issharingimpl, \"{ this->div(\".(s:coeff).\"); return *this; }\", \";\")¡\n\n    friend bool operator==(<+s:relclsname+> const& <+s:rhs+>, <+s:relclsname+> const& <+s:lhs+>)¡lh#ui#if(s:issharingimpl, \"\\n{ return \".s:relclsname.\"::isEqual(\".(s:rhs).\", \".(s:lhs).\"); }\", \";\")¡\n\n    <+s:tmpl2_decl+>friend ¡s:relclsname.s:tmpl2¡ const operator-(¡s:absclsname.s:tmpl2¡ const& <+s:lhs+>, ¡s:absclsname.s:tmpl2¡ const& <+s:rhs+>);\n    //@}\n\n    protected:\n    explicit <+s:relclsname+>(<+s:super+> const& <+s:rhs+>) : <+s:super+>(<+s:rhs+>) {}\n};\n\n<+s:tmpl_decl+>inline\n¡s:relclsname.s:tmpl¡ operator-(\n        ¡s:absclsname.s:tmpl¡ const& <+s:lhs+>,\n        ¡s:absclsname.s:tmpl¡ const& <+s:rhs+>)\n{ return ¡s:relclsname.s:tmpl¡(¡s:absclsname.s:tmpl¡::diff(<+s:lhs+>, <+s:rhs+>)); }\n\n<+s:tmpl_decl+>inline\n¡s:absclsname.s:tmpl¡ operator+(\n        ¡s:absclsname.s:tmpl¡        <+s:lhs+>,\n        ¡s:relclsname.s:tmpl¡ const& <+s:rhs+>)\n{ return <+s:lhs+> += <+s:rhs+>; }\n\n<+s:tmpl_decl+>inline\n¡s:absclsname.s:tmpl¡ operator+(\n        ¡s:relclsname.s:tmpl¡ const& <+s:lhs+>,\n        ¡s:absclsname.s:tmpl¡        <+s:rhs+>)\n{ return <+s:rhs+> += <+s:lhs+>; }\n\n<+s:tmpl_decl+>inline\n¡s:absclsname.s:tmpl¡ operator-(\n        ¡s:absclsname.s:tmpl¡        <+s:lhs+>,\n        ¡s:relclsname.s:tmpl¡ const& <+s:rhs+>)\n{ return <+s:lhs+> -= <+s:rhs+>; }\n\n#if 0\n// Makes no sense\n<+s:tmpl_decl+>inline\n¡s:absclsname.s:tmpl¡ const operator-(\n        ¡s:relclsname.s:tmpl¡ const& <+s:lhs+>,\n        ¡s:absclsname.s:tmpl¡ const& <+s:rhs+>);\n#endif\n\n<+s:tmpl_decl+>inline\n¡s:relclsname.s:tmpl¡ operator+(\n        ¡s:relclsname.s:tmpl¡        <+s:lhs+>,\n        ¡s:relclsname.s:tmpl¡ const& <+s:rhs+>)\n{ return <+s:lhs+> += <+s:rhs+>; }\n\n<+s:tmpl_decl+>inline\n¡s:relclsname.s:tmpl¡ operator-(\n        ¡s:relclsname.s:tmpl¡        <+s:lhs+>,\n        ¡s:relclsname.s:tmpl¡ const& <+s:rhs+>)\n{ return <+s:lhs+> -= <+s:rhs+>; }\n\n<+s:tmpl_decl+>inline\n¡s:relclsname.s:tmpl¡ operator*(\n        ¡s:relclsname.s:tmpl¡              <+s:lhs+>,\n        ¡s:typename.s:relclsname.s:tmpl¡::scalar_type <+s:rhs+>)\n{ return <+s:lhs+> *= <+s:rhs+>; }\n\n<+s:tmpl_decl+>inline\n¡s:relclsname.s:tmpl¡ operator*(\n        ¡s:typename.s:relclsname.s:tmpl¡::scalar_type <+s:lhs+>,\n        ¡s:relclsname.s:tmpl¡              <+s:rhs+>)\n{ return <+s:rhs+> *= <+s:lhs+>; }\n\n<+s:tmpl_decl+>inline\n¡s:relclsname.s:tmpl¡ operator/(\n        ¡s:relclsname.s:tmpl¡              <+s:lhs+>,\n        ¡s:typename.s:relclsname.s:tmpl¡::scalar_type <+s:rhs+>)\n{ return <+s:lhs+> /= <+s:rhs+>; }\n\n<+s:tmpl_decl+>inline\n¡s:relclsname.s:tmpl¡ operator/(\n        ¡s:typename.s:relclsname.s:tmpl¡::scalar_type <+s:lhs+>,\n        ¡s:relclsname.s:tmpl¡              <+s:rhs+>)\n{ return <+s:rhs+> /= <+s:lhs+>; }\n\n"
  },
  {
    "path": "after/template/cpp/abstract-class.template",
    "content": "VimL:\" abstract-class File Template, Luc Hermitte <hermitte {at} free {dot} fr>, 25th Nov 2015\nVimL:\" hint: Abstract (base) class to inherit from\nMuT:  let s:destructor = s:Param('destructor', {})\nVimL: \" -- Override any previous setting on visibility and 'how'\nVimL: let s:destructor['visibility'] = 'public'\nVimL: let s:destructor['how'] = 'pure'\nVimL: \" --- Defines Doxygen comments\nMuT:  let s:parameters = s:Param('cls_parameters', {})\nVimL: call lh#dict#add_new(s:parameters, {'comments': {}})\nMuT:  let s:cls_comments = s:parameters.comments\nVimL: \" Don't add \"Abstract\" if this is an interface\nMuT:  if index(get(s:cls_comments, 'semantics', []), 'Interface') < 0\nVimL:   let s:cls_comments.semantics = get(s:cls_comments, 'semantics', [])+['Abstract']\nMuT:  endif\nVimL: \" --- Insert the skeleton built\nVimL: call s:Include('base-class', 'cpp', {'cls_parameters': s:parameters})\n"
  },
  {
    "path": "after/template/cpp/array_size.template",
    "content": "VimL:\" array_size definition File Template, Luc Hermitte, 25th Apr 2014\nVimL:\" hint: std::extent<decltype(tab)>::value\nVimL: let s:value_start = 'Â¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nMuT:  let s:array_size = lh#ft#option#get('array_size', &ft)\nMuT:  if lh#option#is_unset(s:array_size) && lh#cpp#use_cpp17()\nMuT:      let s:array_size = {'file': '<iterator>', 'funcname': 'std::size(%1)'}\nMuT:  endif\nMuT:  if lh#option#is_set(s:array_size)\nVimL:     call s:AddPostExpandCallback('lh#dev#import#add(s:array_size.file)')\nMuT:      let s:_array_size = s:array_size.funcname\nMuT:  elseif lh#cpp#use_cpp11()\nVimL:     call s:AddPostExpandCallback('lh#dev#import#add(\"<type_traits>\")')\nMuT:      let s:_array_size = 'std::extent<decltype(%1)>::value'\nMuT:      let s:restore_style = lh#on#exit().restore('s:content.can_apply_style')\nVimL:     let s:content.can_apply_style = 0\n// You may want instead to define the missing std::size() in a header file\n//   template <typename T, std::size_t N>\n//   constexpr std::size_t size(T (&)[N]) noexcept { return N ;}\n// And include this file instead.\n// In you have such a file ready to be used, please set\n//    let b:cpp_array_size = {'file': 'theheader to include', 'funcname': 'std::size(%1)' }\n// in your vim project configuration file (_vimrc_local.vim...)\nVimL:      call s:restore_style.finalize()\nMuT:  else\nMuT:      let s:restore_style = lh#on#exit().restore('s:content.can_apply_style')\nVimL:     let s:content.can_apply_style = 0\n// You may want instead to define the following in a header file\n// and include this file instead.\n// Then set\n//    let b:cpp_array_size = {'file': 'theheader to include', 'funcname': 'array_size(%1)' }\n// in your vim project configuration file (_vimrc_local.vim...)\nVimL:      call s:restore_style.finalize()\nnamespace{\n    template<typename T, std::size_t N>\n        char (&array_size_helper(T (&)[N]))[N];\n}// namespace\n#define array_size(array) (sizeof ::array_size_helper(array))\nMuT:      let s:_array_size = 'array_size(%1)'\nMuT:  endif\n<+lh#fmt#printf(s:_array_size, s:Surround(1, s:Param(\"array\", lh#marker#txt('array'))))+>\n"
  },
  {
    "path": "after/template/cpp/assignment-operator.template",
    "content": "VimL:\" assignment-operator File Template, Luc Hermitte, 21st Aug 2011\nVimL:\" hint: T& operator=(T const&);\nVimL: \"TODO: support noexcept\nVimL: let s:marker_open  = \"<+\"\nVimL: let s:marker_close = \"+>\"\nVimL: let s:reindent     = 1\nVimL: call s:Include('get-class-name', 'cpp/internals')\nVimL: let s:how = get(s:Param(\"assignment-operator\", {}), \"how\", \"\")\nMuT:  if s:how =~ \"deleted\\\\|defaulted\"\n<+s:clsname+>& operator=(<+s:clsname+> const&) <+lh#cpp#snippets#{s:how}()+>;\nMuT:  else\nMuT:    let s:use_copyandswap0 =  s:Param('use_copy_and_swap', lh#option#get('cpp_use_copy_and_swap'))\nVimL:   let s:use_copyandswap =  lh#option#is_set(s:use_copyandswap0) ? s:use_copyandswap0 : lh#ui#confirm(\"Use copy-and-swap idiom?\", \"Yes\\nNo\", 1)\nMuT:    if 1 == s:use_copyandswap\nVimL:     call s:Include(\"copy-and-swap\",\"cpp\", s:clsname)\nMuT:    else\nVimL:     let s:rhs = lh#naming#param(\"rhs\")\nVimL:     let s:fn_comments = { }\nVimL:     let s:fn_comments.brief = \"Assignment operator\"\nVimL:     let s:fn_comments.param = [{\"dir\": \"in\", \"name\": (s:rhs), \"text\": \"source data to be copied.\" } ]\nVimL:     let s:fn_comments.throw = {\"optional\": 1}\nVimL:     call s:Include(\"function-comment\", \"cpp/internals\",s:fn_comments)\nMuT:      let s:attributes = s:Param(\"attributes\", lh#option#unset())\nMuT:      if lh#option#is_set(s:attributes) && !empty(s:attributes)\nMuT:        let s:definition = '{'.join(map(copy(s:attributes), 'lh#naming#member(v:val.name).\" = \".lh#cpp#snippets#duplicate_param(s:rhs.\".\".lh#naming#member(v:val.name), v:val.type).\";\"'), \"\\n\").'}'\nMuT:      else\nMuT:        let s:definition = ';'\nMuT:      endif\n<+s:clsname+>& operator=(<+s:clsname+> const& <+s:rhs+>)<+s:definition+>\nMuT:    endif\nMuT: endif\n"
  },
  {
    "path": "after/template/cpp/auto_ptr-instance.template",
    "content": "VimL:\" unique_ptr File Template, Luc Hermitte, 22nd May 2014\nVimL:\" hint: std::auto_ptr<T> ptr(new T(args));\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<memory>\")')\nstd::auto_ptr<¡s:Surround(1, '<+type+>')¡> <+ptr+>(new ¡s:Surround(1, '<+type+>')¡(<+args+>));\n"
  },
  {
    "path": "after/template/cpp/auto_ptr.template",
    "content": "VimL:\" unique_ptr File Template, Luc Hermitte, 22nd May 2014\nVimL:\" hint: std::auto_ptr<>\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<memory>\")')\nstd::auto_ptr<¡s:Surround(1, '<+type+>')¡><+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/cpp/b-e.template",
    "content": "VimL:\" b-e File Template, Luc Hermitte, 30th Jun 2011\nVimL:\" hint: <+container+>.begin(), <+container+>.end()\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:Include('get-b-e', 'cpp/internals')\n<+s:begin+>, <+s:end+><++>\n"
  },
  {
    "path": "after/template/cpp/base-class-non-virtual.template",
    "content": "VimL:\" base-class-non-virtual File Template, Luc Hermitte <hermitte {at} free {dot} fr>, 25th Nov 2015\nVimL:\" hint: Base class to inherit from, but not delete -- Non-copiable entity\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: \" Set default-constructor to protected if not already set\nMuT:  let s:default_constructor = s:Param('default-constructor', {})\nVimL: call lh#dict#add_new(s:default_constructor, {'visibility': 'protected'})\nVimL: \" Force destructor to protected, (and not how)\nVimL: let s:destructor = s:Param('destructor', {})\nVimL: let s:destructor['visibility'] = 'protected'\nVimL: call s:Include('entity-class', 'cpp')\n"
  },
  {
    "path": "after/template/cpp/base-class.template",
    "content": "VimL:\" base-class File Template, Luc Hermitte <hermitte {at} free {dot} fr>, 25th Nov 2015\nVimL:\" hint: Base class to inherit from -- Not necessarily abstract, Non-copiable entity\nVimL: \" Set default-consructor to protected if not already set\nMuT:  let s:default_constructor = s:Param('default-constructor', {})\nVimL: call lh#dict#add_new(s:default_constructor, {'visibility': 'protected'})\nVimL: \" Set destructor to public, (and no how), if not already set\nMuT:  let s:destructor = s:Param('destructor', {})\nVimL: call lh#dict#add_new(s:destructor, {'how': ''})\nVimL: call lh#dict#add_new(s:destructor, {'visibility': 'public'})\nVimL: \" Force virtual!\nVimL: let s:destructor['virtual'] = 1\nVimL: call s:Include('entity-class', 'cpp')\n"
  },
  {
    "path": "after/template/cpp/benchmark.template",
    "content": "VimL:\" google-benchmark File Template, Luc Hermitte, 27th Oct 2015\nVimL:\" hint: static void BM_<+test+>(benchmark::State & state) {\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nstatic void BM_<+bench+>(benchmark::State & state) {\n    while (state.KeepRunning()) {\n        <++>\n    }\n}\nBENCHMARK(BM_<+bench+>);\n"
  },
  {
    "path": "after/template/cpp/bool-operator.template",
    "content": "VimL:\" bool-operator Template, Luc Hermitte\nVimL:\" hint: safe bool operator\nVimL: let s:reindent     = 1\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL:\"\nVimL:\" @pre must be within a class/struct context\nVimL:\" @todo propose other approaches (Don Box's, safe_bool, void*, ...)\n\nstruct boolean{ int i;};\n/** Is the data <+valid+> ?.\n * \n * Hack to provide a boolean operator that is convertible only to a\n * boolean expression to be used in \\c if tests.\n * @see <em>Imperfect C++</em>, Matthew Wilson, Addisson-Welsey, 24.6\n * <+@since +>\n */\noperator int boolean ::* () const<+C_nl_before_curlyB()+>{\n    return <+isValid()+> ? &boolean::i : 0;\n}\n\n"
  },
  {
    "path": "after/template/cpp/catch.template",
    "content": "VimL:\"{catch(...){...}} Template-File, Luc Hermitte\nVimL:\" hint: catch(...){...}\nVimL: let s:value_start  = '¡'\nVimL: let s:value_end    = '¡'\nVimL: let s:reindent     = 1 \nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\ncatch(<+...+>){\n    ¡s:Surround(1, '<+catch-code+>')¡\n}<++>\n"
  },
  {
    "path": "after/template/cpp/cerr.template",
    "content": "VimL:\" cerr File Template, Luc Hermitte, 28th Apr 2014\nVimL:\" hint: std::cerr\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<iostream>\")')\nstd::cerr << <++>;\n"
  },
  {
    "path": "after/template/cpp/chrono-how-long.template",
    "content": "VimL:\" chrono-how-long File Template, Luc Hermitte <hermitte {at} free {dot} fr>, 24th Apr 2019\nVimL:\" hint: Compute duration\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:reindent     = 1\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<chrono>\")')\nconst auto <+start+> = std::chrono::system_clock::now();\n¡s:Surround(1, '<++>')¡\nconst auto <+end+> = std::chrono::system_clock::now();\nconst auto elapsed_seconds = std::chrono::duration<double>(<+end+> - <+start+>).count();\n"
  },
  {
    "path": "after/template/cpp/cin.template",
    "content": "VimL:\" cin File Template, Luc Hermitte, 28th Apr 2014\nVimL:\" hint: std::cin\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<iostream>\")')\nstd::cin >> <++>;\n"
  },
  {
    "path": "after/template/cpp/class.template",
    "content": "VimL:\" C++ Class Template, Luc Hermitte\nVimL:\" hint: Simplistic class snippet -- unaware of semantics\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = '¡'\nVimL: let s:reindent = 1\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nMuT:  let s:parameters = s:Param('cls_parameters', {})\nVimL: \" --- in case the class name is already known, no need to extract it\nVimL: call s:Include('get-class-name', 'cpp/internals')\nVimL: \" --- Defines Doxygen comments\nMuT:  let s:cls_comments = lh#dict#add_new(s:parameters, {'comments': {}}).comments\nMuT:  let s:cls_comments = s:parameters.comments\nVimL: \" --- Insert the skeleton built\nVimL: call s:Include('class-skeleton', 'cpp/internals', s:parameters)\n"
  },
  {
    "path": "after/template/cpp/clonable-class.template",
    "content": "VimL:\" clonable-class File Template, Luc Hermitte <hermitte {at} free {dot} fr>, 27th Nov 2015\nVimL:\" hint: Base class with clone function -- duplicable object within a hierarchy\nMuT:  \"let s:clsname     = s:Param('clsname', lh#marker#txt(lh#naming#type(expand('%:t:r'))))\nVimL: call s:Include('get-class-name', 'cpp/internals')\nMuT:  let s:functions = s:Param('functions', lh#cpp#snippets#new_function_list())\nMuT:  let s:parents     = s:Param('parents', [])\nMuT:  let s:pub_parents = filter(copy(s:parents), '!empty(lh#cpp#snippets#_filter_functions(v:val, \"public\"))')\nMuT:  let s:clone_funcname = lh#naming#function('clone')\nVimL: \" s:clsname in not yet under ctags DB, but fortunately we know the first level parents\nMuT:  let s:root_clones = lh#cpp#override#root_function(lh#list#flatten(map(copy(s:pub_parents), 'keys(v:val)')), s:clone_funcname)\nVimL: let g:root_clones = s:root_clones\nMuT:  if !empty(s:root_clones)\nMuT:    let s:override = ' '.lh#cpp#snippets#override()\nMuT:    let s:static_type = s:root_clones[-1].class\nVimL:   call s:functions.insert({'kind': 'init-constructor', 'parameters': lh#option#unset()})\nVimL:   \" Remove default-consructor unless already set visible\nMuT:    let s:default_constructor = s:Param('default-constructor', {})\nVimL:   call lh#dict#add_new(s:default_constructor, {'visibility': 'none'})\nMuT:  else\nMuT:    let s:override = ''\nMuT:    let s:static_type = s:clsname\nMuT:  endif\nMuT:  let s:ret_type = lh#cpp#snippets#return_ptr_type(s:static_type)\nMuT:  let s:copy_constructor = s:Param('copy-constructor', {})\nVimL: let s:copy_constructor.visibility = 'protected'\nVimL: \" TODO \"how\" will eventually depend on detected non-copyable attributes\nVimL: let s:copy_constructor.how        = 'defaulted'\nVimL: \" TODO: if abstract class => pure virtual clone function\nVimL: call s:functions.add([{'signature': 'virtual '.s:ret_type.' '.s:clone_funcname.'() const'.s:override, 'implementation': 'return '.lh#cpp#snippets#make_ptr(s:clsname, s:static_type, '*this').';'}])\nVimL: \" --- Defines Doxygen comments\nMuT:  let s:parameters = s:Param('cls_parameters', {})\nVimL: call lh#dict#add_new(s:parameters, {'comments': {}})\nMuT:  let s:cls_comments = s:parameters.comments\nVimL: let s:cls_comments.semantics = get(s:cls_comments, 'semantics', [])+['Clonable (but not assignable)']\nVimL: \" --- Insert the skeleton built\nVimL: call s:Include('base-class', 'cpp')\n"
  },
  {
    "path": "after/template/cpp/copy-and-swap.template",
    "content": "VimL:\" copy-and-swap File Template, Luc Hermitte, 21st Aug 2011\nVimL:\" hint: assign op + swap\nVimL: \" todo: recognize C++11 in order to add the proper nothrow specification\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:reindent     = 1\nVimL: \" in case the class name is already known, no need to extract it\nVimL: call s:Include('get-class-name', 'cpp/internals')\nVimL:\"\nVimL: let s:rhs = lh#naming#param(\"rhs\")\nVimL: let s:fn_comments = lh#dox#new_function(\"Assignment operator\")\nVimL: let s:fn_comments.text  = []\nVimL: let s:fn_comments.note  = [] \" => empty line\nVimL: let s:fn_comments.note += [\"based on copy-and-swap idiom, with copy-elision exploited\"]\nVimL: let s:fn_comments.note += [\"exception-safe\"]\nVimL: let s:fn_comments.param = [{\"dir\": \"in\", \"name\": (s:rhs), \"text\": \"source data to be copied.\" } ]\nVimL: let s:fn_comments.throw = {\"optional\": 1}\nVimL: call s:Include(\"function-comment\", \"cpp/internals\",s:fn_comments)\n<+s:clsname+>& operator=(<+s:clsname+> <+s:rhs+>){\n    this->swap(<+s:rhs+>);\n    return *this;\n}\nVimL: call s:Include('swap-function', 'cpp')\n"
  },
  {
    "path": "after/template/cpp/copy-back_inserter.template",
    "content": "VimL:\" copy-back_inserter File Template, Luc Hermitte, 23rd May 2014\nVimL:\" hint: std::copy(orig.begin(), orig.end(), std::back_inserter(dest));\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:reindent     = 1\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<algorithm>\")')\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<iterator>\")')\nVimL: let s:orig = s:Surround(1, s:Param('origin', lh#marker#txt('origin')))\nVimL: let s:dest = s:Surround(2, s:Param('destination', lh#marker#txt('destination')))\nstd::copy(<+s:orig+>.begin(),<+s:orig+>.end(), std::back_inserter(<+s:dest+>));\nVimL: unlet s:orig\nVimL: unlet s:dest\n"
  },
  {
    "path": "after/template/cpp/copy-constructor.template",
    "content": "VimL:\" copy-constructor File Template, Luc Hermitte, 21st Aug 2011\nVimL:\" hint: T(T const&);\nVimL: let s:marker_open  = \"<+\"\nVimL: let s:marker_close = \"+>\"\nVimL: let s:reindent     = 1\nVimL: call s:Include('get-class-name', 'cpp/internals')\nVimL: let s:how = get(s:Param(\"copy-constructor\", {}), \"how\", \"\")\nMuT:  if s:how =~ \"deleted\\\\|defaulted\"\n<+s:clsname+>(<+s:clsname+> const&) <+lh#cpp#snippets#{s:how}()+>;\nMuT:  else\nVimL:   let s:lead = lh#dox#comment_leading_char().\" \"\nVimL:   let s:param = lh#naming#param(\"rhs\")\nVimL:   let s:fn_comments = { }\nVimL:   let s:fn_comments.brief = \"Copy constructor.\"\nVimL:   let s:fn_comments.throw = {\"optional\": 1}\nVimL:   \" let s:fn_comments.text  = []\nVimL:   let s:fn_comments.param = [{\"dir\": \"in\", \"name\": (s:param), \"text\": \"source data to be copied.\" } ]\nVimL:   call s:Include(\"function-comment\", \"cpp/internals\",s:fn_comments)\nMuT:    let s:attributes = s:Param(\"attributes\", lh#option#unset())\nMuT:    if lh#option#is_set(s:attributes) && !empty(s:attributes)\nMuT:      let s:definition = (len(s:attributes)>1?\"\\n\": \"\").\": \".join(map(copy(s:attributes), 'lh#naming#member(v:val.name).\"(\".lh#cpp#snippets#duplicate_param(s:param.\".\".lh#naming#member(v:val.name), v:val.type).\")\"'), \"\\n, \").'{}'\nMuT:    else\nMuT:      let s:definition = ';'\nMuT:    endif\n<+s:clsname+>(<+s:clsname+> const& <+s:param+>)<+s:definition+>\nMuT:  endif\n"
  },
  {
    "path": "after/template/cpp/copy.template",
    "content": "VimL:\" std::copy File Template, Luc Hermitte, 04th Nov 2015\nVimL:\" hint: std::copy(first, last, dest)\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<algorithm>\")')\nMuT:  let s:container = s:SurroundableParam('container', 1)\nstd::copy(<+s:container+>.begin(),<+s:container+>.end(), <+dest+>);\nVimL: unlet s:container\n"
  },
  {
    "path": "after/template/cpp/cout.template",
    "content": "VimL:\" cout File Template, Luc Hermitte, 28th Apr 2014\nVimL:\" hint: std::cout\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<iostream>\")')\nstd::cout << <++>;\n"
  },
  {
    "path": "after/template/cpp/default-constructor.template",
    "content": "VimL:\" default-constructor File Template, Luc Hermitte, 21st Aug 2011\nVimL:\" hint: T();\nVimL: let s:marker_open  = \"<+\"\nVimL: let s:marker_close = \"+>\"\nVimL: let s:reindent     = 1\nVimL: call s:Include('get-class-name', 'cpp/internals')\nVimL: let s:lead = lh#dox#comment_leading_char().' '\nVimL: let s:default_constructor = s:Param('default-constructor', {})\nVimL: let s:how = get(s:default_constructor, 'how', '')\nMuT:  if s:how !~ 'defaulted\\|deleted'\nMuT:    let s:fn_comments = get(s:default_constructor, 'comments', {})\nVimL:   call lh#dict#add_new(s:fn_comments, {'brief': 'Default constructor.'})\nVimL:   call lh#dict#add_new(s:fn_comments, {'throw': {'optional': 1}})\nVimL:   call s:Include('function-comment', 'cpp/internals',s:fn_comments)\nMuT:  else\nVimL:   let s:how = ' '.lh#cpp#snippets#{s:how}()\nMuT:  endif\n<+s:clsname+>()<+s:how+>;\n"
  },
  {
    "path": "after/template/cpp/destructor.template",
    "content": "VimL:\" destructor File Template, Luc Hermitte, 23rd Mar 2012\nVimL:\" hint: ~T();\nVimL: let s:marker_open  = \"<+\"\nVimL: let s:marker_close = \"+>\"\nVimL: let s:reindent     = 1\nVimL: call s:Include('get-class-name', 'cpp/internals')\nMuT:  let s:destructor = s:Param('destructor', lh#option#unset())\nMuT:  if lh#option#is_set(s:destructor)\nMuT:      let s:virtual    = get(s:destructor, 'virtual', 0)\nMuT:      let s:how        = get(s:destructor, 'how', '')\nVimL:     let s:visibility = get(s:destructor, 'visibility', 'public')\nVimL:     \" Let's suppose s:clsname is set\nMuT:  else\nMuT:    let s:virtual      = lh#marker#txt('virtual ')\nVimL:   let s:how          = ''\nVimL:   \" TODO: autodetect last visibility\nVimL:   let s:visibility   = 'public'\nMuT:  endif\nMuT:  let s:virtual = type(s:virtual) == type('str') ? s:virtual : ((s:virtual) ? 'virtual ' : '')\nMuT:  let s:how = s:how =~ '\\vpure|deleted|defaulted' ? ' '.lh#cpp#snippets#{s:how}() : ''\nMuT:  let s:fn_comments = get(s:destructor, 'comments', {})\nVimL: call lh#dict#add_new(s:fn_comments, {'brief': substitute(s:virtual.'Destructor.', '\\v(.)(.*)', '\\u\\1\\L\\2', '')})\nMuT:  if s:visibility == 'protected'\nVimL:     let s:fn_comments.note = ['This class is not meant to be destroyed polymorphically']\nMuT:  elseif empty(s:virtual)\nVimL:     let s:fn_comments.warning = ['this class is not meant to be publicly inherited']\nMuT:  endif\nVimL: call lh#dict#add_new(s:fn_comments, {'throw': 'Nothing'})\nVimL: \" let s:fn_comments.text  = []\nVimL: call s:Include('function-comment', 'cpp/internals',s:fn_comments)\n<+s:virtual+>~<+s:clsname+>()<+s:how+>;\n"
  },
  {
    "path": "after/template/cpp/empty-exception-class.template",
    "content": "VimL:\" empty-exception-class File Template, Luc Hermitte <hermitte {at} free {dot} fr>, 27th Nov 2015\nVimL:\" hint: Minimalist exception class\nVimL: let s:default_constructor = s:Param(\"default-constructor\", {\"visibility\": \"none\"})\nVimL: let s:destructor = s:Param(\"destructor\", {})\nVimL: let s:destructor.virtual = 1\nMuT:  let s:parents = s:Param(\"parents\", [])\nMuT:  let s:default_exception = lh#option#get('cpp_root_exception', {\"std::runtime_error\": {\"includes\": \"<stdexcept>\"}})\nMuT:  let s:parent_exception = s:Param(\"root-exception\", s:default_exception)\nVimL: let s:parents += [s:parent_exception]\nVimL: call s:Include('list-constructors', 'cpp/internals')\nMuT:  let s:functions = s:Param(\"functions\", lh#cpp#snippets#new_function_list())\nMuT:  if lh#cpp#use_cpp11() && empty(s:constructors)\nVimL:   call s:functions.insert({\"signature\": \"using \". lh#cpp#snippets#constructor_name(s:parent_exception) })\nMuT:  else\nVimL:   \" override any previous \"parameters\" argument\nVimL:   \" TODO: search for new attributes => parameters ; and merge with parent parameters\nVimL:   call s:functions.insert({\"kind\": \"init-constructor\", 'parameters': lh#option#unset()})\nMuT:  endif\nVimL: \" --- in case the class name is already known, no need to extract it\nVimL: call s:Include('get-class-name', 'cpp/internals')\nVimL: \" --- Defines Doxygen comments\nMuT:  let s:parameters = s:Param('cls_parameters', {})\nVimL: call lh#dict#add_new(s:parameters, {'comments': {}, 'copyable': 1})\nMuT:  let s:cls_comments = s:parameters.comments\nVimL: let s:cls_comments.semantics = get(s:cls_comments, 'semantics', [])\nVimL: let s:cls_comments.semantics += ['Exception class', 'Copyable']\nVimL: \" --- Insert the skeleton built\nVimL: call s:Include('class-skeleton', 'cpp/internals', s:parameters)\n"
  },
  {
    "path": "after/template/cpp/ends_with.template",
    "content": "VimL:\" ends_with File Template, Luc Hermitte <hermitte at free.fr>, 28th May 2014\nVimL:\" hint: boost::algorithm::ends_with\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<boost/algorithm/string/predicate.hpp>\")')\nboost::algorithm::ends_with(<+input+>, <+prefix_searched+>)\n"
  },
  {
    "path": "after/template/cpp/entity-class.template",
    "content": "VimL:\" entity-class File Template, Luc Hermitte <hermitte {at} free {dot} fr>, lun. 19 déc. 2016 17:14:18 CET\nVimL:\" hint: Entity class -- non copyable\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nMuT:  let s:parameters = s:Param('cls_parameters', {})\nVimL: call lh#dict#add_new(s:parameters, {'noncopyable': 1, 'comments': {}})\nVimL: \" --- in case the class name is already known, no need to extract it\nVimL: call s:Include('get-class-name', 'cpp/internals')\nVimL: \" --- Defines Doxygen comments\nMuT:  let s:cls_comments = s:parameters.comments\nVimL: let s:cls_comments.semantics = get(s:cls_comments, 'semantics', [])\nMuT:  if match(s:cls_comments.semantics, 'Clonable') < 0\nVimL:    let s:cls_comments.semantics += ['Entity','Non-copyable']\nMuT:  endif\nVimL: \" --- Insert the skeleton built\nVimL: call s:Include(\"class-skeleton\", \"cpp/internals\", s:parameters)\n"
  },
  {
    "path": "after/template/cpp/enum.template",
    "content": "VimL:\" Enum definition Template, Luc Hermitte\nVimL: let s:value_start = '¡'\nVimL:\" hint: struct Enum { enum type { ... } };\nVimL: let s:value_end   = '¡'\nVimL: let s:reindent = 1\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:enum_name = inputdialog('Name of the enum class ?', lh#marker#txt(expand('%:t:r')))\nstruct ¡s:enum_name¡ {\n    enum type { <+values+>, MAX__ };\n    static type next(type e_) {\n        assert(e_ < MAX__);\n        return type(e_+1);\n    }\n    static char const* to_string(type e_);\n    static type to_enum(std::string const& s_);\n};\n\ninline\n¡s:enum_name¡::type& operator++(¡s:enum_name¡::type& e_) {\n    return e_ = ¡s:enum_name¡::next(e_);\n}\n\ninline\n¡s:enum_name¡::type operator++(¡s:enum_name¡::type&e_, int) {\n    const ¡s:enum_name¡::type tmp = e_;\n    e_ = ¡s:enum_name¡::next(e_);\n    return tmp;\n}\n"
  },
  {
    "path": "after/template/cpp/enum2-impl.template",
    "content": "VimL:\" enum2-impl File Template, Luc Hermitte, 23rd Apr 2014\nVimL:\" hint: enum2 code that goes into .cpp files\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: \" let g:args = s:args\nMuT:  let s:enum_name   = s:Param('name', lh#marker#txt(lh#naming#type(expand('%:t:r'))))\nMuT:  let s:scope       = s:Param('scope', '')\nMuT:  let s:values      = map(s:Param('values', [lh#marker#txt('values')]), '\"\\\"\".v:val.\"\\\"\"')\nMuT:  let s:lhs_        = lh#naming#param(\"lhs\")\nMuT:  let s:rhs_        = lh#naming#param(\"rhs\")\nMuT:  let s:value_      = lh#naming#param(\"value\")\nMuT:  let s:m_value     = lh#naming#member(\"value\")\nMuT:  let s:tmp         = lh#naming#local(\"tmp\")\nMuT:  let s:range       = s:Param('range', lh#naming#function(\"range\"))\nMuT:  let s:RangeType   = s:Param('RangeType', lh#naming#type(\"range\"))\nMuT:  let s:iterable    = s:Param(\"iterable\", 0)\nMuT:  let s:to_string   = lh#naming#function(\"to_string\")\nMuT:  let s:to_internal = lh#naming#function(\"to_internal\")\nMuT:  let s:max         = lh#naming#function(\"max\")\nMuT:  let s:type        = lh#naming#type(\"type\")\nMuT:  let s:str_param   = lh#naming#param(\"s\")\nMuT:  let s:k_strings   = lh#naming#constant(s:enum_name.'_strings')\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<algorithm>\")')\nMuT:  let s:restore_options = lh#on#exit().restore_option('cpp_begin_end_style')\nMuT:  if lh#cpp#use_cpp11()\nVimL:   call s:AddPostExpandCallback('lh#dev#import#add(\"<type_traits>\")')\nVimL:   let b:cpp_begin_end_style = lh#option#get('cpp_begin_end_style', 'std')\nMuT:  else\nVimL:   let b:cpp_begin_end_style = lh#option#get('cpp_begin_end_style', 'boost')\nMuT:  endif\nVimL: call s:Include('get-b-e', 'cpp/internals', {'container': '::'.s:k_strings})\n\nnamespace  { // Anonymous namespace\n    typedef char const* const* strings_iterator;\n    static char const* const <+s:k_strings+>[] =\n    { <+join(s:values, ', ')+> };\n} // Anonymous namespace //  namespaces\n\n\n<+s:scope+><+s:enum_name+>::<+s:enum_name+>(std::string const& <+s:str_param+>)\n{\n    strings_iterator const <+s:enum_name+>_it = std::find(<+s:begin+>,<+s:end+>, <+s:str_param+>);\n    if (<+s:enum_name+>_it == <+s:end+>) {\nVimL: call s:Include('throw', 'cpp', '\"Cannot decode '.s:enum_name.' name `\"+'.s:str_param.'+\"`\"')\n    }\n    <+s:m_value+> = <+s:type+>(std::distance(<+s:begin+>, <+s:enum_name+>_it));\n    assert(<+s:m_value+> < MAX__);\n}\n\nVimL: call s:Include('array_size', 'cpp')\n\nchar const* <+s:scope+><+s:enum_name+>::<+s:to_string+>() const\n{\nVimL: call s:Include('static_assert', 'cpp', {'condition': 'MAX__ == '.lh#fmt#printf(s:_array_size,'::'.s:k_strings), 'message': '\"Array size mismatches number of elements in enum\"'})\n    assert(<+s:m_value+> != UNDEFINED__); // Yes, I know UNDEFINED__ > MAX__\n    assert(<+s:m_value+> < MAX__);\n    return <+s:k_strings+>[<+s:m_value+>];\n}\nMuT:  if s:iterable && lh#cpp#use_cpp11()\n\n/*static*/ <+s:scope+><+s:enum_name+>::<+s:RangeType+> <+s:scope+><+s:enum_name+>::<+s:range+>() { return <+s:RangeType+>(); }\nMuT:  endif\n\nVimL: silent! unlet s:values\nVimL: call s:restore_options.finalize()\n"
  },
  {
    "path": "after/template/cpp/enum2.template",
    "content": "VimL:\" safe-Enum definition Template, Luc Hermitte\nVimL: let s:value_start = '¡'\nVimL:\" hint: struct Enum { enum type { ... } ; private: type m_value; };\nVimL: let s:value_end   = '¡'\nVimL: let s:reindent = 1\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nMuT:  let s:enum_args   = s:CmdLineParams([])\nMuT:  let s:enum_name   = s:enum_args[0]\nMuT:  if empty(s:enum_name)\nMuT:    let s:enum_name   = inputdialog('Name of the enum class ?', lh#marker#txt(lh#naming#type(expand('%:t:r'))))\nMuT:  endif\nMuT:  let s:iterable    = lh#ui#confirm(\"Shall \".s:enum_name.\" be iterable ?\", \"&Yes\\n&No\", 1) == 1\nMuT:  let s:values      = len(s:enum_args) <=1 ? [lh#marker#txt('values')] : s:enum_args[1:]\nMuT:  let s:lhs_        = lh#naming#param(\"lhs\")\nMuT:  let s:rhs_        = lh#naming#param(\"rhs\")\nMuT:  let s:value_      = lh#naming#param(\"value\")\nMuT:  let s:m_value     = lh#naming#member(\"value\")\nMuT:  let s:tmp         = lh#naming#local(\"tmp\")\nMuT:  let s:range       = lh#naming#function(\"range\")\nMuT:  let s:RangeType   = lh#naming#type(\"range\")\nMuT:  let s:to_string   = lh#naming#function(\"to_string\")\nMuT:  let s:to_internal = lh#naming#function(\"to_internal\")\nMuT:  let s:max         = lh#naming#function(\"max\")\nMuT:  let s:type        = lh#naming#type(\"type\")\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<string>\")')\nMuT:  if lh#cpp#use_cpp11()\nVimL:   call s:AddPostExpandCallback('lh#dev#import#add(\"<cstdint>\")')\nMuT:  else\nVimL:   call s:AddPostExpandCallback('lh#dev#import#add(\"<stdint.h>\")')\nMuT:  endif\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<cassert>\")')\nVimL: silent! unlet s:doc\nMuT:  let s:doc = []\nVimL: let s:doc += [{ \"tag\": \"ingroup\", \"text\": \"g\".lh#ft#option#get('dox_group', &ft, lh#marker#txt('Group')) }]\nVimL: let s:doc += [{ \"tag\": \"brief\", \"text\": (s:enum_name).\" Safe Enum\" }]\nVimL: let s:doc += [{ \"text\": \"\\n\" }]\nVimL: let s:doc += [{ \"text\": \"This snippet has been automatically generated with vim plugin mu-template.\" }]\nVimL: let s:doc += [{ \"text\": \"\\n\" }]\nVimL: let s:doc += [{ \"text\": \"<+doc+>\" }]\nVimL: let s:doc += [{ \"text\": \"\\n\" }]\nVimL: let s:doc += [{ \"tag\": \"invariant\"}]\nVimL: let s:doc += [{ \"text\": \"\\n\" }]\nVimL: let s:doc += [{ \"tag\": \"version\", \"text\": \"$\".\"revision$\"}]\nVimL: let s:doc += [{ \"tag\": \"author\"}]\nVimL: let s:doc += [{ \"text\": \"<b>Licence</b>\"}]\nVimL: let s:doc += [{ \"text\": \"BSD 3 clauses (http://opensource.org/licenses/BSD-3-Clause)\"}]\nVimL: let s:doc += [{ \"text\": \"Copyright (c) 2014, Luc Hermitte (snippet author)\" }]\nVimL: let s:doc += [{ \"license\": \"BSD-3\"}]\nVimL: call s:Include(\"formatted-comment\", \"cpp/internals\", s:doc, {'style': 0})\nstruct <+s:enum_name+>{\n    enum <+s:type+>{ <+join(s:values, ', ')+>, MAX__, UNDEFINED__, FIRST__=0 };\n\nMuT:  if lh#cpp#use_cpp11()\n    explicit <+s:enum_name+>(std::uint8_t <+s:value_+>)\nMuT:  else\n    explicit <+s:enum_name+>(uint8_t <+s:value_+>)\nMuT:  endif\n        : <+s:m_value+>(<+s:type+>(<+s:value_+>))\n        {\n            if (<+s:value_+> >= MAX__){\nVimL: call s:Include('throw', 'cpp', '\"Invalid '.s:enum_name.' value\"')\n            }\n        }\n    <+s:enum_name+>(<+s:type+> <+s:value_+>)\n        : <+s:m_value+>(<+s:type+>(<+s:value_+>)){\n            assert(<+s:m_value+> < MAX__);\n        }\n    <+s:enum_name+>()\n        : <+s:m_value+>(UNDEFINED__){}\n    <+s:enum_name+>(std::string const& <+lh#naming#param(\"s\")+>);\nMuT:  if s:iterable\n    <+s:enum_name+>& operator++(){\n        assert(<+s:m_value+> < MAX__);\n        <+s:m_value+> = <+s:enum_name+>::<+s:type+>(<+s:m_value+>+1);\n        return *this;\n    }\n    <+s:enum_name+> operator++(int){\n        <+s:enum_name+> <+s:tmp+> = *this;\n        ++*this;\n        return <+s:tmp+>;\n    }\nMuT:  endif\n\n    char const* <+s:to_string+>() const;\nMuT:  if lh#cpp#use_cpp11()\n    explicit operator int() const{ return <+s:m_value+>; }\nMuT:  endif\n    <+s:type+> <+s:to_internal+>() const{ return <+s:m_value+>; }\nMuT:  if s:iterable\n    friend bool operator<=(<+s:enum_name+> <+s:lhs_+>, <+s:enum_name+> <+s:rhs_+>){ return <+s:lhs_+>.<+s:m_value+> <= <+s:rhs_+>.<+s:m_value+>; }\n    friend bool operator>=(<+s:enum_name+> <+s:lhs_+>, <+s:enum_name+> <+s:rhs_+>){ return <+s:lhs_+>.<+s:m_value+> >= <+s:rhs_+>.<+s:m_value+>; }\n    friend bool operator< (<+s:enum_name+> <+s:lhs_+>, <+s:enum_name+> <+s:rhs_+>){ return <+s:lhs_+>.<+s:m_value+> <  <+s:rhs_+>.<+s:m_value+>; }\n    friend bool operator> (<+s:enum_name+> <+s:lhs_+>, <+s:enum_name+> <+s:rhs_+>){ return <+s:lhs_+>.<+s:m_value+> >  <+s:rhs_+>.<+s:m_value+>; }\nMuT:  endif\n    friend bool operator==(<+s:enum_name+> <+s:lhs_+>, <+s:enum_name+> <+s:rhs_+>){ return <+s:lhs_+>.<+s:m_value+> == <+s:rhs_+>.<+s:m_value+>; }\n    friend bool operator!=(<+s:enum_name+> <+s:lhs_+>, <+s:enum_name+> <+s:rhs_+>){ return <+s:lhs_+>.<+s:m_value+> != <+s:rhs_+>.<+s:m_value+>; }\n\n    static <+s:enum_name+> <+s:max+>  (){ return <+s:enum_name+>(build_max()); }\nMuT:  if s:iterable\n    static <+s:enum_name+> begin(){ return FIRST__; }\n    static <+s:enum_name+> end  (){ return <+s:enum_name+>(build_max()); }\n\nMuT:      if lh#cpp#use_cpp11()\n          /** Helper class to provide for-range loops on <+s:enum_name+>.\n           * @see \\c range()\n           */\n          struct <+s:RangeType+>;\n          /** Helper function to provide for-range loops on \\c <+s:enum_name+>.\n           * e.g.\n           * @code\n           * for (auto value : <+s:enum_name+>::<+s:range+>())\n           *    cout << value.<+s:to_internal+>() << \" -> \" << value.<+s:to_string+>();\n           * @endcode\n           */\n          static <+s:RangeType+> <+s:range+>();\nMuT:      endif\nMuT:  endif\nprivate:\n    struct build_max{};\n    <+s:enum_name+>(build_max) : m_value(MAX__){}\n\n    <+s:type+> <+s:m_value+>;\n};\nMuT:  if s:iterable && lh#cpp#use_cpp11()\n\n          struct <+s:enum_name+>::<+s:RangeType+>{\n              struct iterator{\n                iterator(<+s:enum_name+> <+s:value_+>) : <+s:m_value+>(<+s:value_+>){}\n                <+s:enum_name+> operator*() const{ return <+s:m_value+>; }\n                friend bool operator!=(iterator <+s:lhs_+>, iterator <+s:rhs_+>)\n                { return <+s:lhs_+>.<+s:m_value+> != <+s:rhs_+>.<+s:m_value+>;}\n                iterator& operator++(){ ++<+s:m_value+>; return *this;}\n            private:\n                <+s:enum_name+> <+s:m_value+>;\n              };\n              static iterator begin(){ return <+s:enum_name+>::begin(); }\n              static iterator end  (){ return <+s:enum_name+>::end(); }\n          };\nMuT:  endif\nVimL: let b:cpp_last_enum = {'name': s:enum_name, 'type': s:type, 'values': s:values, 'RangeType': s:RangeType, 'range': s:range, 'iterable': s:iterable}\nVimL: silent! unlet s:values\n"
  },
  {
    "path": "after/template/cpp/erase-remove.template",
    "content": "VimL:\" erase-remove File Template, Luc Hermitte, 06th Nov 2012\nVimL:\" hint: erase-remove idiom\nVimL: let s:reindent     = 1\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<algorithm>\")')\nMuT:  let s:container = s:SurroundableParam('container', 1)\n<+s:container+>.erase(std::remove<+_if+>(<+s:container+>.begin(), <+s:container+>.end(), <+what+>), <+s:container+>.end());\nVimL: unlet s:container\n"
  },
  {
    "path": "after/template/cpp/exception-class.template",
    "content": "VimL:\" exception-class File Template, Luc Hermitte <hermitte {at} free {dot} fr>, 25th Nov 2015\nVimL:\" hint: Value Class ((implicitly) copyable, no hierarchy)\nVimL:\" NOTE: when we define our own exception types, we do much more than just inherit from a standard exception type\nVimL: \" There is an init constructor, no need to delete the default constructor.\nVimL: let s:default_constructor = s:Param(\"default-constructor\", {\"visibility\": \"none\"})\nMuT:  let s:functions = s:Param(\"functions\", lh#cpp#snippets#new_function_list())\nVimL: call s:functions.add([{\"signature\": \"virtual char const* what() const \".lh#cpp#snippets#noexcept().\" \".lh#cpp#snippets#override()}])\nVimL: call s:Include(\"empty-exception-class\", \"cpp\")\n"
  },
  {
    "path": "after/template/cpp/file.template",
    "content": "VimL:\" file File Template, Luc Hermitte, 28th Apr 2014\nVimL:\" hint: i/ofstream\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<fstream>\")')\nstd::<+i+>fstream f(¡s:Surround(1, '<+filename+>')¡);\n"
  },
  {
    "path": "after/template/cpp/for-enum.template",
    "content": "VimL:\" For loop over Enum definition Template, Luc Hermitte\nVimL:\" hint: for (Enum::type e=Enum::type(); e!=Enum::MAX__; ++e) { ... }\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = '¡'\nVimL: let s:reindent = 1\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:enum_name = inputdialog('Name of the enum class ?', Marker_Txt('EnumType'))\nVimL: let s:index = inputdialog('Name of the for index ?', Marker_Txt('e'))\nVimL: \" todo: automagically detect the type of the real enum, and the MAX__ value\nfor(¡s:enum_name¡::type ¡s:index¡ = ¡s:enum_name¡::type() ; ¡s:index¡ != ¡s:enum_name¡::MAX__ ; ++¡s:index¡ ){\n    ¡s:Surround(1, '<++>')¡\n}<+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/cpp/for-iterator.template",
    "content": "VimL:\" C++ for-loop on iterators Template, Luc Hermitte\nVimL:\" hint: for (T::iterator b=c.begin(), e=c.end(); b!=e; ++b) { ... }\nVimL: let s:value_start  = '¡'\nVimL: let s:value_end    = '¡'\nVimL: let s:reindent     = 1\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL:\"\nVimL: let s:cont  = lh#ui#input('Container name: ')\nVimL: let s:begin = lh#ui#input('Iterator variable: ', 'b')\nVimL: let s:end   = lh#ui#input('Iterator end variable: ', 'e')\nVimL:\"\nVimL:\" Note: The \"const\" can be deleted or kept thanks to <Plug>MarkersMark\nMuT:  let s:container_type = lh#dev#types#of_var(s:cont, lh#marker#txt('container_type'))\nMuT:  let s:const = lh#dev#cpp#types#is_const(s:container_type) ? 'const_' : lh#marker#txt('const_')\nVimL: let s:container_type = lh#dev#cpp#types#remove_cv(lh#dev#cpp#types#remove_reference(s:container_type))\nfor (<+s:container_type+>::<+s:const+>iterator ¡s:begin¡ = ¡s:cont¡.begin(), ¡s:end¡ = ¡s:cont¡.end()\n    ; ¡s:begin¡ != ¡s:end¡\n    ; ++¡s:begin¡\n    )\n{\n¡s:Surround(1, '<++>')¡\n}<+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/cpp/for-range.template",
    "content": "VimL:\" range-based for loop File Template, Luc Hermitte, 07th Jul 2015\nVimL:\" hint: for(auto&& e : range)\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:reindent     = 1\nVimL: let s:type = s:Param(\"type\", lh#marker#txt('auto&&'))\nVimL: let s:elem = s:Param(\"elem\", lh#marker#txt('e'))\nVimL: let s:range = s:Param(\"range\", lh#marker#txt('range'))\nfor(<+s:type+> <+s:elem+> : <+s:range+>){\n    ¡s:Surround(1, '<++>')¡\n}<+s:TerminalPlaceHolder()+>\nVimL: unlet s:type\nVimL: unlet s:elem\nVimL: unlet s:range\n"
  },
  {
    "path": "after/template/cpp/fori.template",
    "content": "VimL:\"{for int i=0...} Template-File, Luc Hermitte\nVimL:\" hint: for (int i=0;i!=N;++i) { action }\nVimL: let s:value_start  = '¡'\nVimL: let s:value_end    = '¡'\nVimL: let s:reindent     = 1\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nfor(<+int+> <+i+>=0; <+i+>!=<+MAX+> ; ++<+i+>){\n    ¡s:Surround(1, '<+code+>')¡\n}<+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/cpp/foriN.template",
    "content": "VimL:\"{for size_t i=0, N= ; i!=N...} Template-File, Luc Hermitte\nVimL:\" hint: for (std::size_t i=0, N=...;i!=N;++i) { action }\nVimL: let s:value_start  = '¡'\nVimL: let s:value_end    = '¡'\nVimL: let s:reindent     = 1\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nfor(<+std::size_t+> <+i+>=0, <+N+>=<+MAX+>; <+i+>!=<+N+> ; ++<+i+>){\n    ¡s:Surround(1, '<+code+>')¡\n}<+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/cpp/forward.template",
    "content": "VimL:\" forward File Template, Luc Hermitte, mar. 29 mars 2016 17:13:03 CEST\nVimL:\" hint: std::forward<T>(v)\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nMuT:  let s:var = s:SurroundableParam('var', 1)\nMuT:  let s:type = s:SurroundableParam('type', 2)\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<utility>\")')\nstd::forward<<+s:type+>>(<+s:var+>)<+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/cpp/getter.template",
    "content": "VimL:\" getter File Template, Luc Hermitte <hermitte {at} free {dot} fr>, 02nd Dec 2015\nVimL:\" hint: T const& getFoo() const\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:reindent     = 1\nVimL: \"The interactive mode (w/ dynamic placeholders) won't permit to have \"getFoo\" and \"return m_foo\".\nMuT:  let s:attribute    = s:Param(\"attribute\", {'type': lh#marker#txt(lh#naming#type('type')), 'name': lh#marker#txt('name')})\nMuT:  let s:attrb_name   = s:attribute.name\nMuT:  let s:ret_expr = lh#naming#member(s:attrb_name)\nMuT:  if lh#dev#cpp#types#is_smart_ptr(s:attribute.type)\nMuT:    let s:ret_type = lh#dev#cpp#types#remove_ptr(s:attribute.type)\nVimL:   let s:ret_expr = '*'.s:ret_expr\nMuT:  else\nMuT:    let s:ret_type = s:attribute.type\nMuT:  endif\nVimL: let s:ret_type = lh#dev#cpp#types#const_correct_type(s:ret_type)\n<+s:ret_type+> <+lh#naming#getter(s:attrb_name)+>() const{return <+s:ret_expr+>;}\n"
  },
  {
    "path": "after/template/cpp/init-constructor.template",
    "content": "VimL:\" init-constructor File Template, Luc Hermitte, 30th Nov 2015\nVimL:\" hint: Constructor(parameters): m_attributes(params){}\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:reindent     = 1\nVimL: \" in case the class name is already known, no need to extract it\nVimL: call s:Include('get-class-name', 'cpp/internals')\nMuT:  let s:parameters = s:Param(\"parameters\", lh#option#unset())\nMuT:  let s:fn_comments = lh#dox#new_function(\"Init constructor.\")\nVimL: let s:fn_comments.throw = {\"optional\": 1}\nVimL: \" let s:fn_comments.text  = []\nMuT:  if lh#option#is_set(s:parameters)\nMuT:    let s:parameterList = lh#cpp#snippets#build_param_list(s:parameters)\nMuT:    let s:definition = (empty(s:parameters)? \"\" : (len(s:parameters)>1?\"\\n\": \"\").\": \").join(map(copy(s:parameters), 'lh#naming#member(v:val.name).\"(\".lh#naming#param(v:val.name).\")\"'), \"\\n, \").'{}'\nVimL:   for param in s:parameters | call s:fn_comments.add_param(param) | unlet param | endfor\nMuT:  else\nMuT:    let s:parameterList = lh#marker#txt('ctr-parameters')\nMuT:    let s:definition = ';'\nVimL:   let s:fn_comments.param = [lh#marker#txt('ctr-parameters'). ' ' . lh#marker#txt()]\nMuT:  endif\nVimL: call s:Include(\"function-comment\", \"cpp/internals\",s:fn_comments)\n<+s:clsname+>(<+s:parameterList+>)<+s:definition+>\n"
  },
  {
    "path": "after/template/cpp/interface.template",
    "content": "VimL:\" interface File Template, Luc Hermitte <hermitte {at} free {dot} fr>, lun. 19 déc. 2016 18:32:45 CET\nVimL:\" hint: Interface class -- An abstract class actually\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: \" --- Defines Doxygen comments\nMuT:  let s:parameters = s:Param('cls_parameters', {})\nVimL: call lh#dict#add_new(s:parameters, {'comments': {}})\nMuT:  let s:cls_comments = s:parameters.comments\nVimL: let s:cls_comments.semantics = get(s:cls_comments, 'semantics', [])+['Interface']\nVimL: \" --- Insert the skeleton built\nVimL: call s:Include('abstract-class', 'cpp', {'cls_parameters': s:parameters})\n"
  },
  {
    "path": "after/template/cpp/internals/abs-rel-shared.template",
    "content": "VimL:\" Shared definition for Absolute and relative Classes Template, Luc Hermitte\nVimL:\" Used to define Date and Duration, Point and Distance, ... \nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = '¡'\nVimL: let s:reindent = 1\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL:\"\nnamespace DETAILS\n{\n    <+s:tmpl_decl+>class <+s:sharedclsname+>\n    {\n    public:\n\ttypedef ¡lh#ui#if(s:istemplate, s:tmpl_type, \"<+scalar_type+>\")¡ scalar_type;\n\tfriend class ¡s:absclsname.s:tmpl¡;\n\tfriend class ¡s:relclsname.s:tmpl¡;\n    protected:\n\t/**@name Construction/destruction\n\t */\n\t//@{\n\t/** Initialisation constructor.\n\t */\n\t<+s:sharedclsname+>(<+parameters+>)¡lh#ui#if(s:istemplate,\"\\n<+: +>{<++>}\", \";\")¡\n\t/** Protected destructor.\n\t */\n\t~<+s:sharedclsname+>();\n\t¡lh#cpp#abs_rel#canonicalortodoxform(s:absclsname, ! s:defaultisenough)¡\n\t//@}\n\n\t/**@name Operations\n\t */\n\t//@{\n\tvoid add(<+s:sharedclsname+> const& <+s:rhs+>)¡lh#ui#if(s:istemplate,\"\\n{<++>}\", \";\")¡\n\tvoid dec(<+s:sharedclsname+> const& <+s:rhs+>)¡lh#ui#if(s:istemplate,\"\\n{<++>}\", \";\")¡\n\tvoid mult(scalar_type <+s:coeff+>)¡lh#ui#if(s:istemplate,\"\\n{<++>}\", \";\")¡\n\tvoid div(scalar_type <+s:coeff+>)¡lh#ui#if(s:istemplate,\"\\n{<++>}\", \";\")¡\n\tstatic bool isEqual(\n\t\t<+s:sharedclsname+> const& <+s:rhs+>,\n\t\t<+s:sharedclsname+> const& <+s:lhs+>)¡lh#ui#if(s:istemplate,\"\\n{<++>}\", \";\")¡\n\t//@}\n    private:\n\t<+representation+>;\n    };\n}\n\n"
  },
  {
    "path": "after/template/cpp/internals/attribute.template",
    "content": "VimL:\" attribute File Template, Luc Hermitte <hermitte {at} free {dot} fr>, 02nd Dec 2015\nVimL:\" hint: Type m_attribute;\nVimL: \" Parameter: \"attribute\" (optional)\nVimL: \"  - \"name\": string, mandatory\nVimL: \"  - \"type\": string, mandatory,\nVimL: \"  - \"type_info\": dict, mandatory (comes from lh#cpp#types#get_info())\nVimL: \"  - \"storage\": string, optional: \"constepxr \", \"static \", \"thread_local \", ...\nVimL: \"  - \"default\": string, optional, C++11+ only: \" = value\"\nVimL: \"  - \"align\": number, optional\nVimL: \"  - \"include\": string/list: files to #include\nVimL: \" @pre \"type\" is expected to have been processed w/ lh#cpp#type#*()\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:reindent     = 1\nVimL: \" TODO: Handle Doxygen/comments as well\nMuT:  let s:attribute    = s:Param(\"attribute\", {'type': lh#marker#txt(lh#naming#type('type')), 'name': lh#marker#txt('name')})\nVimL: call s:Include('includes', 'cpp/internals', s:attribute)\nMuT:  let s:align = repeat(' ', max([0, get(s:attribute, 'align', 0) - lh#encoding#strlen(s:attribute.type)]))\nMuT:  if !lh#cpp#use_cpp11()\nMuT:    let s:default_attrb_value = \"\"\nMuT:  else\nMuT:    let s:default_attrb_value = get(s:attribute, \"default\", \"\")\nVimL:   let s:default_attrb_value = empty(s:default_attrb_value) ? \"\" : \" = \".s:default_attrb_value\nMuT:  endif\nMuT:  if lh#option#is_set(s:attribute.type_info)\nVimL:    call s:AddPostExpandCallback('lh#dev#import#add_any('.string(get(s:attribute.type_info, \"includes\", [])).')')\nMuT:  endif\n<+get(s:attribute, 'storage', '')+><+s:attribute.type+> <+s:align+><+lh#naming#member(s:attribute.name)+><+s:default_attrb_value+>;\nVimL: \" <+get(s:attribute, 'storage', '')+><+s:Include(s:attribute.type, 'cpp')+> <+s:align+><+lh#naming#member(s:attribute.name)+><+s:default_attrb_value+>;\n"
  },
  {
    "path": "after/template/cpp/internals/class-skeleton.template",
    "content": "VimL:\" class-skeleton File Template, Luc Hermitte <hermitte {at} free {dot} fr>, 25th Nov 2015\nVimL:\" hint: Routine Skeleton for C++ classes\nVimL:\" TODO: find a way to order members\nVimL:\" TODO: find a way to group members\nVimL:\" TODO: option to disable comments in defaulted functions\nVimL:\" TODO: C++11 move copy & move assign\nVimL:\" TODO: Enforce rule of \"all or nothing\"\nVimL:\" TODO: Find a way to specify attributes to use in init-ctr and w/ getters/setters when surrounding.\nVimL: let s:value_start  = \"¡\"\nVimL: let s:value_end    = s:value_start\nVimL: let s:marker_open  = \"<+\"\nVimL: let s:marker_close = \"+>\"\nVimL: let s:reindent     = 1\nMuT:  \" let s:clsname    = s:Param('clsname', lh#marker#txt(lh#naming#type(expand('%:t:r'))))\nVimL: call s:Include('get-class-name', 'cpp/internals')\nMuT:  let s:functions  = s:Param('functions', lh#cpp#snippets#new_function_list())\nVimL: \" =====[ Attributes\nVimL: \" Fetch attributes from the parameters passed to the class skeleton\nMuT:  let s:attributes = s:Param('attributes', [])\nVimL: \" And also use the surrounded attributes\nVimL: let s:attributes += lh#cpp#snippets#_decode_selected_attributes(s:SurroundRaw(1, ''))\nVimL: call s:Verbose('attributes: %1', s:attributes)\nVimL: \" Finally fill the related function with these information\nMuT:  let s:attrb_functions = []\nMuT:  if !empty(s:attributes)\nVimL:   for attr in s:attributes | for fct in get(attr, 'functions', []) | let s:attrb_functions += [{'kind': fct, 'attribute': attr}] | endfor | endfor\nVimL:   for attr in s:attributes | let attr.type_info = lh#cpp#types#get_info(attr.type, {'type': attr.type}) | let attr.type = attr.type_info.typename_for_header() |endfor\nVimL:   \" Set attributes as parameters to init-ctr, unless already set\nMuT:    let s:init_constructor = s:functions.get1({'kind' : 'init-constructor'})\nVimL:   call s:init_constructor.add_new({'parameters': lh#list#map_on(deepcopy(s:attributes), 'type', 'lh#dev#cpp#types#const_correct_type(v:val)'), 'visibility': 'public'})\nVimL:   \" Remove default-constructor unless already set visible\nMuT:    let s:default_constructor = s:Param('default-constructor', {})\nVimL:   call lh#dict#add_new(s:default_constructor, {'visibility': 'none'})\nMuT:  endif\nVimL: \" =====[ Class characteristics\nMuT:  let s:is_final = s:Param('final', 0)\nMuT:  let s:final_str = s:is_final ? (lh#cpp#use_cpp11() ? ' final' : lh#marker#txt(' final')) : ''\nVimL: \" =====[ Parents\nMuT:  let s:parents = s:Param('parents', [])\nMuT:  let s:noncopyable = s:Param('noncopyable', -1) \" -1 == maybe\nMuT:  let s:copyable    = s:Param('copyable', -1)    \" -1 == maybe\nMuT:  if s:copyable == 1\nVimL:   let s:noncopyable = 0 \" clean 'may be'\nMuT:  endif\nMuT:  if s:noncopyable == 1\nVimL:   let s:copyable = 0 \" clean 'may be'\nMuT:    let s:noncopyable_class = lh#option#get('cpp_noncopyable_class', {'name': 'noncopyable'})\nVimL:   \" TODO: support auto import of noncopyable file\nMuT:    if empty(s:noncopyable_class)\nVimL:     call lh#dict#add_new(s:Param('copy-constructor', {}), {'how': 'deleted'})\nVimL:     call lh#dict#add_new(s:Param('assignment-operator', {}), {'how': 'deleted'})\nMuT:    else\nVimL:     \" Don't add the noncopyable if there is already a public parent\nMuT:      if ! lh#cpp#snippets#_has_a_non_copyable_parent(s:parents)\nVimL:       let s:parents += [ lh#cpp#snippets#_merge_include_data(s:noncopyable_class, {'visibility': 'private'})]\nMuT:      endif\nMuT:      if lh#cpp#snippets#shall_explicit_defaults()\nVimL:       call lh#dict#add_new(s:Param('copy-constructor', {}), {'how': 'deleted'})\nVimL:       call lh#dict#add_new(s:Param('assignment-operator', {}), {'how': 'deleted'})\nMuT:      endif\nMuT:    endif\nMuT:  endif\nVimL: \"let g:args=deepcopy(s:args)\nMuT:  let s:parents_data = lh#cpp#snippets#parents(s:parents)\nVimL: call lh#list#for_each_call(s:parents_data[1], \"lh#mut#_add_post_expand_callback(\\\"lh#dev#import#add(v:val)\\\")\")\nVimL: \" =====[ Functions\nVimL: \" --------[ Any Functions\nMuT:  \"let s:functions = s:Param('functions', [])\nVimL: \" --------[ Attribute functions (get/set)\nVimL: call s:functions.add(s:attrb_functions)\nVimL: \" --------[ General case\nVimL: call s:functions.reverse()\nMuT:  let s:pub_functions = s:functions.public()\nMuT:  let s:pro_functions = s:functions.protected()\nMuT:  let s:pri_functions = s:functions.private()\nVimL: \" --------[ Special Functions\nMuT:  if lh#cpp#snippets#requires_destructor(s:attributes)\nMuT:    let s:destructor = s:Param('destructor', {})\nVimL:   \" Force visible (even private) if not set already\nViml:   call lh#dict#add_new(s:destructor, {'visibility': 'public'})\nMuT:  endif\nMuT:  if (s:copyable != 0) && lh#cpp#snippets#requires_copy_operations(s:attributes)\nMuT:    let s:copy_constructor = s:Param('copy-constructor', {})\nVimL:   \" Force visible (even protected) if not set already\nViml:   call lh#dict#add_new(s:copy_constructor, {'visibility': 'public'})\nMuT:    let s:assignment_operator = s:Param('assignment-operator', {})\nVimL:   \" Force visible (even protected) if not set already\nViml:   call lh#dict#add_new(s:assignment_operator, {'visibility': 'public'})\nMuT:  endif\nVimL: call s:Include('shall_explicit_defaults', 'cpp/internals')\nVimL: \" In reverse order because of how Include() works\nMuT:  let s:special_functions = ['destructor', 'assignment-operator', 'copy-constructor', 'default-constructor']\nMuT:  let s:spe_func_data = map(copy(s:special_functions), \"extend(s:Param(v:val, {}), {'kind': v:val})\")\nVimL: for spe in s:spe_func_data | call lh#dict#add_new(spe, s:default_explicit) | endfor\nMuT:  let s:pub_special_functions = lh#cpp#snippets#_filter_functions(s:spe_func_data, 'public')\nMuT:  let s:pro_special_functions = lh#cpp#snippets#_filter_functions(s:spe_func_data, 'protected')\nMuT:  let s:pri_special_functions = lh#cpp#snippets#_filter_functions(s:spe_func_data, 'private')\nVimL: call extend(s:pub_functions, map(copy(s:pub_special_functions), 'v:val'))\nVimL: call extend(s:pro_functions, map(copy(s:pro_special_functions), 'v:val'))\nVimL: call extend(s:pri_functions, map(copy(s:pri_special_functions), 'v:val'))\nVimL: \" =====[ Doxygen\nMuT:  let s:cls_comments_default = {}\nVimL: let s:cls_comments_default.brief = lh#dox#brief(s:clsname)\nVimL: let s:cls_comments_default.ingroup = {}\nVimL: let s:cls_comments_default.invariant = lh#marker#txt()\nVimL: let s:cls_comments_default.author = lh#dox#author_value(). ', creation'\nVimL: let s:cls_comments_default.since = lh#dox#since_value()\nMuT:  let s:cls_comments = s:Param('comments', {})\nVimL: call extend(s:cls_comments, s:cls_comments_default, 'keep')\nVimL: call s:Include('function-comment', 'cpp/internals', s:cls_comments)\nVimL: \" =====[ The Skeleton\nclass <+s:clsname+><+s:final_str+><+s:parents_data[0]+>\n{\npublic:\n\nVimL: for fn in s:pub_functions | call s:Include(\"function\", \"cpp/internals\", {\"function\": fn}) | endfor\nMuT:  if !empty(s:pro_functions)\n\nprotected:\n\nVimL:   for fn in s:pro_functions | call s:Include(\"function\", \"cpp/internals\", {\"function\": fn}) | endfor\nMuT:  endif\nMuT:  if !empty(s:pri_functions) || !empty(s:attributes)\n\nprivate:\n\nVimL:   for fn in s:pri_functions | call s:Include(\"function\", \"cpp/internals\", {\"function\": fn}) | endfor\nMuT:    let s:longest_type = max(map(copy(s:attributes), 'strlen(v:val.type)'))\nVimL:   \" calling s:Include() in a loop inserts at the current line => need to reverse\nVimL:   for attrb in reverse(s:attributes) | call s:Include('attribute', 'cpp/internals', {\"attribute\": extend(attrb, {'align':s:longest_type}, 'force')}) | endfor\nMuT:  endif\n};\n"
  },
  {
    "path": "after/template/cpp/internals/formatted-comment.template",
    "content": "VimL:\" C++ formatted-comment template-routine, Luc Hermitte, 23rd Mar 2012\nVimL:\" Meant to be used as a function whose parameter is a list of things to print.\nVimL:\" Default output format=doxygen; override this template for  other formats.\nVimL:\" hint: /** stuff from the list... */\nVimL: let s:reindent     = 1\nVimL: function! s:_LoopOverDoxItems(doc)\nVimL:    \" echomsg \"-->\".string(a:doc)\nVimL:    let lead = lh#dox#comment_leading_char(). \" \"\nVimL:    let lines = []\nVimL:    for item in a:doc\nVimL:        let text = get(item, 'text', '')\nVimL:        if has_key(item,\"tag\")\nVimL:           \" try to use the lh#dox#{tag}() function if it exists\nVimL:           if (item.tag) == \"param\"\nVimL:               let line = lh#dox#{item.tag}(item)\nVimL:           elseif exists(\"*lh#dox#\".(item.tag))\nVimL:               let line = lh#dox#{item.tag}(text)\nVimL:           else\nVimL:               let line = lh#dox#tag(item.tag) . \" \" . text\nVimL:           endif\nVimL:        elseif has_key(item, \"license\")\nVimL:            let license = s:GetTemplateLines(item.license, \"license/text\")\nVimL:            let pat_not_text = '\\c\\(^'.s:Command('').'\\|'.s:Special('').'\\)'\nVimL:            call map(license, \"v:val =~ pat_not_text ? (v:val) : lead.v:val\")\nVimL:            let lines += license\nVimL:            continue\nVimL:        else\nVimL:            let line = text\nVimL:        endif\nVimL:        \" optional entries are completly surrounded by a placeholder\nVimL:        if has_key(item,\"optional\") && item.optional && match(line, lh#marker#txt(\".\\\\{-}\"))==-1\nVimL:            let line = lh#marker#txt(line)\nVimL:        endif\nVimL:        \" special case: @ingroup is put on the /** line\nVimL:        if has_key(item,\"tag\") && item.tag == \"ingroup\"\nVimL:            let s:content.lines[s:content.crt-1] .= line\nVimL:        elseif (line!~'^\\s*$') \" empty lines produce nothing\nVimL:            \" Use \"\\n\" as {text} to force an empty line\nVimL:            let lines += [line==\"\\n\" ? lead : lead.line]\nVimL:        endif\nVimL:    endfor\nVimL:    \"trim trailing whitespaces\nVimL:    call map(lines, \"substitute(v:val, ' *$', '', '')\")\nVimL:    call s:Inject(lines)\nVimL: endfunction\nMuT: if lh#ft#option#get(\"template_expand_doc\", &ft, 1)\nMuT:   let s:restore_options = lh#on#exit().restore(s:content, 'can_apply_style')\nVimL:  let s:content.can_apply_style = s:Param('style', 0)\n/**\nVimL:  call s:_LoopOverDoxItems(empty(s:Args()) ? [] : s:Args()[0])\n */\nVimL: \" let g:lines = deepcopy(s:content.lines)\nVimL:  call s:restore_options.finalize()\nMuT: endif\n"
  },
  {
    "path": "after/template/cpp/internals/function-comment.template",
    "content": "VimL:\" function-comment File Template, Luc Hermitte, 22nd Aug 2011\nVimL:\" template to generate function comments, default format=doxygen\nVimL: let s:fn_comments=s:Args()[0]\nVimL: \"\nVimL: function! s:_AddItemToDoc(tagname, data)\nVimL:   let text = empty(a:data) ? \"\\n\" : a:data\nVimL:   if empty(a:tagname)\nVimL:      return [{'text': text}]\nVimL:   else\nVimL:      return [{'tag':(a:tagname), 'text': text}]\nVimL:   endif\nVimL: endfunction\nVimL: \"\nVimL: function! s:_AddToDoc(tagname, data)\nVimL:   \" if !has_key(a:data, a:tagname) | return [] | endif\nVimL:   let res = []\nVimL:   if type(a:data[a:tagname]) == type([])\nVimL:     for e in a:data[a:tagname]\nVimL:       let e2 = {(a:tagname): e}\nVimL:       let res += s:_AddToDoc(a:tagname, e2)\nVimL:     endfor\nVimL:   elseif type(a:data[a:tagname]) == type({})\nVimL:     \" special case to handle things like \"optional\"\nVimL:     let data = copy(a:data[a:tagname])\nVimL:     let data.tag = a:tagname\nVimL:     let res += [data]\nVimL:   else\nVimL:     let res += s:_AddItemToDoc(a:tagname, a:data[a:tagname])\nVimL:   endif\nVimL:   return res\nVimL: endfunction\nVimL: \"\nVimL: function! s:_GenerateDoc(data)\nVimL:   \" echomsg \"\\n-->\".string(a:data)\nVimL:   \" tags ordered => determine the order in which they are displayed\nVimL:   let pre_tags_default = [ 'brief', 'ingroup', 'tparam', 'param', 'return', 'throw', 'invariant', 'pre', 'post']\nVimL:   let post_tags_default = ['note', 'warning', 'author', 'since', 'version', 'see']\nVimL:   let doc = []\nVimL:   let tags = lh#ft#option#get('pre_desc_ordered_tags', &ft, pre_tags_default)\nVimL:   for tag in filter(copy(tags), 'has_key(a:data, v:val)')\nVimL:     let doc +=  s:_AddToDoc(tag, a:data)\nVimL:   endfor\nVimL:   if has_key(s:fn_comments, 'semantics')\nVimL:     let doc += s:_AddItemToDoc('semantics', '')\nVimL:     for t in s:fn_comments.semantics\nVimL:         let doc += s:_AddItemToDoc('', '- '.t)\nVimL:     endfor\nVimL:   endif\nVimL:   if has_key(s:fn_comments, 'text')\nVimL:     if empty(s:fn_comments.text)\nVimL:       let doc += s:_AddItemToDoc('', '')\nVimL:     else\nVimL:       for t in s:fn_comments.text\nVimL:         let doc += s:_AddItemToDoc('', t)\nVimL:       endfor\nVimL:     endif\nVimL:   endif\nVimL:   let tags = lh#ft#option#get('post_desc_ordered_tags', &ft, post_tags_default)\nVimL:   for tag in filter(copy(tags), 'has_key(a:data, v:val)')\nVimL:     let doc +=  s:_AddToDoc(tag, a:data)\nVimL:   endfor\nVimL:   \" echomsg string(doc)\nVimL:   \" and finally, generate!\nVimL:   call s:Include('formatted-comment', 'cpp/internals', doc)\nVimL: endfunction\nMuT:  if lh#ft#option#get('template_expand_doc', &ft, 1)\nVimL:   call s:_GenerateDoc(s:fn_comments)\nMuT:  endif\n"
  },
  {
    "path": "after/template/cpp/internals/function.template",
    "content": "VimL:\" «function» File Template, Luc Hermitte <hermitte {at} free {dot} fr>, 27th Nov 2015\nVimL:\" hint: «function-hint»\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nMuT:  let s:function = s:Param('function', {})\nMuT:  let s:kind = get(s:function, 'kind', '')\nMuT:  if s:kind =~ '\\vconstructor|destructor|assignment-operator'\nVimL:   call s:Include(s:kind, 'cpp', s:function)\nMuT:    \" let s:how = get(s:function, 'how', '')\nMuT:    \" let s:how = s:how =~ \"\\\\vpure|deleted|defaulted\" ? \" \".lh#cpp#snippets#{s:how}() : \"\"\nMuT:    \" let s:clsname = s:Param(\"clsname\", lh#cpp#AnalysisLib_Class#CurrentScope(line(\".\"), \"class\"))\nVimL:   \"<+s:clsname+>(<+s:Param(\"parameters\", lh#marker#txt(\"ctr-parameters\"))+>)<+s:how+>;\nMuT:  elseif s:kind =~ '\\vget|set'\nVimL:   call s:Include(s:kind.'ter', 'cpp', {'attribute': s:function.attribute})\nMuT:  let s:attrb_name = s:function.attribute.name\nMuT:  else\nMuT:    let s:signature = get(s:function, 'signature', '')\nMuT:    let s:implementation = get(s:function, 'implementation', ';')\nVimL:   let s:signature = substitute(s:signature, '<+__clsname__+>', s:clsname, 'g')\nMuT:    if s:implementation != ';'\nVimL:     let s:implementation = substitute(s:implementation, '<+__clsname__+>', s:clsname, 'g')\nVimL:     let s:implementation = '{'.s:implementation.'}'\nMuT:    endif\nMuT:    let s:fn_comments = get(s:function, 'comments', {})\nMuT:    if !empty(s:fn_comments)\nVimL:     call s:Include('function-comment', 'cpp/internals', s:fn_comments)\nMuT:    endif\n<+s:signature+><+s:implementation+>\nMuT:  endif\nVimL: \" TODO: definition in separate file\n"
  },
  {
    "path": "after/template/cpp/internals/get-b-e.template",
    "content": "VimL:\" get-b-e File Template, Luc Hermitte <hermitte {at} free {dot} fr>, jeu. 02 juin 2016 17:02:36 CEST\nVimL: \" Parameters:\nVimL: \" - \"container\"\nVimL: \" Options:\nVimL: \" - (bg):cpp_begin_end_style\nVimL: \" Defines:\nVimL: \" - s:begin\nVimL: \" - s:end\nVimL: \" - s:container\nVimL: \" And:\nVimL: \" - include the relevant files according to g:cpp_begin_end_style\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nMuT:  let s:container = s:SurroundableParam('container', 1)\nMuT:  let s:begin = lh#cpp#snippets#_select_begin_end(s:container, 'begin')\nMuT:  let s:end   = lh#cpp#snippets#_select_begin_end(s:container, 'end')\nMuT:  let s:includes = lh#cpp#snippets#_include_begin_end()\nVimL: call lh#list#for_each_call(s:includes, s:getSNR('AddPostExpandCallback(\"lh#dev#import#add(v:val)\")'))\n"
  },
  {
    "path": "after/template/cpp/internals/get-class-name.template",
    "content": "VimL:\" get-class-name routine File Template, Luc Hermitte <hermitte {at} free {dot} fr>, jeu. 17 déc. 2015 18:40:56 CET\nVimL:\" hint: Internal routine to fetch the class name if already known\nVimL: \"1- in case the class name is already known, no need to extract it\nMuT:  let s:clsname = s:Param(\"clsname\",join(s:CmdLineParams(), ''))\nMuT:  if empty(s:clsname)\nVimL: \"2- otherwise: we try to extract it\nMuT:    let s:clsname = lh#cpp#AnalysisLib_Class#CurrentScope(line(\".\"), \"class\")\nMuT:    if empty(s:clsname)\nVimL: \"3- otherwise, we ask it to the end-user, default = filename minus extensions\nMuT:      let s:clsname = lh#ui#input(\"class name ?\", lh#marker#txt(lh#naming#type(expand(\"%:t:r\"))))\nMuT:    endif\nVimL: \"4- reinject the new clsname into the arguments\nVimL: \"   However, as this template-file is included, arguments will be popped\nVimL: \"   => clsname will be lost in crt context\nVimL: \"   => it has to be injected in parent context! (yes, this is quite dirty!)\nVimL:   call s:InjectInParentArgs({'clsname': (s:clsname)})\nMuT:  endif\n"
  },
  {
    "path": "after/template/cpp/internals/includes.template",
    "content": "VimL:\" includes File Template, Luc Hermitte <hermitte {at} free {dot} fr>, 02nd Dec 2015\nVimL:\" hint: include skel-routine\nVimL: \" Parameter: list/string: files to include\nMuT:  let s:includes = lh#list#flatten([s:Param(\"includes\", [])])\nVimL: for inc in s:includes | call s:AddPostExpandCallback('lh#dev#import#add(\"'.inc.'\")') | endfor\n"
  },
  {
    "path": "after/template/cpp/internals/list-constructors.template",
    "content": "VimL:\" list-constructors File Template, Luc Hermitte <hermitte {at} free {dot} fr>, 27th Nov 2015\nVimL:\" hint: Routine template-file, returns: s:constructors\nVimL: \"let g:args = deepcopy(s:args)\nMuT:  let s:flat_args     = lh#list#flatten(s:args)\nMuT:  let s:constructors  = filter(copy(s:flat_args), 'match(keys(v:val), \"constructor\") >= 0')\nVimL: \"let g:constructors0 = deepcopy(s:constructors)\nVimL: \" Ignore removed (none) constructors\nVimL: call filter(s:constructors, \"empty(lh#cpp#snippets#_filter_functions(v:val, 'none'))\")\nVimL: \"let g:constructors1 = deepcopy(s:constructors)\nVimL: \" Ignore defaulted constructors\nVimL: call filter(s:constructors, \"empty(lh#cpp#snippets#_filter_functions(v:val, 'how', 'defaulted'))\")\nVimL: \"let g:constructors2 = deepcopy(s:constructors)\nMuT:  let s:ctr_functions = filter(copy(s:flat_args), 'has_key(v:val,\"functions\")')\nVimL: \"let g:ctr_functions = deepcopy(s:ctr_functions)\nMuT:  if !empty(s:ctr_functions)\nVimL:   let s:ctr_functions2 = lh#list#accumulate2(s:ctr_functions, {}, 'extend(v:1_, v:2_)')\nVimL:   \"let s:ctr_functions3 = filter(copy(s:ctr_functions2['functions']), 'get(v:val, \"kind\", \"\") == \"constructor\"')\nVimL:   let s:ctr_functions3 = s:ctr_functions2.functions.filter({'kind': 'constructor'})\nVimL:   call extend(s:constructors, s:ctr_functions3)\nMuT:  endif\nVimL: \"let g:constructors3 = deepcopy(s:constructors)\n"
  },
  {
    "path": "after/template/cpp/internals/namespace-name.template",
    "content": "VimL:\" Factorize namespace name \"computation\"\nMuT:  let s:namespace = s:Param('namespace', '###')\nMuT:  if (type(s:namespace) == type('')) && (s:namespace == '###')\nMuT:     let s:namespace0 = lh#ft#option#get('project_namespace', &ft, lh#marker#txt('ns'))\nMuT:     let s:namespace = type(s:namespace0) == type([]) ? join(s:namespace0, \"::\") : s:namespace0\nVimL:    let s:namespace = lh#ui#input('Namespace name: ', s:namespace)\nMuT:  endif\n"
  },
  {
    "path": "after/template/cpp/internals/shall_explicit_defaults.template",
    "content": "VimL:\" shall_explicit_defaults File Template, Luc Hermitte <hermitte {at} free {dot} fr>, 26th Nov 2015\nVimL:\" hint: wraps call to lh#cpp#snippets#shall_explicit_defaults()\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nMuT:  if lh#cpp#snippets#shall_explicit_defaults()\nMuT:    let default_explicit = {\"visibility\": \"public\", \"how\": \"defaulted\"}\nMuT:  else\nMuT:    let default_explicit = {\"visibility\": \"none\"}\nMuT:  endif\n"
  },
  {
    "path": "after/template/cpp/internals/stream-common.template",
    "content": "VimL:\" «stream-common» File Template, Luc Hermitte\nVimL: let s:reindent     = 1\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:type = 'std::'.s:direction.'stream'\nVimL: let s:op = lh#ui#if(s:direction=='o', '<<', '>>')\nVimL: let s:const = lh#ui#if(s:direction=='o', 'const ', ' ')\nVimL: let s:clsname0 = Cpp_SearchClassDefinition(line('.'))\nVimL: let s:friend = lh#ui#if(strlen(s:clsname0), 'friend ', ' ')\nVimL: let s:clsname  = lh#ui#input(\"Template\\noperator\".s:op.\" for the class:\", s:clsname0)\nVimL: call s:Include('stream-signature', 'cpp/internals')\nVimL: call s:Include('stream-implementation', 'cpp/internals')\n<++>\nVimL: \" Todo: check for context-namespaces and trim them from s:clsname\nVimL: \" Todo: check for the previous class if s:clsname0 isempty\nVimL: \" Todo: options for inline or not ; -> g:implPlace, ...\nVimL: \" Todo: ask for simple or complex (Langer/Roguewave) inserter\nVimL: \" Todo: Try to detect The attributes of the objet in order to generate the instruction. ; option: separator\n"
  },
  {
    "path": "after/template/cpp/internals/stream-implementation.template",
    "content": "VimL:\" «stream-implementation» File Template, Luc Hermitte\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<'.s:direction.'stream>\")')\n{\nVimL: \" The space for the second argument is madatory at the moment.\n    return ¡s:stream_param.' '.s:op¡ <+fields+>;\n}\n"
  },
  {
    "path": "after/template/cpp/internals/stream-signature.template",
    "content": "VimL:\" «stream-signature» File Template, Luc Hermitte, 04th Jun 2004\nVimL: let s:stream_param = lh#naming#param(s:direction.\"s\")\n<+s:friend.s:type+> & operator<+s:op+>(¡s:type.' & '.s:stream_param¡, <+s:const.s:clsname+> & <+lh#naming#param(\"v\")+>)\n"
  },
  {
    "path": "after/template/cpp/iss.template",
    "content": "VimL:\" {istringstream iss(str); iss >>..} File Template, Luc Hermitte, 06th Dec 2010\nVimL:\" hint: std::istringstream iss(str); if (iss >> ...) { ... }\nVimL: let s:value_start = '¡'\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<sstream>\")')\nstd::istringstream iss(<++>);\nif (iss >> <++>) {\n    <++>\n}<++>\n"
  },
  {
    "path": "after/template/cpp/list.template",
    "content": "VimL:\" list File Template, Luc Hermitte, 28th Apr 2014\nVimL:\" hint: std::list<>\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<list>\")')\nstd::list<¡s:Surround(1, '<+type+>')¡> <++>\n"
  },
  {
    "path": "after/template/cpp/map.template",
    "content": "VimL:\" map File Template, Luc Hermitte, 28th Apr 2014\nVimL:\" hint: std::map<>\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<map>\")')\nstd::map<¡s:Surround(1, '<+key+>')¡, ¡s:Surround(2, '<+value+>')¡><+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/cpp/namespace.template",
    "content": "VimL:\" C++ namespace Template, Luc Hermitte\nVimL:\" hint: namespace ns { ... } // ns\nVimL:\" Options:\nVimL:\" - snippet parameter: {'namespace' : xxx}\nVimL:\" - (bg):[cpp_]project_namespace\nVimL:\" - (bg):cpp_use_nested_namespace (bool) when [bg]:cpp_std_flavour=/CXXFLAGS/CMake match C++17\nVimL:\" - lh#style options\nVimL: let s:value_start  = '¡'\nVimL: let s:value_end    = '¡'\nVimL: let s:reindent     = 1\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL:\"\nMuT:  if ! exists('s:namespace')\nVimL: call s:Include('namespace-name', 'cpp/internals')\nMuT:  endif\nMuT:  let s:ns_join = lh#cpp#option#multiple_namespaces_on_same_line()\nMuT:  if lh#cpp#use_cpp17() && lh#option#get('cpp_use_nested_namespaces', 1)\nMuT:    let s:namespaces = type(s:namespace) == type([]) ? s:namespace : [s:namespace]\nMuT:  else\nMuT:    let s:namespaces = type(s:namespace) == type([]) ? s:namespace : split(s:namespace, \"::\")\nMuT:  endif\nVimL: \" let s:ns_open   = s:namespace =~ '^\\s*$' ? [\"namespace{// Anonymous namespace\"] : map(copy(s:namespaces), '\"namespace \".v:val.\"{\"')\nVimL: \" let s:ns_close  = s:namespace =~ '^\\s*$' ? [\"}// Anonymous namespace\"] : map(copy(s:namespaces), '\"}\".(s:ns_join ? \"\" : \" // \".v:val.\" namespace\")')\nVimL: let s:ns_open   = empty(s:namespaces) ? [\"namespace{// Anonymous namespace\"] : map(copy(s:namespaces), '\"namespace \".v:val.\"{\"')\nVimL: let s:ns_close  = empty(s:namespaces) ? [\"}// Anonymous namespace\"] : map(copy(s:namespaces), '\"}\".(s:ns_join ? \"\" : \"// \".v:val.\" namespace\")')\nVimL: let s:ns_join_s = s:ns_join ? \" \" : \"\\n\"\n<+join(s:ns_open, s:ns_join_s)+>\nMuT:  let s:def_content = s:Param('content', lh#marker#txt())\n¡s:Surround(1, s:def_content)¡\nMuT:  let s:ns_comment = s:ns_join && !empty(s:namespaces) ? (\"// \".join(s:namespaces, \"::\") . \" namespace\".(len(s:namespaces)>1 ? \"s\": \"\")) : \"\"\n<+join(s:ns_close, s:ns_join_s)+><+s:ns_comment+>\nMuT:  if ! s:Param('included', 0)\n<+s:TerminalPlaceHolder()+>\nMuT:  endif\nVimL: \"<+join(s:ns_close, s:ns_join_s)+><+s:ns_join && s:namespace !~ '^\\s*$'? (\" // \".s:namespace . \" namespace\".(len(s:namespaces)>1 ? \"s\": \"\")) : \"\"+>\n"
  },
  {
    "path": "after/template/cpp/noncopyable.template",
    "content": "VimL:\" noncopyable File Template, Luc Hermitte <hermitte at free.fr>, 28th May 2014\nVimL:\" hint: boost::noncopyable\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<boost/noncopyable.hpp>\")')\nboost::noncopyable\n"
  },
  {
    "path": "after/template/cpp/operator-binary.template",
    "content": "VimL:\" C++ binary operator snippet, Luc Hermitte, 30th Sep 2013\r\nVimL:\" hint: operatorX(T lhs, T const& rhs) { return lhs X= rhs; }\r\nVimL: let s:marker_open  = '<+'\r\nVimL: let s:marker_close = '+>'\r\nVimL: let s:reindent     = 1\r\nVimL:\"\r\nVimL: \"1- snippet parameters\r\nVimL: \"1.1- classname\r\nVimL: \"1.1.1- in case the class name is already known, no need to extract it\r\nMuT:  let s:clsname = s:Param(\"clsname\",join(s:CmdLineParams(), ''))\r\nMuT:  if empty(s:clsname)\r\nVimL: \"1.1.2- otherwise: we try to extract it\r\nMuT:    let s:clsname = lh#cpp#AnalysisLib_Class#CurrentScope(line(\".\"), \"class\")\r\nMuT:    if empty(s:clsname)\r\nVimL: \"1.1.3- otherwise, we try to get the name of the last class found\r\nMuT:      let s:clsname = lh#cpp#AnalysisLib_Class#search_closest_class(line('.'))\r\nVimL: \"1.1.4- otherwise, we ask it to the end-user, default = filename minus extensions\r\nMuT:      if empty(s:clsname)\r\nMuT:        let s:clsname = lh#ui#input(\"class name ?\", lh#marker#txt(lh#naming#type(expand(\"%:t:r\"))))\r\nMuT:      endif\r\nMuT:      let s:_friend = ''\r\nMuT:    else\r\nMuT:      let s:_friend = 'friend '\r\nMuT:    endif\r\nMuT:  else\r\nMuT:    let s:_friend = lh#marker#txt('friend ')\r\nMuT:  endif\r\nVimL: \"1.2- the operator\r\nMuT:  let s:_op      = s:Param('operator', lh#marker#txt('X'))\r\nVimL: \"1.3- operator parameters\r\nMuT:  let s:_lhs     = lh#naming#param('lhs')\r\nMuT:  let s:_rhs     = lh#naming#param('rhs')\r\nVimL: \"\r\nVimL:\" 2- the code\r\n<+s:_friend+><+s:clsname+> operator<+s:_op+>(<+s:clsname+> <+s:_lhs+>, <+s:clsname+> const& <+s:_rhs+>){ return <+s:_lhs+> <+s:_op+>= <+s:_rhs+>; }\r\n"
  },
  {
    "path": "after/template/cpp/oss.template",
    "content": "VimL:\"{std::ostringstream oss; oss << } Template-File, Luc Hermitte\nVimL:\" hint: std::ostringstream oss; oss << ...\nVimL: let s:value_start  = '¡'\nVimL: let s:value_end    = '¡'\nVimL: let s:reindent     = 1 \nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<sstream>\")')\nstd::ostringstream oss;\noss << <++>;\n<++>\n"
  },
  {
    "path": "after/template/cpp/otb-sug-latex.template",
    "content": "VimL:\" $Id$\nVimL:\" otb-sug-latex File Template, Luc Hermitte, 21st May 2012\nVimL:\" hint: Software Guide : BeginLatex\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\n// Software Guide : BeginLatex\n//\n¡s:Surround(1, '//  <+doc+>')¡\n//\n// Software Guide : EndLatex\n"
  },
  {
    "path": "after/template/cpp/otb-sug-snippet.template",
    "content": "VimL:\" $Id$\nVimL:\" otb-sug-snippet File Template, Luc Hermitte, 21st May 2012\nVimL:\" hint: Software Guide : BeginCodeSnippet\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\n// Software Guide : BeginCodeSnippet\n¡s:Surround(1, '<+code+>')¡\n// Software Guide : EndCodeSnippet\n"
  },
  {
    "path": "after/template/cpp/path.template",
    "content": "VimL:\" boost-path File Template, Luc Hermitte, 29th Apr 2014\nVimL:\" hint: boost::filesystem::path\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<boost/filesystem.hpp>\")')\nboost::filesystem::path<++>\n"
  },
  {
    "path": "after/template/cpp/ptr_vector.template",
    "content": "VimL:\" ptr_vector File Template, Luc Hermitte <hermitte at free.fr>, 22nd May 2014\nVimL:\" hint: boost::ptr_vector<>\nVimL:\" hint: std::vector<>\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<boost/ptr_container/ptr_vector.hpp>\")')\nboost::ptr_vector<¡s:Surround(1, '<+type+>')¡> <++>\n"
  },
  {
    "path": "after/template/cpp/ref_setter.template",
    "content": "VimL:\" setter File Template, Luc Hermitte <hermitte {at} free {dot} fr>, 02nd Dec 2015\nVimL:\" hint: void setFoo(T const& foo) { *m_foo = foo; } // for ptr attributes\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:reindent     = 1\nVimL: \"The interactive mode (w/ dynamic placeholders) won't permit to have \"setFoo\" and \"return m_foo\".\nMuT:  let s:attribute    = s:Param(\"attribute\", {'type': lh#marker#txt(lh#naming#type('type')), 'name': lh#marker#txt('name')})\nMuT:  let s:attrb_name   = s:attribute.name\nMuT:  let s:attrb_param  = lh#naming#param(s:attrb_name)\nMuT:  if !lh#dev#cpp#types#IsPointer(s:attribute.type)\nVimL:   throw \"ref_setter snippet: \".s:attribute.type.\" is not recognized as a pointer type\"\nMuT:  else\nMuT:    let s:in_type = lh#dev#cpp#types#remove_ptr(s:attribute.type)\nVimL:   let s:in_type = lh#dev#cpp#types#const_correct_type(s:in_type)\nvoid <+lh#naming#setter(s:attrb_name)+>(<+s:in_type+> <+s:attrb_param+>){*<+lh#naming#member(s:attrb_name)+> = <+s:attrb_param+>;}\nMuT:  endif\n"
  },
  {
    "path": "after/template/cpp/scoped_ptr.template",
    "content": "VimL:\" scoped_ptr File Template, Luc Hermitte <hermitte {at} free {dot} fr>, jeu. 23 juin 2016 17:28:07 CEST\nVimL:\" hint: boost::scoped_ptr<>\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<boost/scoped_ptr.hpp>\")')\nboost::scoped_ptr<¡s:Surround(1, '<+type+>')¡><+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/cpp/set.template",
    "content": "VimL:\" set File Template, Luc Hermitte, 28th Apr 2014\nVimL:\" hint: std::set<>\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<set>\")')\nstd::set<¡s:Surround(1, '<+type+>')¡><+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/cpp/setter.template",
    "content": "VimL:\" setter File Template, Luc Hermitte <hermitte {at} free {dot} fr>, 02nd Dec 2015\nVimL:\" hint: void setFoo(T const& foo) { m_foo = foo; }\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:reindent     = 1\nVimL: \"The interactive mode (w/ dynamic placeholders) won't permit to have \"setFoo\" and \"return m_foo\".\nMuT:  let s:attribute    = s:Param(\"attribute\", {'type': lh#marker#txt(lh#naming#type('type')), 'name': lh#marker#txt('name')})\nMuT:  let s:attrb_name   = s:attribute.name\nMuT:  let s:attrb_param  = lh#naming#param(s:attrb_name)\nvoid <+lh#naming#setter(s:attrb_name)+>(<+lh#dev#cpp#types#const_correct_type(s:attribute.type)+> <+s:attrb_param+>){<+lh#naming#member(s:attrb_name)+> = <+s:attrb_param+>;}\n"
  },
  {
    "path": "after/template/cpp/shared_ptr.template",
    "content": "VimL:\" shared_ptr File Template, Luc Hermitte, 28th Apr 2014\nVimL:\" hint: std/boost::shared_ptr<>\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nMuT:  if lh#cpp#use_cpp11()\nVimL:    call s:AddPostExpandCallback('lh#dev#import#add(\"<memory>\")')\nstd::shared_ptr<¡s:Surround(1, '<+type+>')¡> <++>\nMuT:  else\nVimL:    call s:AddPostExpandCallback('lh#dev#import#add(\"<boost/shared_ptr.hpp>\")')\nboost::shared_ptr<¡s:Surround(1, '<+type+>')¡> <++>\nMuT:  endif\n"
  },
  {
    "path": "after/template/cpp/singleton.template",
    "content": "VimL:\" C++ Singleton-Class Template, Luc Hermitte\nVimL:\" «Meyers singleton», cf. More Effective C++ Item 26\nVimL:\" For a more precise definition, cf. A. Alexandrescu's Modern C++ Design\nVimL:\" hint: Singleton class Wizard\nVimL: let s:value_start  = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:reindent     = 1\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nMuT:  let s:parameters = s:Param('cls_parameters', {})\nVimL: call lh#dict#add_new(s:parameters, {'noncopyable': 1, 'final': 1, 'comments': {}})\nMuT:  let s:functions = s:Param('functions', lh#cpp#snippets#new_function_list())\nVimL: \" in case the class name is already known, no need to extract it\nVimL: call s:Include('get-class-name', 'cpp/internals')\nVimL: \" Defines Doxygen comments\nMuT:  let s:cls_comments = s:parameters.comments\nVimL: let s:cls_comments.brief = lh#dox#brief(s:clsname.' singleton.')\nVimL: \" Ask which kind\nMuT:  let s:type = confirm('Of what type of the singleton should be?', \"&Meyers' (local-static, MT-safe (in C++11), default ctr)\\n\" .'&Explicit Initialisation (MT-safe)', 2 - lh#cpp#use_cpp11())\nMuT:  if s:type == 1\nVimL: \" ----> Meyers' singleton\nVimL:    \" --- instance()\nMuT:     let s:instance = {'signature': 'static <+__clsname__+> & instance() '.lh#cpp#snippets#noexcept()}\nVimL:    let s:instance.implementation = \"static <+__clsname__+> s_instance;\\nreturn s_instance;\"\nVimL:    let s:instance.comments = {'brief': 'Singleton Accessor.', 'throw': 'None'}\nVimL:    call s:functions.insert(s:instance)\nVimL:    \" --- Force default-constructor and destructor to private\nVimL:    \" And set how to defaulted, in not already set\nMuT:     let s:default_constructor = s:Param('default-constructor', {})\nVimL:    let s:default_constructor.visibility = 'private'\nVimL:    let s:default_constructor.comments = {'text': ['Hidden constructor.'], 'see': '`instance()`'}\nVimL:    call lh#dict#add_new(s:default_constructor, {'how': 'defaulted'})\nMuT:     let s:destructor = s:Param('destructor', {})\nVimL:    let s:destructor['visibility'] = 'private'\nVimL:    call lh#dict#add_new(s:destructor, {'how': 'defaulted'})\nVimL:    \" --- Complete Doxygen comments\nVimL:    let s:cls_comments.semantics = ['Implicitly initialized with a default constructor', 'MT-safe', 'Non-copyable']\nVimL:    \" --- Insert the skeleton built\nVimL:    call s:Include('class-skeleton', 'cpp/internals', s:parameters)\nMuT:  elseif s:type == 2\nVimL: \" ----> Explicit' singleton\nVimL:    call s:AddPostExpandCallback('lh#dev#import#add(\"<cassert>\")')\nVimL:    \" --- instance()\nMuT:     let s:instance = {}\nVimL:    let s:instance.comments = {'brief': 'Singleton Accessor.', 'throw': 'None', 'pre': '`ms_instance != nullptr`'}\nVimL:    let s:instance.signature = 'static <+__clsname__+> & instance() '.lh#cpp#snippets#noexcept()\nVimL:    let s:instance.implementation = 'assert(ms_instance && \"Singleton not initialized.\");'\nVimL:    let s:instance.implementation .= \"\\nreturn *ms_instance;\"\nVimL:    call s:functions.insert(s:instance)\nVimL:    \" --- create()\nMuT:     let s:create = {}\nVimL:    let s:create.comments = {'brief': 'Singleton Construction.', 'throw': lh#marker#txt('std::exception'), 'pre': ' `ms_instance == nullptr`', 'post': '`ms_instance != nullptr`'}\nVimL:    let s:create.signature = 'static void create('.lh#marker#txt('Parameters').')'\nVimL:    let s:create.implementation = 'assert(!ms_instance && \"Singleton already initialized.\");'\nVimL:    let s:create.implementation .= \"\\nms_instance = new <+__clsname__+>(\".lh#marker#txt('parameters').');'\nVimL:    call s:functions.insert(s:create)\nVimL:    \" --- release()\nMuT:     let s:release = {}\nVimL:    let s:release.comments = {'brief': 'Singleton Destruction.', 'throw': 'None', 'pre': ' `ms_instance != nullptr`', 'post': '`ms_instance == nullptr`'}\nVimL:    let s:release.signature = 'static void release() '.lh#cpp#snippets#noexcept()\nVimL:    let s:release.implementation = 'assert(ms_instance && \"Singleton not initialized.\");'\nVimL:    let s:release.implementation .= \"\\nms_instance = \".lh#cpp#snippets#nullptr().\";\"\nVimL:    call s:functions.insert(s:release)\nVimL:    \" --- Define an init-constructor\nMuT:     let s:init_constructor = s:functions.get1({'kind' : 'init-constructor'})\nVimL:    let s:init_constructor.visibility = 'private'\nVimL:    \" call s:functions.insert(s:init_constructor)\nVimL:    \" --- Set destructor to private, set how to defaulted, in not already set\nMuT:     let s:destructor = s:Param('destructor', {})\nVimL:    let s:destructor['visibility'] = 'private'\nVimL:    call lh#dict#add_new(s:destructor, {'how': 'defaulted'})\nVimL:    \" --- Complete Doxygen comments\nVimL:    let s:cls_comments.semantics = ['Explicitly initialized', 'MT-safe', 'Non-copyable']\nVimL:    \" --- Insert the skeleton built\nVimL:    call s:Include('class-skeleton', 'cpp/internals', s:parameters)\n// don't forget to move the following definition to <+expand('%:t:r')+>.cpp\n<+s:clsname+> *<+s:clsname+>::ms_instance = <+lh#cpp#snippets#nullptr()+>;\nMuT:  endif\n"
  },
  {
    "path": "after/template/cpp/sort.template",
    "content": "VimL:\" std::sort File Template, Luc Hermitte, 28th May 2015\nVimL:\" hint: std::sort(range.begin(), range.end());\nVimL:\" todo: support for std::begin() and std::end()\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:reindent     = 1\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<algorithm>\")')\nVimL: let s:range = s:Surround(1, s:Param('range', lh#marker#txt('range')))\nstd::sort(<+s:range+>.begin(),<+s:range+>.end());\nVimL: unlet s:range\n"
  },
  {
    "path": "after/template/cpp/starts_with.template",
    "content": "VimL:\" starts_with File Template, Luc Hermitte <hermitte at free.fr>, 28th May 2014\nVimL:\" hint: boost::algorithm::starts_with\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<boost/algorithm/string/predicate.hpp>\")')\nboost::algorithm::starts_with(<+input+>, <+prefix_searched+>)\n"
  },
  {
    "path": "after/template/cpp/static_assert.template",
    "content": "VimL:\" static_assert File Template, Luc Hermitte, 23rd Apr 2014\nVimL:\" hint: static_assert(cond, msg)/BOOST_STATIC_ASSERT(cond)\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:reindent     = 1\nVimL: let s:_condition = s:Param('condition', lh#marker#txt(\"condition\"))\nVimL: let s:_message   = s:Param('message', lh#marker#txt(\"message\"))\nMuT:  if lh#cpp#use_cpp11()\nstatic_assert(<+s:_condition+>, <+s:_message+>);\nMuT:  else\nBOOST_STATIC_ASSERT(<+s:_condition+>);\nVimL: call s:AddPostExpandCallback(lh#dev#import#add(\"<boost/static_assert.hpp>\"))\nMuT:  endif\n"
  },
  {
    "path": "after/template/cpp/stream-extractor.template",
    "content": "VimL:\" C++ stream-extractor (operator>>) Template, Luc Hermitte, 04th Jun 2004\nVimL:\" hint: istream& operator>>(istream &, class-type)\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:direction   = 'i'\nVimL: call s:Include('stream-common', 'cpp/internals')\n"
  },
  {
    "path": "after/template/cpp/stream-inserter.template",
    "content": "VimL:\" C++ stream-inserter (operator<<) Template, Luc Hermitte, 04th Jun 2004\nVimL:\" hint: ostream& operator<<(ostream &, class-type)\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:direction   = 'o'\nVimL: call s:Include('stream-common', 'cpp/internals')\n"
  },
  {
    "path": "after/template/cpp/string.template",
    "content": "VimL:\" string File Template, Luc Hermitte, 28th Apr 2014\nVimL:\" hint: std::string\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<string>\")')\nstd::string<+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/cpp/swap-function.template",
    "content": "VimL:\" swap-function File Template, Luc Hermitte <hermitte {at} free {dot} fr>, mar. 22 déc. 2015 11:34:40 CET\nVimL:\" hint: void swap(T & other)\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:Include('get-class-name', 'cpp/internals')\nMuT:  let s:param_name = lh#naming#param(\"other\")\nVimL: let s:fn_comments = lh#dox#new_function(\"Swap operation.\")\nVimL: let s:fn_comments.throw = [\"None\"]\nVimL: let s:fn_comments.param = [{'name': s:param_name, 'text': \"data with which content is swapped\", 'dir': 'in,out'}]\nVimL: call s:Include(\"function-comment\", \"cpp/internals\",s:fn_comments)\nVimL: \" If parameters are known => swap them!\nMuT:  let s:attributes = s:Param(\"attributes\", lh#option#unset())\nMuT:  if lh#option#is_set(s:attributes) && !empty(s:attributes)\nMuT:    let s:definition = \"{using std::swap;\\n\"\nVimL:   let s:definition .= join(map(copy(s:attributes), '\"swap(\".lh#naming#member(v:val.name).\", \".s:param_name.\".\".lh#naming#member(v:val.name).\");\"'), \"\\n\")\nVimL:   let s:definition .= '}'\nMuT:  else\nMuT:    let s:definition = ';'\nMuT:  endif\nvoid swap(<+s:clsname+> & <+s:param_name+>) <+lh#cpp#snippets#noexcept()+><+s:definition+>\n"
  },
  {
    "path": "after/template/cpp/throw.template",
    "content": "VimL:\"{throw default exceptions for project} Template-File, Luc Hermitte\nVimL:\" hint: throw std::runtime_error/@throw (depending on context)\nVimL:\"\nVimL:\" This snippet supports options:\nVimL:\" - b:exception_type in the form of a string\nVimL:\" - b:exception_args in the form of lh#function:\nVimL:\"   e.g.: let b:exception_args = 'v:1_.lh#marker#txt(\", \".b:cpp_project_namespace.\"::ExitCode::\")'\nVimL:\"   This functor takes a parameter that will get injected in place of v:1_\nVimL:\"   e.g. VimL: call s:Include('throw', 'cpp', '\"Cannot decode'.s:enum_name.'\"')\nVimL:\"   Note: If you want to dynamically adapt to the current marcher\nVimL:\"   characters, or the current b:cpp_project_namespace option, don't use `string()`\nVimL:\"   in expressions like:\nVimL:\"   :let b:exception_args = 'v:1_.'.string(lh#marker#txt(', '.b:cpp_project_namespace.'::ExitCode::'))\nVimL:\"\nVimL: let s:reindent     = 1\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nMuT:  let s:_exception_type = lh#ft#option#get('exception_type', &ft, 'std::runtime_error')\nMuT:  let s:_exception_txt  = empty(s:CmdLineParams()) ? lh#marker#txt('text') : (s:CmdLineParams()[0])\nMuT:  let s:_exception_args = lh#function#bind(lh#ft#option#get('exception_args', &ft, 'v:1_'))\nMuT:  if synIDattr(synID(line('.'),col('.')-1,1),'name') =~ 'doxygen\\|comment'\n<+lh#dox#throw(lh#marker#txt(s:_exception_type))+><++>\nMuT:  else\nMuT:    if s:_exception_type =~ 'std::.*'\nVimL:     call s:AddPostExpandCallback('lh#dev#import#add(\"<stdexcept>\")')\nMuT:    endif\nthrow <+s:_exception_type+>(<+lh#function#execute(s:_exception_args, s:_exception_txt)+>);<++>\nMuT:  endif\nVimL: unlet s:_exception_type\nVimL: unlet s:_exception_txt\nVimL: unlet s:_exception_args\n"
  },
  {
    "path": "after/template/cpp/traits.template",
    "content": "VimL:\" traits-class File Template, Luc Hermitte, 20th Jan 2011\nVimL:\" hint: traits-class\nVimL: let s:value_start = '¡'\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\n/** <+name+> traits class.\n */\ntemplate <typename <+T+>> struct <+name+>_traits\n{\n    <++>\n};\n\n/** <+name+> traits class specialization for \\c <+spe+>.\n */\nVimL: \" todo: auto deduce the overridable traits\ntemplate <> struct <+name+>_traits<<+spe+>>\n{\n    <++>\n};\n"
  },
  {
    "path": "after/template/cpp/try.template",
    "content": "VimL:\"{try{...}catch(){...}} Template-File, Luc Hermitte\nVimL:\" hint: try { ... } catch(...) { ... }\nVimL: let s:value_start  = '¡'\nVimL: let s:value_end    = '¡'\nVimL: let s:reindent     = 1\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\ntry{\n    ¡s:Surround(1, '<+code+>')¡\n}catch(<+std::exception const& e+>){\n    ¡s:Surround(2, '<+catch-code+>')¡\n} <+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/cpp/typeid.template",
    "content": "VimL:\" typeid File Template, Luc Hermitte <hermitte {at} free {dot} fr>, jeu. 31 mars 2016 11:38:16 CEST\nVimL:\" hint: typeid(<++>).name()\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<typeinfo>\")')\ntypeid(<+s:SurroundableParam(\"type\", 1)+>).name()<+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/cpp/unique_ptr.template",
    "content": "VimL:\" unique_ptr File Template, Luc Hermitte, 28th Apr 2014\nVimL:\" hint: std::unique_ptr<>\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<memory>\")')\nstd::unique_ptr<¡s:Surround(1, '<+type+>')¡> <++>\n"
  },
  {
    "path": "after/template/cpp/unordered_map.template",
    "content": "VimL:\" unordered_map File Template, Luc Hermitte, 07th Oct 2017\nVimL:\" hint: std::unordered_map\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<unordered_map>\")')\nstd::unordered_map<¡s:Surround(1, '<+key+>')¡, ¡s:Surround(2, '<+value+>')¡><+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/cpp/unordered_set.template",
    "content": "VimL:\" unordered_set File Template, Luc Hermitte, 07th Oct 2017\nVimL:\" hint: std::unordered_map\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<unordered_set>\")')\nstd::unordered_set<¡s:Surround(1, '<+type+>')¡><+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/cpp/utf8.template",
    "content": "let s:value_start  = '¡'\n \n"
  },
  {
    "path": "after/template/cpp/value-class.template",
    "content": "VimL:\" value-class File Template, Luc Hermitte <hermitte {at} free {dot} fr>, 25th Nov 2015\nVimL:\" hint: Value Class ((implicitly) copyable, no hierarchy)\nMuT:  let s:destructor = s:Param(\"destructor\", {})\nVimL: if get(s:destructor, 'virtual', 0) | throw \"Value classes aren't expected to belong to polymorphic hierarchies\" | endif\nVimL: \" --- in case the class name is already known, no need to extract it\nVimL: call s:Include('get-class-name', 'cpp/internals')\nVimL: \" --- Defines Doxygen comments\nMuT:  let s:parameters = s:Param('cls_parameters', {})\nVimL: call lh#dict#add_new(s:parameters, {'comments': {}, 'copyable': 1})\nMuT:  let s:cls_comments = s:parameters.comments\nVimL: let s:cls_comments.semantics = get(s:cls_comments, 'semantics', [])\nVimL: let s:cls_comments.semantics += ['Value object',lh#marker#txt('Regular object'),lh#marker#txt('Comparable')]\nVimL: \" --- Force special functions\nVimL: \" TODO: detect when the class has no declared attribute. Propose to force the generation of empty shells for the special functions in case the object will contain non-copyable attributes\nVimL: \" --- Insert the skeleton built\nVimL: call s:Include('class-skeleton', 'cpp/internals', s:parameters)\n"
  },
  {
    "path": "after/template/cpp/vector.template",
    "content": "VimL:\" vector File Template, Luc Hermitte, 28th Apr 2014\nVimL:\" hint: std::vector<>\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<vector>\")')\nMuT:  let s:type = s:SurroundableParam('type', 1)\nstd::vector<<+s:type+>> <+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/cpp/weak_ptr.template",
    "content": "VimL:\" weak_ptr File Template, Luc Hermitte, 28th Apr 2014\nVimL:\" hint: std/boost::weak_ptr<>\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nMuT:  if lh#cpp#use_cpp11()\nVimL:    call s:AddPostExpandCallback('lh#dev#import#add(\"<memory>\")')\nstd::weak_ptr<¡s:Surround(1, '<+type+>')¡> <++>\nMuT:  else\nVimL:    call s:AddPostExpandCallback('lh#dev#import#add(\"<boost/shared_ptr.hpp>\")')\nboost::weak_ptr<¡s:Surround(1, '<+type+>')¡> <++>\nMuT:  endif\n"
  },
  {
    "path": "after/template/cpp/while-getline.template",
    "content": "VimL:\" while-getline File Template, Luc Hermitte, 06th Sep 2012\nVimL:\" hint: while(std::getline(stream,line)) { action; }\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:reindent     = 1\nVimL: call s:AddPostExpandCallback('lh#dev#import#add(\"<string>\")')\nwhile(std::getline(<+stream+>, <+line+>)){\n    ¡s:Surround(1, '<+code+>')¡\n}<+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/dox/author.template",
    "content": "VimL:\" C++ Doxygen snippet for authors, Luc Hermitte\nVimL:\" hint: @author\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:reindent = 1\n<+lh#dox#author()+>\n"
  },
  {
    "path": "after/template/dox/code.template",
    "content": "VimL:\" doxygen <code/> File Template, Luc Hermitte, 11th Apr 2012\nVimL:\" hint: <code>|</code>\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:reindent     = 1\nVimL: let s:code = s:Param(\"code\", lh#marker#txt())\nVimL: let s:text = s:Surround(1, s:code)\n<+lh#dox#tag(\"code\")+>\nVimL: unlet s:code\nVimL: unlet s:text\n"
  },
  {
    "path": "after/template/dox/em.template",
    "content": "VimL:\" doxygen <em/> snippet, Luc Hermitte, 11th Apr 2012\nVimL:\" hint: <em>|</em>\nVimL: let s:text = s:Surround(1, lh#marker#txt())\n<em><+s:text+></em><+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/dox/file.template",
    "content": "VimL:\" dox/file Template, Luc Hermitte\nVimL:\" hint: /** @file ... */\nVimL: let s:value_start  = '¡'\nVimL: let s:value_end    = '¡'\nVimL: let s:reindent     = 1\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL:\"\n/**<+lh#dox#tag(\"ingroup\")+> g¡lh#option#get('dox_group', '<+Projet+>')¡\n * <+lh#dox#tag(\"file\")+>    ¡expand('%:t')¡\n * <+lh#dox#author()+>\n * <+lh#dox#tag(\"version\")+> ¡'$'¡Revision$\n * <+lh#dox#since()+>\n * ¡'$'¡Id$\n */\n\n"
  },
  {
    "path": "after/template/dox/function.template",
    "content": "VimL:\" C++ Doxygen snippet for functions, Luc Hermitte\nVimL:\" Meant to be used through the command :DOX\nVimL:\" hint: /** @ingroup, @params, @exceptions, ... */\nVimL:\" TODO: rewrite to rely on function-comment.template\nVimL: let s:value_start  = '¡'\nVimL: let s:value_end    = '¡'\nVimL: let s:reindent     = 1\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\n/**¡CppDox_snippet('ingroup', '')¡\n ¡CppDox_snippet('brief', '* ')¡\n * <+details+>\n ¡CppDox_snippet('Params', '* ')¡\n *\n ¡CppDox_snippet('return', '* ')¡\n ¡CppDox_snippet('exceptions', '* ')¡\n ¡CppDox_snippet('preconditions', '* ')¡\n */\n"
  },
  {
    "path": "after/template/dox/group.template",
    "content": "VimL:\" Doxygen local group File-Template, Luc Hermitte, 26th Jan 2011\nVimL:\" hint: Doxygen local group\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:reindent     = 1\n/**<+lh#dox#tag(\"name \")+><+group-name+> */\nMuT:  let s:text = s:Surround(1, \"<++>\")\nVimL: let s:text = s:text != \"<++>\" ? (\"\\n\".s:text) : lh#marker#txt()\n//@{<+s:text+>\n//@}<+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/dox/html.template",
    "content": "VimL:\" doxygen <+html+> snippets, Luc Hermitte, 11th Apr 2012\nVimL:\" hint: <html-tag>|</html-tag>\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nMuT: let s:text = s:Surround(1, lh#marker#txt())\nMuT: let s:tag = s:Surround(2, lh#marker#txt(\"html\"))\n<<+s:tag+>><+s:text+></<+s:tag+>><+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "after/template/dox/ingroup.template",
    "content": "VimL:\" $Id$\nVimL:\" dox/ingroup File Template, Luc Hermitte, 23rd Dec 2013\nVimL:\" hint: /**@ingroup ... */\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\nVimL: let s:reindent     = 1\nVimL:\"\n/**<+lh#dox#tag(\"ingroup\")+> g¡lh#option#get('dox_group', '<+Projet+>')¡\n */<++>\n"
  },
  {
    "path": "after/template/dox/since.template",
    "content": "VimL:\" C++ Doxygen snippet for since tag, Luc Hermitte\nVimL:\" hint: @since Version\nVimL: let s:value_start = '¡'\nVimL: let s:value_end   = s:value_start\nVimL: let s:marker_open  = '<+'\nVimL: let s:marker_close = '+>'\n<+lh#dox#since()+>\n"
  },
  {
    "path": "after/template/dox/tt.template",
    "content": "VimL:\" doxygen <tt/> File Template, Luc Hermitte, 11th Apr 2012\nVimL:\" hint: <tt>|</tt>\nMuT:  let s:text = s:Surround(1, lh#marker#txt())\n<tt><+s:text+></tt><+s:TerminalPlaceHolder()+>\n"
  },
  {
    "path": "autoload/lh/cpp/AnalysisLib_Class.vim",
    "content": "\" ========================================================================\n\" File:         autoload/lh/cpp/AnalysisLib_Class.vim                 {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"               <URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/tree/master/License.md>\nlet s:k_version = 220\n\" Version:      2.2.0\n\" Last Update:  31st Aug 2018\n\"------------------------------------------------------------------------\n\" Description:\n\"       Library C++ ftplugin.\n\"       It provides functions used by other C++ ftplugins.\n\"       The theme of this library is the analysis of C++ scopes.\n\"\n\" Defines: {{{2\n\" (*) Function: lh#cpp#AnalysisLib_Class#CurrentScope(lineNo, scope_type)\n\"     Returns the scope (class name or namespace name) at line lineNo.\n\"     scope_type can value: \"any\", \"class\" or \"namespace\".\n\" (*) Function: lh#cpp#AnalysisLib_Class#SearchClassDefinition(lineNo)\n\"     Returns the class name of any member at line lineNo -- could be of the\n\"     form: \"A::B::C\" for nested classes.\n\"     Note: Outside class-scope, an empty string is returned\n\"     Note: Classes must be correctly defined: don't forget the ';' after the\n\"     '}'\n\" (*) Function lh#cpp#AnalysisLib_Class#BaseClasses(lineNo)\n\"     Return the list of the direct base classes of the class around lineNo.\n\"     form: \"+a_public_class, #a_protected_class, -a_private_class\"\n\" }}}2\n\"------------------------------------------------------------------------\n\" Installation: See |lh-cpp-readme.txt|\n\" Dependencies: VIM 7.0+\n\n\" History:      {{{2\n\"       06th Dec 2016\n\"       (*) Fix scope searching to ignore non-namespace/enum/class scopes\n\"       17th Feb 2015\n\"       (*) + list available namespaces\n\"       (*) + simplfy_id()\n\"       31st May 2012\n\"       (*) v2.0.0 , License GPLv3 w/ extension\n\"       26th Aug 2011\n\"       (*) list of imported namespaces lh#cpp#AnalysisLib_Class#used_namespaces\n\"       31st May 2010\n\"       (*) many generic functions move to lh#dev#class#\n\"       23rd Apr 2008\n\"       (*) #Ancestors() return the list of base classes (topologicaly sorted)\n\"       13th Feb 2008\n\"       (*) new option [bg]:cpp_defines_to_ignore\n\"       12th Sep 2007\n\"       (*) support \"namespace NS1 { namespace NS2 {\" on a same line\n\"\n\"       07th Oct 2006\n\"       (*) Renamed from ftplugin/cpp/cpp_FindContextClass.vim to\n\"       autoload/lh/cpp/AnalysisLib_Class.vim\n\"\n\"       16th May 2006\n\"       (*) Bug fix: \"using namespace\" was misdirecting lh#cpp#AnalysisLib_Class#CurrentScope(), and\n\"           :GOTOIMPL as a consequence.\n\"       29th Apr 2005\n\"       (*) Not misdriven anymore by:\n\"           - forward declaration in namespaces\n\"             -> \"namespace N {class foo;} namespace M{ class bar{}; }\"\n\"       09th Feb 2005\n\"       (*) class_token += enum\\|union\n\"       (*) Not misdriven anymore by:\n\"           - consecutive classes\n\"             -> \"namespace N {class foo {}; class bar{};}\"\n\"           - comments\n\"       16th dec 2002\n\"       (*) Bug fixed regarding forwarded classes.\n\"       16th oct 2002\n\"       (*) Able to handle C-definitions like\n\"           \"typedef struct foo{...} *PFoo,Foo;\"\n\"       (*) An inversion problem, with nested classes, fixed.\n\"       (*) Cpp_SearchClassDefinition becomes obsolete. Instead, use\n\"           lh#cpp#AnalysisLib_Class#CurrentScope(lineNo, scope_type) to search for a\n\"           namespace::class scope.\n\"       11th oct 2002\n\"       (*) Cpp_SearchClassDefinition supports:\n\"           - inheritance -> 'class A : xx B, xx C ... {'\n\"           - and declaration on several lines of the previous inheritance\n\"           text.\n\"       (*) Functions that will return the list of the direct base classes of\n\"           the current class.\n\"\n\" TODO: {{{2\n\" (*) Support templates -> A<T>::B, etc\n\" (*) Must we differentiate anonymous namespaces from the global namespace ?\n\" (*) reinject implicit context in #Ancestors\n\" }}}1\n\" ==========================================================================\nlet s:cpo_save = &cpo\nset cpo&vim\n\" ==========================================================================\n\" Internal constant regexes {{{1\n\" Note: this regex can be tricked with nasty comments\nlet s:id              = '\\(\\<\\I\\i*\\>\\)'\nlet s:class_token     = '\\<\\(class\\|struct\\|enum\\|union\\)\\>'\nlet s:class_part      = s:class_token  . '\\_s\\+' . s:id\nlet s:namespace_token = '\\<\\(namespace\\)\\>\\_s\\+'\nlet s:namespace_part  = s:namespace_token . s:id\n\nlet s:both_token     = '\\<\\(struct\\|enum\\(\\s\\+class\\)\\=\\|\\(enum\\s\\+\\)\\@<!class\\|union\\|namespace\\)\\>'\nlet s:both_part      = s:both_token  . '\\_s\\+' . s:id\n\" let s:namespace_part = '\\<\\(namespace\\)\\>\\_s\\+' . s:id . '\\='\n\" Use '\\=' for anonymous namespaces\n\n\" let s:class_open      = '\\_.\\{-}{'\n\" '.' -> '[^;]' in order to avoid forward declarations.\nlet s:class_open00    = '\\_[^;]\\{-}{'\nlet s:class_open      = '\\_[^;]\\{-}'\nlet s:class_close     = '}\\%(\\_s\\+\\|\\*\\=\\s*\\<\\I\\i*\\>,\\=\\)*;'\n  \"Note: '\\%(\\_s*\\|\\*=\\s*\\<\\I\\i*\\>,\\=\\)*' is used to accept C typedef like :\n  \"  typedef struct foo {...} *PFoo, Foo;\nlet s:namespace_open00= '\\_s*{'\nlet s:namespace_open  = '\\_s*'\nlet s:namespace_close = '}'\n\" }}}1\n\" ==========================================================================\n\" Debug oriented command {{{1\nif exists('g:force_load_cpp_FindContextClass')\n  command! -nargs=1 CppCACEcho :echo s:<arg>\nendi\n\n\" # Version {{{2\nfunction! lh#cpp#AnalysisLib_Class#version()\n  return s:k_version\nendfunction\n\n\" # Debug   {{{2\nlet s:verbose = get(s:, 'verbose', 0)\nfunction! lh#cpp#AnalysisLib_Class#verbose(...)\n  if a:0 > 0 | let s:verbose = a:1 | endif\n  return s:verbose\nendfunction\n\nfunction! s:Log(expr, ...)\n  call call('lh#log#this',[a:expr]+a:000)\nendfunction\n\nfunction! s:Verbose(expr, ...)\n  if s:verbose\n    call call('s:Log',[a:expr]+a:000)\n  endif\nendfunction\n\nfunction! lh#cpp#AnalysisLib_Class#debug(expr) abort\n  return eval(a:expr)\nendfunction\n\n\" }}}1\n\" ==========================================================================\n\" Search for current and most nested namespace/class <internal> {{{\n\nlet s:skip_comments = 'synIDattr(synID(line(\".\"), col(\".\"), 0), \"name\") =~?'\n      \\ . '\"string\\\\|comment\\\\|doxygen\"'\n\nfunction! s:SearchBracket() abort\n  let flag = 'bW'\n  let res = searchpair('{', '', '}', flag, s:skip_comments)\n  call s:Verbose('|   +-> s:SearchBracket(\"{\", \"\", \"}\", \"bW\" -- from=%1) --> %2', getpos('.'), res)\n  return res\nendfunction\n\nlet s:k_skip_comments = '(synIDattr(synID(line(\".\"), col(\".\"), 0), \"name\") '\n      \\ . '!~? \"c\\\\%(pp\\\\)\\\\=Structure\")'\nlet s:k_skip_using_ns = '(getline(\".\") =~ \"using\\s*namespace\")'\nfunction! s:CurrentScope(bMove, scope_type) abort\n  call s:Verbose('+-> s:CurrentScope(%1) at %2', a:, getpos('.'))\n  let flag = a:bMove ? 'bW' : 'bnW'\n  let pos = 'call cursor(' . line('.') . ',' . col('.') . ')'\n  let result = line('.')\n  try\n    while 1\n      \" First, search for current block start\n      let result = s:SearchBracket()\n      if result <= 0 | return result | endif\n\n      \" Then, check whether this is the kind of scoping block we are looking for\n      let start = substitute(s:both_part, '(', '%(', 'g'). s:{a:scope_type}_open\n      let last_pos = lh#position#getcur()\n      let result = searchpair(\n            \\ start, '', '{', 'bW',\n            \\ s:k_skip_comments.'&&'.s:k_skip_using_ns)\n      call s:Verbose('|   +-> searchpair(%1, \"\", \"{\", %2, skip comments & using) -> %3', start, flag, result)\n      if result > 0\n        \" Be sure this is the exact token searched (s:both_path searches\n        \" everything)\n        call s:Verbose(\"|   +-> %3: '%1' =~ '%2'\", getline(result), '.*'.s:{a:scope_type}_token.'.*', getline(result) =~ '.*'.s:{a:scope_type}_token.'.*' ? 'True': 'False')\n        if getline(result) !~ '.*'.s:{a:scope_type}_token.'.*'\n          let result = 0 \" needed by finally\n          return result\n        endif\n        \" Check that if we search this last thing in the other direction then\n        \" we go to the last_pos\n        let r2 = searchpairpos(start, '', '{', 'Wn',\n              \\ s:k_skip_comments.'&&'.s:k_skip_using_ns)\n        call lh#assert#value(r2[0]).is_gt(0)\n        if r2 == last_pos[1:2]\n          \" This was a searched scope\n          call s:Verbose('|  +-> This was searched scope => return %1', result)\n          return result\n        endif\n        call s:Verbose('|   +-> The previous scope start (%1) is not compatible with the current scope found (%2)', lh#position#getcur(), last_pos)\n        call setpos('.', last_pos) \" go back and search again\n      endif\n    endwhile\n    return result\n  finally\n    if result <= 0\n      exe pos\n    endif\n  endtry\nendfunction\n\n\n\" obsolete\nfunction! s:CurrentScope000(bMove,scope_type) abort\n  let flag = a:bMove ? 'bW' : 'bnW'\n  return searchpair(\n        \\ substitute(s:{a:scope_type}_part, '(', '%(', 'g')\n        \\ . s:{a:scope_type}_open00, '', s:{a:scope_type}_close00, flag,\n        \\ s:skip_comments)\n  \"Note: '\\(..\\)' must be changed into '\\%(...\\)' with search() and\n  \"searchpair().\nendfunction\n\" }}}\n\" ==========================================================================\n\" Search for a class definition (not forwarded definition) {{{\n\" Checks whether lineNo is in between the '{' at line classStart and its\n\" '}' counterpart ; in that case, returns \"::\".className\nfunction! s:SearchClassOrNamespaceDefinition(class_or_ns) abort\n  call s:Verbose('s:SearchClassOrNamespaceDefinition(%1)', a:)\n  let pos = 1\n  let scope = ''\n  let defines = lh#option#get('cpp_defines_to_ignore', '')\n  while pos > 0\n    let pos = s:CurrentScope(1, a:class_or_ns)\n    if pos > 0\n      \" in case of \"ns NS1 { ns NS2 {\", filter from cursor to EOL\n      let line = getline(pos)[col('.')-1:]\n      if strlen(defines) > 0\n        let line = substitute(line, defines, '', 'g')\n      endif\n      let current_scope = substitute(line,\n            \\ '^.\\{-}'.s:{a:class_or_ns}_part.'.*$', '\\2', '')\n      let scope = '::' . current_scope . scope\n    endif\n  endwhile\n  return substitute (scope, '^:\\+', '', 'g')\nendfunction\n\" }}}\n\" ==========================================================================\n\" Search for a class definition (not forwarded definition) {{{\n\" Function: Cpp_SearchClassDefinition(lineNo [, bNamespaces])\n\" Checks whether lineNo is in between the '{' at line classStart and its\n\" '}' counterpart ; in that case, returns \"::\".className\nfunction! lh#cpp#AnalysisLib_Class#SearchClassDefinition(lineNo,...) abort\n  \" let pos = a:lineNo\n  exe a:lineNo\n  let scope = s:SearchClassOrNamespaceDefinition('class')\n  if (a:0 > 0) && (a:1 == 1)\n    let ns = s:SearchClassOrNamespaceDefinition('namespace')\n    let scope = ns . (((\"\"!=scope) && (\"\"!=ns)) ? '::' : '') . scope\n  endif\n  exe a:lineNo\n  return scope\nendfunction\n\n\" Possible Values:\n\"  - 'class'\n\"  - 'namespace'\n\"  - 'any'\nfunction! lh#cpp#AnalysisLib_Class#CurrentScope(lineNo, scope_type) abort\n  exe a:lineNo\n  if a:scope_type =~ 'any\\|##'\n    let scope = s:SearchClassOrNamespaceDefinition('class')\n    let ns = s:SearchClassOrNamespaceDefinition('namespace')\n    let scope = ns . (((\"\"!=scope) && (\"\"!=ns))\n          \\ ? ((a:scope_type == '##') ? '#::#' : '::')\n          \\ : '') . scope\n  elseif a:scope_type =~ 'class\\|namespace'\n    let scope = s:SearchClassOrNamespaceDefinition(a:scope_type)\n  else\n    echoerr 'lh#cpp#AnalysisLib_Class#CurrentScope(): the only ' .\n          \\ 'scope-types accepted are {class}, {namespace} and {any}!'\n    return ''\n  endif\n  exe a:lineNo\n  return scope\nendfunction\n\" }}}\n\" ==========================================================================\n\" Function: lh#cpp#AnalysisLib_Class#search_closest_class(line) {{{\nfunction! lh#cpp#AnalysisLib_Class#search_closest_class(line) abort\n  \" We can't use search('class|struct', b') as it will not distinguish\n  \" \"class foo\" from \"template <class Foo> void f()\"\n  \" So, we'll use ctags for now, and libclang in the future\n  try\n    let session = lh#tags#session#get()\n    let tags = session.tags\n    \" tags generated by lh#tags#session#get() have a line field\n    let tags = filter(copy(tags), 'v:val.kind=~\"[sc]\" && v:val.line < a:line')\n    \" and they are sorted by lines numbers...\n    if empty(tags)\n      call lh#common#error_msg(\"No class definition upstream\")\n      return ''\n    else\n      return tags[-1].name\n    endif\n  finally\n    call session.finalize()\n  endtry\nendfunction\n\" }}}\n\" ==========================================================================\n\" Search for templates specs <internal> {{{\nfunction! s:TemplateSpecs() abort\nendfunction\n\" }}}\n\" ==========================================================================\n\" Search for the direct base classes <internal> <deprecated> {{{\nfunction! s:BaseClasses0(pos) abort\n  \" a- Retrieve the declaration: 'class xxx : yyy {' zone limits {{{\n  let pos = a:pos\n  let end_pos = line('$')\n  let decl = ''\n  while pos < end_pos\n    \" Concat lines and strip comments on the way to the '{'.\n    let text = substitute(getline(pos), '/\\*.\\{-}\\*/\\|//.*$', '', 'g')\n    let decl = decl . ' ' . text\n    if text =~ '{' | break | endif\n    let pos = pos + 1\n  endwhile\n  \" }}}\n  \" b- Get the base classes only {{{\n  let base = substitute(decl, '^.*'.s:class_part.'[^:]*:\\([^{]*\\){.*$', '\\3','')\n  let base = substitute(base, 'public',    '+', 'g')\n  let base = substitute(base, 'protected', '#', 'g')\n  let base = substitute(base, 'private',   '-', 'g')\n  let base = substitute(base, '\\s*', '', 'g')\n  let base = substitute(base, ',', ', ', 'g')\n  \" }}}\n  return base\nendfunction\nfunction! lh#cpp#AnalysisLib_Class#BaseClasses0(lineNo) abort\n  exe a:lineNo\n  let pos = s:CurrentScope(1, 'class')\n  exe a:lineNo\n  return (pos > 0) ? s:BaseClasses0(pos) : ''\nendfunction\n\" }}}\n\" ==========================================================================\n\" Search for the base classes {{{\n\" @todo determine the access rigths\n\" @todo get children\n\" @todo get all public functions\n\" @todo get available functions\n\" @todo get overidable functions\n\" @todo follow typedefs\n\nfunction! lh#cpp#AnalysisLib_Class#GetClassTag(id) abort\n  call lh#common#error_msg(\"lh#cpp#AnalysisLib_Class#GetClassTag is deprecated, use lh#dev#class#get_class_tag() instead\")\n  return lh#dev#option#call('class#get_class_tag', &ft, a:id)\nendfunction\n\n\nfunction! lh#cpp#AnalysisLib_Class#FetchDirectParents(id) abort\n  call lh#common#error_msg(\"lh#cpp#AnalysisLib_Class#FetchDirectParents is deprecated, use lh#dev#class#fetch_direct_parents() instead\")\n  return lh#dev#option#call('class#fetch_direct_parents', &ft, a:id)\nendfunction\n\nfunction! lh#cpp#AnalysisLib_Class#Ancestors(id) abort\n  call lh#common#error_msg(\"lh#cpp#AnalysisLib_Class#Ancestors is deprecated, use lh#dev#class#ancestors() instead\")\n  return lh#dev#option#call('class#ancestors', &ft, a:id)\nendfunction\n\n\" }}}\n\" ==========================================================================\n\" Search for the child classes {{{1\n\" a:namespace_where_to_search is a hack because listing all element to extract\n\" classes is very slow!\n\" lh#cpp#AnalysisLib_Class#FetchDirectChildren(id, namespace_where_to_search [, recheck_namespace])\nfunction! lh#cpp#AnalysisLib_Class#FetchDirectChildren(id, namespace_where_to_search, ...) abort\n  call lh#common#error_msg(\"lh#cpp#AnalysisLib_Class#FetchDirectChildren is deprecated, use lh#dev#class#fetch_direct_children() instead\")\n  return lh#dev#option#call('class#fetch_direct_children', &ft, a:id)\nendfunction\n\n\" }}}1\n\" ==========================================================================\n\" List of imported namespaces {{{1\n\" Function: lh#cpp#AnalysisLib_Class#used_namespaces([up_to]) {{{3\n\" @return list of imported namespaces\n\" @todo take the \"namespace xx {\" scop into account\nfunction! lh#cpp#AnalysisLib_Class#used_namespaces(...) abort\n  let up_to_line = (a:0>0) ? (a:1) : line('$')\n  let imported_ns = map(\n        \\filter(\n        \\    getline(1,up_to_line),\n        \\    'v:val =~ \"^\\\\s*using\\\\s\\\\+namespace\"'),\n        \\ 'matchstr(v:val, \"^\\\\s*using\\\\s\\\\+namespace\\\\s\\\\+\\\\zs.\\\\{-}\\\\ze\\\\s*;\")'\n        \\ )\n  return imported_ns\nendfunction\n\n\" ==========================================================================\n\" List of available namespaces {{{1\n\" Function: lh#cpp#AnalysisLib_Class#available_namespaces(up_to) {{{3\n\" @return list of available namespaces (imported + current)\nfunction! lh#cpp#AnalysisLib_Class#available_namespaces(up_to_line) abort\n  let current_ns = lh#cpp#AnalysisLib_Class#CurrentScope(a:up_to_line, 'namespace')\n  let imported_ns = lh#cpp#AnalysisLib_Class#used_namespaces(a:up_to_line)\n  let ns_list = imported_ns + [current_ns]\n  return ns_list\nendfunction\n\n\" ==========================================================================\n\" Simplify id {{{1\n\" Function: lh#cpp#AnalysisLib_Class#simplify_id(id, available_scopes [, return_ns_found]) {{{3\n\" Strips the best scope that matches the {id}. If\n\" {return_ns_found} is set, return the matching scope as well.\n\" @see tests/lh/analysis.vim\nfunction! lh#cpp#AnalysisLib_Class#simplify_id(id, available_scopes, ...) abort\n  let return_ns_found = a:0==0 ? 0 : a:1\n  let scopes = reverse(sort(a:available_scopes))\n  let re = join(\n        \\ map(scopes, 'substitute(v:val, \"^\\\\(.\\\\{-}\\\\)\\\\(::\\\\)\\\\=$\", \"^\\\\1\\\\\\\\(::\\\\\\\\)\\\\\\\\=\", \"\")'),\n        \\'\\|')\n  let g:re = re\n  if !return_ns_found\n    return substitute(a:id, re, '', '')\n  else\n    let match = substitute(a:id, re, '&#', '')\n    if stridx(match, '#') == -1\n      let match = '#'.match\n    endif\n    return split(match, '#', 1)\n  endif\nendfunction\n\n\" ==========================================================================\n\" Fetch Attributes {{{1\nfunction! lh#cpp#AnalysisLib_Class#attributes(id) abort\n  call lh#common#error_msg(\"lh#cpp#AnalysisLib_Class#attributes is deprecated, use lh#dev#class#attributes() instead\")\n  return lh#dev#option#call('class#attributes', &ft, a:id)\nendfunction\n\" }}}1\n\" ==========================================================================\nlet &cpo = s:cpo_save\n\" ========================================================================\n\" vim60: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/AnalysisLib_Function.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp/AnalysisLib_Function.vim                  {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"               <URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/tree/master/License.md>\n\" Version:      2.2.0\n\" Created:      05th Oct 2006\n\" Last Update:  26th Nov 2019\n\"------------------------------------------------------------------------\n\" Description:\n\"       This plugin defines VimL functions specialized in the analysis of C++\n\"       code.\n\"       It can be seen as a library plugin.\n\"\n\" Functions Defined:\n\"       Scope: lh#cpp#AnalysisLib_Function#\n\"\n\"       GetFunctionPrototype(lineno, onlyDeclaration)\n\"               @param lineno           Number of the line where the prototype is fetched\n\"               @param onlyDeclaration  Restrict to function declarations (1), or\n\"                                      definition are accepted (0)\n\"               @return The exact prototype found at the given line\n\"\n\"       GetListOfParams(prototype)\n\"               @param prototype        Prototype to analyse\n\"               @return a list of [ {type}, {name}, {default value} ], one\n\"                       for each parameter specified in the prototype\n\"\n\"       AnalysePrototype(prototype)\n\"               @param prototype        Prototype to analyse\n\"               @return a |dictionary| made of the following fields:\n\"                       - qualifier: \"\" / \"virtual\" / \"static\" / \"explicit\"\n\"                       - return: type of the value returned by the function\n\"                       - name: list of the scopes + the name of the function\n\"                       - parameters: @see GetListOfParams\n\"                       - const: 0/1 whether the function is a const-member \"                   function\n\"                       - throw: list of exception specified in the signature\n\"\n\"------------------------------------------------------------------------\n\" Installation:\n\"       Drop it into: {rtp}/autoload\n\"       Requirements: Vim7\n\" History:\n\"       v2.2.0\n\"       (*) Add detection of final, override, constexpr, noexept, volatile,\n\"          =default, =delete\n\"       (*) Fix regex building for operator()\n\"       (*) Support `decltype(auto)`\n\"       (*) Support `->` return type specification\n\"       v2.0.0\n\"       (*) GPLv3 w/ exception\n\"       (*) AnalysePrototype() accepts spaces between functionname and (\n\"       (*) Fix :GOTOIMPL to support operators like +=\n\"       v1.1.1\n\"       (*) lh#cpp#AnalysisLib_Function#GetListOfParams() is not messed up by\n\"       throw-spec\n\"       v1.0.1:\n\"       (*) Remembers the parameter is on a new line\n\"       v1.0.0: First version\n\"               Code extracted from cpp_GotoFunctionImpl\n\" TODO:\n\"       (*) Support template, function types, friends\n\" }}}1\n\"=============================================================================\n\n\n\"=============================================================================\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\" ## Functions {{{1\n\" # Debug {{{2\nlet s:verbose = get(s:, 'verbose', 0)\nfunction! lh#cpp#AnalysisLib_Function#verbose(...)\n  if a:0 > 0 | let s:verbose = a:1 | endif\n  return s:verbose\nendfunction\n\nfunction! s:Log(...)\n  call call('lh#log#this', a:000)\nendfunction\n\nfunction! s:Verbose(...)\n  if s:verbose\n    call call('s:Log', a:000)\n  endif\nendfunction\n\nfunction! lh#cpp#AnalysisLib_Function#debug(expr)\n  return eval(a:expr)\nendfunction\n\n\"------------------------------------------------------------------------\n\" # Public {{{2\nlet s:k_not_available = lh#option#unset('libclang cannot tell')\n\n\" \" Function: lh#cpp#AnalysisLib_Function#get_function_info(lineno, onlyDeclaration) {{{3\nfunction! lh#cpp#AnalysisLib_Function#get_function_info(lineno, onlyDeclaration) abort\n  try\n    if lh#has#plugin('autoload/clang.vim') && clang#can_plugin_be_used()\n      \" TODO move cursor to function name\n      let py_info = clang#get_symbol()\n      if py_info.is_definition && a:onlyDeclaration\n        return {}\n      endif\n\n      let [sNoexceptSpec, idx_s, idx_e] = lh#string#matchstrpos(py_info.type.spelling, s:re_noexcept_spec)\n      call s:Verbose(\"sNoexceptSpec: %1 ∈ [%2, %3]\", sNoexceptSpec, idx_s, idx_e)\n\n      let info = {}\n      let info.qualifier\n            \\ = py_info.static   ? 'static'\n            \\ : py_info.virtual  ? 'virtual'\n            \\ : ''\n            \" \\ : py_info.explicit ? 'explicit'\n            \" As of 9, libclang still cannot tell whether a constructor is\n            \" declared explicit\n      let info.return     = py_info.true_kind =~ '\\vCONSTRUCTOR|DESTRUCTOR'\n            \\ ? ''\n            \\ : py_info.result_type.spelling\n      let info.name       = py_info.spelling\n      let info.constexpr  = s:k_not_available\n      let info.const      = py_info.const\n      let info.volatile   = py_info.type.spelling =~ '\\v<volatile>'\n      let info.pure       = py_info.pure\n      let info.special_definition\n            \\ = py_info.is_default_method ? '= default'\n            \\ : ''\n            \" \\ : py_info.deleted   ? '= delete'\n            \" As of 9, libclang still cannot tell whether a function is\n            \" deleted...\n      let info.throw      = [] \" Let's forget about this\n      let info.noexcept   = sNoexceptSpec\n      let info.final      = ! empty(get(py_info.children, 'CursorKind.CXX_FINAL_ATTR', {}))\n      let info.overriden  = ! empty(get(py_info.children, 'CursorKind.CXX_OVERRIDE_ATTR', {}))\n      let info.parameters = []\n      for py_param in get(py_info.children, 'CursorKind.PARM_DECL', [])\n        let param = {\n              \\ 'name'   : py_param.spelling\n              \\,'type'   : py_param.type.spelling\n              \\,'default': s:k_not_available\n              \\,'nl'     : s:k_not_available\n              \\ }\n        let info.parameters += [param]\n      endfor\n      let info.tparams    = []\n      for py_param in get(py_info.children, 'CursorKind.TEMPLATE_TYPE_PARAMETER', [])\n            \\ + get(py_info.children, 'CursorKind.TEMPLATE_NON_TYPE_PARAMETER', [])\n        let param = {\n              \\ 'name'   : py_param.spelling\n              \\,'default': s:k_not_available\n              \\,'nl'     : s:k_not_available\n              \\ }\n        let info.tparams += [param]\n      endfor\n      let info.start = py_info.extent.start\n      let info.end   = py_info.extent.end\n      return info\n    endif\n  catch /.*/\n    call lh#common#warning_msg(\"We cannot use vim-clang+libclang to decode function prototype, falling back to pure vimscript analysis. \".v:exception)\n  endtry\n\n  \" If vim-clang + libclang could not be used....\n  let proto = lh#dev#c#function#get_prototype(a:lineno, a:onlyDeclaration)\n  let info  = lh#cpp#AnalysisLib_Function#AnalysePrototype(proto)\n  return info\nendfunction\n\n\" Function: lh#cpp#AnalysisLib_Function#GetFunctionPrototype \" {{{3\n\" Todo:\n\" * Retrieve the type even when it is not on the same line as the function\n\"   identifier.\n\" * Retrieve the const modifier even when it is not on the same line as the\n\"   ')'.\nfunction! lh#cpp#AnalysisLib_Function#GetFunctionPrototype(lineno, onlyDeclaration) abort\n  \" deprecated\n  return lh#dev#c#function#get_prototype(a:lineno, a:onlyDeclaration)\nendfunction\n\n\" Function: lh#cpp#AnalysisLib_Function#get_prototype(pos, onlyDeclaration) {{{3\n\" @WARNING: never tested/used function\nfunction! lh#cpp#AnalysisLib_Function#get_prototype(pos, onlyDeclaration) abort\n  if type(a:pos) == type(0)\n    let lineno = a:pos\n    return lh#dev#c#function#get_prototype(lineno, a:onlyDeclaration)\n  elseif type(a:pos) == type({}) \" this is a tag definition\n    \" TODO: extract this position rollback code to its own function\n    let cleanup = lh#on#exit()\n    let filename = a:pos.filename\n    let nb_windows = winnr('$')\n    let crt_win = winnr()\n    call lh#buffer#jump(filename, 'sp')\n    if winnr('$') != nb_windows\n      call cleanup.register(':q')\n    elseif crt_win != winnr()\n      call cleanup.register(':'.crt_win.'wincmd w')\n    endif\n    try\n      if a:pos.cmd == '^/'\n        let lineno = search(cmd, 'n')\n      elseif a:pos.cmd == ':'\n        let lineno = eval(a:pos.cmd[1:])\n      endif\n      if 0 == lineno\n        throw \"lh-cpp: Impossible to find where prototype for \".(a:pos.name). \" is\"\n      endif\n      return lh#dev#c#function#get_prototype(lineno, a:onlyDeclaration)\n    finally\n      call cleanup.finalize()\n    endtry\n  endif\nendfunction\n\" }}}3\n\n\"------------------------------------------------------------------------\n\" Function: s:SplitTypeParam(typed_param) {{{3\n\" @return 4-uple -> [parameter-type, parameter-name, default-value, new-line-before]\n\" @under deprecation...\nfunction! s:SplitTypeParam(typed_param) abort\n  let pa = lh#dev#option#call('function#_analyse_parameter', &ft, a:typed_param)\n  return [pa.type, pa.name, pa.default, pa.nl]\nendfunction\n\" }}}3\n\"------------------------------------------------------------------------\n\" Function: lh#cpp#AnalysisLib_Function#GetListOfParams(prototype, mustCleanSpace) {{{3\n\" todo: beware of exception specifications\n\" todo: check about of functions types ; to be done with templates... ?\n\" todo: Arrays of pointers       : \"T (*p)[n]\"\nfunction! lh#cpp#AnalysisLib_Function#GetListOfParams(prototype, mustCleanSpace) abort\n  \" 1- Strip comments and parenthesis\n  let prototype = a:prototype\n  let prototype = substitute(prototype, '//.\\{-}\\n', '', 'g')\n  let prototype = substitute(prototype, '/\\*\\_.\\{-}\\*/', '', 'g')\n  \" 2- Strip throw spec\n  let prototype = substitute(prototype, ')\\zs\\_s*throw(.*', '', '')\n\n  \" 3- convert the string into a list, the separation being done on commas\n  let res_params = lh#dev#option#call('function#_signature_to_parameters', &ft, prototype, a:mustCleanSpace)\n\n  return res_params\nendfunction\n\" }}}3\n\n\" Function: lh#cpp#AnalysisLib_Function#AnalysePrototype(prototype) {{{3\n\" @return: {qualifier, return-type, function-name, parameters, throw-spec, const}\n\" @todo support friends.\n\" @todo support function types\n\" @todo support templates\n\" Constants {{{4\nlet s:re_qualifiers                 = '\\<\\%(static\\|explicit\\|virtual\\)\\>'\n\nlet s:re_qualified_name1            = '\\%(::\\s*\\)\\=\\<\\I\\i*\\>'\nlet s:re_qualified_name2            = '\\s*::\\s*\\<\\I\\i*\\>'\nlet s:re_qualified_name             = s:re_qualified_name1.'\\%('.s:re_qualified_name2.'\\)*'\n\nlet s:re_operators                  = '\\<operator\\%([=~%+-\\*/^&|]\\|[]\\|()\\|&&\\|||\\|->\\|<<\\|>>\\|==\\| \\)'\n\"   What looks like to a \"space\" operator is actually used in next regex to\n\"   match convertion operators\nlet s:re_qualified_oper             = '\\%('.s:re_qualified_name . '\\s*::\\s*\\)\\=' . s:re_operators . '.\\{-}\\ze('\n\nlet s:re_const_member_fn            = ')\\s*\\zs\\<const\\>'\nlet s:re_volatile_member_fn         = ')\\s*\\zs\\<volatile\\>'\nlet s:re_throw_spec                 = ')\\s*\\%(\\%(\\<const\\>\\|\\<volatile\\>\\)\\s\\+\\)\\=\\<throw\\>(\\(\\zs.*\\ze\\))'\n\" let s:re_noexcept_spec              = ')\\s*\\%(\\%(\\<const\\>\\|\\<volatile\\>\\)\\s\\+\\)\\=\\<noexcept\\>\\((\\zs.*\\ze)\\)\\='\nlet s:re_noexcept_spec              = '\\<noexcept\\>\\%((\\zs.*\\ze)\\)\\='\nlet s:re_defined_by_compiler_prefix = ')\\s*\\%(\\%(\\<const\\>\\|\\<volatile\\>\\)\\s*\\)\\=\\%(\\<noexcept\\>\\%((.*)\\)\\=\\s*\\)\\==\\s*'\nlet s:re_pure_virtual               = s:re_defined_by_compiler_prefix . '0\\s*[;{]'\nlet s:re_special_definition         = s:re_defined_by_compiler_prefix . '\\zs\\<\\(default\\|delete\\)\\>\\ze\\s*[;{]'\n\nlet s:re_constexpr                  = '\\<constexpr\\>'\nlet s:re_final                      = '\\<final\\>'\nlet s:re_override                   = '\\<override\\>'\n\n\" Implementation {{{4\nfunction! lh#cpp#AnalysisLib_Function#AnalysePrototype(prototype) abort\n  \" 0- strip comments                            {{{5\n  let prototype = substitute(a:prototype, \"\\\\(\\\\s\\\\|\\n\\\\)\\\\+\", ' ', 'g')\n  let prototype = substitute(prototype, '/\\*.\\{-}\\*/\\|//.*$', '', 'g')\n\n  \" let prototype = s:StripComments(a:prototype)\n\n  \" 1- Qualifier (only one possible in C++)      {{{5\n  \"   -> virtual / explicit / static\n  let qualifier = matchstr  (prototype, s:re_qualifiers)\n  let prototype = substitute(prototype, '\\s*'.qualifier.'\\s*', '', '')\n\n  \" 2- Function name                             {{{5\n  \"   Not supposed to have a scoped qualification\n  \"   Operators need a special care\n  let iName = match(prototype, s:re_qualified_oper)\n  \"   '.\\{-}\\ze(' is to match anything till the firt '(' -> convertion\n  \"   operators\n  if iName == -1\n    \" if not an operator -> just a function\n\n    \" First: special case of `decltype(auto)`\n    let iName = match   (prototype, 'decltype(auto)\\s*\\zs'.s:re_qualified_name . '\\ze\\s*(')\n    if  iName >= 0\n      let sName = matchstr(prototype, 'decltype(auto)\\s*\\zs'.s:re_qualified_name . '\\ze\\s*(')\n    else\n      \" \"\\s*(\" -> parenthesis may be aligned and not sticking to the function\n      \" name\n      let iName = match   (prototype, s:re_qualified_name . '\\ze\\s*(')\n      let sName = matchstr(prototype, s:re_qualified_name . '\\ze\\s*(')\n    endif\n  else\n    \" echo \"operator\"\n    let sName = matchstr(prototype, s:re_qualified_oper)\n  endif\n  let sName = matchstr(sName, '^\\s*\\zs.\\{-}\\ze\\s*$')\n  let lName = split(sName, '::')\n\n  \" 3- Return type                               {{{5\n  let retType = strpart(prototype, 0, iName)\n  let retType = matchstr(retType, '^\\s*\\zs.\\{-}\\ze\\s*$')\n  if retType =~ '\\~$'  \" destructor\n    let sName   = retType.sName\n    let sName   = matchstr(sName, '^\\s*\\zs.\\{-}\\ze\\s*$')\n    let lName   = split(sName, '::')\n    let retType = ''\n  endif\n  let retType = substitute(retType, s:re_constexpr.'\\s*', '', '')\n  if retType =~ '\\v^$|auto' && prototype =~ '->'\n    \" New C++11 syntax for return type specification\n    let retType = matchstr(prototype, '\\v-\\>\\s*\\zs.{-}\\ze\\s*[{;]\\s*$')\n    let prototype = matchstr(prototype, '\\v^.{-}\\ze\\s*-\\>')\n  endif\n\n  \" 4- Throw specification                       {{{5\n  let sThrowSpec = matchstr(prototype, s:re_throw_spec)\n  let lThrowSpec = split(sThrowSpec, '\\s*,\\s*')\n  if len(lThrowSpec) == 0 && match(prototype, s:re_throw_spec) > 0\n    let lThrowSpec = [ '' ]\n  endif\n  let [sNoexceptSpec, idx_s, idx_e] = lh#string#matchstrpos(prototype, s:re_noexcept_spec)\n  call s:Verbose(\"sNoexceptSpec: %1 ∈ [%2, %3]\", sNoexceptSpec, idx_s, idx_e)\n  if !empty(sNoexceptSpec)\n    \" call s:Verbose(\"Prototype before trimming noexcept(): %1\", prototype)\n    let prototype = prototype[:idx_s-2].prototype[idx_e+1:]\n    \" +2: to remove () that'll mess param extraction\n    call s:Verbose(\"Prototype after trimming noexcept(): %1\", prototype)\n  endif\n\n  \" 5- Parameters                                {{{5\n  let sParams = strpart(prototype, iName+len(sName))\n  let params = lh#cpp#AnalysisLib_Function#GetListOfParams(sParams, 0)\n\n  \" 6- Const member function ?                   {{{5\n  let isConst    = match(prototype, s:re_const_member_fn) != -1\n  let isVolatile = match(prototype, s:re_volatile_member_fn) != -1\n\n  \" 7- Pure member function ?                    {{{5\n  let isPure =  prototype =~ s:re_pure_virtual\n\n  \" 8- =default/=delete ?                        {{{5\n  let special_definition =  matchstr(prototype, s:re_special_definition)\n\n  \" 9- final/override ?                          {{{5\n  let isFinal     = prototype =~ s:re_final\n  let isOverriden = prototype =~ s:re_override\n\n  \" 10- constexpr ?                              {{{5\n  let isConstexpr = prototype =~ s:re_constexpr\n\n  \" *- Result                                    {{{5\n  \" let result = [ qualifier, retType, lName, params]\n  let result =\n        \\ { \"qualifier\"          : qualifier\n        \\ , \"return\"             : retType\n        \\ , \"name\"               : lName\n        \\ , \"parameters\"         : params\n        \\ , \"constexpr\"          : isConstexpr\n        \\ , \"const\"              : isConst\n        \\ , \"volatile\"           : isVolatile\n        \\ , \"pure\"               : isPure\n        \\ , \"special_definition\" : special_definition\n        \\ , \"throw\"              : lThrowSpec\n        \\ , \"noexcept\"           : sNoexceptSpec\n        \\ , \"final\"              : isFinal\n        \\ , \"overriden\"          : isOverriden\n        \\ }\n  return result\nendfunction\n\" }}}3\n\"------------------------------------------------------------------------\n\" Function: lh#cpp#AnalysisLib_Function#HaveSameSignature(sig1, sig2) {{{3\n\" @param[in] sig1 Signature 1 (GetListOfParams() format)\n\" @param[in] sig2 Signature 2 (GetListOfParams() format)\n\" @return whether the two signatures are similar (parameters names, default\n\" parameters and other comment are ignored)\nfunction! lh#cpp#AnalysisLib_Function#HaveSameSignature(sig1, sig2) abort\n  return a:sig1 == a:sig2\n\n  if len(a:sig1) != len(a:sig2) | return 0 | endif\n  let i = 0\n  while i != len(a:sig1)\n    if a:sig1[i] != a:sig2[i] | return 0 | endif\n    let i += 1\n  endwhile\n  return 1\nendfunction\n\" }}}3\n\"------------------------------------------------------------------------\n\" Function: lh#cpp#AnalysisLib_Function#SignatureToString(fn) {{{3\nfunction! s:ParamToString(param) abort\n  \" 0:Type + 1:param name\n  let p = (a:param.type) . ' ' .(a:param.name)\n  return p\nendfunction\n\nfunction! lh#cpp#AnalysisLib_Function#BuildSignatureAsString(fn) abort\n  let params = []\n  for param in a:fn.parameters\n    call add(params, s:ParamToString(param))\n  endfor\n  let sig = a:fn.name.'(' . join(params, ', ') .')'\n  if a:fn.const\n    let sig .= ' const'\n  endif\n  return sig\nendfunction\n\" }}}3\n\"------------------------------------------------------------------------\n\" Function: lh#cpp#AnalysisLib_Function#SignatureToString(fn) {{{3\n\" function! lh#cpp#AnalysisLib_Function#IsSame(def, decl)\n  \" return a:def.name == a:decl[0].name\n        \" \\ && lh#cpp#AnalysisLib_Function#HaveSameSignature(a:def.parameters, a:decl[0].parameters)\n\" endfunction\nfunction! lh#cpp#AnalysisLib_Function#IsSame(def, decl) abort\n  let res = a:def.name == a:decl.name\n        \\ && lh#cpp#AnalysisLib_Function#HaveSameSignature(a:def.parameters, a:decl.parameters)\n  \" if a:def.name == a:decl.name\n    \" echomsg res .\"[\".(a:def.name).\"] <- \" . string(a:def.parameters) . ' <--> ' . string(a:decl.parameters)\n  \" endif\n  return res\nendfunction\n\" }}}3\n\"------------------------------------------------------------------------\n\" Function: lh#cpp#AnalysisLib_Function#LoadTags(id) {{{3\nfunction! s:ConvertTag(t) abort\n  let fn_data = {\n        \\ 'name'          : a:t.name,\n        \\ 'signature'     : a:t.signature,\n        \\ 'parameters'    : lh#cpp#AnalysisLib_Function#GetListOfParams(a:t.signature, 1),\n        \\ 'const'         : match(a:t.signature, s:re_const_member_fn) != -1,\n        \\ 'filename'      : a:t.filename,\n        \\ 'implementation': get(a:t, 'implementation', ''),\n        \\ 'class'         : get(a:t, 'class', ''),\n        \\ 'cmd'           : a:t.cmd }\n  if has_key(a:t, 'access')\n    let fn_data['access'] = a:t.access\n  endif\n  return fn_data\nendfunction\n\nfunction! lh#cpp#AnalysisLib_Function#LoadTags(id) abort\n  let tags = taglist(a:id)\n  call s:Verbose('%1 functions definitions & declarations matching %2 found', len(tags), a:id)\n\n  \" # Definitions (f)\n  let f_tags = filter(copy(tags), 'v:val.kind == \"f\"')\n  let definitions = map(copy(f_tags), 's:ConvertTag(v:val)')\n  call s:Verbose('%1 functions definitions found', len(definitions))\n  \" Remove inline definitions\n  \" -> a definition with an access specifier is an inline definition\n  call filter(definitions, '! has_key(v:val, \"access\")')\n  \" -> We can also use universal ctags {c++.properties} field option\n  call filter(definitions, 'get(v:val, \"properties\",\"\") =~ \"inline\"')\n  call s:Verbose('%1 functions definitions kept (class-inline definitions removed)', len(definitions))\n\n  \" # Declarations (p)\n  let p_tags = filter(copy(tags), 'v:val.kind == \"p\"')\n  let declarations = map(copy(p_tags), 's:ConvertTag(v:val)')\n  call s:Verbose('%1 functions declarations found', len(declarations))\n\n  \" Remove \"= 0\"\n  call filter(declarations, 'v:val.implementation !~ \"pure\"')\n  call s:Verbose('%1 functions declarations kept (pure virtual function removed)', len(declarations))\n  \" Remove \"= default\" & \"= delete\"\n  \" -> not present in the signature.\n  \" -> at best, it may be in the command\n  call filter(declarations, 'v:val.cmd !~ \"=\\\\v\\\\s*(default|delete)\"')\n  \" -> We can also use universal ctags {c++.properties} field option\n  call filter(declarations, 'get(v:val, \"properties\",\"\") =~ \"default\\\\|delete\"')\n  call s:Verbose('%1 functions declarations found and kept (defaulted/deleted function removed)', len(declarations))\n\n  let result = { 'definitions':definitions, 'declarations': declarations }\n  return result\nendfunction\n\" }}}3\n\"------------------------------------------------------------------------\n\" Function: lh#cpp#AnalysisLib_Function#SearchUnmatched(fn) {{{3\nfunction! s:CmpSig(lhs, rhs) abort\n  if     len(a:lhs) < len(a:rhs) | return -1\n  elseif len(a:lhs) > len(a:rhs) | return  1\n  else\n    let i = 0\n    while i != len(a:rhs)\n      if     a:lhs[i] < a:rhs[i] | return -1\n      elseif a:lhs[i] > a:rhs[i] | return  1\n      endif\n      let i += 1\n    endwhile\n    return 0\n  endif\nendfunction\n\nfunction! lh#cpp#AnalysisLib_Function#_ByNameAndSig(lhs, rhs) abort\n  let res = a:lhs.name <  a:rhs.name ? -1\n        \\ : a:lhs.name == a:rhs.name ? s:CmpSig(lh#list#get(a:lhs.parameters,'type'), lh#list#get(a:rhs.parameters, 'type'))\n        \\ :                             1\n  return res\nendfunction\n\nfunction! s:SearchUnmatched(functions) abort\n  let decls = sort(a:functions.declarations, function('lh#cpp#AnalysisLib_Function#_ByNameAndSig'))\n  call s:Verbose('%1 function declarations sorted', len(a:functions.declarations))\n  let defs  = sort(a:functions.definitions,  function('lh#cpp#AnalysisLib_Function#_ByNameAndSig'))\n  call s:Verbose('%1 function definitions sorted', len(a:functions.definitions))\n\n  let unmatched_decl = []\n  let unmatched_def  = []\n  call lh#list#concurrent_for(a:functions.declarations, a:functions.definitions,\n        \\ unmatched_decl, unmatched_def, [],\n        \\ function('lh#cpp#AnalysisLib_Function#_ByNameAndSig'))\n  let unmatched = { 'definitions':unmatched_def, 'declarations':unmatched_decl }\n  call s:Verbose('Symetric difference between function definitions and declarions done')\n  return unmatched\nendfunction\n\nfunction! lh#cpp#AnalysisLib_Function#SearchUnmatched(what) abort\n  if     type(a:what) == type('string')\n    let functions = lh#cpp#AnalysisLib_Function#LoadTags(a:what)\n    return s:SearchUnmatched(functions)\n  elseif type(a:what) == type({})\n    return s:SearchUnmatched(a:what)\n  else\n    throw \"lh#cpp#AnalysisLib_Function#SearchUnmatched: Invalid argument type\"\n    \" We only accept id to fetch with taglist, or list of functions\n  endif\nendfunction\n\n\"------------------------------------------------------------------------\n\" Function: lh#cpp#AnalysisLib_Function#SearchAllDeclarations(fn) {{{3\n\" inline member function are seen as \"p\" (instead of \"f\") by ctags, hence this\n\" function\nfunction! lh#cpp#AnalysisLib_Function#SearchAllDeclarations(functions) abort\n  let declarations = deepcopy(a:functions.declarations)\n  let unmatched_def = copy(a:functions.definitions)\n\n  for f in declarations\n    let idx = lh#list#Find_if(unmatched_def, 'lh#cpp#AnalysisLib_Function#IsSame(v:val,v:1_)', [f], 0)\n    if idx != -1\n      call remove(unmatched_def, idx)\n    endif\n  endfor\n\n  \" That is not a very good way to identify inline functions, at least all\n  \" inline function are still kept\n  call extend(declarations, unmatched_def)\n  return declarations\nendfunction\n\"------------------------------------------------------------------------\n\" }}}3\n\"------------------------------------------------------------------------\n\" Function! lh#cpp#AnalysisLib_Function#SignatureToSearchRegex2(signature,className) {{{3\n\" todo:\n\" - ignore default arguments\n\" - template types like std::auto_ptr<foo::bar>\nfunction! s:Type2Regex(type, param) abort\n  let type = a:type\n  \"\n  \" let id = (\"\"!=ptr) ? ' ( \\* \\%(\\<\\I\\i*\\>\\)\\= ) ' : ' \\%(\\<\\I\\i*\\>\\)\\= '\n  let id =  strlen(a:param) ? ' \\%(\\<\\I\\i*\\>\\)\\= ' : ''\n  \" arrays\n  let array = matchstr(a:param, '\\[.*\\]')\n\n  \" escape arrays and pointers characters\n  let type = substitute(type, '\\s*\\([[\\]*]\\)\\s*', ' \\\\\\1 ', 'g')\n  let type = substitute(type, '\\s*&\\s*', ' \\0 ', 'g')\n  let array = substitute(array, '\\s*\\([[\\]*]\\)\\s*', ' \\\\\\1 ', 'g')\n  \" echomsg a:param . ' -> ' . type\n  let re_param = type . ' ' . id . ' ' . array\n  return re_param\nendfunction\n\nfunction! lh#cpp#AnalysisLib_Function#SignatureToSearchRegex2(signature,className) abort\n  let function_data = lh#cpp#AnalysisLib_Function#AnalysePrototype(a:signature)\n\n  \" Return type {{{4\n  let impl2search = ''\n  if strlen(function_data.return) > 0\n  let impl2search .= s:Type2Regex(function_data.return, '') . ' '\n  endif\n\n  \" Class::functionname {{{4\n  let className = a:className . (\"\"!=a:className ? '::' : '')\n  if className =~ '#::#'\n    let ns = matchstr(className, '^.*\\ze#::#') . '::'\n    let b = substitute(ns, '[^:]', '', 'g')\n    let b = substitute(b, '::', '\\\\%(', 'g')\n    let ns_re = b.substitute(ns, '\\<\\I\\i*\\>::', '\\0\\\\)\\\\=', 'g')\n    let cl_re = matchstr(className, '#::#\\zs.*$')\n    let className = ns_re.cl_re\n  endif\n  let className   = substitute(className, '\\s*::\\s*', ' :: ', 'g')\n  let name = className . join(function_data.name, ' :: ')\n  let impl2search .= escape(name, '~')\n\n  \" Parameters {{{4\n  let params = []\n  for param in function_data.parameters\n    call add(params, s:Type2Regex(param[0], param[1]))\n  endfor\n  let impl2search .= ' ( ' . join(params, ' , ').' )'\n\n  let impl2search .= function_data.const ? ' const' : ''\n\n\n  \" Spaces & comments -> '\\(\\_s\\|/\\*.\\{-}\\*/\\|//.*$\\)*' and \\i {{{4\n  let impl2search = substitute(impl2search, '\\s\\{2,}', ' ', 'g')\n  let g:impl2search2 = impl2search\n\n  let impl2search = substitute(' \\zs'.impl2search, ' ',\n        \\ '\\\\%(\\\\_s\\\\|/\\\\*.\\\\{-}\\\\*/\\\\|//.*$\\\\)*', 'g')\n  \" Note: \\%(\\) is like \\(\\) but the subexpressions are not counted.\n  \" Note: ' \\zs' inserted at the start of the regex helps ignore any comments\n  \" before the signature of the function.\n  \" Return the regex built {{{4\n  \"\n  \" Check pure virtual functions: {{{4\n  let isPure =  function_data.pure\n\n  \" Check =delete/=default functions: {{{4\n  let isWithoutDefinition = !empty(function_data.special_definition)\n\n  let res = {'regex':impl2search, 'ispure':isPure, 'isWithoutDefinition': isWithoutDefinition}\n  return res\nendfunction\n\n\" Function! lh#cpp#AnalysisLib_Function#SignatureToSearchRegex(signature,className) {{{3\nfunction! lh#cpp#AnalysisLib_Function#SignatureToSearchRegex(signature,className) abort\n  let g:signature = a:signature\n  let g:className = a:className\n  \" trim spaces {{{4\n  let impl2search = substitute(a:signature, \"\\\\(\\\\s\\\\|\\n\\\\)\\\\+\", ' ', 'g')\n  \" trim comments {{{4\n  let impl2search = substitute(impl2search, '/\\*.\\{-}\\*/\\|//.*$', '', 'g')\n  \" destructor ? {{{4\n  let impl2search = substitute(impl2search, '\\~', '\\\\\\0', 'g')\n  \" '[,' '],' pointers {{{4\n    \" let impl2search = substitute(impl2search, '\\s*\\([[\\]*]\\)\\s*', ' \\\\\\1 ', 'g')\n    \" Note: these characters will be backspaced into s:TrimParametersNames\n  \" echo impl2search\n  let impl2search = substitute(impl2search, '\\s*\\([[\\]*]\\)\\s*', ' \\1 ', 'g')\n    \" However returned pointers must be backspaced\n    let retTypePos = matchend(impl2search, '.\\{-}\\s\\+\\ze\\i\\{-}\\s*(\\|\\ze\\<operator\\>')\n    let retType       = strpart(impl2search, 0, retTypePos)\n    let func_n_params = strpart(impl2search, retTypePos)\n    let retType = substitute(retType, '\\s*\\([[\\]*]\\)\\s*', ' \\\\\\1 ', 'g')\n    let impl2search = retType . func_n_params\n  \" operator* {{{4\n  let impl2search = substitute(impl2search, 'operator\\s*\\*', 'operator \\\\*', '')\n  \"  <, >, =, (, ), ',' and references {{{4\n  let impl2search = substitute(impl2search, '\\s*\\([-+*/%^=<>!]=\\|&&\\|||\\|[<>=(),&]\\)\\s*', ' \\1 ', 'g')\n  \" Check pure virtual functions: {{{4\n  let isPure =  impl2search =~ '=\\s*0\\s*;\\s*$'\n  \" Check =delete/=default functions: {{{4\n  let isWithoutDefinition = impl2search =~ '=\\s*\\<\\(default\\|delete\\)\\>\\s*;\\s*$'\n  \" Start and end {{{4\n  let impl2search = substitute(impl2search, '^\\s*\\|\\s*;\\s*$', '', 'g')\n  \" Default parameters -> comment => ignored along with spaces {{{4\n  \" -> recognize \"=\" to strip what follows when not operator[-+*/=!^]=\n  let impl2search = substitute(impl2search, '\\%(\\<operator\\>\\s*\\([-+*/=!^%]\\s*\\)\\=\\)\\@<!=[^,)]\\+', '', 'g')\n  \" virtual, static and explicit -> comment => ignored along with spaces {{{4\n  let impl2search = substitute(impl2search,\n        \\ '\\_s*\\<\\%(virtual\\|static\\|explicit\\)\\>\\_s*', '', 'g')\n  \" Extract throw specs {{{4\n  let throw_specs = matchstr(impl2search, '\\v\\)\\s*\\zs(throw|noexcept).*$')\n  \" Trim the variables names {{{4\n  \" Todo: \\(un\\)signed \\(short\\|long\\) \\(int\\|float\\|double\\)\n  \"       const, *\n  \"       First non spaced type + exceptions like: scope\\s*::\\s*type ,\n  \"       class<xxx,yyy> (scope or type)\n  let impl2search = lh#cpp#AnalysisLib_Function#TrimParametersNames(impl2search)\n  \" class name {{{4\n  let className = a:className . (\"\"!=a:className ? '::' : '')\n  if className =~ '#::#'\n    let ns = matchstr(className, '^.*\\ze#::#') . '::'\n    let b = substitute(ns, '[^:]', '', 'g')\n    let b = substitute(b, '::', '\\\\%(', 'g')\n    let ns_re = b.substitute(ns, '\\<\\I\\i*\\>::', '\\0\\\\)\\\\=', 'g')\n    let cl_re = matchstr(className, '#::#\\zs.*$')\n    let className = ns_re.cl_re\n  endif\n  let className   = substitute(className, '\\s*::\\s*', ' :: ', 'g')\n  \" let g:className = className\n  \" and finally inject the class name patten in the search pattern\n  \" NB: operators have a special treatment\n  let impl2search = substitute(impl2search,\n        \\ '\\%(\\\\\\~\\)\\=\\<\\I\\i*\\>\\_s*(\\|\\<operator\\>',\n        \\ escape(className, '\\' ) .'\\0', '')\n  \" echo impl2search\n  let g:impl2search1 = impl2search\n\n  \" Reinject throw specs {{{4\n  let impl2search .= ' '.throw_specs\n  \" Spaces & comments -> '\\(\\_s\\|/\\*.\\{-}\\*/\\|//.*$\\)*' and \\i {{{4\n  \" let impl2search = substitute(' \\zs'.impl2search, ' ',\n  let impl2search = substitute(impl2search, ' ',\n        \\ '\\\\%(\\\\_s\\\\|/\\\\*.\\\\{-}\\\\*/\\\\|//.*$\\\\)*', 'g')\n  \" Note: \\%(\\) is like \\(\\) but the subexpressions are not counted.\n  \" Note: ' \\zs' inserted at the start of the regex helps ignore any comments\n  \" before the signature of the function.\n  \" Return the regex built {{{4\n  \"\n  let res = {'regex':impl2search, 'ispure':isPure, 'isWithoutDefinition': isWithoutDefinition}\n  return res\nendfunction \"}}}4\n\"------------------------------------------------------------------------\n\" Function: s:TrimParametersNames(str) {{{3\n\" Some constant regexes {{{4\nlet s:type_sign = 'unsigned\\|signed'\nlet s:type_size = 'short\\|long'\nlet s:type_main = 'void\\|char\\|int\\|float'\nlet s:type_simple = s:type_sign.'\\|'.s:type_size.'\\|'.s:type_main\nlet s:type_scope1 = '\\%(::\\s*\\)\\=\\<\\I\\i*\\>'\nlet s:type_scope2 = '\\s*::\\s*\\<\\I\\i*\\>'\nlet s:type_scope  = s:type_scope1.'\\%('.s:type_scope2.'\\)*'\nlet s:re = '^\\s*\\%(\\<const\\>\\s*\\)\\='.\n      \\ '\\%(\\%('.s:type_simple.'\\|\\s\\+\\)\\+\\|'.s:type_scope.'\\)'.\n      \\ '\\%(\\<const\\>\\|\\*\\|&\\|\\s\\+\\)*'\n\" }}}4\nfunction! lh#cpp#AnalysisLib_Function#TrimParametersNames(str) abort\n  \" Stuff Supported: {{{4\n  \" - Simple parameters          : \"T p\"\n  \" - Arrays                     : \"T p[][n]\"\n  \" - Arrays of pointers         : \"T (*p)[n]\"\n  \" - Scopes within complex types: \"T1::T2\"\n    \" Todo: support templates like \"A<B,C>\"\n    \" Todo: support functions like \"T (*NameF)(P1, P2, ...)\" ,\n    \"                              \"T (CL::* pmf)(params)\"\n  \" }}}4\n  \" Cut the signature in order to concentrate on the most outer parenthesis\n  let head_end = matchend(a:str, '^\\([^(]\\{-}\\<operator\\>\\s*(\\s*)\\s*\\|[^(]*\\)(') \" take operator() into account\n  let head = a:str[ : head_end]\n  let tail = matchstr(a:str, ')[^)]*$', head_end-1)\n  let params = matchstr(a:str, '^[^(]*(\\zs.*\\ze)[^)]*$', head_end-1)\n  let params_types = ''\n  \" Loop on the parameters\n  while '' != params\n    \" Get the parameter field\n    let field  = matchstr(params, '^[^,]*')\n    let params = matchstr(params, ',\\zs.*$')\n\n    \" Handle case of arrays {{{5\n    let p = 0\n    let array = ''\n    while -1 != p\n      let p = match(field, '\\[.\\{-}\\]', p)\n      if -1 == p | break | endif\n      let array = array . escape(matchstr(field, '\\[.\\{-}\\]', p), '[]')\n      let p = p + 1\n    endwhile \" }}}4\n    \" Extract the type of the parameter and only the type\n    let type = matchstr(field, s:re)\n    \" let type = matchstr(field, '^\\s*\\(\\<const\\>\\s*\\)\\='.\n          \" \\ '\\(\\('.s:type_simple.'\\|\\s\\+\\)\\+\\|\\<\\I\\i*\\>\\)'.\n          \" \\ '\\(\\<const\\>\\|\\*\\|&\\|\\s\\+\\)*')\n    \" Check for special pointers stuff \"T (*p_id)\"\n    let ptr = matchstr(field, '(\\s*\\*\\s*\\(\\<\\I\\i*\\>\\)\\=\\s*)')\n    let id = (\"\"!=ptr) ? ' ( \\* \\%(\\<\\I\\i*\\>\\)\\= ) ' : ' \\%(\\<\\I\\i*\\>\\)\\= '\n    \" Build the regex containing the parameter type, spaces, etc\n    let params_types = params_types.','.\n          \\ escape(type, '*')\n          \\ . id\n          \\ . array\n          \" \\ type.'\\%(\\<\\I\\i*\\>\\)\\= '\n  endwhile\n\n  \" Return the final regex to search.\n  return substitute(head . strpart(params_types,1) . tail, '\\s\\s\\+', ' ', 'g')\nendfunction\n\" }}}3\n\"------------------------------------------------------------------------\n\" }}}2\n\n\" Functions }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/GotoFunctionImpl.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp/GotoFunctionImpl.vim                      {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"               <URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/tree/master/License.md>\n\" Version:      2.2.1\nlet s:k_version = '221'\n\" Created:      07th Oct 2006\n\" Last Update:  04th Apr 2019\n\"------------------------------------------------------------------------\n\" Description:\n\"       Implementation functions for ftplugin/cpp/cpp_GotoImpl\n\"\n\"------------------------------------------------------------------------\n\" Installation:\n\"       Drop this file into {rtp}/autoload/lh/cpp/\n\"       Use Vim 7+\n\" History:\n\"       12th Sep 2007:\n\"       (*) Accepts spaces between \"~\" and class name (destructors)\n\"       v1.0.0:\n\"       (*) Code moved from ftplugin/cpp/cpp_GotoFunctionImpl.vim\n\"       (*) Fixes issues with g:alternateSearchPath in order to open the .cpp\n\"       in the correct subdirectory\n\"       (*) Don't escape '&' (from parameter's type) to build search regex\n\"       (*) Preserve line breaks between parameters\n\"       (*) A message is displayed if the position of the function definition\n\"           cannot be found.\n\"       v1.1.0\n\"       (*) two functions moved to autoload/lh/cpp/AnalysisLib_Function\n\"       v1.1.1\n\"       (*) Support jump to existing destructor\n\"       (*) Support jump to constructor with a initialization-list\n\"       (*) Support \"using namespace\"\n\"       (*) Don't expect the searched regex to start the line (as the return\n\"           type may need to be fully-qualified is the function definition)\n\"       v2.0.0\n\"       (*) GPLv3 with exception\n\"       (*) parameter for the new implementation file extention\n\"       (*) reuse a know buffer if it already exists -- i.e.: not limited to\n\"           readable files\n\"       (*) facultative option: extension of the file where to put the\n\"           definition of the function.\n\"       (*) Fix :GOTOIMPL to work even if &isk contains \":\"\n\"       (*) Fix :GOTOIMPL to support operators like +=\n\"       v2.2.0\n\"       (*) Use new alternate-lite API to determine the destination file\n\"       (*) Update options to support specialization\n\"       (*) Fix extra space introduced by `:MOVETOIMPL`\n\"       (*) Update to new lh-tags v3.0 and lh-dev new API\n\"       v2.2.1\n\"       (*) override and final cannot be used outside class definition\n\" TODO:\n\"       (*) add knowledge about C99/C++11 new numeric types\n\"       (*) :MOVETOIMPL should not expect the open-brace \"{\" to be of the same\n\"           line as the function signature.\n\"       (*) Check how to convert the return, and the parameters, types to their\n\"           fully-qualified names if required in the function definition.\n\" }}}1\n\"=============================================================================\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\" ## Misc Functions     {{{1\n\" # Version {{{2\nfunction! lh#cpp#GotoFunctionImpl#version()\n  return s:k_version\nendfunction\n\n\" # Debug   {{{2\nlet s:verbose = get(s:, 'verbose', 0)\nfunction! lh#cpp#GotoFunctionImpl#verbose(...)\n  if a:0 > 0 | let s:verbose = a:1 | endif\n  return s:verbose\nendfunction\n\nfunction! s:Log(expr, ...)\n  call call('lh#log#this',[a:expr]+a:000)\nendfunction\n\nfunction! s:Verbose(expr, ...)\n  if s:verbose\n    call call('s:Log',[a:expr]+a:000)\n  endif\nendfunction\n\nfunction! lh#cpp#GotoFunctionImpl#debug(expr) abort\n  return eval(a:expr)\nendfunction\n\n\" ## Functions {{{1\n\" # Public {{{2\n\"------------------------------------------------------------------------\n\" Function: lh#cpp#GotoFunctionImpl#MoveImpl() \"{{{3\n\" The default values for 'HowToShowVirtual', 'HowToShowStatic' and\n\" 'HowToShowDefaultParams' can be overridden momentarily.\n\" Parameters: None\nfunction! lh#cpp#GotoFunctionImpl#MoveImpl(...) abort\n  try\n    let a_save = @a\n    let s      = @/\n\n    let [end_proto, proto] = lh#dev#c#function#get_prototype(line('.'), 0, 1)\n    if empty(proto)\n      throw \"No prototype found under the cursor.\"\n    endif\n    \" move to the start of the definition\n    call setpos('.', end_proto) \" this puts us one char behind the definition start\n    if lh#position#char_at_mark('.') !~ '[:{]'\n      normal! h\n    endif\n    if proto[-1:] == ':'\n      \" select everything till the open bracket.\n      \" this won't work with C++11 initialiser-lists extended to {}\n      silent exe \"normal! \\\"ad/{\\<cr>\"\n    else\n      let @a = ''\n    endif\n    silent normal! \"Ad%\n    \" For some reason, the previous command insert a leading newline\n    let @a = substitute(@a, '^\\_s*', '', '')\n    \" Add the ';' at the end what precedes, but not on a single line\n    call search('\\S', 'b')\n    silent :exe \"normal! A;\\<esc>\"\n    \" Search the prototype (once again!), from a compatible position (on the\n    \" closing bracket)\n    call search(')', 'b')\n    \" TODO: For now, search the protype once again...\n    \" `\"Ad%` sets regtype to \"V\". When pasted, it introduces a newline\n    \" => we need to prevent that\n    if exists('*setreg')\n      call setreg('a', @a, 'v')\n    endif\n    :exe \"normal! :GOTOIMPL \".join(a:000, ' ').\"\\<cr>va{\\\"ap=a{\"\n    \" was:\n    \" :exe \"normal! \\<home>f{\\\"ac%;\\<esc>:GOTOIMPL \".join(a:000, ' ').\"\\<cr>va{\\\"ap=a{\"\n  finally\n    let @a = a_save\n    let @/ = s\n  endtry\nendfunction\n\n\"------------------------------------------------------------------------\n\" Function: lh#cpp#GotoFunctionImpl#GrabFromHeaderPasteInSource \"{{{3\n\" The default values for 'HowToShowVirtual', 'HowToShowStatic' and\n\" 'HowToShowDefaultParams' can be overridden momentarily.\n\" Parameters: 'ShowVirtualon', 'ShowVirtualoff', 'ShowVirtual0', 'ShowVirtual1',\n\"             'ShowStaticon', '..off', '..0' or '..1'\n\"             'ShowExplicitcon', '..off', '..0' or '..1'\n\"             'ShowDefaultParamson', '..off', '..0', '..1',  or '..2'\n\" TODO: add C++11 override and final\nlet s:option_value = '\\%(on\\|off\\|\\d\\+\\)$'\nfunction! lh#cpp#GotoFunctionImpl#GrabFromHeaderPasteInSource(...) abort\n  let expected_extension = call('s:CheckOptions', a:000)\n  let ft = &ft\n\n  \" 1- Retrieve the context {{{4\n  \" 1.1- Get the class name,if any -- thanks to cpp_FindContextClass.vim\n  let className = lh#cpp#AnalysisLib_Class#CurrentScope(line('.'), '##')\n  \" 1.2- Get the whole prototype of the function (even if on several lines)\n  let proto = lh#dev#c#function#get_prototype(line('.'), 1)\n  if \"\" == proto\n    call lh#common#error_msg('cpp#GotoFunctionImpl.vim: We are not uppon the declaration of a function prototype!')\n    return\n  endif\n\n  \" 2- Build the result strings {{{4\n  try\n    let isk_save = &isk\n    set isk-=:\n    let impl2search = s:BuildRegexFromImpl(proto,className)\n    if impl2search.isWithoutDefinition\n      call lh#common#error_msg(\"cpp#GotoFunctionImpl.vim:\\n\\n\".\n            \\ \"=delete and =default functions don't have an implementation!\")\n      return\n    endif\n    if impl2search.ispure\n      call lh#common#error_msg(\"cpp#GotoFunctionImpl.vim:\\n\\n\".\n            \\ \"Pure virtual functions don't have an implementation!\")\n      \" TODO: actually, they can have one. Add a confirm dialog\n      return\n    endif\n\n    \" 3- Add the string into the implementation file {{{4\n    call lh#cpp#GotoFunctionImpl#open_cpp_file(expected_extension)\n    if &ft != ft\n      exe 'setf '.ft\n    endif\n\n    \" Search or insert the C++ implementation\n    if !s:Search4Impl((impl2search.regex).'\\_s*[{:]', className)\n      let impl        = s:BuildFunctionSignature4impl(proto,className)\n      \" Todo: Support looking into other files like the .inl file\n\n      \" Insert the C++ code at the end of the file\n      call lh#cpp#GotoFunctionImpl#insert_impl(impl)\n    endif\n  finally\n    let &isk = isk_save\n  endtry\n\n  \" call confirm(impl, '&ok', 1)\n  \" }}}4\nendfunction\n\n\"------------------------------------------------------------------------\n\" Function: lh#cpp#GotoFunctionImpl#insert_impl(impl) {{{3\nfunction! lh#cpp#GotoFunctionImpl#insert_impl(impl) abort\n  let p = s:SearchLineToAddImpl()\n  if -1 != p\n    call s:InsertCodeAtLine(a:impl, p)\n    let s:FunctionImpl = a:impl\n  else\n    \" Otherwise, we use a method somehow like the one used by Robert:\n    \" We store the text to insert in a specific variable and wait for manual\n    \" insertion of the text.\n    let s:FunctionImpl = a:impl\n    call lh#common#warning_msg(\":GOTOIMPL cannot determine where the function definition should be inserted.\"\n          \\ .\"\\nUse :PASTEIMPL to paste the code prepared.\"\n          \\ .\"\\nSee ftplugin/cpp/cpp_options.vim to tune the placement heuristic\")\n  endif\nendfunction\n\n\"------------------------------------------------------------------------\n\" Function: lh#cpp#GotoFunctionImpl#open_cpp_file(expected_extension) {{{3\nfunction! lh#cpp#GotoFunctionImpl#open_cpp_file(expected_extension) abort\n  call s:Verbose('Opening file with extension `%1`', a:expected_extension)\n  if expand('%:e') =~? 'cpp\\|c\\|C\\|cxx\\|txx'\n    \" already within the .cpp file\n    return\n  endif\n  try\n    \" neutralize mu-template jump to marker feature\n    let cleanup = lh#on#exit()\n          \\.restore('g:mt_jump_to_first_markers')\n    let g:mt_jump_to_first_markers = 0\n\n    let split_opt = lh#cpp#GotoFunctionImpl#_find_alternates(a:expected_extension)\n    if !empty(split_opt)\n      let split_opt = lh#path#to_relative(split_opt)\n      call s:DoSplit(split_opt)\n    endif\n  finally\n    \" restore mu-template\n    call cleanup.finalize()\n  endtry\nendfunction\n\n\" Function: lh#cpp#GotoFunctionImpl#InsertCodeAtLine() {{{3\nfunction! lh#cpp#GotoFunctionImpl#InsertCodeAtLine() abort\n  return s:InsertCodeAtLine()\nendfunction\n\n\" # Private {{{2\n\n\" Function: s:CheckOptions(...) {{{3\nfunction! s:CheckOptions(...) abort\n  \" 0- Check options {{{4\n  let s:ShowVirtual             = lh#ft#option#get('ShowVirtual',       &ft, 1)\n  let s:ShowStatic              = lh#ft#option#get('ShowStatic',        &ft, 1)\n  let s:ShowExplicit            = lh#ft#option#get('ShowExplicit',      &ft, 1)\n  let s:ShowDefaultParams       = lh#ft#option#get('ShowDefaultParams', &ft, 1)\n  let expected_extension        = ''\n  if 0 != a:0\n    let i = 0\n    while i < a:0\n      let i +=  1\n      let varname = substitute(a:{i}, '\\(.*\\)'.s:option_value, '\\1', '')\n      if varname !~ 'ShowVirtual\\|ShowStatic\\|ShowExplicit\\|ShowDefaultParams' \" Error {{{5\n        if !empty(expected_extension)\n          call lh#common#error_msg(\n                \\ 'cpp#GotoFunctionImpl.vim::GrabFromHeaderPasteInSource: extension already set to <'.expected_extension.'>')\n          return\n        else\n          let expected_extension = a:{i}\n        endif\n      else \" }}}4\n        let val = matchstr(a:{i}, s:option_value)\n        if     val == 'on'  | let val = 1\n        elseif val == 'off' | let val = 0\n        elseif val !~ '\\d\\+'\n          call lh#common#error_msg(\n                \\ 'cpp#GotoFunctionImpl.vim::GrabFromHeaderPasteInSource: Invalid value for parameter : <'.varname.'>')\n          return\n        endif\n        \" exe \"let s:\".varname.\"= val\"\n        let s:{varname} = val\n        \" call confirm(s:{varname}.'='.val, '&ok', 1)\n      endif\n    endwhile\n  endif\n  return expected_extension\nendfunction\n\"------------------------------------------------------------------------\n\" Function: s:BestExtensionFor(root_name) {{{3\nfunction! s:BestExtensionFor(root_name, expected_extension) abort\n  if !empty(a:expected_extension) | return a:expected_extension | endif\n  let Best_ext = lh#ft#option#get('ext_4_impl_file', &ft, 'cpp')\n  let best_ext = type(Best_ext) == type(function('has'))\n        \\ ?  Best_ext(a:root_name)\n        \\ : Best_ext\n  return best_ext\nendfunction\n\n\"------------------------------------------------------------------------\n\" Function: s:BuildRegexFromImpl(impl,className) {{{3\n\" Build the regex that will be used to search the signature in the\n\" implementations file\nfunction! s:BuildRegexFromImpl(impl,className) abort\n  let impl2search=lh#cpp#AnalysisLib_Function#SignatureToSearchRegex(a:impl,a:className)\n  let g:impl2search2 = impl2search\n  return impl2search\n  \" }}}4\nendfunction\n\"------------------------------------------------------------------------\n\" Function: s:Search4Impl(re_impl, scope):bool {{{3\nfunction! s:Search4Impl(re_impl, scope) abort\n  \" 0- Pretransformations {{{4\n  let required_ns = matchstr(a:scope, '^.*\\ze#::#')\n  \" 1- Memorize position {{{4\n  let l0 = line('.')\n  \" 2- Loop until the implementation is found, {{{4\n  \"    *and* the scope (namespaces) matches\n  normal! gg\n  \" let l = 1\n  while 1 \" l > 0\n    \" a- search for an acceptable implementation {{{5\n    \"    Note: re_impl looks like :\n    \"    'type \\(\\(ns1::\\)\\=ns2::\\)\\=cl1::cl2::function(...)'\n    let l = search(a:re_impl, 'W')\n    if l <= 0 | break | endif\n\n    \" b- Get the current namespace at the line found {{{5\n    let ns_list = lh#cpp#AnalysisLib_Class#available_namespaces(l)\n\n    \" c- Build the function name that must be found on the current line {{{5\n    \"    The function aname also contain the scope\n    \" let req_proto  = matchstr(required_ns, current_ns.\n    \" \\ (current_ns == '') ? '.*$' : '::\\zs.*$')\n\n    \" d- Retrieve the actual function name (+ relative scope) {{{5\n    let z=@\"\n    let fe=&foldenable\n    set nofoldenable\n    let mv = l.\"gg\".virtcol('.').'|'\n    if search('(', 'W') <= 0\n      \" echoerr \"Weird Error!!!\"\n    endif\n    silent exe 'normal! v'.mv.'y'\n    let &foldenable=fe\n    let current_proto = matchstr(@\", '\\%(::\\|\\<\\I\\i*\\>\\|\\<operator\\>\\s*\\(||\\|&&\\|[-+*/^%=]=\\=\\)\\=\\|\\~\\)\\+\\ze($')\n    let proto0= @\"\n    let @\" = z\n    \" Todo: purge comments within current_proto\n\n    \" e- Check if really found {{{5\n    for ns in ns_list\n      \" if match(required_ns, '^'.ns) == 0\n      \" \\ && (req_proto == current_proto)\n      let current = ns . ((ns != \"\") ? '::' : '' ).current_proto\n      if (\"\" != required_ns) && (required_ns !~ '.*::$')\n        let required_ns .=  '::'\n      endif\n      \" call confirm('required_ns='.required_ns.\n      \" \\ \"\\ncurrent_proto=\".current_proto.\n      \" \\ \"\\ncurrent_ns=\".ns.\n      \" \\ \"\\n\".l.\"=\".getline('.').\n      \" \\ \"\\n\\nmv=\".mv.\"\\nproto0=\".proto0.\"\\ncurrent=\".current,\n      \" \\ '&ok', 1)\n      \" \\ \"\\n\\nreq_proto=\".req_proto.\n      if match(current,'^'.required_ns) == 0\n        return l\n      endif\n    endfor\n    \" }}}5\n  endwhile\n\n  \" 2.b- Not found {{{4\n  exe l0\n  return 0\n  \" }}}4\nendfunction\n\"------------------------------------------------------------------------\n\" Function: s:BuildFunctionSignature4impl \" {{{3\nlet s:k_operators = '\\<operator\\%([=~%+-\\*/^&|]\\|[]\\|()\\|&&\\|||\\|->\\|<<\\|>>\\)'\nfunction! s:BuildFunctionSignature4impl(proto,className) abort\n  let proto = lh#cpp#AnalysisLib_Function#AnalysePrototype(a:proto)\n  let g:implproto = proto\n\n  let re_qualifiers = []\n  \" 1.a- XXX if you want virtual commented in the implementation: {{{4\n  if s:ShowVirtual\n    let re_qualifiers += ['\\<virtual\\>']\n  endif\n\n  \" 1.b- XXX if you want static commented in the implementation: {{{4\n  if s:ShowStatic\n    let re_qualifiers += ['\\<static\\>']\n  endif\n\n  \" 1.b- XXX if you want explicit commented in the implementation: {{{4\n  if s:ShowExplicit\n    let re_qualifiers += ['\\<explicit\\>']\n  endif\n  let comments = matchstr(proto.qualifier, join(re_qualifiers, '\\|'))\n  if !empty(comments)\n    let comments = '/*'.comments.'*/ '\n  endif\n\n  \" 2- Handle default params, if any. {{{4\n  \"    0 -> \"\"              : ignored\n  \"    1 -> \"/* = value */\" : commented\n  \"    2 -> \"/*=value*/\"    : commented, spaces trimmed\n  \"    3 -> \"/*value*/\"     : commented, spaces trimmed, no equal sign\n  if     s:ShowDefaultParams == 0 | let pattern = '\\2'\n  elseif s:ShowDefaultParams == 1 | let pattern = '/* = \\1 */\\2'\n  elseif s:ShowDefaultParams == 2 | let pattern = '/*=\\1*/\\2'\n  elseif s:ShowDefaultParams == 3 | let pattern = '/*\\1*/\\2'\n  else                            | let pattern = '\\2'\n  endif\n  \"\n\n  let implParams = []\n  for param in proto.parameters\n    call s:Verbose(\"Parameter: %1\", param)\n    \" TODO: param type may need to be fully-qualified, see 4.2\n    let sParam = (get(param, 'nl', 0) ? \"\\n\" : '')\n          \\ . (param.type) . ' ' . (param.name)\n          \\ . substitute((param.default), '\\(.\\+\\)', pattern, '')\n    \" echo \"param=\".param\n    call add(implParams, sParam)\n  endfor\n  let implParamsStr = join(implParams, ', ')\n  \" @todo: exceptions specifications\n\n  \" 3- Add '::' to the class name (if any).{{{4\n  let className = a:className . (\"\"!=a:className ? '::' : '')\n  \" let impl = substitute(impl, '\\%(\\~\\s*\\)\\=\\%(\\<\\i\\+\\>\\|'.s:k_operators.'\\)\\('.\"\\n\".'\\|\\s\\)*(',\n  \" \\ className.'\\0', '')\n\n  \" 4- Add scope to other types {{{4\n  \" 4.1- ... return type\n  \" return type is stored in function signature extracted by ... ctags\n  let session = lh#tags#session#get()\n  let ltags   = session.tags\n  call session.finalize()\n  let all_ret_dicts = filter(copy(ltags), 'v:val.name == '.string(proto.return))\n  let all_rets = lh#list#get(all_ret_dicts, 'class', '')\n  \" let all_rets = lh#list#transform(all_ret_dicts, [], 'v:1_.class')\n  let all_rets = lh#list#unique_sort(all_rets)\n  if len(all_rets) > 1\n    let all_rets = ['::'] + all_rets\n    let choice = lh#ui#confirm('Where does <'.(proto.return).'> comes from?',\n          \\ join(all_rets, \"\\n\"), 1)\n    if     choice == 0 | let scope = []\n    elseif choice == 1 | let scope = ['']\n    else               | let scope = [all_rets[choice-1]]\n    endif\n  elseif len(all_rets) == 1\n    let scope = all_rets\n  else\n    let scope = []\n  endif\n  let scope += [proto.return]\n  let return = join(scope, '::')\n  \" 4.2- ... parameters types\n  \" 4.3- ... constexpr\n  \" TODO: Check: not sure this really makes sense: constexpr function shall\n  \" be inlined\n  if proto.constexpr\n    let return = 'constexpr ' . return\n  endif\n\n  \" 5- Return{{{4\n  \" TODO: some styles like to put return types and function names on two\n  \" different lines\n  let unstyled = comments\n        \\ . return . ' '\n        \\ . className\n        \\ . join(proto.name, '::')\n        \\ . '('.implParamsStr . ')'\n        \\ . (proto.const ? ' const' : '')\n        \\ . (proto.volatile ? ' volatile' : '')\n        \\ . (!empty(proto.throw) ? ' throw ('.join(proto.throw, ',').')' : '')\n        \\ . (!empty(proto.noexcept) ? ' ' . proto.noexcept : '')\n        \\ . \"{}\"\n  let styles = lh#style#get(&ft)\n\n  let res = unstyled\n  if !empty(styles)\n    let styled = lh#style#apply(unstyled)\n    let res = styled\n  endif\n\n  return res\n  \"}}}4\nendfunction\n\"------------------------------------------------------------------------\n\" Function: s:SearchLineToAddImpl() {{{3\nfunction! s:SearchLineToAddImpl() abort\n  let Position = lh#ft#option#get('FunctionPosition', &ft, 0)\n  \" Default value for FunctionPosArg may change depending on FunctionPosition\n  if type(Position) == type(function('has'))         \" -- function (direct) {{{4\n    return Position()\n  elseif Position == 1 || type(Position) == type('') \" -- search pattern {{{4\n    \" Default: EOF\n    let FunctionPosArg   = lh#ft#option#get('FunctionPosArg',   &ft, '\\%$')\n    let s=search(FunctionPosArg)\n    if 0 == s\n      call lh#common#error_msg(\"cpp#GotoFunctionImpl.vim: Can't find the pattern\\n\".\n            \\'   <(bpg):cpp'.&ft.'_FunctionPosArg>: '.FunctionPosArg)\n      return -1\n    else\n      return s\n    endif\n  elseif Position == 0                               \" -- offset from end {{{4\n    let FunctionPosArg   = lh#ft#option#get('FunctionPosArg',   &ft, 0)\n    return line('$') - FunctionPosArg\n  elseif Position == 2                               \" -- function (indirect) {{{4\n    let FunctionPosArg   = lh#ft#option#get('FunctionPosArg',   &ft)\n    if lh#option#is_unset(FunctionPosArg)\n      call lh#common#error_msg('cpp#GotoFunctionImpl.vim: No positionning '.\n            \\ 'function defined thanks to <(bpg):cpp'.&ft.'_FunctionPosArg>')\n      return -1\n    elseif type(FunctionPosArg) == type(function('has'))\n      return FunctionPosArg()\n    elseif (type(FunctionPosArg) == type('')) && !exists('*'.FunctionPosArg)\n      call lh#common#error_msg('cpp#GotoFunctionImpl.vim: The function '.\n            \\ '<(bpg):cpp'.&ft.'_FunctionPosArg> is not defined')\n      return -1\n    endif\n    exe \"return \".FunctionPosArg.\"()\"\n  elseif Position == 3                               \" -- non-automatic insertion {{{4\n    return -1\n  endif \" }}}4\nendfunction\n\"------------------------------------------------------------------------\n\" Function: s:InsertCodeAtLine([code [,line]]) {{{3\nfunction! s:InsertCodeAtLine(...) abort\n  if     a:0 >= 2 | let p = a:2+1     | let impl = a:1\n  elseif a:0 >= 1 | let p = line('.') | let impl = a:1\n  else            | let p = line('.') | let impl = s:FunctionImpl\n  endif\n  \" Check namespace value\n  let ns = lh#cpp#AnalysisLib_Class#CurrentScope(p, 'namespace')\n  let ns0 = ns\n  let impl0 = impl\n  \" call confirm('ns  ='.ns.\"\\nimpl=\".impl, '&Ok', 1)\n  while ns != \"\"\n    let n0 = matchstr(ns, '^.\\{-}\\ze\\%(::\\|$\\)')\n    if impl =~ '\\s'.n0.'\\%(::\\|#::#\\)'\n      \" call confirm('trim: '.n0, '&OK', 1)\n      let impl = substitute(impl, '\\(\\s\\)'.n0.'\\%(::\\|#::#\\)', '\\1', 'g')\n    else\n      call lh#common#error_msg( 'cpp#GotoFunctionImpl.vim: Namespaces mismatch!!!'.\n            \\ \"\\n\\nCan't insert <\".\n            \\ matchstr(impl0, '\\%(::\\|#::#\\|\\<\\I\\i*\\>\\)*\\ze\\_s*(').\n            \\ '> within the namespace <'.ns.'>')\n      \" let g:impl0=impl0\n      return\n    endif\n    let ns = matchstr(ns, '::\\zs.*$')\n    \" call confirm('ns  ='.ns.\"\\nimpl=\".impl, '&Ok', 1)\n  endwhile\n  \" Change my namespace delimiters (#::#) to normal scope delimiters (::)\n  let impl = substitute(impl, '#::#', '::', '') . \"\\n\"\n  \" Unfold folders otherwise there could be side effects with ':put'\n  let folder=&foldenable\n  set nofoldenable\n  \" Insert the default function implementation at position 'p'\n  if p > line('$')\n    if getline('$') !~ '^\\s*$'\n      let impl=\"\\n\".impl\n    endif\n    let p=line('$')\n  endif\n  silent exe p.\"put=impl\"\n  \" Note: unlike 'put', 'append' can't insert multiple lines.\n  \" call append(p, impl)\n  \" Reindent the newly inserted lines\n  let nl = strlen(substitute(impl, \"[^\\n]\", '', 'g')) - 1\n  let p +=  1\n  silent exe p.','.(p+nl).'v/^$/normal! =='\n  \" Restore folding\n  let &foldenable=folder\nendfunction\n\"------------------------------------------------------------------------\n\" Function: lh#cpp#GotoFunctionImpl#_find_alternates(expected_extension) {{{3\nfunction! lh#cpp#GotoFunctionImpl#_find_alternates(expected_extension) abort\n  let files = lh#alternate#_find_alternates() \" on current file\n  if len(files.existing) == 1\n    return files.existing[0]\n  elseif !empty(files.existing)\n    let lFiles = files.existing\n  else\n    let lFiles = files.theorical\n  endif\n  let result = lh#path#select_one(lFiles, \"What should be the name of the new file?\")\n  return result\nendfunction\n\n\"------------------------------------------------------------------------\n\" Split Options: {{{3\n\" Function: s:SplitOption() {{{4\n\" @return the type of split desired: \"n)o split\", \"v)ertical\" (default one) or\n\"         \"h)orizontal\"/\nfunction! s:SplitOption() abort\n  if exists('g:cpp_Split')\n    if     g:cpp_Split =~ 'v\\%[ertical]'   | return 'v'\n    elseif g:cpp_Split =~ 'h\\%[orizontal]' | return 'h'\n    else                                   | return 'n'\n    endif\n  endif\n  \" default: vertical split\n  return 'v'\nendfunction\n\n\" Internal constants {{{4\n\" s:split_{a.vim or vim built-in commands}_{split n/h/v} = command to execute\n\" --a.vim\nlet s:split_a_n = 'A'\nlet s:split_a_h = 'AS'\nlet s:split_a_v = 'AV'\n\n\" --no a.vim\n\" @todo don't split if the buffer is opened (while the file does not exists\n\" yet)\nlet s:split_n_n = 'e'\nlet s:split_n_h = 'sp'\nlet s:split_n_v = 'vsp'\n\n\" Function: s:DoSplit(arg) {{{4\nfunction! s:DoSplit(arg) abort\n  call lh#buffer#jump(a:arg, s:split_n_{s:SplitOption()})\nendfunction\n\" }}}2\n\" Functions }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/UnmatchedFunctions.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp/UnmatchedFunctions.vim                  {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"               <URL:http://code.google.com/p/lh-vim/>\n\" Version:      1.1.0\n\" Created:      14th Feb 2008\n\" Last Update:  $Date$\n\"------------------------------------------------------------------------\n\" Description:  description\n\"\n\"------------------------------------------------------------------------\n\" Installation: install details\n\" History:      history\n\" TODO:\n\" (*) Do not mess with history and @/\n\" (*) Support an update command\n\" }}}1\n\"=============================================================================\n\ncommand! -nargs=1 FEcho :echo s:<args>\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\" ## Functions {{{1\n\" # Debug {{{2\nfunction! lh#cpp#UnmatchedFunctions#verbose(level)\n  let s:verbose = a:level\nendfunction\n\nfunction! s:Verbose(expr)\n  if exists('s:verbose') && s:verbose\n    echomsg a:expr\n  endif\nendfunction\n\nfunction! lh#cpp#UnmatchedFunctions#debug(expr)\n  return eval(a:expr)\nendfunction\n\n\" ## Menu {{{1\n\" ==========================[ Menu ]====================================\nfunction! s:AddToMenu(lines, fns, kind)\n  for fn in a:fns\n    let line = fn.filename.'| No '.a:kind.' found for '\n          \\. lh#cpp#AnalysisLib_Function#BuildSignatureAsString(fn)\n    call add(a:lines, line)\n  endfor\nendfunction\n\nfunction! s:BuildMenu(unmatched)\n  let res = ['--abort--']\n  call s:AddToMenu(res, a:unmatched.declarations, \"definition\")\n  call s:AddToMenu(res, a:unmatched.definitions, \"declaration\")\n  return res\nendfunction\n\nfunction! lh#cpp#UnmatchedFunctions#Display(className)\n  let unmatched = lh#cpp#AnalysisLib_Function#SearchUnmatched(a:className)\n  let choices = s:BuildMenu(unmatched)\n  \" return\n  let b_id = lh#buffer#dialog#new(\n        \\ 'Unmatched('.substitute(a:className, '[^A-Za-z0-9_.]', '_', 'g' ).')',\n        \\ 'Unmatched functions for '.a:className,\n        \\ 'bot below',\n        \\ 0,\n        \\ 'lh#cpp#UnmatchedFunctions#select',\n        \\ choices\n        \\)\n  \" Added the lonely functions to the b_id\n  let lUnmatched = unmatched.declarations\n  call extend(lUnmatched, unmatched.definitions)\n  let b_id['unmatched'] = lUnmatched\n  \" Syntax and co\n  call s:PostInitDialog()\n  return ''\nendfunction\n\nfunction! s:PostInitDialog()\n  if has(\"syntax\")\n    syn clear\n\n    \" syntax region UFNbOcc  start='^--' end='$' contains=UFNumber,UFName\n    syntax match UFSignature /.*$/ contained\n    syntax match UFFile /^  [^-][^|]\\+/ contained nextgroup=UFText\n    syntax match UFText /| No .* found for / contained nextgroup=UFSignature\n    syntax region UFLine  start='^  [^-]' end='$' contains=UFFile,UFText,UFSignature\n\n    syntax region UFExplain start='@' end='$' contains=UFStart\n    syntax match UFStart /@/ contained\n    syntax match Statement /--abort--/\n\n    \" Help\n    highlight link UFExplain Comment\n    highlight link UFStart Ignore\n\n    \" Lines\n    highlight link UFLine Normal\n    highlight link UFFile Directory\n    highlight link UFText Normal\n    highlight link UFSignature Identifier\n  endif\nendfunction\n\nfunction! lh#cpp#UnmatchedFunctions#select(results) abort\n  if len(a:results.selection) > 1\n    \" this is an assert\n    throw \"Functions-Matcher: We are not supposed to select several functions\"\n  endif\n  let selection = a:results.selection[0]\n  if selection == 0 | call lh#buffer#dialog#quit() | return | endif\n  \" let unmatched = b:dialog.unmatched\n  \" let cmd = b:cmd\n\n  let choices = a:results.dialog.choices\n  echomsg '-> '.choices[selection]\n  \" echomsg '-> '.info[selection-1].filename . \": \".info[selection-1].cmd\n  if exists('s:quit') | :quit | endif\n  \"\n  let selected_unmatched = a:results.dialog.unmatched[selection-1]\n  call lh#buffer#jump(selected_unmatched.filename, 'sp')\n  normal! gg\n  try\n    \" todo: save history and @/\n    let save_magic = &magic\n    set nomagic\n    exe selected_unmatched.cmd\n  finally\n    let &magic = save_magic\n  endtry\nendfunction\n\n\" ==========================[ Highlight ]===============================\n\" @todo\n\" Active HL in buffers where there are unmatched functions decl/def\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/abs_rel.vim",
    "content": "\"=============================================================================\n\" File:\t\tautoload/lh/cpp/abs_rel.vim                       {{{1\n\" Author:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\" \t\t<URL:http://code.google.com/p/lh-vim/>\n\" Version:\t1.1.0\n\" Created:\t12th May 2009\n\" Last Update:\t$Date$\n\"------------------------------------------------------------------------\n\" Description:\t\n\"  Generative functions for the cpp/abs-rel.template file\n\" \n\"------------------------------------------------------------------------\n\" Installation:\tinstall details\n\" History:\thistory\n\" TODO:\t\tmissing features\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\n\" ## Functions {{{1\n\" # Debug {{{2\nfunction! lh#cpp#abs_rel#verbose(level)\n  let s:verbose = a:level\nendfunction\n\nfunction! s:Verbose(expr)\n  if exists('s:verbose') && s:verbose\n    echomsg a:expr\n  endif\nendfunction\n\nfunction! lh#cpp#abs_rel#debug(expr)\n  return eval(a:expr)\nendfunction\n\n\"------------------------------------------------------------------------\nfunction! lh#cpp#abs_rel#canonicalortodoxform(clsname, required)\n  if !a:required | return \"\" | endif\n  let text = \"/** Protected Copy constructor.\\n*/\\n\"\n  let text .= a:clsname.\"(\".a:clsname.\" const& rhs_);\\n\"\n  let text .= \"/** Protected Assignment operator.\\n*/\\n\"\n  let text .= a:clsname.\" & operator=(\".a:clsname.\" const& rhs_);\"\n  \" let text = Marker_Txt(\"sorry not implemented yet>\") . \";\\n\"\n  return text\nendfunction\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/analyse.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp/analyse.vim                       {{{1\n\" Author:       Luc Hermitte <EMAIL:luc {dot} hermitte {at} gmail {dot} com>\n\"               <URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      2.2.0.\nlet s:k_version = '220'\n\" Created:      08th Apr 2016\n\" Last Update:  31st Aug 2018\n\"------------------------------------------------------------------------\n\" Description:\n\"       Various functions to analyse C and C++ codes\n\"\n\"------------------------------------------------------------------------\n\" History:      «history»\n\" TODO:         «missing features»\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\" ## Misc Functions     {{{1\n\" # Version {{{2\nfunction! lh#cpp#analyse#version()\n  return s:k_version\nendfunction\n\n\" # Debug   {{{2\nlet s:verbose = get(s:, 'verbose', 0)\nfunction! lh#cpp#analyse#verbose(...)\n  if a:0 > 0 | let s:verbose = a:1 | endif\n  return s:verbose\nendfunction\n\nfunction! s:Log(expr, ...)\n  call call('lh#log#this',[a:expr]+a:000)\nendfunction\n\nfunction! s:Verbose(expr, ...)\n  if s:verbose\n    call call('s:Log',[a:expr]+a:000)\n  endif\nendfunction\n\nfunction! lh#cpp#analyse#debug(expr) abort\n  return eval(a:expr)\nendfunction\n\n\n\"------------------------------------------------------------------------\n\" ## Exported functions {{{1\n\n\" Function: lh#cpp#analyse#var_type(name [,default]) {{{3\nfunction! lh#cpp#analyse#var_type(name,...) abort\n  try\n    let p = getpos('.')\n    let cleanup = lh#on#exit()\n          \\.register('call setpos(\".\",'.string(p).')')\n    if a:name =~ '^\\s*$'\n      return call('s:NoDecl', [a:name]+a:000)\n    endif\n    if searchdecl(a:name) == 0\n      \" First: let Vim find the variable definitions\n      let def_line = getline('.')\n      call s:Verbose('Definition of %1 found line %2: %3', a:name, line('.'), def_line)\n    else\n      \" Then: search in the tags DB (it may be an attribute from the current\n      \" class)\n      let session    = lh#tags#session#get()\n      let [var_kind] = session.indexer.get_kind_flags(&ft, ['variable', 'v', 'l'])\n      let tags       = session.tags\n      let pat = '.*\\<'.a:name.'\\>.*'\n      \" FIXME: get the scopename of the current function as well=> ClassName::foobar()\n      let classname = lh#cpp#AnalysisLib_Class#CurrentScope(line('.'), 'class')\n      let defs = filter(copy(tags), 'v:val.name =~ classname.\"::\".pat || (v:val.name =~ pat && s:GetClassName(v:val) =~ classname)')\n      call s:Verbose('Attributes of %1 matching %2: %3', classname, pat, defs)\n      let t_vars  = filter(copy(defs), 'index(var_kind,  v:val.kind)>=0')\n      if empty(t_vars)\n        return call('s:NoDecl', [a:name]+a:000)\n      elseif len(t_vars) == 1\n        let def_line = t_vars[0].cmd\n      else\n        throw \"Too many matching variables\"\n      endif\n    endif\n    let def_line = substitute(def_line, '\\s*;\\s*$\\|\\s*=.*', '', '')\n    let def_line = substitute(def_line, '^\\s*', '', '')\n    let def = split(def_line, ',') \" split function lists\n    call filter(def, 'v:val =~ \"\\\\<\".a:name.\"\\\\s*$\"')\n    let var = lh#dev#option#call('function#_analyse_parameter', &ft, def[0])\n    return var.type\n  finally\n    call cleanup.finalize()\n    if exists('session')\n      call session.finalize()\n    endif\n  endtry\nendfunction\n\n\" Function: lh#cpp#analyse#token(name, ...) {{{3\n\" TODO: finish\nfunction! lh#cpp#analyse#token(name, ...) abort\n  let session    = lh#tags#session#get()\n  let tags       = session.tags\n  let type_kinds = session.indexer.get_kind_flags('cpp', 'classes\\|structure names\\|enumeration names\\|typedefs')\n  try\n    \" 1- check whether its a variable or a type\n    \" 1.1- ask clang, if available\n    \" 1.2- ask ctags, if available\n    \" todo? filter on the exact name as well ?\n    let pat = '.*\\<'.a:name.'\\>.*'\n    \" let defs = taglist(pat)\n    let defs = filter(copy(tags), 'v:val.name =~ pat')\n    if !empty(defs)\n      let t_types = lh#list#copy_if(defs, [], 'v:1_.kind == \"g\"')\n      let var_kinds = 'lvx'\n      if lh#tags#ctags_flavour() =~ 'utags'\n        let var_kinds .= 'z' \" parameters\n      endif\n      let t_vars  = lh#list#copy_if(defs, [], 'v:1_.kind =~ \"['.var_kinds.']\"')\n      \" nominal case: one type\n      if len(t_types) > 1\n        let t_types = lh#dev#tags#keep_full_names(t_types)\n      endif\n      if len(t_vars) > 1\n        let t_vars = lh#dev#tags#keep_full_names(t_vars)\n      endif\n      if len(t_types) == 1 && empty(t_vars)\n        let res = (a:0 > 0) ? (a:1) : {}\n        let res['type'] = t_types[0]\n        return res\n      elseif len(t_vars) == 1 && empty(t_types)\n        let res = { 'var': t_vars[0] }\n        if a:0 > 0\n          throw \"Variable \".string(a:1).\" referencing another variable: \".string(res)\n        endif\n      elseif !empty(t_types) && !empty(t_vars)\n        throw \"Too many compatible identifiers match the alleged \".(a:name).\" symbol\"\n      elseif empty(t_types) && empty(t_vars)\n        \"No compatible identifier match the alleged symbol\n        \"but it can be something to search with searchdecl\n        let res = {}\n      else\n        throw \"unexpected case\"\n      endif\n    else\n      let res = {}\n    endif\n\n    \" 1.3- or searchdecl otherwise\n    if empty(res)\n      let pos = getpos('.')\n      try\n        let not_found = searchdecl(a:name, 1)\n        if not_found | return {} | endif\n        \" Type or variable ?\n        let line = getline('.')\n        if line =~ 'enum\\s\\+\\(class\\s\\+\\)\\='.(a:name)\n          \" type\n          let res = (a:0 > 0) ? (a:1) : {}\n          let res['type'] = {'pos':getpos('.'), 'name': (a:name)}\n          return res\n        else\n          \" variable!\n          \" todo: factorize this common pattern\n          let s:re_qualified_name1 = '\\%(::\\s*\\)\\=\\<\\I\\i*\\>'\n          let s:re_qualified_name2 = '\\s*::\\s*\\<\\I\\i*\\>'\n          let s:re_qualified_name  = s:re_qualified_name1.'\\%('.s:re_qualified_name2.'\\)*'\n          \" let type = matchstr(line, '.*[(),{};]\\s\\*\\<.*\\>\\ze\\s\\+'.a:name)\n          let type = matchstr(line, s:re_qualified_name.'\\ze\\s\\+'.a:name)\n          if type =~ '^\\s*$'\n            throw \"Cannot find an enum type related to the \".a:name.\" variable defined line \".line('.')\n          endif\n          let res = { 'var': {'name': (a:name), 'pos':getpos('.')}, 'type': {'name': type}}\n          if a:0 > 0\n            throw \"Variable \".string(a:1).\" referencing another variable: \".string(res)\n          endif\n          let res = lh#cpp#analyse#token(type, res)\n          return res\n        endif\n      finally\n        call setpos('.', pos)\n      endtry\n    endif\n\n    \" 2- find the type definition\n  finally\n    call session.finalize()\n  endtry\nendfunction\n\n\" ## Internal functions {{{1\n\n\" Function: s:NoDecl(name, [default]) {{{3\nfunction! s:NoDecl(name, ...) abort\n  if a:0 == 0\n    throw \"Cannot find variable <\".a:name.\"> declaration. Impossible to deduce its type.\"\n  else\n    return a:1\n  endif\nendfunction\n\n\" Function: s:GetClassName(dict) {{{3\nfunction! s:GetClassName(dict) abort\n  return get(a:dict, \"class\", get(a:dict, \"struct\", \"\"))\nendfunction\n\n\" Function: lh#cpp#analyse#context([line]) {{{3\n\" https://vi.stackexchange.com/a/11942/626\nfunction! lh#cpp#analyse#context(...) abort\n  let line = get(a:, 1, line('.'))\n  let fn = lh#dev#find_function_boundaries(line)\n  if fn.lines[0] <= line && line <= fn.lines[1]\n    \" This is a function\n    call lh#assert#value(fn).has_key('fn')\n    let kinds = filter(['struct', 'class', 'namespace'], 'has_key(fn.fn, v:val)')\n    call lh#assert#value(kinds).not().empty()\n    let scope = join(\n          \\ [ get({'public': '+', 'private': '-', 'protected': '#'}, get(fn.fn, 'access', ''), '')\n          \\ , substitute(get(fn.fn, 'typeref', ''), '^typename:', '', '')\n          \\ , fn.fn[kinds[0]] . '::' . fn.fn.name . get(fn.fn, 'signature')\n          \\ ], ' ')\n  else\n    \" classes, structs, namespaces, ...\n    \" TODO: don't move the cursor\n    let scope = lh#cpp#AnalysisLib_Class#CurrentScope(line, 'any')\n  endif\n  return scope\nendfunction\n\n\"------------------------------------------------------------------------\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/constructors.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp/constructors.vim                          {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"               <URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/blob/master/License.md>\n\" Version:      2.2.0\n\" Created:      09th Feb 2009\n\" Last Update:  05th Sep 2018\n\"------------------------------------------------------------------------\n\" Description:\n\"       Helper MMIs to generate constructors\n\"       Deported functions used by ftplugin/cpp/cpp_Constructor.vim\n\"\n\"------------------------------------------------------------------------\n\" History:\n\"       v1.1.0: Creation\n\"       v2.0.0  31st May 2012\n\"               License GPLv3 w/ extension\n\"       v.2.0.0b4\n\"               New commands: :ConstructorCopy, :ConstructorDefault,\n\"               :ConstructorInit, :AssignmentOperator\n\" Requirements:\n\"       - mu-template 3.0.8\n\"       - lh-dev\n\" TODO:\n\" - select all attributes by default\n\" - permit to change the order of the attributes in the constructor parameters\n\"   list (with <c-up>, <c-down> for instance\n\" - align parameters on multiple lines, and init-lists\n\" - have init-constructors rely on a mu-template snippet\n\" - rely of libclang (databases?)\n\" - Extend to C++11 move constructors & co\n\" - Use universal ctags typeref attribute when available to obtain types\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\n\" ## Functions {{{1\n\" # Debug {{{2\nfunction! lh#cpp#constructors#verbose(level)\n  let s:verbose = a:level\nendfunction\n\nfunction! s:Verbose(expr)\n  if exists('s:verbose') && s:verbose\n    call lh#common#echomsg_multilines(a:expr)\n  endif\nendfunction\n\nfunction! lh#cpp#constructors#debug(expr) abort\n  return eval(a:expr)\nendfunction\n\n\" # API {{{2\n\"Function: s:Attributes(classname) {{{3\nfunction! s:Attributes(classname) abort\n  \" fetch the attributes\n  let attributes = lh#dev#class#attributes(a:classname, 1)\n  \" The attributes need to be sorted by their order of definition in the class\n  \" definition\n\n  \" todo: do not assume the attributes comes from the same file/class\n  if len(attributes) == 0 | return attributes | endif\n  for attr in attributes\n    let signature = attr.cmd\n    let attr['fullsignature' ] = s:Regex2Sig(signature)\n    \" ctags doesn't extract attribute type...\n    let attr.type = matchstr(attr.fullsignature, '^\\s*\\zs.\\{-}\\s\\+\\ze\\S\\+\\s*$')\n  endfor\n  unlet attr\n\n  let filename = attributes[0].filename\n  \" The buffer may not be associated to a real file, in that case, use its\n  \" current content.\n  let bid = bufnr(filename)\n  if bid >= 0\n    let buffer = getbufline(bid, 1, '$')\n  else\n    call lh#assert#true(filereadable(filename), \"Cannot read lines from a file that cannot be read...\")\n    let buffer = readfile(filename)\n  endif\n  let search = join(lh#list#transform(attributes,[], 'escape(matchstr(v:1_.cmd,\"/^\\\\s*\\\\zs.*\\\\ze\\\\s*;\"),\"*\")'), '\\|')\n  call filter(buffer, 'v:val =~ '.string(search))\n  call map(buffer, 'matchstr(v:val,\"\\\\s*\\\\zs.*\\\\ze\\\\s*;\")')\n  let sorted_attributes = []\n  for attr in buffer\n    let p = lh#list#Find_if(attributes, 'v:val.fullsignature == '.string(attr))\n    \" assert p!=-1\n    if p == -1\n      throw \"lh#cpp#constructors.s:Attributes: unexpected attribute: \".string(attr)\n    endif\n    call add(sorted_attributes, attributes[p])\n  endfor\n\n  return sorted_attributes\nendfunction\n\n\"Function: lh#cpp#constructors#Main {{{3\nfunction! lh#cpp#constructors#Main(...) abort\n  if a:0 == 0 || a:1 == 'init'\n    call lh#cpp#constructors#InitConstructor()\n  elseif a:1 =~ 'assign'\n    call lh#cpp#constructors#AssignmentOperator()\n  else\n    call lh#cpp#constructors#GenericConstructor(a:1)\n  endif\nendfunction\n\n\" Function: lh#cpp#constructors#InitConstructor() {{{3\nfunction! lh#cpp#constructors#InitConstructor() abort\n  \" 1- Obtain current class name\n  let classname = lh#cpp#AnalysisLib_Class#CurrentScope(line('.'),'any')\n  call s:Verbose (\"classname=\".classname)\n  \" 2- Obtain attributes functions\n  let attributes = s:Attributes(classname)\n  call s:Verbose (\"attributes=\".join(attributes,\"\\n\"))\n\n  if !empty(attributes)\n    \" 3- Propose to select the functions to override\n    call s:Display(classname, attributes)\n    \" 4- Insert them in the current class\n    \" -> asynchrounous\n  else\n    \" 3.bis- do it synchronously\n    let where_it_started = getpos('.')\n    let where_it_started[0] = bufnr('%')\n    call lh#cpp#constructors#_expand_selection(classname, [], [], where_it_started)\n  endif\nendfunction\n\n\" Function: lh#cpp#constructors#AssignmentOperator() {{{3\nfunction! lh#cpp#constructors#AssignmentOperator() abort\n  \" 1- Obtain current class name\n  let classname = lh#cpp#AnalysisLib_Class#CurrentScope(line('.'),'any')\n  call s:Verbose (\"classname=\".classname)\n  \" 2- Obtain attributes functions\n  let attributes = s:Attributes(classname)\n  call s:Verbose (\"attributes=\".join(attributes,\"\\n\"))\n\n  \" 3- Insert the assignment-operator declaration\n  let params = {}\n  let params.clsname = classname\n  let params.attributes = attributes\n  \" remove scope from attribute name\n  call lh#list#map_on(attributes, 'name', 'substitute(v:val, \".*::\", \"\", \"\")')\n  try\n    let cleanup = lh#on#exit()\n          \\.restore('g:mt_jump_to_first_markers')\n    let g:mt_jump_to_first_markers = 0\n    call lh#mut#expand_and_jump(0, 'cpp/assignment-operator', params)\n  finally\n    call cleanup.finalize()\n  endtry\n\n  \" 4- Move its implementation, if any, to the right place\n  if getline('.') =~ '}$'\n    normal! %\n    while line('.') > 1 && getline('.') =~ '\\v^\\s*\\{|^\\s*$'\n      normal! k\n    endwhile\n    call lh#cpp#GotoFunctionImpl#MoveImpl()\n  endif\nendfunction\n\n\" Function: lh#cpp#constructors#GenericConstructor(kind) {{{3\nfunction! lh#cpp#constructors#GenericConstructor(kind) abort\n  \" 1- Obtain current class name\n  let classname = lh#cpp#AnalysisLib_Class#CurrentScope(line('.'),'any')\n  call s:Verbose (\"classname=\".classname)\n  \" 2- Obtain attributes functions\n  let attributes = s:Attributes(classname)\n  let g:attributes = attributes\n  call s:Verbose (\"attributes=\".join(attributes,\"\\n\"))\n\n  \" 3- Insert the *-constructor declaration\n  try\n    let cleanup = lh#on#exit()\n          \\.restore('g:mt_jump_to_first_markers')\n    let g:mt_jump_to_first_markers = 0\n    exe 'MuTemplate cpp/'.a:kind.'-constructor'\n  finally\n    call cleanup.finalize()\n  endtry\n\n  \" 4- Go-to its implementation and fill-it\n  \" Last line inserted should be the constructor signature\n  \" 4.1- goto impl is at the right place\n  \" MOVETOIMPL doesn't know how to ignore initialization-list\n  \" => We don't use the constructor snippets at their full capacity for now,\n  \" and thus duplicate their attribute-duplication code.\n  GOTOIMPL\n  normal! %\n  \" 4.2- Prepare init-list code\n  let rhs = lh#naming#param('rhs').'.'\n  let init_list=[]\n  for attribute in attributes\n    let attrb_name = matchstr(attribute.fullsignature, '^\\s*.\\{-}\\s\\+\\zs\\S\\+\\ze\\s*$')\n    if a:kind == 'copy'\n      call add(init_list, attrb_name.'('.lh#cpp#snippets#duplicate_param(rhs.attrb_name, attribute.type).')')\n    elseif a:kind == 'default'\n      call add(init_list, attrb_name.'()')\n    endif\n  endfor\n\n  \" 4.3- Insert the init-list\n  if !empty(init_list)\n    let impl_lines=[]\n    call add(impl_lines, ': '.init_list[0])\n    if len(init_list) > 0\n      call extend(impl_lines, lh#list#transform(init_list[1:], [], '\", \".v:1_'))\n    endif\n    put!=impl_lines\n  endif\nendfunction\n\n\" # Internals {{{2\n\" Function: lh#cpp#constructors#_complete(A,L,P) {{{3\nfunction! lh#cpp#constructors#_complete(A,L,P) abort\n  return filter(['init', 'copy', 'default', 'assign'], 'v:val =~ \"^\".a:A.\".*\"')\nendfunction\n\n\" # GUI {{{2\n\n\" ==========================[ Menu ]====================================\n\" Function: s:Access(attr) {{{3\nfunction! s:Access(attr) abort\n  if has_key(a:attr, 'access')\n    if     a:attr.access == 'public'    | return '+'\n    elseif a:attr.access == 'protected' | return '#'\n    elseif a:attr.access == 'private'   | return '-'\n    else                              | return '?'\n    endif\n  else                                | return '?'\n  endif\nendfunction\n\nfunction! s:Regex2Sig(regex) abort\n  let sig = substitute(a:regex, '\\v/\\^\\s*(.{-})\\s*;\\s*\\$/', '\\1', '')\n  return sig\nendfunction\n\n\" Function: s:AddToMenu(lines, attrs) {{{3\nfunction! s:AddToMenu(lines, attrs) abort\n  \" 1- Compute max function length\n  let max_length = 0\n  let attrs=[]\n  \" for overloads in a:attrs\n    \" for attr in overloads\n    for attr in a:attrs\n      \" this damned ctags does not store the type of the attribute ...\n      let length = lh#encoding#strlen(attr.fullsignature)\n      if length > max_length | let max_length = length | endif\n      call add(attrs, attr)\n    endfor\n  \" endfor\n\n  \" 2- Build the result\n  for attr in attrs\n    let line = s:Access(attr).' '.attr.fullsignature\n          \\ . repeat(' ', max_length-lh#encoding#strlen(attr.fullsignature))\n    call add(a:lines, line)\n  endfor\nendfunction\n\n\" Function: s:BuildMenu(declarations) {{{3\nfunction! s:BuildMenu(declarations) abort\n  let res = ['--abort--']\n  call s:AddToMenu(res, a:declarations)\n  return res\nendfunction\n\n\" Function: s:Display(className, declarations) {{{3\nfunction! s:Display(className, declarations) abort\n  let choices = s:BuildMenu(a:declarations)\n  \" return\n  let b_id = lh#buffer#dialog#new(\n        \\ 'C++Constructor('.substitute(a:className, '[^A-Za-z0-9_.]', '_', 'g' ).')',\n        \\ 'Construct-Initializable fields for '.a:className,\n        \\ 'bot below',\n        \\ 1,\n        \\ 'lh#cpp#constructors#select',\n        \\ choices\n        \\)\n  call lh#buffer#dialog#add_help(b_id, '@| +==public, #==protected, -==private in one of the ancestor class', 'long')\n  \" Added the lonely functions to the b_id\n  let b_id['declarations'] = a:declarations\n  let b_id['classname']    = a:className\n  \" Syntax and co\n  call s:PostInitDialog()\n  return ''\nendfunction\n\n\" Function: s:PostInitDialog() {{{3\nfunction! s:PostInitDialog() abort\n  if has(\"syntax\")\n    syn clear\n\n    \" todo: fix syntax names\n    \" syntax region UFNbOcc  start='^--' end='$' contains=UFNumber,UFName\n    \" syntax match CTRtype /.\\{-}$/ contained nextgroup=CTRname\n    syntax match CTRname /\\S*\\s*$/ contained\n    syntax match CTRtagged /^\\*/ contained\n    \" syntax match UFFile /^  [^-][^[]\\+/ contained nextgroup=UFText\n    \" syntax match UFText /| No .* found for / contained nextgroup=UFSignature\n    syntax region CTRLine  start='^[ *] [^-]' end='$' contains=CTRtagged,CTRtype,CTRname\n\n    syntax region CTRExplain start='@' end='$' contains=CTRStart\n    syntax match CTRStart /@/ contained\n    syntax match Statement /--abort--/\n\n    \" Help\n    highlight link CTRExplain Comment\n    highlight link CTRStart Ignore\n\n    \" Lines\n    highlight link CTRLine type\n    highlight link CTRtagged Statement\n    \" highlight link CTRtype Comment\n    highlight link CTRname Identifier\n  endif\nendfunction\n\n\" Function: lh#cpp#constructors#_expand_selection(results) {{{3\nfunction! lh#cpp#constructors#_expand_selection(classname, sig_params, init_list, where_it_started) abort\n  \" 0- prepare the init-ctr signature\n  let len = lh#list#accumulate2(a:sig_params, 0, 'v:1_ + strlen(v:2_)')\n   \\ + lh#encoding#strlen(a:classname) + 2*len(a:sig_params)\n   \\ + 3 \" ();\n  if len > &tw-&sw\n    let sig = [a:classname . '(' ]\n    call extend(sig, lh#list#transform(a:sig_params[0:len(a:sig_params)-2], [], 'v:1_ . \",\"'))\n    call add(sig, a:sig_params[-1].')')\n    let header_lines = sig\n  else\n    let sig = a:classname.'('. join(a:sig_params, ', ') . ')'\n    let header_lines = [substitute(sig, '\\s\\+', ' ', 'g')]\n  endif\n  let impl_lines       = deepcopy(header_lines)\n  let header_lines[-1] .= ';'\n\n  \" 1- insert it in the .h\n  \" Go back to the original buffer, and insert the built lines\n  call lh#buffer#find(a:where_it_started[0])\n  if 0==append(a:where_it_started[1]-1, header_lines)\n    exe (a:where_it_started[1]-1).',+'.(len(header_lines)-1).'normal! =='\n    call s:Verbose((a:where_it_started[1]-1).',+'.(len(header_lines)-1).'normal! ==')\n  endif\n  \" TODO: auto-dox\n\n  \" 2- insert the default impl (see gotoimpl) in the .cpp, don't forget the\n  \" init-list\n  let impl_lines[0] = a:classname . '::' . impl_lines[0]\n  if !empty(a:init_list)\n    call add(impl_lines, ': '.a:init_list[0])\n    if len(a:init_list) > 0\n      call extend(impl_lines, lh#list#transform(a:init_list[1:], [], '\", \".v:1_'))\n    endif\n  endif\n  call extend(impl_lines, [ '{', '}'])\n  let impl = join(impl_lines, \"\\n\")\n  call lh#cpp#GotoFunctionImpl#open_cpp_file('')\n  call lh#cpp#GotoFunctionImpl#insert_impl(impl)\nendfunction\n\n\" Function: lh#cpp#constructors#select(results) {{{3\nfunction! lh#cpp#constructors#select(results) abort\n  call lh#buffer#dialog#quit()\n  if len(a:results.selection)==1 && a:results.selection[0]==0\n    return\n  endif\n  \" if exists('s:quit') | :quit | endif\n\n  \" let unmatched = b:dialog.unmatched\n  \" let cmd = b:cmd\n\n  \" let choices = a:results.dialog.choices\n  let sig_params = []\n  let init_list  = []\n  for selection in a:results.selection\n    \" echomsg '-> '.choices[selection]\n    \" echomsg '-> '.info[selection-1].filename . \": \".info[selection-1].cmd\n    \"\n    let one_selected_attr = a:results.dialog.declarations[selection-1]\n    let attrb_type = matchstr(one_selected_attr.fullsignature, '^\\s*\\zs.\\{-}\\s\\+\\ze\\S\\+\\s*$')\n    let attrb_name = matchstr(one_selected_attr.fullsignature, '^\\s*.\\{-}\\s\\+\\zs\\S\\+\\ze\\s*$')\n    let param_name = lh#cpp#style#attribute2parameter_name(attrb_name)\n\n    call add(sig_params, lh#dev#cpp#types#ConstCorrectType(attrb_type).' '.param_name)\n\n    call add(init_list, attrb_name.'('.param_name.')')\n    \" echomsg string(selected_virt)\n\n  endfor\n\n\n  let classname = a:results.dialog.classname\n  call lh#cpp#constructors#_expand_selection(a:results.dialog.classname,\n        \\ sig_params, init_list,\n        \\ a:results.dialog.where_it_started)\nendfunction\n\n\"------------------------------------------------------------------------\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/enum.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp/enum.vim                          {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"               <URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/License.md>\nlet s:k_version = 220\n\" Version:      2.2.0\n\" Created:      06th Jan 2011\n\" Last Update:  31st Aug 2018\n\"------------------------------------------------------------------------\n\" Description:\n\"       Support autoload-plugin for :SwitchEnum.\n\"\n\"------------------------------------------------------------------------\n\" Requirements:\n\"       Requires Vim7+, lh-dev, lh-vim-lib\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\" ## Misc Functions     {{{1\n\" # Version {{{2\nfunction! lh#cpp#enum#version()\n  return s:k_version\nendfunction\n\n\" # Debug   {{{2\nlet s:verbose = get(s:, 'verbose', 0)\nfunction! lh#cpp#enum#verbose(...)\n  if a:0 > 0 | let s:verbose = a:1 | endif\n  return s:verbose\nendfunction\n\nfunction! s:Log(expr, ...)\n  call call('lh#log#this',[a:expr]+a:000)\nendfunction\n\nfunction! s:Verbose(expr, ...)\n  if s:verbose\n    call call('s:Log',[a:expr]+a:000)\n  endif\nendfunction\n\nfunction! lh#cpp#enum#debug(expr)\n  return eval(a:expr)\nendfunction\n\n\n\"------------------------------------------------------------------------\n\" ## Exported functions {{{1\n\n\" Function: lh#cpp#enum#expand_enum_to_switch() {{{3\nfunction! lh#cpp#enum#expand_enum_to_switch() abort\n  let enum_name = GetCurrentKeyword()\n  let def = lh#cpp#enum#get_definition(enum_name)\n  let ns  = lh#cpp#AnalysisLib_Class#available_namespaces(line('.'))\n  let values = []\n  for enum in def.values\n    let simplified = map(copy(ns), 'substitute(enum, \"^\".v:val.\"::\", \"\", \"\")')\n    let shortest = lh#list#arg_min(ns, function('len'))\n    call lh#assert#true(shortest >= 0 && shortest < len(simplified))\n    let values += [simplified[shortest]]\n  endfor\n  let def.values = lh#list#unique_sort(values)\n  \" TODO: recognize whether this is a type or surround it with markers\n  let def.expr = def.name\n  call s:Verbose('Generate swith from enum %1 -> %2', enum_name, def)\n  if !empty(def)\n    normal! diw\n    call MuTemplate('c/switch', def)\n    \" todo: delete enum_name if MuTemplate() expands\n  endif\nendfunction\n\n\" Function: lh#cpp#enum#analyse_token(name, ...) {{{3\nfunction! lh#cpp#enum#analyse_token(name, ...) abort\n  let session               = lh#tags#session#get()\n  let tags                  = session.tags\n  \" \"variable\" => regex\n  let [var_kind, enum_kind] = session.indexer.get_kind_flags(&ft, ['variable', 'v', 'l'], ['enumeration name', 'g'])\n  try\n    \" 1- check whether its a variable or a type\n    \" 1.1- ask clang, if available\n    \" 1.2- ask ctags, if available\n    \" todo? filter on the exact name as well ?\n    let pat = '.*\\<'.a:name.'\\>.*'\n    \" let defs = taglist(pat)\n    let defs = filter(copy(tags), 'v:val.name =~ pat')\n    if !empty(defs)\n      let t_enums = filter(copy(defs), 'index(enum_kind, v:val.kind)>=0')\n      let t_vars  = filter(copy(defs), 'index(var_kind,  v:val.kind)>=0')\n      \" nominal case: one type\n      if len(t_enums) > 1\n        let t_enums = lh#dev#tags#keep_full_names(t_enums)\n      endif\n      if len(t_vars) > 1\n        let t_vars = lh#dev#tags#keep_full_names(t_vars)\n      endif\n      if len(t_enums) == 1 && empty(t_vars)\n        let res = (a:0 > 0) ? (a:1) : {}\n        let res['type'] = t_enums[0]\n        return res\n      elseif len(t_vars) == 1 && empty(t_enums)\n        let res = { 'var': t_vars[0] }\n        if a:0 > 0\n          throw \"Variable \".string(a:1).\" referencing another variable: \".string(res)\n        endif\n      elseif !empty(t_enums) && !empty(t_vars)\n        throw \"Too many compatible identifiers match the alleged \".(a:name).\" enum\"\n      elseif empty(t_enums) && empty(t_vars)\n        \"No compatible identifier match the alleged enum\n        \"but it can be something to search with searchdecl\n        let res = {}\n      else\n        throw \"unexpected case\"\n      endif\n    else\n      let res = {}\n    endif\n\n    \" 1.3- or searchdecl otherwise\n    if empty(res)\n      let pos = getpos('.')\n      try\n        let not_found = searchdecl(a:name, 1)\n        if not_found | return {} | endif\n        \" Type or variable ?\n        let line = getline('.')\n        if line =~ 'enum\\s\\+\\(class\\s\\+\\)\\='.(a:name)\n          \" type\n          let res = (a:0 > 0) ? (a:1) : {}\n          let res['type'] = {'pos':getpos('.'), 'name': (a:name)}\n          return res\n        else\n          \" variable!\n          \" todo: factorize this common pattern\n          let s:re_qualified_name1 = '\\%(::\\s*\\)\\=\\<\\I\\i*\\>'\n          let s:re_qualified_name2 = '\\s*::\\s*\\<\\I\\i*\\>'\n          let s:re_qualified_name  = s:re_qualified_name1.'\\%('.s:re_qualified_name2.'\\)*'\n          \" let type = matchstr(line, '.*[(),{};]\\s\\*\\<.*\\>\\ze\\s\\+'.a:name)\n          let type = matchstr(line, s:re_qualified_name.'\\ze\\s\\+'.a:name)\n          if type =~ '^\\s*$'\n            throw \"Cannot find an enum type related to the \".a:name.\" variable defined line \".line('.')\n          endif\n          let res = { 'var': {'name': (a:name), 'pos':getpos('.')}, 'type': {'name': type}}\n          if a:0 > 0\n            throw \"Variable \".string(a:1).\" referencing another variable: \".string(res)\n          endif\n          let res = lh#cpp#enum#analyse_token(type, res)\n        endif\n      finally\n        call setpos('.', pos)\n      endtry\n    endif\n\n    return res\n    \" 2- find the type definition\n  finally\n    call session.finalize()\n  endtry\nendfunction\n\n\" Function: lh#cpp#enum#get_definition(name) {{{2\nfunction! lh#cpp#enum#get_definition(name) abort\n  let what = lh#cpp#enum#analyse_token(a:name)\n  if empty(what)\n    throw \"Cannot obtain information on the alleged \".(a:name).\" enum\"\n  endif\n  \" A- case when the enum follows lh-cpp enum pattern:\n  \" struct MyEnum {\n  \"     enum type { E1, E2, ...., MAX__ };\n  \" };\n  if what.type.name =~ \"::type$\"\n    \" 1- ask ctags\n    \" TODO: check weither the else case is enough\n    if has_key(what.type, 'struct')\n      let super = what.type.struct\n    elseif has_key(what.type, 'class')\n      let super = what.type.class\n    else\n      ... ?\n    endif\n    let enum_values = taglist(super)\n    call filter(enum_values, 'get(v:val, \"kind\", \"\") == \"e\"')\n  else\n    \" Other cases, with no guaranties\n    if has_key(what.type, 'struct')\n      let super = what.type.struct\n    elseif has_key(what.type, 'class')\n      let super = what.type.class\n    else\n      let super = '.'\n    endif\n    let enum_values = taglist(super)\n    let enum_name = matchstr(what.type.name, '\\(.*::\\)\\=\\zs.*')\n    call filter(enum_values, 'get(v:val, \"kind\", \"\") == \"e\" && get(v:val, \"enum\", \"\")=~ enum_name')\n  endif\n\n  let res = {'type': what.type.name, 'name': (a:name)}\n  let enum_values = lh#dev#tags#keep_full_names(enum_values)\n  let res['values'] =  lh#list#get(enum_values, 'name')\n  return res\nendfunction\n\n\" Function: lh#cpp#enum#_new(...) {{{2\nfunction! lh#cpp#enum#_new(...) abort\n  try\n    \" Inhibits the jump part in lh#mut#expand_and_jump()\n    let cleanup = lh#on#exit()\n          \\.restore_option('mt_jump_to_first_markers')\n          \\.restore('b:cpp_last_enum')\n    let b:mt_jump_to_first_markers = 0\n\n    \" What is the current scope ?\n    let scope = lh#cpp#AnalysisLib_Class#CurrentScope(line('.'), 'any')\n    if !empty(scope) | let scope .= '::' | endif\n    \" Insert the enum definition\n    let last_line = call('lh#mut#expand_and_jump', [0, 'cpp/enum2']+a:000)\n    let last_enum = b:cpp_last_enum\n    call append(last_line, '')\n    call cursor(last_line+1, 1)\n    \" Goto to its associated definition file\n    call lh#cpp#GotoFunctionImpl#open_cpp_file('')\n    \" And insert the non-inlined function definitions\n    call call('lh#mut#expand_and_jump', [0, 'cpp/enum2-impl', last_enum])\n  finally\n    \" Restores mt_jump_to_first_markers\n    call cleanup.finalize()\n  endtry\n\nendfunction\n\n\"------------------------------------------------------------------------\n\" ## Internal functions {{{1\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/ftplugin.vim",
    "content": "\"=============================================================================\n\" File:\t\tautoload/lh/cpp/ftplugin.vim                             {{{1\n\" Author:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\" \t\t<URL:http://code.google.com/p/lh-vim/>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://code.google.com/p/lh-vim/wiki/License>\n\" Version:\t2.0.0\n\" Created:\t11th Sep 2008\n\" Last Update:\t$Date$\n\"------------------------------------------------------------------------\n\" Description:\t\n\"       Provides lh#cpp#ftplugin#OptionalClass(...) that can be used to write\n\"       :commands in ftplugins that tries to deduce the name of the current\n\"       class if none is provided.\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\" ## Functions {{{1\n\" # Debug {{{2\nfunction! lh#cpp#ftplugin#verbose(level)\n  let s:verbose = a:level\nendfunction\n\nfunction! s:Verbose(expr)\n  if exists('s:verbose') && s:verbose\n    echomsg a:expr\n  endif\nendfunction\n\nfunction! lh#cpp#ftplugin#debug(expr)\n  return eval(a:expr)\nendfunction\n\n\"------------------------------------------------------------------------\n\" # Public {{{2\nfunction! lh#cpp#ftplugin#OptionalClass(...)\n  if a:0 != 0\n    if     type(a:1) == type(\"\") && strlen(a:1)>0\n      return a:1\n    elseif type(a:1) == type([])\n      if len(a:1) > 0 && strlen(a:1[0]) > 0\n\treturn a:1[0]\n      endif\n    endif\n  endif\n\n  let classname = lh#cpp#AnalysisLib_Class#CurrentScope(line('.'),'class')\n  return classname\nendfunction\n\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/include.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp/include.vim                       {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://code.google.com/p/lh-vim/>\n\" Version:      002\n\" Created:      28th Apr 2014\n\" Last Update:  01st Oct 2018\n\"------------------------------------------------------------------------\n\" Description:\n\"       «description»\n\"\n\"------------------------------------------------------------------------\n\" History:      «history»\n\" TODO:         «missing features»\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\" ## Misc Functions     {{{1\n\" # Version {{{2\nlet s:k_version = 2\nfunction! lh#cpp#include#version()\n  return s:k_version\nendfunction\n\n\" # Debug   {{{2\nlet s:verbose = 0\nfunction! lh#cpp#include#verbose(...)\n  if a:0 > 0 | let s:verbose = a:1 | endif\n  return s:verbose\nendfunction\n\nfunction! s:Verbose(expr)\n  if s:verbose\n    echomsg a:expr\n  endif\nendfunction\n\nfunction! lh#cpp#include#debug(expr)\n  return eval(a:expr)\nendfunction\n\n\n\"------------------------------------------------------------------------\n\" ## Exported functions {{{1\n\n\" Function: lh#cpp#include#add(filename, ...) {{{3\n\" @return if anything was added\n\" usages\n\" - add('\"filename\"')\n\" - add('<filename>')\n\" - add('<filename>', 'first')  \" ou 'last'\n\" - add('filename', 0)  -> \"filename\"\n\" - add('filename', 1)  -> <filename>\n\" - add('filename', 0, 'first')  -> \"filename\"\n\" - add('filename', 1, 'first')  -> <filename>\nfunction! lh#cpp#include#add(filename, ...) abort\n  keepjumps normal! gg\n\n  \" Analyse arguments\n  let filename0 = substitute(a:filename, '[<\"]\\(\\f\\+\\)[>\"]', '\\1', '')\n  let offset = 0\n  if a:filename[0] == '<'\n    let useAngleBrackets = 1\n  elseif a:filename[0] == '\"'\n    let useAngleBrackets = 0\n  elseif a:0 > 0\n    let useAngleBrackets = a:1\n    let offset = 1\n  else\n    let useAngleBrackets = 0\n  endif\n  if useAngleBrackets\n    let filename = '<'.filename0.'>'\n  else\n    let filename = '\"'.filename0.'\"'\n  endif\n\n  let where = a:0 > offset ? a:000[offset] : 'last'\n\n  let l = search('^#\\s*include\\s*[\"<]'.filename0.'\\>', 'c')\n  \" todo: parameter  to inhibit this from mu-template\n  if l > 0\n    call lh#common#warning_msg(filename.\" is already included\")\n    return 0\n  endif\n\n  if where == \"last\"\n    keepjumps normal! G\n    let line = search('^#\\s*include', 'b')\n    if line == 0\n      \" no other #include found => like first\n      return lh#cpp#include#add(filename, 'first')\n    endif\n  elseif where == \"first\"\n    keepjumps normal! gg\n    let line = search('^#\\s*include', 'c')\n    if line == 0 \" try after the first #include\n      \" Search for the #ifndef/#define in case of include files\n      let line = search('^#ifndef \\(\\k\\+\\)\\>.*\\n#define \\1\\>')\n      if line > 0\n        let line += 1\n      elseif line('$') == 1 \" empty file\n        let line = 0\n      else\n        \" Search for after the file headers\n        let line = 1\n        while line <= line('$')\n          let ll = getline(line)\n          if !lh#syntax#is_a_comment_at(line, 1) && !lh#syntax#is_a_comment_at(line, len(ll)+1) && ll !~ '^\\s*\\*'\n            \" Sometimes doxygen comments don't have a synstack\n            break\n          endif\n          let line += 1\n        endwhile\n        let line -= line != line('$')\n        call cursor(line, 0)\n      endif\n    endif\n  endif\n  let text='#include '.filename\n  call append(line, text)\n  \" silent put=line\n  call lh#common#warning_msg(text . ' added')\n  return 1\nendfunction\n\n\" Function: lh#cpp#include#add_c_std(filename, ...) {{{3\n\" Specialization of lh#cpp#include#add() for C standard header files <foo.h>\n\" that shall become <cfoo> when included from a C++ file.\nfunction! lh#cpp#include#add_c_std(filename, ...) abort\n  let ft = &ft\n  let filename = (ft == 'cpp') ? ('c'.a:filename) : (a:filename.'.h')\n  let filename = '<' . filename . '>'\n  return call(function('lh#cpp#include#add'), [filename]+ a:000)\nendfunction\n\n\"------------------------------------------------------------------------\n\" ## Internal functions {{{1\n\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/libclang.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp/libclang.vim                      {{{1\n\" Author:       Luc Hermitte <EMAIL:luc {dot} hermitte {at} gmail {dot} com>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/blob/master/License.md>\n\" Version:      2.2.1.\nlet s:k_version = '221'\n\" Created:      28th Nov 2019\n\" Last Update:  28th Nov 2019\n\"------------------------------------------------------------------------\n\" Description:\n\"       Adapt results from vim-clang\n\"\n\"------------------------------------------------------------------------\n\" History:      «history»\n\" TODO:         «missing features»\n\" }}}1\n\"=============================================================================\n\nif ! (lh#has#plugin('autoload/clang.vim') && clang#can_plugin_be_used())\n  finish\nendif\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\nlet s:k_has_compil_hints = lh#has#plugin('autoload/lh/compil_hints.vim')\n\"------------------------------------------------------------------------\n\" ## Misc Functions     {{{1\n\" # Version {{{2\nfunction! lh#cpp#libclang#version()\n  return s:k_version\nendfunction\n\n\" # Debug   {{{2\nlet s:verbose = get(s:, 'verbose', 0)\nfunction! lh#cpp#libclang#verbose(...)\n  if a:0 > 0 | let s:verbose = a:1 | endif\n  return s:verbose\nendfunction\n\nfunction! s:Log(expr, ...) abort\n  call call('lh#log#this',[a:expr]+a:000)\nendfunction\n\nfunction! s:Verbose(expr, ...) abort\n  if s:verbose\n    call call('s:Log',[a:expr]+a:000)\n  endif\nendfunction\n\nfunction! lh#cpp#libclang#debug(expr) abort\n  return eval(a:expr)\nendfunction\n\n\n\"------------------------------------------------------------------------\n\" ## API      functions {{{1\n\" # Ancestors {{{2\nfunction! s:add_info_to_qf(qf, balloons, info, level, balloon_ctx) abort \" {{{3\n  let info = a:info.location\n  let info.text = a:level. '+- '.a:info.access.' '.a:info.spelling\n  call add(a:qf, info)\n  let balloon_ctx = ' : '.a:info.access.' '.a:info.spelling . a:balloon_ctx\n  call add(a:balloons, balloon_ctx)\n  if has_key(a:info, 'parents')\n    call map(copy(a:info.parents), 's:add_info_to_qf(a:qf, a:balloons, v:val, \"|  \".a:level, balloon_ctx)')\n  endif\nendfunction\n\n\" Function: lh#cpp#libclang#show_ancestors(...) {{{3\n\" TODO:\n\" - Support to pass an optional class name\n\" - Add option to choose qflist or loclist\nfunction! lh#cpp#libclang#show_ancestors(...) abort\n  let [parents, current] = clang#parents()\n  let qf = []\n  let qf += [extend(current.location, {'text': current.name})]\n  let balloons = [' : inspected leaf']\n  call map(copy(parents), 's:add_info_to_qf(qf, balloons, v:val, \"\", \"\")')\n  call setqflist(qf)\n  if lh#has#properties_in_qf()\n    call setqflist([], 'a', {'title': current.name . ' base classes'})\n    if s:k_has_compil_hints\n      call lh#compil_hints#set_balloon_format({k, v -> l:current.name . l:balloons[v.key]})\n    endif\n  endif\n  if exists(':Copen')\n    Copen\n  else\n    copen\n  endif\nendfunction\n\n\"------------------------------------------------------------------------\n\" ## Internal functions {{{1\n\n\"------------------------------------------------------------------------\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/macros.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp/macros.vim                        {{{1\n\" Author:       Luc Hermitte <EMAIL:luc {dot} hermitte {at} gmail {dot} com>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      2.2.0.\nlet s:k_version = '220'\n\" Created:      30th Jun 2016\n\" Last Update:  30th Jun 2016\n\"------------------------------------------------------------------------\n\" Description:\n\"       API related to C and C++ macros\n\"\n\"------------------------------------------------------------------------\n\" History:      «history»\n\" TODO:         «missing features»\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\" ## Misc Functions     {{{1\n\" # Version {{{2\nfunction! lh#cpp#macros#version()\n  return s:k_version\nendfunction\n\n\" # Debug   {{{2\nlet s:verbose = get(s:, 'verbose', 0)\nfunction! lh#cpp#macros#verbose(...)\n  if a:0 > 0 | let s:verbose = a:1 | endif\n  return s:verbose\nendfunction\n\nfunction! s:Log(expr, ...)\n  call call('lh#log#this',[a:expr]+a:000)\nendfunction\n\nfunction! s:Verbose(expr, ...)\n  if s:verbose\n    call call('s:Log',[a:expr]+a:000)\n  endif\nendfunction\n\nfunction! lh#cpp#macros#debug(expr) abort\n  return eval(a:expr)\nendfunction\n\n\n\"------------------------------------------------------------------------\n\" ## Exported functions {{{1\n\n\" # Clean `#if`\n\" Function: lh#cpp#macros#keep(bool) {{{3\n\" Remove the true/false path into a `#if ... #else ... #endif` construct\n\" TODO: support `defined(...)`, `#elif`, ...\nfunction! lh#cpp#macros#keep(bool) abort\n  \" 0- Requirements\n  \" 0.1- Check matchit is installed\n  if !exists('g:loaded_matchit')\n    runtime macros/matchit.vim\n    if !exists('g:loaded_matchit')\n      throw 'Cannot trim `#if..#else..#endif` path without matchit'\n    endif\n  endif\n  \" 0.2- Be sure we're on the `#if 0/1` line\n  let line = getline('.')\n  if line !~ '\\v^#\\s*if\\s+[01]'\n    throw 'Cursor not on a `#if 0|1` line. Cannot trim paths.'\n  endif\n\n  \" 1- Note line numbers\n  normal! ^\n  let l_if = line('.')\n  normal %\n  let l = line('.')\n  if getline(l) =~ '\\v^#\\s*else'\n    let l_else = l\n    normal %\n    let l = line('.')\n  endif \" Not an elif here!\n  if getline(l) !~ '\\v^#\\s*endif'\n    throw '`#endif` expected (`#elif` is not supported yet)'\n  endif\n  let l_endif = line('.')\n\n  \" 2- Trim (starting from the end)\n  let keep_start = (line =~ '\\v^#\\s*if\\s+1') == eval(a:bool)\n  let l_last_if    = keep_start ? l_if : l_else\n  let l_first_else = keep_start ? l_else : l_endif\n  call s:Verbose('Keeping the `#%1` case -- :%2,%3d | %4,%5d', keep_start ? 'if' : 'else', l_first_else, l_endif, l_if, l_last_if)\n  silent! exe l_first_else.','.l_endif.'d _'\n  silent! exe l_if.','.l_last_if.'d _'\nendfunction\n\n\"------------------------------------------------------------------------\n\" ## Internal functions {{{1\n\n\"------------------------------------------------------------------------\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/option.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp/option.vim                        {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://code.google.com/p/lh-vim/>\n\" Version:      2.2.0\n\" Created:      05th Apr 2012\n\" Last Update:  08th Mar 2018\n\"------------------------------------------------------------------------\n\" Description:\n\"       Options for lh-cpp\n\"\n\" Deprecated:\n\"       This nl_before_bracket API has been deprecated in favour of AddStyle!\n\"\n\"------------------------------------------------------------------------\n\" Installation:\n\"       Drop this file into {rtp}/autoload/lh/cpp\n\"       Requires Vim7+, lh-dev\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\" ## Misc Functions     {{{1\n\" # Version {{{2\nlet s:k_version = 2\nfunction! lh#cpp#option#version()\n  return s:k_version\nendfunction\n\n\" # Debug   {{{2\nlet s:verbose = 0\nfunction! lh#cpp#option#verbose(...)\n  if a:0 > 0 | let s:verbose = a:1 | endif\n  return s:verbose\nendfunction\n\nfunction! s:Verbose(expr)\n  if s:verbose\n    echomsg a:expr\n  endif\nendfunction\n\nfunction! lh#cpp#option#debug(expr)\n  return eval(a:expr)\nendfunction\n\n\n\"------------------------------------------------------------------------\n\" ## Exported functions {{{1\n\n\" # Preferences regarding how control statements are expanded {{{2\n\" Possible values: 0 (default)/1\n\" Applies to: if (){}, else{}, for (;;){}, while(){}, switch, catch, ...\n\n\n\" Function: lh#cpp#option#nl_before_bracket() {{{3\n\" Write each '(' on a new line; -> if \\n() ... {}\nfunction! lh#cpp#option#nl_before_bracket()\n  call s:Deprecated()\n  return lh#ft#option#get('nl_before_bracket', &ft, 0)\nendfunction\n\n\" Function: lh#cpp#option#nl_before_curlyB() {{{3\n\" Write each '{' on a new line; -> if ...() \\n {}\nfunction! lh#cpp#option#nl_before_curlyB()\n  call s:Deprecated()\n  return lh#ft#option#get('nl_before_curlyB', &ft, 0)\nendfunction\n\n\" Function: lh#cpp#option#multiple_namespace_on_same_line() {{{3\n\" Write each \"namespace Foo {\" on a same line\nfunction! lh#cpp#option#multiple_namespaces_on_same_line()\n  return lh#ft#option#get('multiple_namespaces_on_same_line', &ft, 1)\nendfunction\n\"------------------------------------------------------------------------\n\" ## Internal functions {{{1\n\n\" # Deprecated {{{2\nlet s:deprecated_notified = 0\nfunction! s:Deprecated()\n  echomsg \"lh#cpp#option#nl_before_bracket() API has been deprecated, please use lh#style#*() and AddStyle instead.\"\n  let s:deprecated_notified = 1\nendfunction\n\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/override.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp/override.vim                              {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"               <URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/tree/master/License.md>\n\" Version:      2.3.0\nlet s:k_version = '230'\n\" Created:      15th Apr 2008\n\" Last Update:  02nd Dec 2019\n\"------------------------------------------------------------------------\n\" Description:  description\n\"\n\"------------------------------------------------------------------------\n\" Installation:\n\"       ctags requirements: fields: m: implementation, i: inheritance\n\" History:      history\n\" TODO:\n\" (*) Cache the LoadTags accesses until the related tags file is updated\n\" (*) Sort result:\n\"     - first: the less overridden functions\n\"     - last: the ones already overridden for the current class\n\" (*) Build and insert the prototypes ; try to fetch the doc as well\n\" (*) Add override C++11 keyword, with vimscript API\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\n\"------------------------------------------------------------------------\n\" ## Misc Functions     {{{1\n\" # Version   {{{2\nfunction! lh#cpp#override#version()\n  return s:k_version\nendfunction\n\n\" # Debug     {{{2\nlet s:verbose = get(s:, 'verbose', 0)\nfunction! lh#cpp#override#verbose(...)\n  if a:0 > 0 | let s:verbose = a:1 | endif\n  return s:verbose\nendfunction\n\nfunction! s:Log(expr, ...)\n  call call('lh#log#this',[a:expr]+a:000)\nendfunction\n\nfunction! s:Verbose(expr, ...)\n  if s:verbose\n    call call('s:Log',[a:expr]+a:000)\n  endif\nendfunction\n\nfunction! lh#cpp#override#debug(expr) abort\n  return eval(a:expr)\nendfunction\n\n\" # Script ID {{{2\nfunction! s:getSID() abort\n  return eval(matchstr(expand('<sfile>'), '<SNR>\\zs\\d\\+\\ze_getSID$'))\nendfunction\nlet s:k_script_name      = s:getSID()\n\n\" ## Functions {{{1\n\" # API {{{2\n\" Function: lh#cpp#override#root_function(classname/ancestors, funcname) {{{3\nfunction! lh#cpp#override#root_function(classname, funcname) abort\n  let result = []\n  \" todo: do not sort ancestors (find the inheritance (tree) order) because\n  \" some virtual functions are not marked virtual in childs\n  let ancestors = type(a:classname) == type([]) ? a:classname : lh#dev#class#ancestors(a:classname)\n  for base in ancestors\n    let functions = taglist('\\v<'.base.'>::<'.a:funcname.'>')\n    \" Shall we make sure they are virtual ?\n    \" call filter(functions, 'v:val.implementation =~ \"virtual\"')\n    \" Shall we make sure the name is correct ?\n    \" call filter(virtual_fcts, 'v:val.name =~ a:funcname')\n    let result += functions\n  endfor\n  \" TODO: filter the root function only. Let's suppose for now that it's the\n  \" last one.\n  \" We may have to take care of diamong of hell.\n  return result\nendfunction\n\n\" Function: s:OverrideableFunctions(classname) {{{3\nfunction! s:OverrideableFunctions(classname) abort\n  let result = {}\n  \" todo: do not sort ancestors (find the inheritance (tree) order) because\n  \" some virtual functions are not marked virtual in childs\n  let ancestors = lh#dev#class#ancestors(a:classname)\n  \" Build the list of inherited overrideable functions\n  for base in ancestors\n    \" - \"::\" because \"inherits:\" does not resolves the contextual namespaces\n    \"   (see omnicppcomplete for a better Ancestors function ?)\n    \" - \"\\>\" strips the symbols from nested classes\n    let base_pattern = ((base =~ '::') ? '^' : '::') . base . '\\>'\n    let functions = lh#cpp#AnalysisLib_Function#LoadTags(base_pattern)\n    let declarations = lh#cpp#AnalysisLib_Function#SearchAllDeclarations(functions)\n    \" - only keep virtual functions\n    let virtual_fcts = filter(declarations, 'v:val.implementation =~ \"virtual\"')\n    for fn in virtual_fcts\n      let fn2 = copy(fn)\n      let name    = matchstr(fn.name, '^[^(]*::\\zs.*$')\n      let context = matchstr(fn.name, '^[^(]*::\\ze.*$')\n      let fn2.defined_in = [ context ]\n      let fn2.name  = name\n\n      if !has_key(result, name)\n        let result[name] = [ fn2 ]\n      else\n        for overload in result[name]\n          if lh#cpp#AnalysisLib_Function#IsSame(overload, fn2)\n            \" an override\n            call add(overload.defined_in, context)\n            \" echomsg \"SAME: \" . string(overload). \" -- \" . string(fn2)\n          else\n            \" new overload\n            call add(result[name], fn2)\n            \" echomsg \"DIFF: \" . string(overload). \" -- \" . string(fn2)\n          endif\n        endfor\n      endif\n    endfor\n    \" echomsg \"fct(\".base.\"=\".string(virtual_fcts)\n  endfor\n\n  \" And now Identify which functions are already overridden\n  \" ::classname\\> is no good with tagslist ...\n  \" let class_pattern = ((a:classname =~ '::') ? '^' : '::') . a:classname . '\\>'\n  let class_pattern = '\\<' . a:classname . '\\>'\n  let functions = lh#cpp#AnalysisLib_Function#LoadTags(class_pattern)\n  let declarations = lh#cpp#AnalysisLib_Function#SearchAllDeclarations(functions)\n  \" don't restrict to virtual as sometimes it is implicit\n  \" let virtual_fcts = filter(declarations, 'v:val.implementation =~ \"virtual\"')\n  for fn in declarations\n    let name    = matchstr(fn.name, '^[^(]*::\\zs.*$')\n    let fn.name = name\n    if has_key(result, name)\n      for overload in result[name]\n        if lh#cpp#AnalysisLib_Function#IsSame(overload, fn)\n          \" an override\n          let overload.overriden = 1\n          echomsg \"SAME: \" . string(overload). \" -- \" . string(fn)\n        else\n          echomsg \"DIFF: \" . string(overload). \" -- \" . string(fn)\n        endif\n      endfor\n    endif\n  endfor\n\n  let flattened = []\n  for decl in values(result)\n    call extend(flattened, decl)\n  endfor\n  return flattened\nendfunction\n\n\" Function: s:OverrideFunction(function_tag) {{{3\nfunction! s:OverrideFunction(function_tag) abort\n  \" a- open the related file in a new window\n  let filename = a:function_tag.filename\n  call lh#window#create_window_with('sp '.filename)\n  try\n    \" b- search the exact signature\n    let signature = a:function_tag.fullsignature\n    let g:signature = signature\n    let regex_signature = lh#cpp#AnalysisLib_Function#SignatureToSearchRegex(signature, '').regex\n    \" todo: support embedded comment within the optional \"= 0\" part\n    let regex_signature .= '\\s*\\(=\\s*0\\s*\\)\\=;'\n    let lineno = search(regex_signature)\n    if lineno <= 0\n      throw \"Override: cannot find \".signature.\" declaration in \".filename\n    endif\n    \" c- extract all the relevant text (beware of =0)\n    let code = lh#cpp#AnalysisLib_Function#GetFunctionPrototype(lineno, 1)\n    let code = substitute(code, '\\s*=\\s*0\\s*;$', '', '')\n  finally\n    \" quit the split-opened window\n    :q\n  endtry\n    \" d- copy the function back.\n    \" todo: open all the related files in a scratch buffer, and fetch the exact\n    \" signatures + the comments\n    let lines = []\n    call add(lines, code.';') \" where is the return type ?\n    call add(lines, '')\n    return lines\nendfunction\n\n\" Vimscript API {{{3\nfunction! s:vim_get_classname() abort \" {{{4\n  let classname = lh#cpp#AnalysisLib_Class#CurrentScope(line('.'),'any')\n  return classname\nendfunction\n\nfunction! s:vim_get_overridable_functions(classname) abort \" {{{4\n  let virtual_fcts = s:OverrideableFunctions(classname)\n  for fn in virtual_fcts\n    let signature = lh#cpp#AnalysisLib_Function#BuildSignatureAsString(fn)\n    let fn['fullsignature' ] = signature\n  endfor\n  return virtual_fcts\nendfunction\n\nfunction! s:vim_override(function_tag) abort \" {{{4\n  return s:OverrideFunction(a:function_tag)\nendfunction\n\nfunction! s:make_vimscript_API() abort \" {{{4\n  let res = lh#object#make_top_type({'API': 'vimscript'})\n  call lh#object#inject(res, 'get_classname', 'vim_get_classname', s:k_script_name)\n  call lh#object#inject(res, 'get_overridable_functions', 'vim_get_overridable_functions', s:k_script_name)\n  call lh#object#inject(res, 'override', 'vim_override', s:k_script_name)\n  return res\nendfunction\n\n\" libclang API {{{3\nfunction! s:libclang_get_classname() abort \" {{{4\n  let classname = pyxeval('findClass().spelling')\n  return classname\nendfunction\n\nfunction! s:libclang_get_overridable_functions(classname) abort \" {{{4\n  \" Given the way it works, we don't need to forward the classname: we will get\n  \" another cursor to it.\n  let virtual_fcts = clang#non_overridden_virtual_functions()\n  for fn in virtual_fcts\n    let signature = substitute(fn.signature, '(', fn.name.'(', '')\n    let fn['fullsignature' ] = signature\n  endfor\n  return virtual_fcts\nendfunction\n\nfunction! s:libclang_override(function_tag) abort \" {{{4\n  call s:Verbose(\"Overriding: %1\", a:function_tag)\n  let extent = a:function_tag.extent\n  if resolve(fnamemodify(extent.file, ':p')) == resolve(expand('%:p'))\n    \" Current buffer may have been changed since last save\n    \" => need to use its current state\n    let lines = getline(1, '$')\n  else\n    \" libclang has certainly parsed a saved file => use readfile\n    let lines = readfile(extent.filename)\n  endif\n  call s:Verbose(\"Extract %1 from %2: l:%3, c:%4 ... l:%5, c:%6\",\n        \\ a:function_tag.name, extent.filename,\n        \\ extent.start.lnum, extent.start.col,\n        \\ extent.end.lnum, extent.end.col)\n  let lines = lines[(extent.start.lnum-1) : (extent.end.lnum-1)]\n  let lines[0]  = lines[0][extent.start.col-1 :]\n  let lines[-1] = lines[0][: extent.end.col]\n  call s:Verbose(\"Definition found: %1\", lines)\n  \" TODO: could be \"final\" instead\n  let lines[0]  = substitute(lines[0], '\\s*virtual\\s\\+', '', '')\n  let lines[-1]  = substitute(lines[-1], '\\s*=\\s*0', ' '.lh#cpp#snippets#override(), '')\n\n  return lines\nendfunction\n\nfunction! s:make_libclang_API() abort \" {{{4\n  let res = lh#object#make_top_type({'API': 'libclang'})\n  call lh#object#inject(res, 'get_classname', 'libclang_get_classname', s:k_script_name)\n  call lh#object#inject(res, 'get_overridable_functions', 'libclang_get_overridable_functions', s:k_script_name)\n  call lh#object#inject(res, 'override', 'libclang_override', s:k_script_name)\n  return res\nendfunction\n\n\" # Main {{{2\nfunction! lh#cpp#override#Main() abort\n  if lh#has#plugin('autoload/clang.vim') && clang#can_plugin_be_used()\n    let api = s:make_libclang_API()\n  else\n    let api = s:make_vimscript_API()\n  endif\n  \" 1- Obtain current class name\n  let classname = api.get_classname()\n  call s:Verbose (\"classname=\".classname)\n  \" 2- Obtain overrideable functions\n  let virtual_fcts = api.get_overridable_functions(classname)\n  call s:Verbose (\"virtual fct=\".string(virtual_fcts))\n  let g:decls = virtual_fcts\n\n  \" 3- Propose to select the functions to override\n  call s:Display(classname, virtual_fcts, api)\n  \" 4- Insert them in the current class\n  \" -> asynchrounous\nendfunction\n\n\" # GUI {{{2\n\" ==========================[ Menu ]====================================\n\" Function: s:Access(fn) {{{3\nfunction! s:Access(fn) abort\n  if has_key(a:fn, 'access')\n    if     a:fn.access == 'public'    | return '+'\n    elseif a:fn.access == 'protected' | return '#'\n    elseif a:fn.access == 'private'   | return '-'\n    else                              | return '?'\n    endif\n  else                                | return '?'\n  endif\nendfunction\n\n\" Function: s:Overriden(fn) {{{3\nfunction! s:Overriden(fn) abort\n  return has_key(a:fn, 'overriden') ? '!' : ' '\nendfunction\n\n\" Function: s:AddToMenu(lines, fns) {{{3\nfunction! s:AddToMenu(lines, fns) abort\n  \" 1- Compute max function length\n  let max_length = 0\n  let fns=[]\n  \" for overloads in a:fns\n    \" for fn in overloads\n    for fn in a:fns\n      let signature = fn.fullsignature\n      let length = lh#encoding#strlen(signature)\n      if length > max_length | let max_length = length | endif\n      call add(fns, fn)\n    endfor\n  \" endfor\n\n  \" 2- Build the result\n  for fn in fns\n    let line = s:Overriden(fn).s:Access(fn).' '.fn.fullsignature\n          \\ . repeat(' ', max_length-lh#encoding#strlen(fn.fullsignature))\n          \\ . ' ' . string(fn.defined_in)\n    call add(a:lines, line)\n  endfor\nendfunction\n\n\" Function: s:BuildMenu(declarations) {{{3\nfunction! s:BuildMenu(declarations) abort\n  let res = ['--abort--']\n  call s:AddToMenu(res, a:declarations)\n  return res\nendfunction\n\n\" Function: s:Display(className, declarations, api) {{{3\nfunction! s:Display(className, declarations, api) abort\n  let choices = s:BuildMenu(a:declarations)\n  \" return\n  let b_id = lh#buffer#dialog#new(\n        \\ 'C++Override('.substitute(a:className, '[^A-Za-z0-9_.]', '_', 'g' ).')',\n        \\ 'Overrideable functions for '.a:className,\n        \\ 'bot below',\n        \\ 1,\n        \\ 'lh#cpp#override#select',\n        \\ choices\n        \\)\n  call lh#buffer#dialog#add_help(b_id, '@| !==already overridden function in '.a:className, 'long')\n  call lh#buffer#dialog#add_help(b_id, '@| +==public, #==protected, -==private in one of the ancestor class', 'long')\n  \" Added the lonely functions to the b_id\n  let b_id['declarations'] = a:declarations\n  let b_id['api']          = a:api\n  \" Syntax and co\n  call s:PostInitDialog()\n  return ''\nendfunction\n\n\" Function: s:PostInitDialog() {{{3\nfunction! s:PostInitDialog() abort\n  if has(\"syntax\")\n    syn clear\n\n    \" todo: fix syntax names\n    \" syntax region UFNbOcc  start='^--' end='$' contains=UFNumber,UFName\n    syntax match UFSignature /.*$/ contained\n    syntax match UFFile /^  [^-][^[]\\+/ contained nextgroup=UFText\n    syntax match UFText /| No .* found for / contained nextgroup=UFSignature\n    syntax region UFLine  start='^  [^-]' end='$' contains=UFFile,UFText,UFSignature\n\n    syntax region UFExplain start='@' end='$' contains=UFStart\n    syntax match UFStart /@/ contained\n    syntax match Statement /--abort--/\n\n    \" Help\n    highlight link UFExplain Comment\n    highlight link UFStart Ignore\n\n    \" Lines\n    highlight link UFLine Normal\n    highlight link UFFile Directory\n    highlight link UFText Normal\n    highlight link UFSignature Identifier\n  endif\nendfunction\n\n\" Function: lh#cpp#override#select(results) {{{3\nfunction! lh#cpp#override#select(results) abort\n  if len(a:results.selection)==1 && a:results.selection[0]==0\n    call lh#buffer#dialog#quit()\n    return\n  endif\n  if exists('s:quit') | :quit | endif\n\n  \" let unmatched = b:dialog.unmatched\n  \" let cmd = b:cmd\n\n  let choices = a:results.dialog.choices\n  let lines = []\n  for selection in a:results.selection\n    \" echomsg '-> '.choices[selection]\n    \" echomsg '-> '.info[selection-1].filename . \": \".info[selection-1].cmd\n    \"\n    let selected_virt = a:results.dialog.declarations[selection-1]\n    \" echomsg string(selected_virt)\n    let api = a:results.dialog.api\n    call extend(lines, api.override(selected_virt))\n  endfor\n  \" Go back to the original buffer, and insert the built lines\n  let where_it_started = a:results.dialog.where_it_started\n  call lh#buffer#find(where_it_started[0])\n  if 0==append(where_it_started[1]-1, lines)\n    silent exe (where_it_started[1]-1).',+'.(len(lines)-1).'normal! =='\n    \" echo (where_it_started[1]-1).',+'.(len(lines)-1).'normal! =='\n  endif\nendfunction\n\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/refactor.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp/refactor.vim                      {{{1\n\" Author:       Luc Hermitte <EMAIL:luc {dot} hermitte {at} gmail {dot} com>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/blob/master/License.md>\n\" Version:      2.2.1.\nlet s:k_version = '221'\n\" Created:      21st Feb 2019\n\" Last Update:  21st Feb 2019\n\"------------------------------------------------------------------------\n\" Description:\n\"       Various helpers function for refactorizing C++ code\n\"\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\" ## Misc Functions     {{{1\n\" # Version {{{2\nfunction! lh#cpp#refactor#version()\n  return s:k_version\nendfunction\n\n\" # Debug   {{{2\nlet s:verbose = get(s:, 'verbose', 0)\nfunction! lh#cpp#refactor#verbose(...)\n  if a:0 > 0 | let s:verbose = a:1 | endif\n  return s:verbose\nendfunction\n\nfunction! s:Log(expr, ...) abort\n  call call('lh#log#this',[a:expr]+a:000)\nendfunction\n\nfunction! s:Verbose(expr, ...) abort\n  if s:verbose\n    call call('s:Log',[a:expr]+a:000)\n  endif\nendfunction\n\nfunction! lh#cpp#refactor#debug(expr) abort\n  return eval(a:expr)\nendfunction\n\n\n\"------------------------------------------------------------------------\n\" ## Exported functions {{{1\n\" Function: lh#cpp#refactor#modernize(code) {{{3\n\" Things transformed:\n\" - typedef -> using\n\" - NULL -> nullptr\n\" - auto_ptr -> unique_ptr\nfunction! lh#cpp#refactor#modernize(code) abort\n  let code = a:code\n  if lh#option#get('cpp_modernize.typedef2using', 1)\n    let code = substitute(code, '\\v<typedef>\\_s+(\\_[^;]{-})\\_s+(\\k+)\\_s*;', 'using \\2 = \\1;', 'g')\n  endif\n  if lh#option#get('cpp_modernize.align_using', 1)\n    \" Correctly aligning require to use virtcol() that can only be used on\n    \" buffers, not on strings.\n    \" Fortunatelly, identifier cannot contain multi-byte characters, and the\n    \" only traps are tabs mixed in with spaces. In order to simplify, we will\n    \" suppose a size of tab &tabstop\n    \"\n    \" The objective is to align `=` signs in using directives that are identically\n    \" indented.\n    let lines = split(code, \"\\n\")\n    \" dictionary: {indent -> max col of '='}\n    let maxes = {}\n    function! maxes._register(line) abort\n      \" let suppose (for now) that tabs never follow spaces in our case...\n      let indent = strlen(substitute(matchstr(a:line, '\\v^\\s\\+'), \"\\t\", '\\=repeat(\" \", &ts)', 'g'))\n      let col = strlen(substitute(matchstr(a:line, '\\v^\\s*using\\zs[^=]+'), \"\\t\", '\\=repeat(\" \", &ts)', 'g'))\n      if !has_key(self, indent)\n        let self[indent] = col\n      else\n        let self[indent] = max([self[indent], col])\n      endif\n      return [col, indent]\n    endfunction\n    \" 1- computes best col for '='\n    let l2 = map(copy(lines), {k,v -> maxes._register(v)})\n    \" 2- apply it\n    let offsets = map(copy(lines), {k,v -> repeat(' ', 1+l:maxes[l2[k][1]]-l2[k][0])})\n    \" echomsg string(offsets)\n    call map(lines, {k,v -> substitute(v, '\\v^\\s*using\\s+.{-}\\zs\\s+\\ze\\=', offsets[k], '')})\n    \" echomsg string(lines)\n    \" echomsg string(l2)\n    let code = join(lines, \"\\n\")\n  endif\n  if lh#option#get('cpp_modernize.nullptr', 1)\n    let code = substitute(code, '\\v<NULL>', 'nullptr', 'g')\n  endif\n  return code\nendfunction\n\n\"------------------------------------------------------------------------\n\" ## API functions {{{1\n\" Function: lh#cpp#refactor#_modernize() {{{3\nfunction! lh#cpp#refactor#_modernize() range abort\n  silent let code = lh#visual#cut()\n  let code = lh#cpp#refactor#modernize(code)\n  silent put!=code\nendfunction\n\n\"------------------------------------------------------------------------\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/scope.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp/scope.vim                         {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://code.google.com/p/lh-vim/>\n\" Version:      2.0.0b10\n\" Created:      25th Jun 2014\n\" Last Update:  $Date$\n\"------------------------------------------------------------------------\n\" Description:\n\"       Support autoload plugin for ftplugin/cpp/cpp_AddMissingScope.vim\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\" ## Misc Functions     {{{1\n\" # Version {{{2\nlet s:k_version = 200\nfunction! lh#cpp#scope#version()\n  return s:k_version\nendfunction\n\n\" # Debug   {{{2\nlet s:verbose = 0\nfunction! lh#cpp#scope#verbose(...)\n  if a:0 > 0 | let s:verbose = a:1 | endif\n  return s:verbose\nendfunction\n\nfunction! s:Verbose(expr)\n  if s:verbose\n    echomsg a:expr\n  endif\nendfunction\n\nfunction! lh#cpp#scope#debug(expr)\n  return eval(a:expr)\nendfunction\n\n\n\"------------------------------------------------------------------------\n\" ## API functions {{{1\n\" Function: lh#cpp#scope#_add_missing() {{{3\nfunction! lh#cpp#scope#_add_missing() abort\n  let [id, info] = lh#cpp#tags#fetch(\"add-missing-scope\")\n  try \n\n    \" Filter out constructors\n    let isk_save = &isk\n    set isk-=:\n    call filter(info, \"! (v:val.kind =~ 'f' && v:val.name=~'.*\\\\<\\\\(\\\\k\\\\+\\\\)::\\\\1')\")\n\n    \" Build the list of names\n    let names = {}\n    for t in info\n      if ! has_key(names, t.name)\n        let names[t.name] = {}\n      endif\n      let names[t.name][t.kind[0]] = ''\n    endfor\n\n    \" Check the number of possible choices\n    if len(info) > 1\n      call lh#common#error_msg(\"add-missing-scope: too many acceptable tags for `\"\n            \\ .id.\"': \".string(names))\n      return\n    endif\n\n    let name = keys(names)[0]\n\n    if name == id\n      call lh#common#warning_msg(\"add-missing-scope: `\".id.\"' is already expanded\")\n      return\n    endif\n\n    \" build the new line\n    set isk+=:\n    let line = getline('.')\n    let head = matchstr(line[:col('.')-1], '.*\\ze\\<\\k\\+$')\n    let tail = line[lh#encoding#strlen(head):]\n    let missing = matchstr(name, '.*\\ze'.id)\n    call setline(line('.'), head.missing.tail)\n  finally\n    let &isk = isk_save\n  endtry\nendfunction\n\"------------------------------------------------------------------------\n\" ## Exported functions {{{1\n\n\"------------------------------------------------------------------------\n\" ## Internal functions {{{1\n\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/snippets.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp/snippets.vim                      {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} gmail {dot} com>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/License.md>\n\" Version:      2.2.0.\nlet s:k_version = '220'\n\" Created:      03rd Nov 2015\n\" Last Update:  08th Mar 2018\n\"------------------------------------------------------------------------\n\" Description:\n\"       Tool functions to help write snippets (ftplugin/c/c_snippets.vim)\n\"\n\"------------------------------------------------------------------------\n\" History:      «history»\n\" TODO:         «missing features»\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\" ## Misc Functions     {{{1\n\" # Version {{{2\nfunction! lh#cpp#snippets#version()\n  return s:k_version\nendfunction\n\n\" # Debug   {{{2\nlet s:verbose = get(s:, 'verbose', 0)\nfunction! lh#cpp#snippets#verbose(...)\n  if a:0 > 0 | let s:verbose = a:1 | endif\n  return s:verbose\nendfunction\n\nfunction! s:Log(expr, ...)\n  call call('lh#log#this',[a:expr]+a:000)\nendfunction\n\nfunction! s:Verbose(expr, ...)\n  if s:verbose\n    call call('s:Log',[a:expr]+a:000)\n  endif\nendfunction\n\nfunction! lh#cpp#snippets#debug(expr) abort\n  return eval(a:expr)\nendfunction\n\n\"------------------------------------------------------------------------\n\" ## Exported functions {{{1\n\" # snippets functions {{{2\n\n\" Function: lh#cpp#snippets#def_abbr(key, expr) {{{3\nfunction! lh#cpp#snippets#def_abbr(key, expr) abort\n  if getline('.') =~ '^\\s*#'\n    return a:key\n  endif\n  \" Default behaviour\n  if type(a:expr) == type({})\n    \" This is a switch\n    let exprs = filter(items(a:expr), 'eval(v:val[0])')\n    call lh#assert#value(exprs).not().empty(\"No case found for the mapping \". string(a:key).\" --> \".string(a:expr))\n    let expr = exprs[0][1]\n  else\n    let expr = a:expr\n  endif\n  let rhs = lh#style#apply(expr)\n  return lh#map#insert_seq(a:key, rhs)\nendfunction\n\n\" Function: lh#cpp#snippets#def_map(key, expr1, expr2) {{{3\nfunction! lh#cpp#snippets#def_map(key, expr1, expr2) abort\n  if lh#brackets#usemarks()\n    return \"\\<c-r>=lh#map#no_context2('\".a:key.\"',lh#map#build_map_seq('\".a:expr2.\"'))\\<cr>\"\n  else\n    return \"\\<c-r>=lh#map#no_context2('\".a:key.\"', '\".a:expr1.\"')\\<cr>\"\n  endif\nendfunction\n\n\" Function: lh#cpp#snippets#insert_return() {{{3\nfunction! lh#cpp#snippets#insert_return() abort\n  let c = col('.') - 1\n  let l = getline('.')\n  let l = strpart(l, c)\n  if l =~ '^\\s*$'\n    return lh#map#build_map_seq('return ;!mark!\\<esc\\>==0:call lh#cpp#snippets#_goto_return_semicolon()\\<cr\\>i')\n  else\n    let spacesLen = strlen(matchstr(l, '^\\s*'))\n    let stripCmd = (spacesLen!=0) ? '\\<esc\\>'.'ct'.l[spacesLen] : ''\n    echo stripCmd\n    if stridx(l, ';') != -1\n      return lh#map#build_map_seq(stripCmd.'return \\<esc\\>==0:call lh#cpp#snippets#_goto_return_semicolon()\\<cr\\>a')\n    elseif stridx(l, '}') != -1\n      return lh#map#build_map_seq(stripCmd.'return ;!mark!\\<esc\\>==0:call lh#cpp#snippets#_goto_return_semicolon()\\<cr\\>i')\n    else\n      return lh#map#build_map_seq(stripCmd.'return \\<esc\\>==A;')\n    endif\n  endif\nendfunction\n\n\" Function: lh#cpp#snippets#insert_if_not_after(key, what, pattern) {{{3\nfunction! lh#cpp#snippets#insert_if_not_after(key, what, pattern) abort\n  let c = col('.') - 1\n  let l = getline('.')\n  let l = strpart(l, 0, c)\n  if l =~ a:pattern.'\\s*$'\n    return a:key\n  else\n    return lh#cpp#snippets#def_abbr(a:key, a:what)\n  endif\nendfunction\n\n\" Function: lh#cpp#snippets#insert_if_not_before(key, what, pattern) {{{3\nfunction! lh#cpp#snippets#insert_if_not_before(key, what, pattern) abort\n  let c = col('.') - 1\n  let l = getline('.')\n  let l = strpart(l, c)\n  if l =~ '^\\s*'.a:pattern\n    return a:key\n  else\n    return lh#cpp#snippets#def_abbr(a:key, a:what)\n  endif\nendfunction\n\n\" Function: lh#cpp#snippets#typedef_typename() {{{3\nfunction! lh#cpp#snippets#typedef_typename() abort\n  return lh#cpp#snippets#insert_if_not_after('typename ', 'typedef ', '\\S')\nendfunction\n\n\" Function: lh#cpp#snippets#current_namespace(default) {{{3\nfunction! lh#cpp#snippets#current_namespace(default) abort\n  let ns = lh#ft#option#get('project_namespace', &ft, '')\n  return empty(ns) ? a:default : (ns.'::')\nendfunction\n\n\" Function: lh#cpp#snippets#select_expr_4_surrounding() {{{3\nfunction! lh#cpp#snippets#select_expr_4_surrounding() abort\n  \" Go to the first non blank character of the line\n  :normal! ^\n  \" Search either the first semin-colon or the end of the line.\n  :call search(';\\|\\s*$', 'c')\n  \" If we are not at the end of the line\n  if getline('.')[col('.')-1] =~ ';\\|\\s'\n    \" If it is followed by blanck characters\n    if strpart(getline('.'), col('.')) =~ '^\\s*$'\n      \" then trim the ';' (or the space) and every thing after\n      exe \"normal! \\\"_d$\"\n    else\n      \" otherwise replace the ';' by a newline character, and goto the end of\n      \" the previous line (where the line has been cut)\n      exe \"normal! \\\"_s\\n\\<esc>k$\"\n    endif\n  endif\n  \" And then select till the first non blank character of the line\n  :normal! v^\nendfunction\n\n\" Function: lh#cpp#snippets#begin_end() {{{3\n\" In std::foreach and std::find algorithms, ..., expand 'algo(container§)'\n\" into:\n\" - 'algo(container.begin(),container.end()§)',\n\" - 'algo(container.rbegin(),container.rend()§)',\n\" - 'algo(container.cbegin(),container.cend()§)',\n\" - 'algo(begin.(container),end.(container)§)',\n\" - 'algo(rbegin.(container),rend.(container)§)',\n\" - 'algo(cbegin.(container),cend.(container)§)',\n\"\n\" Objectives: support redo/repeat\n\" Constants {{{4\nlet s:k_begin_end_fmt = {\n      \\ 'c++98': '%1.%2()',\n      \\ 'std': 'std::%2(%1)',\n      \\ 'boost': 'boost::%2(%1)',\n      \\ 'adl': '%2(%1)'\n      \\ }\nlet s:k_end = {\n      \\ 'begin'  : 'end',\n      \\ 'rbegin' : 'rend',\n      \\ 'cbegin' : 'cend',\n      \\ 'crbegin': 'crend'\n      \\ }\nlet s:k_begin_end_inc = {\n      \\ 'c++98': [],\n      \\ 'std': ['<iterator>'],\n      \\ 'boost': ['<boost/range/begin.hpp>', '<boost/range/end.hpp>'],\n      \\ 'adl': []\n      \\ }\n\nfunction! s:Style() \" {{{4\n  let style = lh#option#get('cpp_begin_end_style')\n  if lh#option#is_unset(style)\n    unlet style\n    let style\n          \\ = lh#cpp#use_cpp11() ? 'std'\n          \\ :                     'c++98'\n    \" \\ : lh#cpp#is_boost_used() ? 'boost'\n  endif\n  return style\nendfunction\n\nfunction! lh#cpp#snippets#_select_begin_end(cont, function) \" {{{4\n  let style = s:Style()\n  return lh#fmt#printf(s:k_begin_end_fmt[style], a:cont, a:function)\nendfunction\n\n\" Function: lh#cpp#snippets#_include_begin_end() {{{3\nfunction! lh#cpp#snippets#_include_begin_end() abort\n  let style = s:Style()\n  \" TODO: find a better way to organize options\n  return lh#option#get('cpp_begin_end_includes', get(s:k_begin_end_inc, style, []))\nendfunction\n\nfunction! lh#cpp#snippets#_begin_end(begin) abort \" {{{4\n  let saved_pos = getpos('.')\n\n  let char_c = lh#position#char_at_pos(getpos('.'))\n  let accept_at_current = char_c == '(' ? 'c' : ''\n  if searchpair('(',',',')','bW'.accept_at_current,'lh#syntax#skip()') == 0\n        \\ && searchpair('(',',',')','bW','lh#syntax#skip()') == 0\n    \" Test necessary because 'c' flag and Skip() don't always work well together\n    throw \"Not on a parameter\"\n  endif\n  \" Goto next character\n  call search('.')\n\n  let pos = [line('.'), col('.')]\n  call setpos('.', saved_pos)\n\n  \" let g:saved_pos = saved_pos\n  \" let g:pos = pos\n\n  if saved_pos[1] == pos[0] && saved_pos[2] == pos[1]\n    \" No container under the cursor => use placeholders\n    let cont = lh#marker#txt('container')\n    return lh#cpp#snippets#_select_begin_end(cont, a:begin). ', ' .lh#cpp#snippets#_select_begin_end(cont, s:k_end[a:begin])\n  endif\n\n  \" Let's suppose same line\n  \" TODO:\n  \" - add \\s after \",\", but not after \"(\" => use apply style on\n  \"   - previous.head,\n  \"   - and ', '.head\n  \"\n  \" Extract container name (and leading whitespace) from the two positions\n  let cont = lh#position#extract(pos, saved_pos[1:2])\n\n  \" Check we aren't selecting too many things\n  if pos[0] != saved_pos[1] && cont =~ '{[^}]*$'\n    throw \"lvalue not in a function call, cannot expand begin/end on it.\"\n  endif\n\n  \" Add .begin/.end on \"foo(bar)\" ?\n  if lh#position#char_at(saved_pos[1], saved_pos[2]-1) == ')'\n    let choice = lh#ui#which('lh#ui#confirm', 'Do you really want to call begin() *and* end() on a function result?', \"&Yes\\n&No\", 2)\n    if choice == 'No'\n      return \"\"\n    endif\n  endif\n\n  \" Number of characters to delete = len - nb of \"\\n\"\n  let len = lh#encoding#strlen(cont)\n        \\ - len(substitute(cont, \"[^\\n]\", '', 'g'))\n  \" trim trailing spaces, but not those at the start\n  let [all, head, cont; rest] = matchlist(cont, '\\v^(\\_s*)(.{-})\\_s*$')\n  if pos[1] == 1 && head =~ '^\\s\\+$'\n    \" text on a new line => head2 shall induce a new line\n    \" TODO: support styling option: \"\\n, \" or \",\\n\"\n    let head2 = \"\\n\"\n  else\n    let head2 = \"\"\n  endif\n  if empty(cont)\n    \" No container under the cursor => use placeholders\n    let cont = lh#marker#txt('container')\n  endif\n  \" Build the string to \"insert\"\n  let res = repeat(\"\\<bs>\", len)\n        \\ . head . lh#cpp#snippets#_select_begin_end(cont, a:begin).\n        \\ ', '.head2 .lh#cpp#snippets#_select_begin_end(cont, s:k_end[a:begin])\n  \" if pos[0] != saved_pos[1]\n    \" When <bs> clear characters at the start of the line, it jumps over indent\n    \" => we force sw to 1\n    let sw=shiftwidth()\n    set sw=1\n    let res .= \"\\<c-o>:set sw=\".sw.\"\\<cr>\"\n  \" endif\n  return res\nendfunction\n\n\" Function: lh#cpp#snippets#_convert_cast(cast_type) {{{3\n\" TODO: have s:k_cast_fmt be a [bg]:({ft}_) option.\n\" Beware the following list is duplicated in ftplugin/cpp/cpp_snippets.vim\nlet s:k_cast = {\n      \\ 'sc': 'static_cast',\n      \\ 'dc': 'dynamic_cast',\n      \\ 'cc': 'const_cast',\n      \\ 'rc': 'reinterpret_cast',\n      \\ 'lc': 'boost::lexical_cast'\n      \\ }\nlet s:k_cast_fmt = '%1<%2>(%3)'\n\nfunction! lh#cpp#snippets#_convert_to_cpp_cast(cast_type) abort\n  \" Extract text to convert\n  let c_cast = lh#visual#selection()\n\n  \" Strip the possible brackets around the expression\n  \" matchlist seems to cause an odd error on multiline C cast expressions: it\n  \" have the fucntion called again.\n  let [all, type, expr ; tail] = matchlist(c_cast,  '\\v^\\(\\_s*(.{-})\\_s*\\)\\_s*(.{-})\\_s*$')\n  let expr = substitute(expr, '\\v^\\(\\s*(.{-})\\s*\\)$', '\\1', '')\n  \"\n  \" Build the C++-casting from the C casting\n  let new_cast = lh#fmt#printf(s:k_cast_fmt, s:k_cast[a:cast_type], type, expr)\n  \" let new_cast = a:cast_type.'<'.type.'>('.expr.')'\n  \" Do the replacement\n  silent exe \"normal! gvs\".new_cast.\"\\<esc>\"\nendfunction\n\n\"------------------------------------------------------------------------\n\" # Functions for mu-template template-files {{{2\n\n\" Function: lh#cpp#snippets#_merge_include_data(name_and_maybe_more, data2) {{{3\nfunction! lh#cpp#snippets#_merge_include_data(name_and_maybe_more, data2) abort\n  let data = copy(a:data2)\n  if type(a:name_and_maybe_more) == type({})\n    \" No \"name\" key => error\n    let name = a:name_and_maybe_more.name\n    call extend(data, a:name_and_maybe_more)\n    call remove(data, 'name')\n  else\n    let name = a:name_and_maybe_more\n  endif\n  return {name : data}\nendfunction\n\n\" Function: lh#cpp#snippets#parents(parents) {{{3\nfunction! lh#cpp#snippets#parents(parents) abort\n  let includes = []\n  let list = []\n  for parent in a:parents\n    for [name, data] in items(parent)\n      let type_info = lh#cpp#types#get_info(name)\n      let list += [\n            \\  get(data, 'visibility', 'public') . ' '\n            \\ .(get(data, 'virtual', 0) ? 'virtual ' : '')\n            \\ .type_info.typename_for_header()\n            \\ ]\n      if has_key(data, 'includes')\n        call lh#list#flat_extend(includes, data['includes'])\n      endif\n      if has_key(type_info, 'includes')\n        call extend(includes, type_info.includes)\n      endif\n    endfor\n  endfor\n  let res = ''\n  if !empty(list)\n    let res = len(list) > 1 ? \"\\n\" : \" \"\n    let res .= ': '.join(list, \"\\n, \")\n  endif\n  call lh#list#unique_sort(includes)\n  return [res, includes]\nendfunction\n\n\" Function: lh#cpp#snippets#constructor_name(class) {{{3\nfunction! lh#cpp#snippets#constructor_name(class) abort\n  \" Assert len(values(a:class)) == 1\n  let data = split(keys(a:class)[0], '::')\n  let data += [data[-1]]\n  let res = join(data, '::')\n  return res\nendfunction\n\n\" Function: lh#cpp#snippets#_filter_functions(list, visibility) {{{3\n\" Function: lh#cpp#snippets#_filter_functions(list, field, value)\nfunction! lh#cpp#snippets#_filter_functions(list, ...) abort\n  if a:0 == 1\n    let value = a:1\n    let field = 'visibility'\n    let default = 'public'\n  elseif a:0 == 2\n    let value = a:2\n    let field = a:1\n    let default = ''\n  else\n    call lh#assert#unexpected('Incorrect number of argument in lh#cpp#snippets#_filter_functions -> '.string(a:000))\n  endif\n  let res = copy(a:list)\n  if value == \"public\"\n    call filter(res, 'get(v:val, field, \"public\") == value && get(v:val, \"how\", \"\") != \"deleted\"')\n  elseif value == \"protected\"\n    call filter(res, 'get(v:val, field, \"public\") == value')\n  elseif value == \"private\"\n    call filter(res, 'get(v:val, field, \"public\") == value || get(v:val, \"how\", \"\") == \"deleted\"')\n  else \"visi=none, or other fields\n    call filter(res, 'get(v:val, field, default) == value')\n  endif\n  return res\nendfunction\n\n\" Function: lh#cpp#snippets#nullptr() {{{3\nfunction! lh#cpp#snippets#nullptr(...) abort\n  return lh#option#get('cpp_nullptr', lh#cpp#use_cpp11() ? 'nullptr' : '0')\nendfunction\n\n\" Function: lh#cpp#snippets#noexcept([condition]) {{{3\nfunction! lh#cpp#snippets#noexcept(...) abort\n  let noexcept = lh#option#get('cpp_noexcept')\n  let args = empty(a:000) ? '' : '('.a:1.')'\n  if lh#option#is_set(noexcept)\n    return lh#fmt#printf(noexcept, args)\n  endif\n  if lh#cpp#use_cpp11()\n    return 'noexcept'.args\n  else\n    return 'throw()'\n  endif\nendfunction\n\n\" Function: lh#cpp#snippets#deleted() {{{3\nfunction! lh#cpp#snippets#deleted() abort\n  let deleted = lh#option#get('cpp_deleted')\n  let args = empty(a:000) ? '' : a:1\n  if lh#option#is_set(deleted)\n    return deleted\n  endif\n  if lh#cpp#use_cpp11()\n    return '= delete'\n  else\n    return '/* = delete */'\n  endif\nendfunction\n\n\" Function: lh#cpp#snippets#override() {{{3\nfunction! lh#cpp#snippets#override() abort\n  let override = lh#option#get('cpp_override')\n  let args = empty(a:000) ? '' : a:1\n  if lh#option#is_set(override)\n    return override\n  endif\n  if lh#cpp#use_cpp11()\n    return 'override'\n  else\n    return '/* override */'\n  endif\nendfunction\n\n\" Function: lh#cpp#snippets#defaulted() {{{3\nfunction! lh#cpp#snippets#defaulted() abort\n  let defaulted = lh#option#get('cpp_defaulted')\n  let args = empty(a:000) ? '' : a:1\n  if lh#option#is_set(defaulted)\n    return defaulted\n  endif\n  if lh#cpp#use_cpp11()\n    return '= default'\n  else\n    \" Don't know how to default functions in C++98\n    return '/* = default */'\n  endif\nendfunction\n\n\" Function: lh#cpp#snippets#pure() {{{3\nfunction! lh#cpp#snippets#pure() abort\n  return \"= 0\"\nendfunction\n\n\" Function: lh#cpp#snippets#return_ptr_type(type) {{{3\nfunction! lh#cpp#snippets#return_ptr_type(type) abort\n  let return_type = lh#option#get('cpp_return_ptr_type')\n  let args = empty(a:000) ? '' : a:1\n  if lh#option#is_set(return_type)\n    return printf(return_type, a:type)\n  endif\n  call lh#mut#_add_post_expand_callback('lh#dev#import#add(\"<memory>\")')\n  if lh#cpp#use_cpp11()\n    return 'std::unique_ptr<'.a:type.'>'\n  else\n    return 'std::auto_ptr<'.a:type.'>'\n  endif\nendfunction\n\n\" Function: lh#cpp#snippets#make_ptr(type, args) {{{3\nfunction! lh#cpp#snippets#make_ptr(type_dynamic, type_static, args) abort\n  let make_ptr = lh#option#get('cpp_make_ptr')\n  let args = empty(a:000) ? '' : a:1\n  if lh#option#is_set(make_ptr)\n    return lh#fmt#printf(make_ptr, a:type_static, a:type_dynamic, a:args)\n  else\n    unlet make_ptr\n  endif\n  call lh#mut#_add_post_expand_callback('lh#dev#import#add(\"<memory>\")')\n  if lh#cpp#use_cpp14()\n    \" upcast is implicit with unique_ptr => using only the dynamic type\n    let make_ptr = 'std::make_unique(%3)'\n  elseif lh#cpp#use_cpp11()\n    \" upcast is implicit with unique_ptr => using only the dynamic type\n    let make_ptr = 'std::unique_ptr<%2>(new %2(%3))'\n  else\n    let make_ptr = 'std::auto_ptr<%1>(new %2(%3))'\n  endif\n  return lh#fmt#printf(make_ptr, a:type_static, a:type_dynamic, a:args)\nendfunction\n\n\" Function: lh#cpp#snippets#requires_destructor(attributes) {{{3\n\" - T* will require a destructor in current class\n\" - auto_ptr<> will require a destructor in current class, even an empty (this\n\"   is because otherwise we can't garanty the deletion function called is the\n\"   right one)\n\" - unique_ptr<>, doesn't require anything\n\" - Let's suppose other types to follow RAII => don't need\n\" - still an option in case code is not idiomatic and destructors may be needed\nfunction! lh#cpp#snippets#requires_destructor(attributes) abort\n  return lh#list#find_if(a:attributes, 'lh#cpp#snippets#_this_param_requires_a_destructor(v:val)') >= 0\nendfunction\n\n\" Function: lh#cpp#snippets#requires_copy_operations(attributes) {{{3\n\" - pointer, references, uncopyable types (stream, mutex, lock, entities, ...) => yes\nfunction! lh#cpp#snippets#requires_copy_operations(attributes) abort\n  return lh#list#find_if(a:attributes, 'lh#cpp#snippets#_this_param_requires_copy_operations(v:val)') >= 0\nendfunction\n\n\" Function: lh#cpp#snippets#shall_explicit_defaults() {{{3\nfunction! lh#cpp#snippets#shall_explicit_defaults() abort\n  return lh#cpp#use_cpp11() && lh#option#get(\"cpp_explicit_default\", 0)\nendfunction\n\n\" Function: lh#cpp#snippets#build_param_list(parameters) {{{3\n\" Fields:\n\" - name\n\" - type\n\" - default\n\" - nl (bool)\nfunction! lh#cpp#snippets#build_param_list(parameters) abort\n  \" 1- Handle default params, if any. {{{4\n  let l:ShowDefaultParams       = lh#ft#option#get('ShowDefaultParams', &ft, 1)\n  \"    0 -> \"\"              : ignored\n  \"    1 -> \"/* = value */\" : commented\n  \"    2 -> \"/*=value*/\"    : commented, spaces trimmed\n  \"    3 -> \"/*value*/\"     : commented, spaces trimmed, no equal sign\n  if     l:ShowDefaultParams == 0 | let pattern = ''\n  elseif l:ShowDefaultParams == 1 | let pattern = '/* = \\1 */'\n  elseif l:ShowDefaultParams == 2 | let pattern = '/*=\\1*/'\n  elseif l:ShowDefaultParams == 3 | let pattern = '/*\\1*/'\n  else                            | let pattern = ''\n  endif\n\n  \" 2- Build the string to return {{{4\n  let implParams = []\n  for param in a:parameters\n    let sParam = (get(param, 'nl', '0') ? \"\\n\" : '')\n          \\ . get(param, 'type', lh#marker#txt('type')) . ' ' . lh#naming#param(param.name)\n\n    if has_key(param, 'default')\n      let sParam .= substitute(param.default, '\\v(.+)', pattern, '')\n    endif\n    \" echo \"param=\".param\n    call add(implParams, sParam)\n  endfor\n  let implParamsStr = join(implParams, ', ')\n  return implParamsStr\nendfunction\n\n\" Function: lh#cpp#snippets#duplicate_param(param) {{{3\nfunction! lh#cpp#snippets#duplicate_param(param, type) abort\n  if  lh#cpp#snippets#_this_param_requires_copy_operations(a:type)\n    return lh#fmt#printf(lh#marker#txt('duplicate(%1)'), a:param)\n  else\n    return a:param\n  endif\nendfunction\n\n\" # Functions to tune mu-template class skeleton {{{2\n\n\" Function: lh#cpp#snippets#new_function_list() {{{3\nfunction! s:public()      dict abort \" {{{4\n  return lh#cpp#snippets#_filter_functions(self.list, \"public\")\nendfunction\nfunction! s:protected()   dict abort \" {{{4\n  return lh#cpp#snippets#_filter_functions(self.list, \"protected\")\nendfunction\nfunction! s:private()     dict abort \" {{{4\n  return lh#cpp#snippets#_filter_functions(self.list, \"private\")\nendfunction\nfunction! s:add(fns)      dict abort \" {{{4\n  let self.list += a:fns\n  for fn in a:fns\n    call extend(fn, {'add_new': function(s:getSNR('AddNew'))})\n  endfor\n  return self\nendfunction\nfunction! s:insert(fn)    dict abort \" {{{4\n  call extend(a:fn, {'add_new': function(s:getSNR('AddNew'))})\n  call insert(self.list, a:fn)\n  return self\nendfunction\nfunction! s:get(id)       dict abort \" {{{4\n  if type(a:id) == type('name')\n    let res = filter(copy(self.list), 'has_key(v:val, \"name\") && v:val.name =~ a:id')\n  else\n    let res = filter(copy(self.list), 's:FunctionMatchesDescription(v:val, a:id)')\n  endif\n  return res\nendfunction\nfunction! s:get1(id, ...) dict abort \" {{{4\n  let matching_functions = self.get(a:id)\n  if len(matching_functions) > 1\n    throw \"lh-cpp: Too many functions match \".string(a:id)\n  elseif empty(matching_functions)\n    \" New reference created, and returned\n    let new_fn = a:0 > 0 ? a:1 : {}\n    \" Force the searched pattern onto the function to return, at least this,\n    \" is correct\n    call extend(new_fn, a:id)\n    call self.add([new_fn])\n    return new_fn\n  endif\nendfunction\nfunction! s:filter(descr) dict abort \" {{{4\n  let res = filter(copy(self.list), 's:FunctionMatchesDescription(v:val, a:descr)')\n  return res\nendfunction\nfunction! s:reverse()     dict abort \"{{{4\n  return reverse(self.list)\nendfunction\nfunction! lh#cpp#snippets#new_function_list() abort \" {{{4\n  let fl = lh#object#make_top_type({ 'list': []})\n  let fl.public    = function(s:getSNR('public'))\n  let fl.protected = function(s:getSNR('protected'))\n  let fl.private   = function(s:getSNR('private'))\n  let fl.add       = function(s:getSNR('add'))\n  let fl.insert    = function(s:getSNR('insert'))\n  let fl.get       = function(s:getSNR('get'))\n  let fl.get1      = function(s:getSNR('get1'))\n  let fl.filter    = function(s:getSNR('filter'))\n  let fl.reverse   = function(s:getSNR('reverse'))\n\n  \" Return object {{{4\n  return fl\n\" }}}4\nendfunction\n\nfunction! s:AddNew(dst) dict abort\n  return extend(self, a:dst, 'keep')\nendfunction\n\n\"------------------------------------------------------------------------\n\" ## Internal functions {{{1\n\n\" # Misc {{{2\n\" s:getSNR([func_name]) {{{3\nfunction! s:getSNR(...)\n  if !exists(\"s:SNR\")\n    let s:SNR=matchstr(expand('<sfile>'), '<SNR>\\d\\+_\\zegetSNR$')\n  endif\n  return s:SNR . (a:0>0 ? (a:1) : '')\nendfunction\n\n\" Function: s:FunctionMatchesDescription(fn, descr) {{{3\nfunction! s:FunctionMatchesDescription(fn, descr)\n  for [k, v] in items(a:descr)\n    if ! has_key(a:fn, k) || a:fn[k] != v\n      return 0\n    endif\n    return 1\n  endfor\nendfunction\n\n\" Function: lh#cpp#snippets#_this_param_requires_a_destructor(attribute) {{{3\n\" see lh#cpp#snippets#requires_destructor(attributes)\nfunction! lh#cpp#snippets#_this_param_requires_a_destructor(attribute) abort\n  if !lh#dev#cpp#types#IsPointer(a:attribute.type)\n    \" TODO: We may need another option as well. Or a list of types ?\n    return 0\n  elseif a:attribute.type =~ '\\vauto_ptr|[*]'\n    return 1\n  elseif a:attribute.type =~ '\\v^[a-z0-9]*_ptr|non_null'\n    \" let's suppose scoped_ptr, unique_ptr, ...\n    \" \"*_ptr\" follows standard naming style, we can expect this is not an\n    \" unsafe pointer type\n    return 0\n  elseif lh#option#get('cpp_always_a_destructor_when_there_is_a_pointer_attribute', 0)\n    return 1\n  else\n    return 0\n  endif\nendfunction\n\n\" Function: lh#cpp#snippets#_this_param_requires_copy_operations(attribute) {{{3\nfunction! lh#cpp#snippets#_this_param_requires_copy_operations(attribute) abort\n  let type = type(a:attribute) == type({}) ? a:attribute.type : a:attribute\n\n  if lh#dev#cpp#types#is_not_owning_ptr(type)\n    return 0\n  elseif lh#dev#cpp#types#IsPointer(type)\n    return 1\n  else\n    \" TODO: recognize non publicy copyable types\n    return 0\n  endif\nendfunction\n\n\" Function: lh#cpp#snippets#_decode_selected_attributes(text) {{{3\n\" TODO: ask which ones shall be used:\n\" - in init-ctr param list\n\" - to generate setters and/or getter\nfunction! lh#cpp#snippets#_decode_selected_attributes(text) abort\n  let res = []\n  for attr in split(a:text, \"\\n\")\n    let attr = matchstr(attr, '^\\s*\\zs.\\{-}\\ze;*\\s*$')\n    let attr_data = lh#dev#option#call('function#_analyse_parameter', &ft, attr, 1)\n    let attr_data.name = lh#naming#param(attr_data.name)\n    let res += [ attr_data ]\n  endfor\n  return res\nendfunction\n\n\" # snippet functions {{{2\n\" Function: lh#cpp#snippets#_goto_return_semicolon() {{{3\nfunction! lh#cpp#snippets#_goto_return_semicolon() abort\n  let p = getpos('.')\n  let r = search('return.*;', 'e')\n  if r == 0 | call setpos('.', p) | endif\nendfunction\n\n\" Function: lh#cpp#snippets#_has_a_non_copyable_parent(parents) {{{3\n\" I'll just test is there is a public parent. From there, let's suppose public\n\" base classes are noncopyable.\n\" I'll trust the end-user to have objects from hierarchies to respect\n\" entity-semantics and be noncopyable (or possibly clonable)\n\" NB: I should may be test for a private inheritance to a \"\\cNon_*Copyable\"\n\" class.\nfunction! lh#cpp#snippets#_has_a_non_copyable_parent(parents) abort\n  let public_parents = filter(copy(a:parents), 'get(v:val, \"visibility\", \"public\") == \"public\"')\n  let res = ! empty(public_parents)\n  return res\nendfunction\n\n\"------------------------------------------------------------------------\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/style.vim",
    "content": "\"=============================================================================\n\" File:\t\tautoload/lh/cpp/style.vim                                 {{{1\n\" Author:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://code.google.com/p/lh-vim/>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://code.google.com/p/lh-vim/wiki/License>\n\" Version:\t2.0.0\n\" Created:\t10th Feb 2009\n\" Last Update:\t08th Mar 2018\n\"------------------------------------------------------------------------\n\" Description:\n\" \tGeneral coding style functions\n\"\n\"------------------------------------------------------------------------\n\" History:\n\" \tv1.1.0: Creation\n\"\tv2.0.0: License GPLv3 w/ extension\n\" TODO:\n\" \t- Refactor to build on top of lh#dev\n\" \t- Integrate style preferences used by InsertAccessors\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\n\" ## Functions {{{1\n\" # Debug {{{2\nfunction! lh#cpp#style#verbose(level)\n  let s:verbose = a:level\nendfunction\n\nfunction! s:Verbose(expr)\n  if exists('s:verbose') && s:verbose\n    echomsg a:expr\n  endif\nendfunction\n\nfunction! lh#cpp#style#debug(expr)\n  return eval(a:expr)\nendfunction\n\n\" # Style accessors {{{2\nfunction! lh#cpp#style#get(datakind, pos)\n  let value = lh#option#get(a:datakind.a:pos, '')\n  return value\nendfunction\n\n\" # Names conversion {{{2\n\" Function: lh#cpp#style#attribute2parameter_name(attrb_name) {{{3\nfunction! lh#cpp#style#attribute2parameter_name(attrb_name)\n  let core_name  = lh#naming#variable(a:attrb_name)\n  let param_name = lh#naming#param(core_name)\n  if param_name == a:attrb_name\n    let param_name = lh#marker#txt(param_name)\n  endif\n  return param_name\nendfunction\n\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/tags.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp/tags.vim                          {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://code.google.com/p/lh-vim/>\n\" Version:      2.3.0\nlet s:k_version = 230\n\" Created:      25th Jun 2014\n\" Last Update:  22nd May 2019\n\"------------------------------------------------------------------------\n\" Description:\n\"       API functions to obtain symbol declarations\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\" ## Misc Functions     {{{1\n\" # Version {{{2\nfunction! lh#cpp#tags#version()\n  return s:k_version\nendfunction\n\n\" # Debug   {{{2\nlet s:verbose = get(s:, 'verbose', 0)\nfunction! lh#cpp#tags#verbose(...)\n  if a:0 > 0 | let s:verbose = a:1 | endif\n  return s:verbose\nendfunction\n\nfunction! s:Log(expr, ...)\n  call call('lh#log#this',[a:expr]+a:000)\nendfunction\n\nfunction! s:Verbose(expr, ...)\n  if s:verbose\n    call call('s:Log',[a:expr]+a:000)\n  endif\nendfunction\n\nfunction! lh#cpp#tags#debug(expr) abort\n  return eval(a:expr)\nendfunction\n\n\"------------------------------------------------------------------------\n\" ## Exported functions {{{1\n\n\" Function: lh#cpp#tags#find_compiler() {{{3\n\" Let's assume C++ and not C\n\" TODO: support C\nfunction! lh#cpp#tags#find_compiler() abort\n  runtime autoload/lh/cmake.vim\n  if exists('*lh#cmake#get_variables')\n    try\n      let compiler = lh#cmake#get_variables('CMAKE_CXX_COMPILER').CMAKE_CXX_COMPILER.value\n      return compiler\n    catch /.*/\n      \" The project isn't under CMake\n    endtry\n  endif\n  if exists('$CXX')\n    return $CXX\n  elseif executable('c++')\n    return 'c++'\n  elseif executable('g++')\n    return 'g++'\n  elseif executable('clang++')\n    return 'clang++'\n  endif\nendfunction\n\n\" Function: lh#cpp#tags#compiler_includes([compiler]) {{{3\n\" Fetch standard includes (hard coded in the compiler)\n\" TODO: find a way to support intel compiler\nlet s:compiler_includes = {}\nfunction! lh#cpp#tags#compiler_includes(...) abort\n  let compiler = a:0 > 0 ? a:1 : lh#cpp#tags#find_compiler()\n  if ! has_key(s:compiler_includes, compiler)\n    \" Let's assume a *nix compiler (g++, clang++)\n    let includes = split(lh#os#system(compiler . ' -E -xc++ - -Wp,-v < /dev/null'), \"\\n\")\n    call filter(includes, 'v:val =~ \"^ \"')\n    call map(includes, 'lh#path#simplify(v:val[1 :])')\n    \" Note that it should contain /usr/include & all\n    let s:compiler_includes[compiler] = includes\n  endif\n  return s:compiler_includes[compiler]\nendfunction\n\n\" Function: lh#cpp#tags#strip_included_paths(filename, includes) {{{3\nfunction! lh#cpp#tags#strip_included_paths(filename, includes)\n  let filename = a:filename\n  if !empty(a:includes)\n    if filename[0] == '/' \" absolute => try to remove things from b:includes and/or b:sources_root\n      let filename = lh#path#strip_start(filename, a:includes)\n    endif\n  else\n    let filename_simplify = lh#ft#option#get('filename_simplify_for_inclusion', &ft, ':t')\n    let filename = fnamemodify(filename, filename_simplify)\n  endif\n  return filename\nendfunction\n\n\" Function: lh#cpp#tags#get_included_paths([default]) {{{3\nfunction! s:as_list(p) abort\n  return type(a:p) == type([]) ? a:p : [a:p]\nendfunction\n\nfunction! lh#cpp#tags#get_included_paths(...)\n  let includes = []\n  \" sources_root: from mu-template & lh-suite(s)\n  \" paths.sources: from lh#project\n  let sources_root = lh#option#get(['sources_root', 'paths.sources'])\n  if lh#option#is_set(sources_root)\n    let includes += [lh#path#to_dirname(sources_root)]\n  endif\n  \" paths.includes: new paths from lh#project\n  \" includes: old path\n  let def_includes = lh#option#get(['paths.includes', 'includes'])\n  if lh#option#is_set(def_includes)\n    call map(copy(def_includes), 'extend(includes, s:as_list(type(v:val)==type(function(\"has\")) ? call(v:val,[]) : v:val))')\n    call filter(includes, '!empty(v:val)')\n  elseif a:0 > 0\n    let includes += type(a:1) == type([]) ? a:1 : split(a:1, ',')\n  endif\n  return lh#list#unique_sort(includes)\nendfunction\n\n\" Function: lh#cpp#tags#fetch(feature) {{{3\nfunction! lh#cpp#tags#fetch(feature) abort\n  let id = eval(s:TagsSelectPolicy())\n\n  try\n    let isk_save = &isk\n    set isk-=:\n    let info = taglist('.*\\<'.id.'$')\n  finally\n    let &isk = isk_save\n  endtry\n  if len(info) == 0\n    throw a:feature.\": no tags for `\".id.\"'\"\n  endif\n  \" Filter for function definitions and #defines, ...\n  let accepted_kinds = lh#ft#option#get('tag_kinds_for_inclusion', &ft, '[dfptcs]')\n  call filter(info, \"v:val.kind =~ \".string(accepted_kinds))\n  \" Filter for include files only\n  let accepted_files = lh#ft#option#get('file_regex_for_inclusion', &ft, '\\.h')\n  call filter(info, \"v:val.filename =~? \".string(accepted_files))\n  \" Is there any symbol left ?\n  if len(info) == 0\n    throw a:feature.\": no acceptable tag for `\".id.\"'\"\n  endif\n\n  \" Strip the leading path that won't ever appear in included filename\n  let includes = lh#cpp#tags#get_included_paths()\n  for val in info\n    let val.filename = lh#cpp#tags#strip_included_paths(val.filename, includes)\n  endfor\n  \" call map(info, \"v:val.filename = lh#cpp#tags#strip_included_paths(v:val.filename, includes)\")\n\n  \" And remove redundant info\n  let info = lh#tags#uniq_sort(info)\n  return [id, info]\nendfunction\n\"------------------------------------------------------------------------\n\" ## Internal functions {{{1\nfunction! s:TagsSelectPolicy()\n  let select_policy = lh#option#get('tags_select', \"expand('<cword>')\", 'bg')\n  return select_policy\nendfunction\n\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/types.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp/types.vim                         {{{1\n\" Author:       Luc Hermitte <EMAIL:luc {dot} hermitte {at} gmail {dot} com>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      2.2.0.\nlet s:k_version = '220'\n\" Created:      15th Dec 2015\n\" Last Update:  15th Dec 2015\n\"------------------------------------------------------------------------\n\" Description:\n\"       C++ types database\n\"\n\"------------------------------------------------------------------------\n\" History:      «history»\n\" TODO:         «missing features»\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\" ## Misc Functions     {{{1\n\" # Version {{{2\nfunction! lh#cpp#types#version()\n  return s:k_version\nendfunction\n\n\" # Debug   {{{2\nif !exists('s:verbose')\n  let s:verbose = 0\nendif\nfunction! lh#cpp#types#verbose(...)\n  if a:0 > 0 | let s:verbose = a:1 | endif\n  return s:verbose\nendfunction\n\nfunction! s:Verbose(expr)\n  if s:verbose\n    echomsg a:expr\n  endif\nendfunction\n\nfunction! lh#cpp#types#debug(expr)\n  return eval(a:expr)\nendfunction\n\n\n\"------------------------------------------------------------------------\n\" ## Types DB {{{1\n\" TODO: support: several entries behind a same name -> boost::shared_ptr,\n\" std::shared_ptr\n\" # Fetch information\n\n\" Function: lh#cpp#types#get_info(type [, default-value]) {{{3\n\" TODO: support also std::vector\nfunction! lh#cpp#types#get_info(type, ...) abort\n  let res = get(s:types, a:type, a:0 ? a:1 : {\"type\" : a:type, \"name\" : a:type, 'unknown':1})\n\n  function! res.typename_for_header(...) abort\n    let type = []\n    if has_key(self, 'namespace') && !empty(self.namespace)\n      let type += [self.namespace]\n    endif\n    \" In case there isn't enough\n    let nb = max(lh#string#matches(self.type, '\\v\\%\\zs\\d+'))\n    let args = a:000 + map(range(len(a:000)+1, nb), 'lh#marker#txt(\"T\".v:val)')\n    let type += [call('lh#fmt#printf', [self.type] + args)]\n    return join(type, '::')\n  endfunction\n  return res\nendfunction\n\n\" Function: lh#cpp#types#get_includes(type) {{{3\nfunction! lh#cpp#types#get_includes(type) abort\n  let info = get(s:types, a:type, {'includes': []})\n  return info.includes\nendfunction\n\n\" # Filling functions {{{2\n\nfunction! s:PrepareHeaders(includes, name) \" {{{3\n  return map(lh#list#flatten([a:includes]), 'lh#fmt#printf(\"<\".v:val.\">\", a:name)')\nendfunction\n\nfunction! s:ExtractName(type) \" {{{3\n  return substitute(a:type, '\\v\\<.*', '', '')\nendfunction\n\nfunction! s:RegisterTypes(list, namespace, ...) \" {{{3\n  let types = map(copy(a:list), '{\"name\": s:ExtractName(v:val), \"namespace\": a:namespace, \"type\": v:val}')\n  if a:0 > 0\n    call map(types, 'extend(v:val, {\"includes\": s:PrepareHeaders(a:1, v:val.name)})')\n  else\n    call map(types, 'extend(v:val, {\"includes\": [\"<\".v:val[\"name\"].\">\"]})')\n  endif\n\n  call map(types, '{(v:val[\"name\"]) : v:val}')\n  for type in types\n    call extend(s:types, type)\n  endfor\nendfunction\n\n\" # Fill the DB {{{2\nlet s:types = {}\n\n\" * Standard types {{{3\n\" - types with no template parameters {{{4\nlet s:std_types = ['fstream', 'string', 'stringstring', 'istream', 'ostream', 'regex', 'thread', 'mutex', 'shared_mutex', 'condition_variable', 'future', 'exception']\ncall s:RegisterTypes(s:std_types, 'std')\n\n\n\" - types with template parameters {{{4\nlet s:std_types = [\n      \\ 'array<%1,%2>', 'bitset<%1>', 'complex<%1>', 'deque<%1>',\n      \\ 'forward_list<%1>', 'function<%1>', 'hash<%1>', 'initializer_list<%1>',\n      \\ 'list<%1>', 'map<%1,%2>', 'multimap<%1,%2>', 'multiset<%1>',\n      \\ 'priority_queue<%1>', 'queue<%1>', 'set<%1>', 'stack<%1>', 'tuple<%1>',\n      \\ 'unordered_map<%1>', 'unordered_multimap<%1,%2>',\n      \\ 'unordered_multiset<%1>', 'unordered_set<%1>', 'vector<%1>'\n      \\]\ncall s:RegisterTypes(s:std_types, 'std')\n\n\" - types defined elsewhere {{{4\nlet s:std_types = [\n      \\ 'runtime_error', 'logic_error', 'domain_error', 'out_of_range',\n      \\ 'future_error', 'invalid_argument', 'range_error', 'overflow_error',\n      \\ 'underflow_error', 'regex_error', 'system_error', 'bad_cast',\n      \\ 'bad_alloc', 'bad_typeid', 'bad_weak_ptr', 'bad_function_call',\n      \\ 'bad_array_new_length', 'bad_exception'\n      \\]\ncall s:RegisterTypes(s:std_types, 'std', 'stdexcept')\n\nlet s:std_types = [\n      \\ 'timed_mutex', 'recursive_mutex', 'recursive_timed_mutex', 'lock_guard',\n      \\ 'unique_lock', 'shared_lock'\n      \\]\ncall s:RegisterTypes(s:std_types, 'std', 'mutex')\n\ncall s:RegisterTypes(['shared_timed_mutex'], 'std', 'shared_mutex')\ncall s:RegisterTypes(['condition_variable_any'], 'std', 'condition_variable')\ncall s:RegisterTypes(['promise', 'packaged_task', 'shared_future'], 'std', 'future')\ncall s:RegisterTypes(['pair'], 'std', 'utility')\ncall s:RegisterTypes(['chrono::time_point<%1>', 'chrono::duration<%1>'], 'std', 'chrono')\ncall s:RegisterTypes(['nullptr_t'], 'std', 'cstddef')\ncall s:RegisterTypes(['hash<%1>'], 'std', 'functional')\n\ncall s:RegisterTypes(['size_t'], 'std',['cstddef', 'cstdio', 'cstring', 'ctime', 'cstdlib', 'cwchar'])\n\" call s:RegisterTypes(['size_t'], '',['stddef.h', 'stdio.', 'string.h', 'time.h', 'wchar.h'])\n\n\" * Boost types {{{3\n\" - types defined in header file w/ same name {{{4\nlet s:boost_types = ['noncopyable'\n      \\]\ncall s:RegisterTypes(s:boost_types, 'boost', 'boost/%1.hpp')\n\n\" - types defined elsewhere {{{4\nlet s:boost_types = [\n      \\ 'ptr_array<%1>', 'ptr_deque<%1>', 'ptr_list>%1>', 'ptr_map<%1,2>',\n      \\ 'ptr_multi_set<%1>', 'ptr_multimap<%1,2>', 'ptr_set<%1>',\n      \\ 'ptr_vector<%1>'\n      \\]\ncall s:RegisterTypes(s:boost_types, 'boost', ['boost/ptr_container.hpp', 'boost/ptr_container/%1.hpp'])\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp/understand.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp/understand.vim                    {{{1\n\" Author:       Luc Hermitte <EMAIL:luc {dot} hermitte {at} gmail {dot} com>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      2.2.0.\nlet s:k_version = '220'\n\" Created:      30th Jun 2016\n\" Last Update:  30th Jun 2016\n\"------------------------------------------------------------------------\n\" Description:\n\"   Plugin that imports understand csv to browse codecheck results.\n\"\n\" Format expected:\n\"   file:line:col: check ; check msg; check detail; other things\n\"   Note this is not the default output format: you'll have to change a few\n\"   semi-colons into colons.\n\"\n\" Usage:\n\"   (draft version that needs to be enhanced)\n\"   Load the .csv with:\n\"       :let u = lh#cpp#understand#init('checks.csv')\n\"   Choose which violations shall be displayed:\n\"       :call u.filter(['6-4-5', 'Unused Variables'], 'check')\n\"   Navigate the violations presented into the quickfix window:\n\"       :h :cn / :h :cp / :h quickfix\n\"\n\"------------------------------------------------------------------------\n\" TODO:\n\" - define commands to add some ergonomy into these functions\n\" - read a real .csv file\n\" - Extract the qf filtering functions to lh-vim-lib\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\" ## Misc Functions     {{{1\n\" # Version {{{2\nfunction! lh#cpp#understand#version()\n  return s:k_version\nendfunction\n\n\" # Debug   {{{2\nlet s:verbose = get(s:, 'verbose', 0)\nfunction! lh#cpp#understand#verbose(...)\n  if a:0 > 0 | let s:verbose = a:1 | endif\n  return s:verbose\nendfunction\n\nfunction! s:Log(expr, ...)\n  call call('lh#log#this',[a:expr]+a:000)\nendfunction\n\nfunction! s:Verbose(expr, ...)\n  if s:verbose\n    call call('s:Log',[a:expr]+a:000)\n  endif\nendfunction\n\nfunction! lh#cpp#understand#debug(expr) abort\n  return eval(a:expr)\nendfunction\n\n\n\"------------------------------------------------------------------------\n\" ## Exported functions {{{1\n\n\" Function: lh#cpp#understand#init(cvs_file) {{{2\nfunction! lh#cpp#understand#init(cvs_file) abort\n  let d = {}\n  \" This way all bufnr are defined\n  exe 'cgetfile ' . a:csv_file\n  let d.data = getqflist()\n\n  let d.data = map(d.data, 's:analyse_violation(v:val)')\n\n  let d.checks    = lh#list#possible_values(d.data, 'check')\n  let d.filenames = lh#list#possible_values(d.data, 'filename')\n\n  let d.filter = function('s:filter')\n\n  return d\nendfunction\n\n\"------------------------------------------------------------------------\n\" ## Internal functions {{{1\n\n\" Function: s:violation_list2dict(v) {{{2\nfunction! s:violation_list2dict(v)\n  return\n        \\ { 'filename': a:v[1]\n        \\ , 'lnum'    : a:v[2]\n        \\ , 'col'     : a:v[3]\n        \\ , 'check'   : a:v[4]\n        \\ , 'results' : a:v[5]\n        \\ , 'entity'  : a:v[6]\n        \\ , 'rem'     : a:v[7]\n        \\ , 'text'    : join(a:v[4:], ';')\n        \\ }\nendfunction\n\n\" Function: s:filter(elements, what) dict abort {{{2\nfunction! s:filter(elements, what) dict abort\n  let regex = '\\v'.join(map(copy(a:elements), 'escape(v:val, \"\\\\\\\\()<>{}+=\")'), '|')\n  let res = filter(copy(self.data), 'v:val[a:what] =~ regex')\n  call setqflist(res)\n  return res\nendfunction\n\n\" Function: s:analyse_violation(v) {{{2\nfunction! s:analyse_violation(v) abort\n  let v = a:v\n  let infos = split(v.text, ';')\n  let v.check   = infos[0]\n  let v.results = infos[1]\n  let infos[1] = substitute(infos[1], '\\v^\"\\s*(.*)\\s*\"$', '\\1', '')\n  let infos[1] = substitute(infos[1], '\"\"\"\"', '\"', 'g')\n  let v.results = infos[1]\n  let v.entity  = infos[2]\n  \" let v.pattern = v.entity\n  let v.rem     = infos[3:]\n  let v.filename = bufname(v.bufnr)\n\n  let v.text = join(infos, ' ; ')\n  return v\nendfunction\n\n\"------------------------------------------------------------------------\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/cpp.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp.vim                               {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://code.google.com/p/lh-vim/>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/License.md>\n\" Version:      2.2.1\nlet s:k_version = '221'\n\" Created:      08th Jun 2014\n\" Last Update:  25th Sep 2019\n\"------------------------------------------------------------------------\n\" Description:\n\"       Various C++ related functions\n\"\n\" - C++ flavour detection\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\" ## Misc Functions     {{{1\n\" # Version {{{2\nfunction! lh#cpp#version()\n  return s:k_version\nendfunction\n\n\" # Debug   {{{2\nlet s:verbose = 0\nfunction! lh#cpp#verbose(...)\n  if a:0 > 0 | let s:verbose = a:1 | endif\n  return s:verbose\nendfunction\n\nfunction! s:Verbose(expr)\n  if s:verbose\n    echomsg a:expr\n  endif\nendfunction\n\nfunction! lh#cpp#debug(expr)\n  return eval(a:expr)\nendfunction\n\n\n\"------------------------------------------------------------------------\n\" ## Exported functions {{{1\n\n\" # Obtain C++ flavour (03, TR1, 11, 14, 17, 20) {{{2\n\" @note this set of functions deprecates lh#dev#cpp#use_cpp11()\n\n\" Function: lh#cpp#get_flavour() {{{3\n\" @return a value among: 03 (C++98/03), 05 (TR1), 11 (C++11), 14, 17, 20\nfunction! lh#cpp#get_flavour()\n  \" First check a dedicated set of variables\n  let flavour = lh#option#get('cpp_std_flavour', 0)\n  if flavour != 0 | return flavour | endif\n\n  let flavour = s:CheckFlavour()\n  if flavour != 0 | return flavour | endif\n\n  \" then, check $CXXFLAGS\n  if exists('$CXXFLAGS')\n    let std=matchstr($CXXFLAGS, '-std=\\zs\\S\\+\\ze')\n    if !empty(std)\n      return s:DecodeStdFlavour(std)\n    endif\n  endif\n\n  \" Or CMAKE CXXFLAGS\n  let flags = ''\n  try\n    \" The following may fail if lh-cmake is not installed\n    \" or if the project isn't using CMake\n    let flags = lh#cmake#get_variables('CXXFLAGS')\n  catch /.*/\n  endtry\n  \" Or compile_commands.json database\n  \" as newer versions of CMake use the CXX_STANDARD property that\n  \" doesn't set any variable that can be fetched.\n  if empty(flags)\n    try\n      \" The following may fail if build-tools-wrapper is not installed\n      \" or if the project isn't using CMake\n      let prj_dirname = lh#project#_check_project_variables(\n        \\ ['paths.sources', 'project_sources_dir', ['BTW_project_config', '_.paths.sources']])\n      let dbs = lh#path#glob_as_list(\n            \\ [lh#btw#compilation_dir(), prj_dirname],\n            \\ 'compile_commands.json', 0)\n      if  !empty(dbs)\n        let db = dbs[0]\n        let l_flags = filter(readfile(db), 'v:val =~ \"-std=\"')\n        let flags = empty(l_flags) ? '' : l_flags[0]\n      endif\n    catch /.*/\n    endtry\n  endif\n\n  \" And ... decode!\n  if !empty(flags)\n    let std=matchstr(flags, '-std=\\zs\\S\\+\\ze')\n    if !empty(std)\n      return s:DecodeStdFlavour(std)\n    endif\n  endif\n\n  return 03\nendfunction\n\n\" Function: lh#cpp#use_TR1() {{{3\nfunction! lh#cpp#use_TR1(...)\n  let flavour = lh#cpp#get_flavour()\n  return flavour == 05\nendfunction\n\n\" Function: lh#cpp#use_cpp11([and_no_more = 0]) {{{3\nfunction! lh#cpp#use_cpp11(...)\n  let flavour = lh#cpp#get_flavour()\n  if a:0 == 0 || a:1 == 0\n    return flavour >= 11\n  else\n    return flavour == 11\n  endif\nendfunction\n\n\" Function: lh#cpp#use_cpp14([and_no_more = 0]) {{{3\nfunction! lh#cpp#use_cpp14(...)\n  let flavour = lh#cpp#get_flavour()\n  if a:0 == 0 || a:1 == 0\n    return flavour >= 14\n  else\n    return flavour == 14\n  endif\nendfunction\n\n\" Function: lh#cpp#use_cpp17([and_no_more = 0]) {{{3\nfunction! lh#cpp#use_cpp17(...)\n  let flavour = lh#cpp#get_flavour()\n  if a:0 == 0 || a:1 == 0\n    return flavour >= 17\n  else\n    return flavour == 17\n  endif\nendfunction\n\n\" Function: lh#cpp#use_cpp20([and_no_more = 0]) {{{3\nfunction! lh#cpp#use_cpp20(...)\n  let flavour = lh#cpp#get_flavour()\n  if a:0 == 0 || a:1 == 0\n    return flavour >= 20\n  else\n    return flavour == 20\n  endif\nendfunction\n\n\"------------------------------------------------------------------------\n\" ## Internal functions {{{1\n\n\" # C++ flavour\n\" Function: s:CheckFlavour() {{{3\nfunction! s:CheckFlavour()\n  if lh#option#get('cpp_use_TR1', 0) | return 05 | endif\n  let flavours = {\n        \\ 'cpp03': 03,\n        \\ 'cpp05': 05,\n        \\ 'cpp11': 11,\n        \\ 'cpp14': 14,\n        \\ 'cpp17': 17,\n        \\ 'cpp20': 20\n        \\ }\n  \" TODO: use filter!\n  for kv in reverse(items(flavours))\n    if lh#option#get('cpp_use_'.kv[0], 0)\n      return kv[1]\n    endif\n  endfor\n  return 0\nendfunction\n\n\" Function: s:DecodeStdFlavour(std) {{{3\nfunction! s:DecodeStdFlavour(std)\n  let std = matchstr(a:std, '\\(gnu++\\|c++\\)\\zs.*')\n  if     std =~ '\\(98\\|03\\)' | return 03\n  elseif std =~ '\\(11\\|0x\\)' | return 11\n  elseif std =~ '\\(14\\|1y\\)' | return 14\n  elseif std =~ '\\(17\\|1z\\)' | return 17\n  elseif std =~ '\\(20\\|2a\\)' | return 20\n  else                       | return 03\n  endif\nendfunction\n\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "autoload/lh/dox.vim",
    "content": "\"=============================================================================\n\" File:         autoload/lh/cpp/dox.vim                           {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\" \t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/tree/master/License.md>\nlet s:k_version = 221\n\" Version:\t2.2.1\n\" Created:      22nd Feb 2011\n\" Last Update:  22nd Nov 2019\n\"------------------------------------------------------------------------\n\" Description:\n\"       Set of functions to generate Doxygen tags in respect of the current\n\"       style.\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\" ## Misc Functions     {{{1\n\" # Version {{{2\nfunction! lh#dox#_version()\n  return s:k_version\nendfunction\n\n\" # Debug   {{{2\nlet s:verbose = get(s:, 'verbose', 0)\nfunction! lh#dox#verbose(...)\n  if a:0 > 0 | let s:verbose = a:1 | endif\n  return s:verbose\nendfunction\n\nfunction! s:Verbose(expr)\n  if s:verbose\n    echomsg a:expr\n  endif\nendfunction\n\nfunction! lh#dox#debug(expr)\n  return eval(a:expr)\nendfunction\n\n\n\"------------------------------------------------------------------------\n\" ## Exported functions {{{1\n\n\" # doxygen comment generation {{{2\n\" Function: lh#dox#comment_leading_char() {{{3\nfunction! lh#dox#comment_leading_char()\n  return lh#ft#option#get('dox_CommentLeadingChar', &ft, '*')\nendfunction\n\n\" Function: lh#dox#tag_leading_char() {{{3\nfunction! lh#dox#tag_leading_char()\n  return lh#ft#option#get('dox_TagLeadingChar', &ft, '@')\n  \" alternative: \\\nendfunction\n\n\" Function: lh#dox#tag(tag) {{{3\nfunction! lh#dox#tag(tag)\n  return lh#dox#tag_leading_char().substitute(a:tag, '\\s\\+$', lh#ft#option#get('dox_sep', &ft, ' '), '')\nendfunction\n\n\" Function: lh#dox#semantics(text) {{{3\n\" TODO: s/text/list\nfunction! lh#dox#semantics(text)\n  return '<p><b>Semantics</b><br>'\nendfunction\n\n\" Function: lh#dox#throw([text]) {{{3\nfunction! lh#dox#throw(...)\n  let throw = lh#ft#option#get('dox_throw', &ft, 'throw ')\n  let res = ''\n  if !empty(throw)\n    let res .= lh#dox#tag(throw)\n    if a:0==0 || empty(a:1)\n      let res = lh#marker#txt(res)\n    else\n      let res .= a:1\n    endif\n  else\n    if a:0!=0 && ! empty(a:1)\n      let res .= lh#dox#tag('throw ') . a:1\n    endif\n  endif\n  return res\nendfunction\n\n\" Function: lh#dox#ingroup([text]) {{{3\nfunction! lh#dox#ingroup(...)\n  let text = a:0==0 || empty(a:1) ? lh#option#get('dox.group.name', lh#marker#txt('group')) : a:1\n  let ingroup = lh#ft#option#get('dox_ingroup', &ft, 0)\n  if     ingroup =~? '^y\\%[es]$\\|^a\\%[lways]$\\|1'\n    let res =  lh#dox#tag('ingroup ').text\n  elseif ingroup =~? '^no$\\|^n\\%[ever]$\\|0'\n    let res =  ''\n  elseif type(ingroup) == type('')\n    let res = lh#dox#tag('ingroup ').ingroup\n  else \" maybe\n    let res = lh#marker#txt(lh#dox#tag('ingroup ').(a:0==0?'':a:1))\n  endif\n  return res\nendfunction\n\n\" Function: lh#dox#brief([text]) {{{3\nfunction! lh#dox#brief(...)\n  let text = a:0==0 || empty(a:1) ? lh#marker#txt('brief explanation').'.' : a:1\n  if text[-1:] != '.' |let text .= '.' | endif\n  let brief = lh#ft#option#get('dox_brief', &ft, 'short')\n  if     brief =~? '^y\\%[es]$\\|^a\\%[lways]$\\|1'\n    let res =  lh#dox#tag('brief ').text\n  elseif brief =~? '^no$\\|^n\\%[ever]$\\|0\\|^s\\%[hort]$'\n    let res =  text\n  else \" maybe\n    let res =  lh#marker#txt(lh#dox#tag('brief ')).text\n  endif\n  return res\nendfunction\n\n\" Function: lh#dox#param({dir,name,text) {{{3\nfunction! lh#dox#param(param)\n  let res = lh#dox#tag(\"param\")\n  if type(a:param) == type({})\n    if has_key(a:param, \"dir\")\n      let dir = a:param.dir\n      if stridx(dir, '[') == -1\n        let dir = '[' . dir .']'\n      endif\n      let res .= dir\n    endif\n    if has_key(a:param, \"name\") | let res .= \" \".(a:param.name) | endif\n    let res .= ' '. a:param.text\n  else\n    let res .= ' ' . a:param\n  endif\n  return res\nendfunction\n\n\" Function: lh#dox#author() {{{3\nfunction! lh#dox#author_value(...) abort\n  if a:0 && !empty(a:1) > 0\n    return a:1\n  endif\n\n  let author = lh#ft#option#get('dox_author', &ft, '')\n  if author =~ '^g:.*'\n    if exists(author)\n      return {author}\n      \" return tag . {author} . lh#marker#txt('')\n    else\n      return lh#marker#txt('author-name')\n    endif\n  elseif strlen(author) == 0\n    return lh#marker#txt('author-name')\n  else\n    return author\n  endif\nendfunction\n\nfunction! lh#dox#author(...) abort\n  let author_tag = lh#ft#option#get('dox_author_tag', &ft, 'author')\n  let tag        = lh#dox#tag(author_tag. ' ')\n  return tag . call('lh#dox#author_value', a:000)\nendfunction\n\n\" Function: lh#dox#since(...) {{{3\nfunction! lh#dox#since_value(...) abort\n  let ver  = lh#option#get('ProjectVersion', a:0==0 ? lh#marker#txt('1.0') : a:1)\n  return ver\nendfunction\n\nfunction! lh#dox#since(...) abort\n  let tag  = lh#dox#tag('since ')\n  return tag . 'Version '.call('lh#dox#since_value', a:000)\nendfunction\n\n\"------------------------------------------------------------------------\n\" # fn_comments object {{{2\n\" Function: lh#dox#_parameter_direction(type) {{{3\nfunction! lh#dox#_parameter_direction(type) abort\n  \" todo: enhance the heuristics.\n  \" - add string_view, span, mdspan\n  \" First strip any namespace/scope stuff\n\n  \" Support for boost smart pointers, custom types, ...\n  if     a:type =~ '\\%(\\<const\\(expr\\)\\=\\>\\s*[&*]\\=\\|const_\\%(reference\\|iterator\\)\\|&&\\|\\%(unique\\|auto\\)_ptr\\)\\s*$'\n        \\ . '\\|^\\s*\\(\\<const\\(expr\\)\\=\\>\\)'\n    return '[in]'\n  elseif a:type =~ '\\%([&*]\\|reference\\|pointer\\|iterator\\|_ptr\\)\\s*$'\n    return '[' . lh#marker#txt('in,') . 'out]'\n  elseif lh#dev#cpp#types#is_base_type(a:type, 0)\n    return '[in]'\n  else\n    return lh#marker#txt('[in]')\n  endif\nendfunction\n\n\" Function: lh#dox#new_function(brief) {{{3\nfunction! lh#dox#new_function(brief) abort\n  let res = {'brief': a:brief, 'param': [], 'pre': []}\n  function! res.add_param(param) \" {{{4\n    \" dict with: \"dir\", \"name\", \"text\"\n    \" if no \"dir\", but a \"type\" => compute \"dir\"\n    let param = a:param\n    let name = lh#naming#param(param.name)\n    if !has_key(param, 'dir')\n      let param.dir = lh#dox#_parameter_direction(param.type)\n    endif\n    if !has_key(param, 'text')\n      let param.text = lh#marker#txt(name.'-explanations')\n    endif\n    if has_key(param, 'type') && lh#dev#cpp#types#is_pointer(param.type)\n      let self.pre += [ '`'.name.' != '.lh#cpp#snippets#nullptr().'`' . lh#marker#txt()]\n    endif\n    let self.param += [ param ]\n  endfunction\n\n  \" }}}4\n  return res\nendfunction\n\"------------------------------------------------------------------------\n\" ## Internal functions {{{1\n\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "doc/API.md",
    "content": "## lh-cpp API\n\n### C++ Flavour\n\nThese functions permit to set the C++ flavour currently used.\n\nThe typical use case of these functions is to adapt code snippets to best fit\nthe idioms of the language, or to select the more standard\ntype/function/construct available.\n\n#### Examples\nSee for instance:\n- [`array_size` snippet](snippets.md#array_size)\n- [`namespace` snippet](snippets.md#namespace)\n- [`shared_ptr` snippet](snippets.md#shared_ptr)\n- [`static_assert` snippet](snippets.md#static_assert)\n- [`begin`-`end` expander](features.md#begin_end)\n\n#### Functions\n##### `lh#cpp#get_flavour()`\n__Returns__: the current C++ flavour (03, 05, 11, 14, or 17)\n\nThe flavour is obtained from [`(bg)_cpp_std_flavour`, `$CXXFLAGS`, or\n`$CMAKE_CXXFLAGS`](options.md#bgcpp_std_flavour-and-cxxflags).\n\n##### `lh#cpp#use_TR1()`\n__Returns__: whether TR1 (or more is supported).\n\nThis function checks [`lh#cpp#get_flavour()`](lh#cpp#get_flavour) result >=\n'05'.\n\nIn order to check for TR1 and only TR1, test `lh#cpp#use_TR1() & !lh#cpp#use_cpp11()`.\n\n##### `lh#cpp#use_cpp11()`\n__Returns__: whether C++11 (or more) is supported\n\nThis function relies on [`lh#cpp#get_flavour()`](lh#cpp#get_flavour)\n\n##### `lh#cpp#use_cpp14()`\n__Returns__: whether C++14 (or more) is supported\n\nThis function relies on [`lh#cpp#get_flavour()`](lh#cpp#get_flavour)\n\n##### `lh#cpp#use_cpp17()`\n__Returns__: whether C++17 (or more) is supported\n\nThis function relies on [`lh#cpp#get_flavour()`](lh#cpp#get_flavour)\n\n#### Tests\nSee [tests/lh/test-flavours.vim](tests/lh/test-flavours.vim).\n"
  },
  {
    "path": "doc/Doxygen.md",
    "content": "## File-templates\nlh-cpp & [mu-template](http://github.com/LucHermitte/mu-template) come with\ntunable project headers (the default is quite bad I have to admit). You'll have\nto override `templates/c/internals/c-file-header.template` to something like:\n\n```c++\n/**<+File brief line+>\n * <+lh#dox#tag('file ').s:filename+>\n * <+lh#dox#ingroup()+>\n * <+lh#dox#author()+>, creation\n * <+lh#dox#tag('copyright ')+><+strftime('%Y')+> Copyright-Holder-name\n * <+lh#dox#since('ProjectVersion')+>\n * <+lh#dox#tag('date ').strftime('%Y %b %d')+> creation\n * <p>Licence:<p> Your Project Licence\n *\n * PROJECTNAME project.\n */\n```\n\n(All the other stuff is already taken care of: include guards will be added automatically in header files, and `foo.h` will be automatically included in `foo.c(pp)`)\n\nThen, in a local vimrc, you'll have to set the\n[following options](options.md#doxygen-related-options):\n\n * `(bpg):({ft}_)dox_author`\n * `(bpg):({ft}_)dox_group`\n * `(bpg):ProjectVersion`\n\n## Snippets\n\nSeveral C++ snippets for classes and functions automatically generate doxygen\ndocumentation.\nSee [doxygen related options](options.md#doxygen-related-options),\n[class snippets](snippets.md#classes) and [Doxygen snippets](snippets.md#doxygen)\nfor more information on the subject.\n\n## `:DOX`\n\nlh-cpp provides the `:DOX` command that analyses the current function signature to build a doxygen skeleton.\n\nThe ([configurable](#configuration)) skeleton will have:\n  * a brief line\n  * a list of _in_, _out_, or _inout_ `@parameters`\n  * a `@return` tag, if something is returned\n  * `@exception` specifications if known\n  * other tags like `@version`\n  * etc.\n\n\n### Examples\n\nGiven\n\n```c++\nstd::string f(\n        std::vector<std::string> & v,\n        std::unique_ptr<IFoo> foo,\n        int i,\n        SomeType v,\n        std::string const& str, int *pj);\n```\n\n`:DOX` will produce:\n\n```c++\n/**\n * «brief explanation».\n * «details»\n * @param[«in,»out] v  «v-explanations»\n * @param«[in]» foo  «foo-explanations»\n * @param[in] i  «i-explanations»\n * @param«[in]» v  «v-explanations»\n * @param[in] str  «str-explanations»\n * @param[«in,»out] pj  «pj-explanations»\n *\n * @return «std::string»\n * «@throw »\n * @pre <tt>foo != NULL</tt>«»\n * @pre <tt>pj != NULL</tt>«»\n */\nstd::string f(\n        std::vector<std::string> & v,\n        std::unique_ptr<IFoo> foo,\n        int i,\n        SomeType v,\n        std::string const& str, int *pj);\n```\n\nYou can see:\n\n * `«»` used as a [placeholder](https://github.com/LucHermitte/lh-brackets) to\n   jump to ;\n * references interpreted as _out_ and possibly _in_ parameters ;\n * const-references interpreted as _in_ parameters ;\n * parameters of known types correctly recognized as _in_ parameters ;\n * parameters of unknown types could be proxys/pointers and thus they could act\n   as _out_ parameters instead ;\n * pointer types are recognized as such, and `:DOX` suggest adding a\n   precondition of non-nullity in their case ;\n * a few other tags left to the user to fill in as nothing could be deduced from\n   the function signature.\n\n\n### `:DOX` specific options\nAll [doxygen related options](options.md#doxygen-related-options) apply.\n\nMore over, `:DOX` has other dependencies:\n\n * `lh#dev#cpp#types#is_base_type()` can be tuned to influence whether parameters\n   taken by copy are considered as _in_ parameters through:\n   *  `(bpg):({ft}_)base_type_pattern`\n * `lh#dev#cpp#types#is_pointer()` is used to recognize pointer types.\n"
  },
  {
    "path": "doc/Enums.md",
    "content": "lh-cpp provides the following features related to enums:\n  * [generation of a scoped and iterable enumerated type](#enum-snippet)\n  * [for-snippet for the iterable enum](#enum-iteration)\n  * [automated generation of a switch-case statement from an enum](#switch-case-generation)\n\n\n### Enum snippet\n\nlh-cpp ships a [µtemplate](http://github.com/LucHermitte/mu-template) snippet that expands `enum` into an enum definition with the following properties:\n  * C++ scoped (no `MYENUM_VAL1`, `MYENUM_VAL2`, ... but `MYENUM::VAL1`, `MYENUM::VAL2`, ...) (which can be taken advantage of in C++ template functions)\n  * the number of elements is automatically provided (which can be used, for instance, into static assertions in order to check that an associated array of strings has a consistant dimension)\n  * iterable with no need to explicitly cast an `int` into the enum type.\n\nLet's say you answer \"`MyEnum`\" when requested with the enum name, the following will be inserted:\n```C++\nstruct MyEnum {\n    enum type { «values», MAX__ };\n    static type next(type e_) {\n\tassert(e_ < MAX__);\n\treturn type(e_+1);\n    }\n    static char const* to_string(type e_);\n    static type to_enum(std::string const& s_);\n};\ninline\nMyEnum::type& operator++(MyEnum::type& e_) {\n    return e_ = MyEnum::next(e_);\n}\ninline\nMyEnum::type operator++(MyEnum::type&e_, int) {\n    const MyEnum::type tmp = e_;\n    e_ = MyEnum::next(e_);\n    return tmp;\n}\n```\n\n### Enum iteration\n\nIn order to take advantage of the particular format of the [iterable enum](#enum-snippet),\na [µtemplate](http://github.com/LucHermitte/mu-template) snippet is provided to\niterate over all enumerated values.\n\n`for-enum` will expand into:\n```C++\nfor (MyEnum::type «e» = MyEnum::type() ; «e» != MyEnum::MAX__ ; ++«e» ) {\n    «»\n}«»\n```\n\n### switch-case generation\n\nGiven an [iterable enum](#enum-snippet) variable or type name, type this name\nand then hit `<c-x>se`. lh-cpp will fill\n[µtemplate](http://github.com/LucHermitte/mu-template) switch-case snippets\nwith all possible values from the enum type. e.g. with:\n\n```C++\nstruct MyEnum {\n    enum type { V1, V2, V42, MAX__ };\n...\nMyEnum::type some_enum_var;\n```\nin INSERT-mode `some_enum_var^Xse` expands into:\n```C++\nswitch (some_enum_var) \n{\n    case MyEnum::V1:\n        {\n            «MyEnum::V1-code»;\n            break;\n        }\n    case MyEnum::V2:\n        {\n            «MyEnum::V2-code»;\n            break;\n        }\n    case MyEnum::V42:\n        {\n            «MyEnum::V42-code»;\n            break;\n        }\n    default:\n        {\n            «default-code»;\n            break;\n        }\n}«»\n```\nAs of today this feature requires a ctags database containing all the tags\nrelated to the enum, and an [iterable enum](#enum-snippet). (I plan to support\n[C++0x class-enums](http://en.wikipedia.org/wiki/C%2B%2B0x#Strongly_typed_enumerations)\nand to find eventually an alternative to ctags)\n"
  },
  {
    "path": "doc/TODO.md",
    "content": "# lh-cpp TO DO list\n\n## Folding\n\n - [ ] if only `{`, search next line\n - [ ] `do` `while`\n - [ ] embedded `#if`\n\n## syntax highlight\n\n - [ ] detect `case`\n    - [X] without a `break`, or a `return`, or `continue`, or a `goto`, or `- [[fallthrough]]`\n    - [ ] `break;} case` is incorrectly recognized\n    - [ ] `default` is not recognized\n - [ ] detect raw pointers\n - [ ] detect calls to `malloc`/`free`/...\n - [ ] detect calls to `delete` (outside destructors)\n - [ ] detect calls to `new` (C++14)\n - [ ] detect C casts\n    - [X] ignore `void foo() const`\n    - [ ] ignore `decltype(auto) foo;`\n    - [ ] ignore `f(12)(13)(14)`\n\n## snippets / wizard\n\n### class wizard\n\n - [ ] Doc!!\n    - [X]  Options\n    - [ ]  Snippets\n\n - [ ] Class kinds\n    - [ ] CRTP\n    - [ ] arithmetic class\n    - [ ] clonable simpl. or interactive\n    - [ ] value w/ manual copy (& swap)\n    - [ ] NVI ?\n    - [ ] template class\n    - [ ] enum class (only tests?)\n    - [ ] singleton (test)\n    - [ ] Simplified way to generate new classes w/ attribs & all\n\n - [ ] class features\n    - [ ] Check inline TODOs\n    - [ ] attributes\n        - [ ] use snippet if there is one with the same type name, idem for\n          inheritance -> require patch on <+s:Include()+> in mu-template\n    - [ ] dox functions\n        - [ ] test w/ and w/o\n        - [X] default constructor\n        - [X] copy constructor\n        - [X] init constructor\n        - [X] destructor\n        - [X] assignment operator\n        - [X] copy'n'swap -> `swap`\n        - [ ] `what`\n        - [ ] attributes\n        - [ ] types & classes\n           - [ ] pointer means invariant\n    - [ ] move contructor\n    - [ ] move assignment-operator\n    - [ ] Enforce «rule of all or nothing»\n    - [ ] Special functions need atomic tests\n        - [X] default constructor\n        - [X] copy constructor\n        - [X] init constructor\n        - [X] destructor\n        - [X] assignment operator\n        - [X] copy'n'swap\n        - [ ] C++11\n        - [ ] w/ TBW `:MuT cpp/class attributes=foo:int,#bar:string parents=Bar,-Toto`\n        - [X] `:Constructor`\n\n\n### Other snippets\n - [ ] `<algorithm>` snippets should use cpp/begin-end\n - [ ] lambda\n - [ ] Check `:InsertEnum` -> tests\n - [X] Fix `:MuTemplate c/swith un deux`\n - [ ] Find a better way to pass options to `:MuTemplate` command in order to take\n   advantage of cpp/class snippets. For instance:\n\n   ```\n   \" +==public, #==protected, -==private\n   :MuT cpp/class attributes=foo:int,#bar:string parents=Bar,-Toto\n   ```\n\n## misc\n\n - [ ] Register options for completion & co into menus, `:Set` and `:Toggle`\n - [ ] Have lh#dev#import rely on lh#cpp#types, or the other way around\n - [ ] `:MOVETOIMPL` doesn't work on constructors when there is an\n   initialization-list\n"
  },
  {
    "path": "doc/c.html",
    "content": "<HTML>\n<HEAD>\n    <META http-equiv=\"content-type\" content=\"text/html;charset=iso-8859-1\">\n    <META name=\"AUTHOR\" content=\"Luc Hermitte\">\n    <META name=\"GENERATOR\" content=\"VIM/5.7 [VI iMproved]\">\n    <META name=\"KeyWords\" content=\"vim,macro,c,java,c++,accessor\">\n\n    <title>Luc Hermitte's VIM C/C++ ftplugins</title>\n</HEAD>\n\n<BODY bgcolor=\"#ffffff\">\n\n  <table border=0 width=100% cellpadding=2 cellspacing=0 BGCOLOR=\"#6996e0\">\n    <tr>\n      <td><FONT SIZE=-1 COLOR=#ffffff>Luc Hermitte's VIM C/C++ ftplugins</FONT></td>\n      <td align=right><FONT SIZE=-1 COLOR=#ffffff>Saturday  30th  November  2002</FONT></td>\n    </tr>\n  </table>\n \n\n\n\n<html></html>\n<!-- (c) By Luc Hermitte <hermitte@free.fr>\n  -  Last Update: 30th nov 2002\n  -->\n\n<!-- --------------------------------------------------------------------- -->\n<!-- --------------------------------------------------------------------- -->\n<A NAME=\"c_cpp\">\n  <h2><FONT COLOR=#6996e0>VIM ftplugins for editing C &amp; C++ files</FONT></h2>\n</A>\n\n<ul> <!-- Indentation -->\n<p>\n    I propose/present here a set of VIM ftplugins designed for editing C++\n    files and C files. \n<p>\n    You will found all the links for downloading the described files <A\n    HREF=\"#cpp_downloads\">at the end</A> of this part.\n</ul>\n\n\n<!-- --------------------------------------------------------------------- -->\n<A NAME=\"c_set\">\n<h3><FONT COLOR=#6996e0>ftplugin for C programming</FONT></h3></A>\n<ul> <!-- Indentation -->\n<p>\n    The script that follow is meant to be placed into one of your <code><FONT\n    COLOR=#6a5acd><em>{rtp}</em></FONT>/ftplugin/c/</code> directories.\n</ul>\n\n\n<ul> <!-- Indentation -->\n<p>\n    <code>c_set.vim</code> defines many things that I found useful when programming\n    in C.  They could be used for C++ and Java programming as well.\n\n<A NAME=\"expl_c\"><h4>Features and Originalities</h4></A>\n<ul>\n    <li> Well there exist, over the WWW, a lot of configurations and mappings\n\tregarding C programming.  Once again you will find in this file\n\tshortcuts for <code><FONT COLOR=#804040><b>if</b></FONT></code>,\n\t<code><FONT COLOR=#804040><b>else</b></FONT></code>, <code>elif</code>\n\t(I know it is not a C keyword, but <code><FONT COLOR=#804040><b>else\n\tif</b></FONT></code> are), <code><FONT\n\tCOLOR=#804040><b>for</b></FONT></code>, <code><FONT\n\tCOLOR=#804040><b>while</b></FONT></code>, <code><FONT\n\tCOLOR=#804040><b>switch</b></FONT></code> and <code><FONT\n\tCOLOR=#804040><b>main</b></FONT></code>. <br>\n\n\tWhat is <em>unique</em> is the fact that if you type <code>if </code>\n\tin insert mode, it will automatically expand into ...\n<pre>\n    <FONT COLOR=#804040><b>if</b></FONT> () {\n    } </pre> \n\t<U> ... in respect of the context</U>. <em>I.e.:</em> within comments\n\tor strings (delimited by single or double quotes) <code>if </code> is\n\tnot expanded. If <em>keyword characters</em> precede the typing,\n\t<code>if </code> is not expanded as well. Thus variables like\n\t<code>tarif</code> can be used without getting any headache.<br>\n\tIn visual mode, <code>,if</code> wraps the selection within the curly\n\tbrackets and inserts <code><FONT COLOR=#804040><b>if</b></FONT>\n\t()</code> just before. In normal mode <code>,if</code> does the same\n\tthing under the consideration that the selection is considered to be\n\tthe current line under the cursor. Actually, it is not <code>,if</code>\n\tbut <code><FONT COLOR=#6a5acd>&lt;LocalLeader&gt;</FONT>if</code>,\n\twith <code><FONT COLOR=#ff00ff>maplocalleader</FONT></code> assigned by\n\tdefault to <code><FONT COLOR=#ff00ff>,</FONT></code>.<br>\n\t\n\n\tAll the three mode oriented mappings <U>respect</U> and force the\n\t<U>indentation</U> regarding the current setting and what was typed.\n<p>\n\tMore precisely, regarding the value of the buffer relative option\n\t<code><FONT COLOR=#ff00ff>b:usemarks</FONT></code> (<em>cf.</em> <A TARGET=_top HREF='../vim/settings.php#common_brackets_vim'><code>common_brackets.vim</code></A>),\n\t<code>if</code> could be expanded into : \n<pre>\n    <FONT COLOR=#804040><b>if</b></FONT> () {\n\t\n    }\n</pre> \n\n    <p> I do not present more precisely the other mappings alike. There are\n\ttwin mappings !\n\n    <li> Some other abbreviations ease the insertion of some formatted\n\tcomments.\n\n    <li> And of course there are some very classical settings for C editing.\n</ul>\n\n<h4>Dependencies :</h4>\n<ul>\n    <li> VIM 6.0+\n    <li> <A TARGET=_top HREF='../vim/general.php#misc_map_vim'><code>misc_map.vim</code></A> \n\tdefines two functions used in every mapping and abbreviation of the\n\tlanguage keywords ; it enables to define context dependent macros.\n    <li> <A TARGET=_top HREF='../vim/settings.php#common_bracket_vim'><code>common_bracket.vim</code></A>\tdefines a set of mappings that ease the management of brackets, quotes,\n\tparenthesis, <em>etc.</em>. These mappings are customized for C &amp;\n\tC++ programming.\n    <li> <code>a.vim</code> very nice when we want to swap between .h, .inl and\n\t.c and .cpp files. Could be found of <A TARGET=_top\n\tHREF=\"http://vim.sf.net/scripts/script.php?script_id=31\">sourceforge</A>\n\t-- not critical regarding the mappings defined.\n    <li> <code>LoadHeaderFile.vim</code> very nice in order to go to included\n\tfiles.  Could be found of <A TARGET=_top\n\tHREF=\"http://vim.sf.net/scripts/script.php?script_id=24\">sourceforge</A>\n\t-- not critical regarding the mappings defined.\n</ul>\n\n</ul> <!-- Indentation -->\n\n<!-- --------------------------------------------------------------------- -->\n<A NAME=\"cpp_set\">\n<h3><FONT COLOR=#6996e0>ftplugins for C++ programming</FONT></h3></A>\n<ul> <!-- Indentation -->\n<p>\n    The script that follow is meant to be placed into one of your <code><FONT\n    COLOR=#6a5acd><em>{rtp}</em></FONT>/ftplugin/cpp/</code> directories.\n<p>\n<A NAME=\"expl_cpp\"><h4>Classical features : <code>cpp_set.vim</code></h4></A>\n    <code>cpp_set.vim</code> :\n    <ul>\n\t<li> sources <code>c_set.vim</code>,\n\t<li> specializes some settings like the format of comments ;\n\t<li> adds 2-3 new mappings for <code><FONT\n\t    COLOR=#804040><b>try</b></FONT></code> &amp; <code><FONT\n\t    COLOR=#804040><b>catch</b></FONT></code> ;\n\t<li> adds shortcuts for <code><FONT\n\t    COLOR=#804040><b>public</b></FONT>:</code>, \n\t    <code><FONT COLOR=#804040><b>protected</b></FONT>:</code>,\n\t    <code><FONT COLOR=#804040><b>private</b></FONT>:</code>,\n\t    <code><FONT COLOR=#2e8b57><b>template</b></FONT>&lt;&gt;</code>,\n\t    <code><FONT COLOR=#2e8b57><b>virtual</b></FONT></code> and\n\t    <code>std::</code> ;\n\t<li> defines <code>/*&lt;space&gt;</code> that expands into :<code><FONT\n\t    COLOR=#0000ff>/** */</FONT></code>\n\t    <br> and <code>/**</code> that expands into :\n\t    <pre>\n\t<FONT COLOR=#0000ff>/**\n\t */</FONT> </pre>\n\t<li> proposes the insert-mode mapping <code><FONT\n\t    COLOR=#6a5acd>&lt;c-x&gt;</FONT>be</code> that expands \n\t    <code>algo(container_expr)</code> into\n\t    <code>algo(container_expr.begin(), container_expr.end())</code>,\n\t    where <code></code> represents the current cursor position.\n    </ul>\n\n    <h4>Enhanced features</h4>\n    The more interesting part comes with four new files full of functions and\n    commands : <ul>\n\t<li> <A HREF='#expl_cpp_options'><code>cpp_options.vim</code></A> that\n\t    is the ideal place for custom C++ preferences.\n\t<li> <A HREF='#expl_cpp_BuildTemplates'><code>cpp_BuildTemplates.vim</code></A> defines my own\n\t    template preferences regarding the format of comments and classes\n\t    -- many headers plus some doxygen constructs. \t\n\t<li> <A HREF='#expl_cpp_FindContextClass'><code>cpp_FindContextClass.vim</code></A> extracts the name\n\t    of the class the cursor is within.\n\t<li> <A HREF='#expl_cpp_InsertAccessors'><code>cpp_InsertAccessors.vim</code></A> defines certainly\n\t    one of the two most useful features : an easy way to add (to a\n\t    class) new attributes and their accessors and mutators (get and set\n\t    methods). \n\t<li> <A HREF='#expl_cpp_GotoFunctionImpl'><code>cpp_GotoFunctionImpl.vim</code></A> defines the second\n\t    most useful feature : a way to jump from the prototype to the\n\t    implementation of a function, and if the implementation has not\n\t    beeing defined yet, an empty implementation is inserted in the\n\t    <code>.cpp</code> file.\n    </ul>\n</ul>\n\n\n<!-- --------------------------------------------------------------------- -->\n<!-- --------------------------------------------------------------------- -->\n<h3><FONT COLOR=#6996e0>Some explanations about the enhanced C++\nftplugins</FONT></h3>\n<p>\n<ul> <!-- Indentation -->\n<p>\n    All the scripts that follow are meant to be placed into one of your\n    <code><FONT COLOR=#6a5acd><em>{rtp}</em></FONT>/ftplugin/cpp/</code>\n    directories.\n</ul>\n\n<!-- --------------------------------------------------------------------- -->\n<A NAME=\"expl_cpp_options\">\n<h4><FONT COLOR=#6996e0><code>cpp_options-commands.vim</code> &amp;\n<code>cpp_options.vim</code></FONT></h4></A>\n<ul> <!-- Indentation -->\n<p>\n    <code>cpp_options.vim</code> is the ideal place for custom C++ preferences\n    like the prefix and postfix notations used for member data and their\n    accessors, the file where inlines should go, if accessors must be inlined,\n    <em>etc.</em> ; this file is used to configure\n    <code>cpp_BuildTemplates.vim</code>, <code>cpp_InsertAccessors.vim</code>\n    and <code>cpp_GotoFunctionImpl.vim</code>.\n<p>\n    Drop it into your <code><FONT\n    COLOR=#6a5acd><em>{rtp}</em></FONT>/ftplugin/cpp/</code> directory ; it\n    will be shared by all your projects. And if for a particular project other\n    rules are required, copy and specialize this file into every directory\n    containing the C++ source files.\n<p>\n    <code>cpp_options-commands.vim</code> only defines the command\n    <code>:CheckOptions</code> that is used by the other scripts to load the\n    correct options (<em>i.e. </em> <code>cpp_options.vim</code>).\n</ul>\n\n<!-- --------------------------------------------------------------------- -->\n<A NAME=\"expl_cpp_BuildTemplates\">\n<h4><FONT COLOR=#6996e0><code>cpp_BuildTemplates.vim</code></FONT></h4></A>\n<ul> <!-- Indentation -->\n<p>\n    This file defines my own template preferences regarding the format of\n    comments and classes -- many \"rulers\" plus some doxygen constructs. You may\n    not be directly interested in this file ; moreover, it will evolve to take\n    advantage of <A HREF=\"#mu_template_vim\">Gergely Kontra's mu-template</A>. \n    The commands are : <ul>\n    <li> <A TARGET=_top HREF='../vim/ex_cpp_HE_h.html'><code>;HE <em>&lt;main class name&gt;</em></code></A> which produces\n\ta template for the header file dedicated to the specified class name.\n    <li> <A TARGET=_top HREF='../vim/ex_cpp_CL.html'><code>;CL <em>&lt;main class name&gt;</em></code></A> which produces a\n\tclass template for specified class name.\n    <li> <A TARGET=_top HREF='../vim/ex_cpp_BL.html'><code>;BL <em>&lt;title&gt;</em></code></A> which produces three lines\n\tof <code>'='</code> around the title -- <em>BigLines</em>.\n    <li> <A TARGET=_top HREF='../vim/ex_cpp_GR.html'><code>;GR <em>&lt;group title&gt;</em></code></A> which inserts  a\n\tDoc++/Doxygen group -- <em>GRoup</em>.\n    <li> <A TARGET=_top HREF='../vim/ex_cpp_GR.html'><code>;MGR <em>&lt;group title&gt;</em></code></A> which inserts  a\n\tDoc++/Doxygen group plus a comment line -- <em>MegaGRoup</em>.\n    <li> <code>;RI <em>&lt;class name&gt;</em></code> which moves the cursor to\n\tthe desired (regarding <code>cpp_options.vim::<FONT\n\tCOLOR=#ff00ff>g:inlinesPlace</FONT></code>) location for the\n\timplementation of the inlines of the current class --\n\t<em>ReachInlines</em>. The functions that the command calls are quite\n\tcomplex and heavily rely on the <em>Big Line</em> format. So if you\n\twant to change the format, you will have to adapt the function\n\t<code>Cpp_search4line()</code> and some other script variables. All the\n\tunderlying functions used by this command are very important for the\n\t<code>cpp_InsertAccessors.vim::AddAccessor</code> command. So, be very\n\tcareful in your customizations.\n    </ul>\n\n    <code>cpp_BuildTemplates.vim</code> needs an old version of <code>a.vim</code>.\n    <p>\n</ul>\n\n<!-- --------------------------------------------------------------------- -->\n<A NAME=\"expl_cpp_FindContextClass\">\n<h4><FONT COLOR=#6996e0><code>cpp_FindContextClass.vim</code></FONT></h4></A>\n<ul> <!-- Indentation -->\n<p>\n    Given a line number, the function (in this ftplugin) extracts the name of\n    the most embedded class around the specified line.\n<p>    \n    A this time, the template are not managed. \n<p>\n    For something like :\n<pre>\n<FONT COLOR=#6a5acd> 1:</FONT>\n<FONT COLOR=#6a5acd> 2:</FONT>    <FONT COLOR=#804040><B>class</B></FONT> A\n<FONT COLOR=#6a5acd> 3:</FONT>    {\n<FONT COLOR=#6a5acd> 4:</FONT>        <FONT COLOR=#0000ff>// ... </FONT>\n<FONT COLOR=#6a5acd> 5:</FONT>        <FONT COLOR=#804040><B>class</B></FONT> B {\n<FONT COLOR=#6a5acd> 6:</FONT>            <FONT COLOR=#0000ff>// ... </FONT>\n<FONT COLOR=#6a5acd> 7:</FONT>        };\n<FONT COLOR=#6a5acd> 8:</FONT>        <FONT COLOR=#0000ff>// ... </FONT>\n<FONT COLOR=#6a5acd> 9:</FONT>        <FONT COLOR=#804040><B>class</B></FONT> C {\n<FONT COLOR=#6a5acd>10:</FONT>            <FONT COLOR=#0000ff>// ... </FONT>\n<FONT COLOR=#6a5acd>11:</FONT>        };\n<FONT COLOR=#6a5acd>12:</FONT>    };\n<FONT COLOR=#6a5acd>13:</FONT>\n</pre>\n    The possible retrieved class names are : <FONT COLOR=#ff00ff>\"\"</FONT>\n    <FONT SIZE=-1>[1, 13]</FONT>, <FONT COLOR=#ff00ff>\"A\"</FONT> <FONT\n    SIZE=-1>[2-4,8,12]</FONT>, <FONT COLOR=#ff00ff>\"A::B\"</FONT> <FONT\n    SIZE=-1>[5-7]</FONT> and <FONT COLOR=#ff00ff>\"A::C\"</FONT> <FONT\n    SIZE=-1>[9-11]</FONT>.\n<p>\n    This script is required by <code>cpp_InsertAccessors.vim</code> and\n    <code>cpp_GotoFunctionImpl.vim</code>.\n</ul>\n\n<!-- --------------------------------------------------------------------- -->\n<A NAME=\"expl_cpp_InsertAccessors\">\n<h4><FONT COLOR=#6996e0><code>cpp_InsertAccessors.vim</code></FONT></h4></A>\n<ul> <!-- Indentation -->\n<p>\n    This file defines an easy way to add new attributes, their accessors (get\n    methods) and their mutators (set methods) to a class. <br> \n    <em>I may use \"accessor\" to also designate the \"mutator\"</em>.\n    \n<p>\n    The built accessors are moreover <U>const and ref. correct</U> in the\n    sense of the item 43 of Herb Sutter's <em>Exceptional C++</em>. BTW, if you\n    extend (with typedefs) the list of base types, you will have to extend the\n    function <code>Cpp_IsBaseType()</code>.\n<p>\n    To use this feature, place the cursor where you want your attributes\n    (internal data members) to be written to, then press <code>;AA</code>. Then\n    first, you will be asked for the type of the new attribute and its name.\n    And then, you will be asked whether you want : <ul>\n\t<li> a get accessor or may be a proxy-get accessor -- <em>cf.</em>\n\t    Scott Meyer's More Effective C++ for instance ;\n\t<li> a set mutator -- may be a proxy-set one ;\n\t<li> a reference accessor -- may be a proxy-ref one ;\n    </ul> \n    Finally, you will have to move the accessors to their desired location.\n<p> \n    Regarding the customization facilities, through\n    <code>cpp_options.vim</code> you can : <ul>\n\t<li> specify the notation you want to use for the internal data member\n\t    ; for instance here are some common notations :\n\t    <code>m_<em>Foo</em></code> (Microsoft's one),\n\t    <code><em>Foo</em>_</code> (Herb Sutter's one),\n\t    <code>_<em>Foo</em></code> (the one you should forget about),\n\t    <code><em>Foo</em></code> (the very lazy one), <em>etc.</em>.\n\t<li> specify the notation you want to use for the accessors ;\n\t    for instance the get accessor to the attribute\n\t    <code><em>Foo</code></em> could be\n\t    \"<code>Get<em>Foo</em>()</code>\", or\n\t    \"<code>get<em>Foo</em>()</code>\", or\n\t    \"<code>get_<em>Foo</em>()</code>\" and so on. And the same for the\n\t    set and the reference accessors.\n\t<li> specify how you want the implementation of the accessors\n\t    to appear : <ul>\n\t\t<li> within the declaration of the class -- lazy behavior\n\t\t    that should disappear thanks to this VIM script ;\n\t\t<li> as inlines : either at the end of the header file\n\t\t    containing the class declaration or in a separate inline\n\t\t    file ;\n\t\t<li> as non-inlines in the implementation file (.cpp).\n\t    </ul>\n    </ul>\n<p>\n    Here is a little example of <A HREF='ex_cpp_AA_h.html'>header file</A> and\n    the corresponding <A HREF='ex_cpp_AA_inl.html'>inline file</A>\n    generated for : <ul>\n\t<li> <code><FONT COLOR=#ff00ff>g:implPlace=1</FONT></code> --\n\t    implemented as inlines ;\n\t<li> <code><FONT COLOR=#ff00ff>g:inlinesPlace=1</FONT></code> --\n\t    inlines in a separate file ;\n\t<li> an <code><FONT COLOR=#2e8b57><B>int</B></FONT></code> attribute\n\t    named <code>AnInteger</code> for which I asked for a get, a set and\n\t    a reference accessor.\n\t<li> an <code>CComplexThing</code> attribute named\n\t    <code>AComplexThing</code> for which I asked for a proxy-get (of\n\t    type <code>CT_Proxy</code>), a set and a reference accessor ;\n    </ul>\n    As you can, see, the declarations have to be moved !\n<p>\n    Note : the inline and the definition files don't need to exist. They are\n    generated <U>automatically</U>.\n</ul>\n\n<!-- --------------------------------------------------------------------- -->\n<A NAME=\"expl_cpp_GotoFunctionImpl\">\n<h4><FONT COLOR=#6996e0><code>cpp_GotoFunctionImpl.vim</code></FONT></h4></A>\n<ul> <!-- Indentation -->\n<p>\n    This file defines an easy way to jump from a function-prototype to its\n    implementation ; if the implementation does exist yet, a default one is\n    generated on the fly.\n<p>\n    This ftplugin has been first inspired by <A TARGET=_top\n    HREF=\"http://vim.sf.net/tips/tip.php?tip_id=335\">Leif Wickland's VIM\n    TIP#335</A> (on sourceforge) and Robert Kelly IV's improvments. Then I\n    added what I've been waiting to do for a longtime: a way to jump the\n    implementation of a function.\n<p>\n    Some other features : <ul>\n    <li> Works with member and non-member functions. If the class is nested\n\tinto other classes, the real class name will be used ;\n    <li> Accepts prototypes written on several lines, but it won't be able to\n\tdetect the return type if it is not written on the same line as the\n\tfunction's name.<br>\n\tIf you get a message saying you're not within a function-prototype, may\n\tbe it comes from your cursor placement : it must be between the line of\n\tthe function's name and before the closing parenthesis.\n    <li> Any comment ending a line (within the function-prototype) will be\n\ttrimmed.\n    <li> Compatible with <code>mu-template</code> : <em>i.e.</em> it won't\n\tcomplains or do any weird and undesired thing.\n    <li> Options are set into <code>cpp_options.vim</code> and can be overriden\n\twhen invoking the command.\n    </ul>\n<p>\n    The ftplugin defines : <ul>\n\t<li> the command <code>:GIMPL</code> (<code><em>GOTO_IMPL</em></code>)\n\t    that will provoke the jump ; The cursor must be placed between the\n\t    line of the function's name and the corresponding closing\n\t    parenthesis.\n\t<li> the INSERT mode mapping <code><FONT\n\t    COLOR=#6a5acd>&lt;C-X&gt;</FONT>i</code> ;\n\t<li> the normal mode mappings <code>;GI</code> and <code><FONT\n\t    COLOR=#6a5acd>&lt;C-W&gt;</FONT>i</code>.\n    </ul> The mappings can be overrided by adding, in a file loaded before this\n\tftplugin, something like : <pre>\n\t<FONT COLOR=#804040><b>imap</b></FONT> <FONT COLOR=#6a5acd>&lt;buffer&gt;</FONT> whateverIWant <FONT COLOR=#6a5acd>&lt;Plug&gt;</FONT>GotoImpl\n\t<FONT COLOR=#804040><b>nmap</b></FONT> <FONT COLOR=#6a5acd>&lt;buffer&gt;</FONT> whateverIWant <FONT COLOR=#6a5acd>&lt;Plug&gt;</FONT>GotoImpl\n\t</pre>\n<p>\n    Several options are available (idea from Robert Kelly IV) : <ul>\n    <li> <code>ShowVirtual</code> (0/1) : determines whether we want the\n\t<em>virtuality</em> of the member function to be reminded along with\n\tthe implementation ;\n    <li> <code>ShowStatic</code> (0/1) : determines whether we want the\n\t<em>staticity</em> of the function to be reminded ;\n    <li> <code>ShowDefaultParam</code> (0/1/2) : determines whether we want the\n\tdefault value of the parameters to be remininded to us.\n    </ul> \n    <FONT SIZE=-1>[0: no reminder ; 1: text with comments ; 2: like 1, but the\n    spaces are trimmed]</FONT> <br>\n\n    The default values for these options are taken into\n    <code>cpp_options.vim</code> that can define the variables: <code><FONT\n    COLOR=#ff00ff>g:cpp_ShowVirtual</FONT></code><FONT COLOR=#ff00ff>,\n    <code><FONT COLOR=#ff00ff>g:cpp_ShowStatic</FONT></FONT></code> and\n    <code><FONT COLOR=#ff00ff>g:cpp_ShowDefaultParams</FONT></code>. <br>\n\n    However, when using the command <code>:GIMPL</code>, we can specify values\n    for these different options. The format beeing :\n    <code><em>&lt;name_of_the_option&gt;</em>(\\d\\+\\|on\\|off)</code>. For\n    instance : <br>\n\t<code>    :GIMPL ShowVirtualoff ShowDefaultParams2</code>.\n    \n<p>\n\n</ul>\n\n<!-- --------------------------------------------------------------------- -->\n<A NAME=\"cpp_downloads\"><h3><FONT COLOR=#6996e0>Downloads</FONT></h3></A>\n<ul> <!-- Indentation -->\n    <table BORDERCOLOR=#6996e0 border=1 cellspacing=0 cellpadding=2>\n\t<tr><td><A NAME=\"lh_cpp_tar_gz\">\n\t\t<A HREF='../vim/ressources//lh-cpp_tar.gz.html'><code>lh-cpp.tar.gz</code></A><br><A HREF='../vim/ressources//lh-cpp.tar.gz'>&lt;raw file&gt;</A><br><center><FONT SIZE=-1 COLOR=#a0a0a0>30th&nbsp;&nbsp;November&nbsp;&nbsp;2002</FONT></center></A></td>\n\t    <td COLSPAN=2> This tarball contains all the following files and a\n\t\tcopy of all the files they rely on. <br>\n\t\tSo, if you plan to have a complete and easy installation of my\n\t\tC &amp; C++ ftplugins, unpack this tarball archive into one\n\t\tdirectory from your <code><b><FONT\n\t\tCOLOR=#2e8b57>'runtimepath'</FONT></b></code>.\n\t    </td>\n\t</tr>\n\t<tr><td><A NAME=\"c_set\">\n\t\t<A HREF='../vim/ressources/vimfiles/ftplugin/c/c_set_vim.html'><code>c_set.vim</code></A><br><A HREF='../vim/ressources/vimfiles/ftplugin/c/c_set.vim'>&lt;raw file&gt;</A><br><center><FONT SIZE=-1 COLOR=#a0a0a0>12th&nbsp;&nbsp;November&nbsp;&nbsp;2002</FONT></center></A>\n\t\t<br><center><FONT SIZE=-2>VIM 6.x only</FONT></center>\n\t    </td>\n\t    <td> The main C ftplugin. It defines several settings plus a lot\n\t\tof mappings for C keywords.\n\t\t<table width=100%>\n\t\t    <tr><td ALIGN=right><FONT SIZE=-1 COLOR=#808080>\n\t\t\t<A HREF=\"#expl_c\">more info...</A></FONT></td>\n\t\t    </tr>\n\t\t</table>\n\t    </td>\n\t    <td> Requires : \n\t\t<A TARGET=_top HREF='../vim/general.php#misc_map_vim'><code>misc_map.vim</code></A>,\n\t\t<A TARGET=_top HREF='../vim/settings.php#common_bracket_vim'><code>common_bracket.vim</code></A>. Wants <code>a.vim</code> and\n\t\t<code>LoadHeaderFile.vim</code>.\n\t    </td>\n\t</tr>\n\t<tr><td><A NAME=\"cpp_set\">\n\t\t<A HREF='../vim/ressources/vimfiles/ftplugin/cpp/cpp_set_vim.html'><code>cpp_set.vim</code></A><br><A HREF='../vim/ressources/vimfiles/ftplugin/cpp/cpp_set.vim'>&lt;raw file&gt;</A><br><center><FONT SIZE=-1 COLOR=#a0a0a0>12th&nbsp;&nbsp;November&nbsp;&nbsp;2002</FONT></center></A>\n\t\t<br><center><FONT SIZE=-2>VIM 6.x only</FONT></center>\n\t    </td>\n\t    <td> The main C++ ftplugin. It defines some new mappings for C++\n\t\tkeywords, enhanced the comments management and loads all the\n\t\tother C++ plugins.\n\t\t<table width=100%>\n\t\t    <tr><td ALIGN=right><FONT SIZE=-1 COLOR=#808080>\n\t\t\t<A HREF=\"#expl_cpp\">more info...</A></FONT></td>\n\t\t    </tr>\n\t\t</table>\n\t    </td>\n\t    <td> Requires : \n\t\t<A HREF='#c_set'><code>c_set.vim</code></A>, and every following\n\t\t<code>cpp_<em>.*</em>.vim</code>.\n\t    </td>\n\t</tr>\n\t<tr><td><A NAME=\"cpp_options_commands_vim\">\n\t\t<A HREF='../vim/ressources/vimfiles/ftplugin/cpp/cpp_options-commands_vim.html'><code>cpp_options-commands.vim</code></A><br><A HREF='../vim/ressources/vimfiles/ftplugin/cpp/cpp_options-commands.vim'>&lt;raw file&gt;</A><br><center><FONT SIZE=-1 COLOR=#a0a0a0>12th&nbsp;&nbsp;November&nbsp;&nbsp;2002</FONT></center></A></td>\n\t    <td> Script in charge of the management of the options. <br>\n\t\t<em>I.e.</em> it loads the appropriate\n\t\t<A HREF=\"#cpp_options_vim\">options-file</A>.\n\t\t<table width=100%>\n\t\t    <tr><td ALIGN=right><FONT SIZE=-1 COLOR=#808080>\n\t\t\t<A HREF=\"#expl_cpp_options\">more info...</A></FONT></td>\n\t\t    </tr>\n\t\t</table>\n\t    </td>\n\t    <td> Needed by : <code>cpp_BuildTemplates.vim</code>,\n\t\t<code>cpp_GotoFunctionImpl.vim</code> and\n\t\t<code>cpp_InsertAccessors.vim</code>.\n\t    </td>\n\t</tr>\n\t<tr><td><A NAME=\"cpp_options_vim\">\n\t\t<A HREF='../vim/ressources/vimfiles/ftplugin/cpp/cpp_options_vim.html'><code>cpp_options.vim</code></A><br><A HREF='../vim/ressources/vimfiles/ftplugin/cpp/cpp_options.vim'>&lt;raw file&gt;</A><br><center><FONT SIZE=-1 COLOR=#a0a0a0>12th&nbsp;&nbsp;November&nbsp;&nbsp;2002</FONT></center></A></td>\n\t    <td> The options-file, designated place for customizing the\n\t\tpolicies of the following files. It is meant to be overriden\n\t\tinto your current working directory.\n\t\t<table width=100%>\n\t\t    <tr><td ALIGN=right><FONT SIZE=-1 COLOR=#808080>\n\t\t\t<A HREF=\"#expl_cpp_options\">more info...</A></FONT></td>\n\t\t    </tr>\n\t\t</table>\n\t    </td>\n\t    <td> Needed by : <code>cpp_BuildTemplates.vim</code>,\n\t\t<code>cpp_GotoFunctionImpl.vim</code> and\n\t\t<code>cpp_InsertAccessors.vim</code>.\n\t    </td>\n\t</tr>\n\t<tr><td><A NAME=\"cpp_BuildTemplates_vim\">\n\t\t<A HREF='../vim/ressources/vimfiles/ftplugin/cpp/cpp_BuildTemplates_vim.html'><code>cpp_BuildTemplates.vim</code></A><br><A HREF='../vim/ressources/vimfiles/ftplugin/cpp/cpp_BuildTemplates.vim'>&lt;raw file&gt;</A><br><center><FONT SIZE=-1 COLOR=#a0a0a0>12th&nbsp;&nbsp;November&nbsp;&nbsp;2002</FONT></center></A>\n\t\t<br><center><FONT SIZE=-2>VIM 6.x only</FONT></center>\n\t    </td>\n\t    <td> Defines some template preference for the formats of comments\n\t\tand classes.\n\t\t<table width=100%>\n\t\t    <tr><td ALIGN=right><FONT SIZE=-1 COLOR=#808080>\n\t\t\t<A HREF=\"#expl_cpp_BuildTemplates\">more info...</A>\n\t\t    </FONT></td></tr>\n\t\t</table>\n\t    </td>\n\t    <td> Requires : <code>a.vim</code></td>\n\t</tr>\n\t<tr><td><A NAME=\"parse-class_sed\">\n\t\t<A HREF='../vim/ressources/vimfiles/ftplugin/cpp/parse-class_sed.html'><code>parse-class.sed</code></A><br><A HREF='../vim/ressources/vimfiles/ftplugin/cpp/parse-class.sed'>&lt;raw file&gt;</A><br><center><FONT SIZE=-1 COLOR=#a0a0a0>15th&nbsp;&nbsp;March&nbsp;&nbsp;2002</FONT></center></A>\n\t    </td>\n\t    <td> Multi-line extraction of class names.</td>\n\t    <td> Depreciated ; Used to be required by\n\t\t<code>cpp_FindContextClass.vim</code> </td>\n\t</tr>\n\t<tr><td><A NAME=\"cpp_FindContextClass_vim\">\n\t\t<A HREF='../vim/ressources/vimfiles/ftplugin/cpp/cpp_FindContextClass_vim.html'><code>cpp_FindContextClass.vim</code></A><br><A HREF='../vim/ressources/vimfiles/ftplugin/cpp/cpp_FindContextClass.vim'>&lt;raw file&gt;</A><br><center><FONT SIZE=-1 COLOR=#a0a0a0>12th&nbsp;&nbsp;November&nbsp;&nbsp;2002</FONT></center></A>\n\t\t<br><center><FONT SIZE=-2>VIM 6.x only</FONT></center>\n\t    </td>\n\t    <td> Extracts name of classes.\n\t\t<table width=100%>\n\t\t    <tr><td ALIGN=right><FONT SIZE=-1 COLOR=#808080>\n\t\t\t<A HREF=\"#expl_cpp_FindContextClass\">more info...</A>\n\t\t    </FONT></td></tr>\n\t\t</table>\n\t    </td>\n\t    <td> <br></td>\n\t</tr>\n\t<tr><td><A NAME=\"cpp_InsertAccessors_vim\">\n\t\t<A HREF='../vim/ressources/vimfiles/ftplugin/cpp/cpp_InsertAccessors_vim.html'><code>cpp_InsertAccessors.vim</code></A><br><A HREF='../vim/ressources/vimfiles/ftplugin/cpp/cpp_InsertAccessors.vim'>&lt;raw file&gt;</A><br><center><FONT SIZE=-1 COLOR=#a0a0a0>12th&nbsp;&nbsp;November&nbsp;&nbsp;2002</FONT></center></A>\n\t\t<br><center><FONT SIZE=-2>VIM 6.x only</FONT></center>\n\t    </td>\n\t    <td> Enables to easily add attributes and their accessors.\n\t\t<table width=100%>\n\t\t    <tr><td ALIGN=right><FONT SIZE=-1 COLOR=#808080>\n\t\t\t<A HREF=\"#expl_cpp_InsertAccessors\">more info...</A>\n\t\t    </FONT></td></tr>\n\t\t</table>\n\t    </td>\n\t    <td> Requires : <code>cpp_options.vim</code>,\n\t\t<code>cpp_BuildTemplates.vim</code>,\n\t\t<code>cpp_FindContextClass.vim</code>, <code>a.vim</code>.\n\t    </td>\n\t</tr>\n\t<tr><td><A NAME=\"cpp_GotoFunctionImpl.vim\">\n\t\t<A HREF='../vim/ressources/vimfiles/ftplugin/cpp/cpp_GotoFunctionImpl_vim.html'><code>cpp_GotoFunctionImpl.vim</code></A><br><A HREF='../vim/ressources/vimfiles/ftplugin/cpp/cpp_GotoFunctionImpl.vim'>&lt;raw file&gt;</A><br><center><FONT SIZE=-1 COLOR=#a0a0a0>12th&nbsp;&nbsp;November&nbsp;&nbsp;2002</FONT></center></A>\n\t\t<br><center><FONT SIZE=-2>VIM 6.x only</FONT></center>\n\t    </td>\n\t    <td> Defines a command and some mappings to jump from a function\n\t\tprototype to its implementation ; if the implementation does\n\t\texist yet, a default one is generated on the fly.\n\t\t<table width=100%>\n\t\t    <tr><td ALIGN=right><FONT SIZE=-1 COLOR=#808080>\n\t\t\t<A HREF=\"#expl_cpp_GotoFunctionImpl\">more info...</A>\n\t\t    </FONT></td></tr>\n\t\t</table>\n\t    </td>\n\t    <td> Requires : <code>cpp_options.vim</code>,\n\t\t<code>cpp_FindContextClass.vim</code>, <code>a.vim</code>.\n\t    </td>\n\t</tr>\n\t<tr><td><A NAME=\"lh_cpp_readme_txt\"><A \n\t\tHREF=\"ressources/vimfiles/ftplugin/c/doc/lh-cpp-readme.txt\"\n\t\t>lh-cpp-readme.txt</A></A></td>\n\t    <td> The VIM documentation for all these scripts. </td>\n\t    <td> Written as a part of the tarball archive. </td>\n\t</tr>\n\t<tr><td><A NAME=\"a_vim\"><A TARGET=_top\n\t\tHREF=\"http://vim.sf.net/scripts/script.php?script_id=31\"\n\t\t>a.vim</A></A></td>\n\t    <td> Commands to switch between source files and header files.</td>\n\t    <td> Maintained on sourceforce.</td>\n\t</tr>\n\t<tr><td><A NAME=\"LoadHeaderFile_vim\"><A TARGET=_top\n\t\tHREF=\"http://vim.sf.net/scripts/script.php?script_id=24\"\n\t\t>LoadHeaderFile.vim</A></A></td>\n\t    <td> Loads a file from a <code>#include</code> line.\n\t    </td>\n\t    <td> Maintained on sourceforce.</td>\n\t</tr>\n\t<tr><td><A NAME=\"mu_template_vim\"><A TARGET=_top\n\t\tHREF=\"http://vim.sf.net/scripts/script.php?script_id=222\"\n\t\t>mu-template.vim</A> <br>\n\t\t<FONT SIZE=-1>Local copy:\n\t\t<A HREF='../vim/ressources/vimfiles/after/plugin/mu-template_vim.html'><code>mu-template.vim</code></A><br><A HREF='../vim/ressources/vimfiles/after/plugin/mu-template.vim'>&lt;raw file&gt;</A><br><center><FONT SIZE=-1 COLOR=#a0a0a0>30th&nbsp;&nbsp;November&nbsp;&nbsp;2002</FONT></center></A></FONT><br>\n\t\t<FONT SIZE=-1>Archive with some templates:\n\t\t<A HREF=\"ressources/mu-template.tar.gz\">mu-template.tar.gz</A></FONT>\n\t\t<br><center><FONT SIZE=-2>VIM 6.x only</FONT></center>\n\t    </td>\n\t    <td> Gergely Kontra's script. It permits to (automatically) load\n\t\ttemplate files. Little to little, I will use this plugin to\n\t\treplace some of my <code>cpp_BuildTemplates.vim</code>'s\n\t\tfunctions. <br>\n\t\tThe version I propose here has been enhanced to support many\n\t\tother things and to be compatible with my other scripts.\n\t    </td>.\n\t    <td> Initial version maintained on sourceforce; <br>\n\t\t Can takes advantage of \n\t\t<A TARGET=_top HREF='../vim/general.php#searchInRuntime_vim'><code>searchInRuntime.vim</code></A> \n\t    </td>\n\t</tr>\n    </table>\n</ul>\n\n\n<!-- --------------------------------------------------------------------- -->\n<p>\n  <table border=0 width=100% cellpadding=2 cellspacing=0 BGCOLOR=\"#6996e0\">\n    <tr>\n      <td><A HREF='http://hermitte.free.fr/vim/settings.php' TARGET='_top']><FONT SIZE=-1 COLOR=#ffffff>Back to the ftplugings page</FONT></A><FONT SIZE=-1 COLOR=#ffffff></FONT></td>\n      <td align=right><A HREF='mailto:hermitte@free.fr']><FONT SIZE=-1 COLOR=#ffffff>hermitte@free.fr</FONT></A><FONT SIZE=-1 COLOR=#ffffff></FONT></td>\n    </tr>\n  </table>\n \n</BODY>\n\n</HTML>\n"
  },
  {
    "path": "doc/lh-cpp-readme.txt",
    "content": "*lh-cpp-readme.txt*     C & C++ ftplugins short presentation (v2.2.0)\n                        For Vim version 7.x.    Last change: 30th Jun 2016\n\n                        By Luc Hermitte\n                        <hermitte {at} free {dot} fr>\n\n\n------------------------------------------------------------------------------\nThis a very short guide to the C&C++ ftplugin suite lh-cpp\n\nContents~\n|lh-cpp-features|       The features proposed by the ftplugins\n|lh-cpp-first-steps|    Your first steps with these ftplugins\n|Files-from-lh-cpp|     The files that compose the archive\n|add-local-help|        Instructions on installing this file (:helptags %:h)\n\n\n------------------------------------------------------------------------------\n                                                        *lh-cpp-features*\nFeatures~\n|C_settings|                    Various settings\n|brackets-for-C|                Bracketing system\n|C_control-statements|          Control statements for C editing (for, if, etc)\n  |C_switch_enum|                 Expands an enum into a switch statement\n|C_snippets|                    Other C snippets and shortcuts\n|C++_control-statements|        Control statements for C++ editing (try, ...)\n|C++_accessors|                 C++ accessors & some templates skeletons\n|C++_jump_implementation|       Jumping to functions-implementation\n|C++_function_doxygenation|     Doxygenize a function prototype\n|C++_templates|                 Skeletons, snippets, and wizards provided\n  |C_snippet_realloc|\n  |C++_template_new|\n  |C++_template_class|\n  |C++_template_default-constructor|\n  |C++_template_copy-constructor|\n  |C++_template_copy-and-swap|\n  |C++_template_assignment-operator|\n  |C++_template_destructor|\n|C++_Override|                  Function overriding helper\n|C++_unmatched_functions|       Search for declared ad undefined functions (or\n                              the other way around)\n|C++_inspection|                Inspection of various properties (children,\n                              ancestors, ...)\n|C++_options|                   Options for different features (i.e. ftplugins)\n ...|C++_doxygen-options|       Options related to Doxygen.\n|lh-cpp_API|                    Functions available to write your own\n                              ftplugins and templates.\n ...|lh#cpp#dox#|               Doxygen related functions\n\n|mu-template.txt|               Gergely Kontra's mu-template\n|previewWord.vim|               Georgi Slavchev's previewWord.vim\n|C_folding| |C++_folding|         C & C++ folding\n|search-in-runtimepath|         Searching in various directories lists\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                                        *C_settings*\n    Various settings from c_set.vim~\n    File:       ftplugin/c/*c_set.vim*\n\n    Vim-options~\n        'formatoptions' is set `to' `croql'\n        'cindent'       is set.\n        'cinoptions'    is set to `g0,t0`\n                                (`g0,t0,h1s` for C++ with |cpp_set.vim|).\n        'define'        is set to recognize defines and constants.\n        'comments'      is set to `sr:/*,mb:*,exl:*/,://`\n        'isk'           is completed with `#`, thus `#if` is considered to\n                        be a keyword, and looses `-` this `ptr->foo` is\n                        correctly separated.\n        'ch'            is set to 2.\n        'showmode'      is unset.\n        'dictionary'    is completed with `{rtp}/ftplugin/c/word.list`.\n        'complete'      is completed with `k`, and looses `i` (to prevent\n                        interminable header-file parsing)\n        'localleader'   is set to `,`, unless it is already defined.\n        'suffixesadd'   is completed with `.h` and `.c`.\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                                        *brackets-for-C*\nBracketing system~\nFiles:      |bracketing.base.vim| & |common_brackets.vim|\nRequires:   |lh-brackets| (needed); |Triggers.vim| (supported)\nHelp:       <http://github.com/LucHermitte/lh-brackets>\n            <http://github.com/LucHermitte/lh-cpp#brackets>\nLicense:    The generated code is under license exception to GPLv3\n            <http://github.com/LucHermitte/lh-cpp/blob/master/License.md>\n\nOptions:\n    |[bg]:usemarks|                                 (0/[1])\n        to enable the insertion of |markers|.\n    |g:marker_prefers_select|                       (0/[1])\n        select or echo the text within marker.\n    |g:marker_select_empty_marks|                   (0/[1]).\n        select or delete markers on !jump!\n    and many more that are pointless here.\n\nMappings defined in this particular configuration:\n    |!mark!|    inserts a |marker| -- default: «»\n    |!jump!|    jumps to the next marker\n    |!jumpB!|   jumps to the previous marker\n    |<M-Ins>|   shortcut to !mark!    ; can be redefined\n    |<M-Del>|   shortcut to !jump!    ; can be redefined\n    |<M-S-Del>| shortcut to !jumpB!   ; can be redefined\n imaps\n    {       {\\n\\n}  + |markers| (if |[bg]:usemarks|==1) and cursor positioned\n    #{      {}      + |markers| (if |[bg]:usemarks|==1) and cursor positioned\n    (       ()      + |markers| (if |[bg]:usemarks|==1) and cursor positioned\n    [       []      + |markers| (if |[bg]:usemarks|==1) and cursor positioned\n    \"       \"\"      + |markers| (if |[bg]:usemarks|==1) and cursor positioned\n    '       ''      + |markers| (if |[bg]:usemarks|==1) and cursor positioned\n    <F9>    toggles the 4 previous mappings   ; requires |Triggers.vim|\n    <M-F9>  toggles the value of |[bg]:usemarks| ; requires |Triggers.vim|\n\n    <       expands into <!cursor!>!mark! if the opening angle-bracket\n        immediatelly follows `#include`, a C++ cast, `template` or\n        `typename`. Otherwise, it is not expanded.\n\n n&vmap:\n    {, (, '', \"\", <localleader>[\n       Surround the current selection (or word in |Normal-mode|) with the\n       bracket-like character used in the mapping.\n    <localleader>{\n       Insert a pair of curly brackets around the current line (/visual\n       selection). It is done in respect of |[bg]:usemarks|.\n\n+ some mappings from auxtex.vim to manipulate brackets\n    *<M-b>x* *<M-b><Delete>* : delete a pair of brackets\n    *<M-b>(*  replaces the current pair of brackets with parenthesis\n    *<M-b>[*  replaces the current pair of brackets with square brackets\n    *<M-b>{*  replaces the current pair of brackets with curly brackets\n    *<M-b><*  replaces the current pair of brackets with angle brackets\n    *<M-b>\\*  toggles the backslash on a pair of brackets\n\nNB: The brackets mappings only insert the markers when |[bg]:usemarks|==1,\n    and outside comments and string contexts.\n    They are buffer relative.\n\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                                    *C++_current_function*\n                                                    *C++_[[*    *C++_][*\n|[[| and |][| have been overriden for C++ functions. Instead of jumping to the\nprevious/next `{`/`}` in the first column, they jump to the start/end of the\ncurrent function.\n\nOn this topic, |lh-dev| also provides |v_if| and |o_if| mappings that select\nthe current function (this feature is not restricted to C++).\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                                    *C_control-statements*\nC Control statements~\nFile:       ftplugin/cpp/|c_snippets.vim|\nRequires:   |lh-brackets| (needed)\nHelp:       <http://github.com/LucHermitte/lh-cpp#code-snippets>\nLicense:    The generated code is under license exception to GPLv3\n            <http://github.com/LucHermitte/lh-cpp/blob/master/License.md>\n\nMappings and abbreviations defined: [always buffer-relative]\n abbr: if    if {\\n}        + |markers| (if |[bg]:usemarks|==1)    *C_if*\n                            + cursor positioned\n abbr: elif   else if {\\n}      + ...                          *C_elif*\n abbr: else   if {\\n}           + ...                          *C_else*\n abbr: while  while {\\n}        + ...                          *C_while*\n abbr: do     do{\\n}while()     + ...                          *C_do*\n abbr: for    for(;;) {\\n}      + ...                          *C_for*\n abbr: switch switch {\\n}       + ...                          *C_switch*\n abbr: Ymain  int main() \\n{\\n} + ...                          *C_main*\n\n n&vmap: <localleader>if , elif, else, wh, for & main\n        Insert the control-statement around the current line (/visual\n        selection). It is also done in respect of |[bg]:usemarks|.\n\n n&vmap: <localleader><localleader>if , elif, wh, for\n        The current line (/visual selection) is used as the\n        conditional expression of the control statement inserted. It is\n        also done in respect of |[bg]:usemarks|.\n\nOptions:\n    * Regarding the control statements (|C_if|, |C_else|, |C_while|,\n      |C_for|, |C_switch|), the style to apply on the inserted snippets is\n      defined thanks to lh-dev |:AddStyle| command.\n      [By default, K&R way of placing brackets is used]\n\n      Note: in the past, this plugin was relying on *g:c_nl_before_bracket*\n      and *g:c_nl_before_curlyB* to control brackets placement. These options\n      have been deprecated. They are still used however in one last place: the\n      |C++_accessors| feature.\n\nNB: * |[bg]:usemarks| is still taken into account.\n    * Works even if the bracketing system is not installed or deactivated\n      (with <F9>).\n    * Not tested with other bracketing systems than the one I propose.\n    * Within comment-, string- or character-context, the abbreviations are\n      not expanded. Variables like 'tarif' can be used with no problem.\n    * These abbreviations will not insert undesired white-space.\n    * Also contains my different settings.\n    * To tune more precisely how the lines are indented, check 'cindent'.\n    * If the visual selection exactly matches a |marker|, then the\n      visual-mode mappings will result in the use of the equivalent\n      abbreviations.\n    * The normal- and visual-modes mappings do respect\n      the current coding style (see |lhdev-style|).\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                                    *C_switch_enum*\n                                                    *<Plug>SwitchEnum*\nMapping: ~\n   *i_CTRL-X_se* expands the name of the enum (type, or variable) before the\n   cursor into a switch statement.\n\n   Given: >\n        enum E { NO, YES, MAX__ };\n        E var;\n\n        var<c-x>se\n<   will expand into: >\n        switch (var)\n        {\n            case YES:\n                «YES-code»;\n                break;\n            case NO:\n                «NO-code»;\n                break;\n            default:\n                «default-code»;\n                break;\n        }\n\nRequirements:~\nThis feature requires a ctags database where to fetch the enum definition.\nIt also requires |lh-dev|, and |mu-template|.\n\nKnown issues:~\nAt this time, the plugin is not capable of respecting the declaration order of\nthe enumerated values. The switch will iterate on the enumerated values\nfollowing the lexical order.\n\nOptions~\nThe default mapping to |i_CTRL-X_se| can be overridden with for instance: >\n    imap <buffer> <silent> <leader>se <Plug>SwitchEnum\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                                    *C_snippets*\nOther snippets and shortcuts from c_snippets.vim~\nFile:       ftplugin/c/*c_snippets.vim*\nLicense:    The generated code is under license exception to GPLv3\n            <http://github.com/LucHermitte/lh-cpp/blob/master/License.md>\n\nMappings and abbreviations~\n    *#n*         Expands into \"#include\", in respect of the context.\n    *#d*         Expands into \"#define\", in respect of the context.\n    *#i*         Expands into \"#ifdef\", in respect of the context.\n    *#e*         Expands into \"#endif\", in respect of the context.\n    *<M-r>*      Expands into \"return ;\"\n    *?:*         Expands into \"?...:...;\"\n    *<M-v>*      Surrounds the selection with `/*...*/`\n    *i_CTRL-X_i* Completes the current path before the cursor as a file to be\n               included. Search the files into the *(bpg):paths.includes*\n               variable (list of directory glob patterns -- see |wildcard|).\n               See also lh-dev |n_CTRL-X_i|\n    *<localleader>0* Surrounds the line selected with `#if 0...#endif`\n    *<localleader>1* Surrounds the line selected with `#if 0...#else\\n#endif`\n                   See also the *c/comment* snippet that takes a count to\n                   determine where the `#else` should go.\n                   See also |KeepPoundIfPath|.\n\nTo prevent these Mappings and abbreviations to be defined, set\n|g:lh_cpp_snippets| to 0.\n\nOn the subject of `#if 0/1...#else...#endif`, the command *:KeepPoundIfPath*\ncan remove the trUe or the false path. It takes one parameter: 1 or 0 to\nindicate which path must be kept.\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                                    *C++_control-statements*\nC++ Control statements and other shortcuts~\nFile:       ftplugin/cpp/*cpp_snippets.vim*\nRequires:   |C_control-statements|\nHelp:       <http://github.com/LucHermitte/lh-cpp#code-snippets>\nLicense:    The generated code is under license exception to GPLv3\n            <http://github.com/LucHermitte/lh-cpp/blob/master/License.md>\n\nMappings and abbreviations defined: [always buffer-relative]\n abbr: namespace namespace {\\n} + markers and cursor pos.    *C_namespace*\n       expanded only in it does not follow `using`\n abbr: try    try{\\n}catch(){\\n} + markers and cursor pos.   *C_try*\n abbr: catch  catch(){\\n}    + markers and cursor positioned *C_catch*\n abbr: pub    public:                                        *C_pub*\n abbr: pro    protected:                                     *C_pro*\n abbr: pri    private:                                       *C_pri*\n abbr: tpl    template<>                                     *C_tpl*\n abbr: virt   virtual                                        *C_virt*\n abbr: delate delta\n abbr: firend friend\n imap: <M-s> std::                                           *Ci_META-s*\n imap: <M-b> boost:: or boost/                               *Ci_META-b*\n imap: <M-l> luc_lib::                                       *Ci_META-l*\n            (very personal mapping you won't need)\n\n imap: <M-t> \"typedef\"/\"template\" depending on the context   *Ci_META-t*\n imap: <c-x>be                                               *Ci_CTRL-X_be*\n imap: <c-x>rbe                                              *Ci_CTRL-X_rbe*\n        Duplicates the text within parenthesis, add a comma between the two\n        occurrences, and append `.begin()` and `.end()` (or `rbegin()`,\n        `rend()`) to each.\n        Depending of the option *[bg]:({ft}_)begin_end_style* , the function\n        used could be member functions, or free unqualified (or not)\n        functions. Possible values are:\n        - `c++98` -> ``%1.%2()`,` default in C++98\n        - `std`   -> ``std::%2(%1)`,` default in C++11 (|lh#cpp#use_cpp11()|)\n        - `boost` -> ``boost::%2(%1)`,` default in C++11 (|lh#cpp#use_cpp11()|)\n        - `adl`   -> ``%2(%1)`,` default in C++11 (|lh#cpp#use_cpp11()|)\n        With %1 being replaced with the container, and %2 with `begin` or\n        `end`.\n\n\n imap: /*<space>    /** */!mark!                             *C++_comments*\n imap: /*!          /**\\n*/!mark!\n\n n&vmap: <localleader>try , catch , ns (-> \"namespace{\\n}\")\n        Insert the previous text around the current line (/visual\n        selection). It also done in respect of |[bg]:usemarks|.\n\n n&vmap: <localleader><localleader>catch\n        The current line (/visual selection) is used as the formal parameter\n        of the catch-block. It is also done in respect of |[bg]:usemarks|.\n\n                                                *n_,dc* *n_,rc* *n_,sc* *n_,cc* *n_,lc*\n                                                *v_,dc* *v_,rc* *v_,sc* *v_,cc* *v_,lc*\n n&vmap: <localleader>dc, rc, sc, cc, lc\n        Insert `dynamic_cast`, `reinterpret_cast`, `static_cast`, `const_cast`\n        or `boost::lexical_cast` the selected text is used as the expression\n        to coercise. The cursor is placed between the angle brackets.\n\n                                                *n_,,dc* *n_,,rc* *n_,,sc* *n_,,cc*\n                                                *v_,,dc* *v_,,rc* *v_,,sc* *v_,,cc*\n n&vmap: <localleader><localleader>dc, rc, sc, cc\n        Replace the selected C-cast by `dynamic_cast`, `reinterpret_cast`,\n        `static_cast` or `const_cast`. The expression and the type it's\n        coerciced to are automatically decoded.\n\nNB: * All the remarks from |C_control-statements| apply.\n    * The current coding style (see |lhdev-style|) apply to |C_namespace|,\n    |C_try| and |C_catch|.\n\nTo prevent these mappings and abbreviations to be defined, set\n|g:lh_cpp_snippets| to 0.\n\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                        *C++_accessors* *getter* *setter*\nC++ accessors & some templates~\nFiles:      *cpp_BuildTemplates.vim* , *cpp_InsertAccessors.vim*\nHelp:       <http://github.com/LucHermitte/lh-cpp>\nLicense:    The generated code is under license exception to GPLv3\n            <http://github.com/LucHermitte/lh-cpp/blob/master/License.md>\nRequires:   |a.vim| (optional)\nOptions:    |C++_accessors_options|\n\nCommands:           Associated mappings\n    *:ADDATTRIBUTE*          *;AA*      (do it, cursor on the \"private\" line)\n        Interactive procedure to add a new set of attribute + its\n        optimized const-correct getter & setter.\n        See also: ||refactor-extract-getter| and ||refactor-extract-setter|.\n\n    *:HEADER* {name}         *;HE*      Header file template\n        Deprecated, prefer |C++_file-template|\n    *:CLASS*  {name}         *;CL*      Class declaration template\n        Deprecated, prefer |C++_class-template|\n    *:BLINES* {name}         *;BL*      Inserts rulers\n    *:GROUP*  {name}         *;GR*      Inserts a Doc++ group\n    *:MGROUP* {name}         *;MGR*     Inserts a Doc++ group + a ruler\n    *:REACHINLINE* {name}    *;RI*      Reaches the place where inlines are\n                                    defined\n                                                *C++_accessors_options*\nOptions:\n    See |lhdev-naming| options.\n\n    *(b|g):{ft_}accessor_comment_get* *(b|g):{ft_}accessor_comment_proxy_get*\n    *(b|g):{ft_}accessor_comment_set* *(b|g):{ft_}accessor_comment_proxy_set*\n    *(b|g):{ft_}accessor_comment_ref* *(b|g):{ft_}accessor_comment_proxy_ref*\n        => strings to customize the comments\n        \"%a\" will be substituted by the name of the attribute.\n\n    *(b|g):{ft_}implPlace* where accessor-definitions occur\n        0 -> Near the prototype/definition (Java's way)\n        1 -> Within the inline section of the header/inline/current file\n        2 -> Within the implementation file (.cpp)\n        3 -> Use the pimpl idiom (In the Todo-List)\n    *g:inlinesPlace* where inlines are written\n        0 -> In the inline section of the header/current file\n        1 -> In the inline section of a dedicated inline file\n\n    |g:c_nl_before_curlyB|                    : newline before '{'\n     This will eventually be deprecated in favour of |lhdev-style|.\n\nNotes:\n    * Everything here match my preferences regarding code presentation\n    * The |:ADDATTRIBUTE| command (that inserts an attribute, its accessor\n      and its mutator -- getter and setter) requires that some formating\n      is respected -- you will certainly have to adapt it.\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                                *C++_jump_implementation*\nJumping to functions-implementation~\nHelp:       <http://github.com/LucHermitte/lh-cpp>\nLicense:    The generated code is under license exception to GPLv3\n            <http://github.com/LucHermitte/lh-cpp/blob/master/License.md>\nInspiration:Leif Wickland's VIM TIP #135, and Robert Kelly IV for many\n            features.\n\nCommands:               Associated mappings\n    *:GOTOIMPL* {options}     *n_;GI*\n                      *i_CTRL-X_GI*     [Insert mode default mapping]\n                        <M-LeftMouse>\n        Go to the implementation of the current function, if the\n        implementation does not exist yet, a default one will be provided.\n        To change the keybindings:  *<Plug>GotoImpl*\n\n    *:MOVETOIMPL* {options}   *n_;MI*\n                      *i_CTRL-X_MI*     [Insert mode default mapping]\n        Move the implementation of the current inline function.\n        To change the keybindings:  *<Plug>MoveToImpl*\n\n    *:PASTEIMPL*              *n_;PI*\n                      *i_CTRL-X_PI*     [Insert mode default mapping]\n                        <M-RightMouse>\n        Insert the function-implementation on the next line\n        To change the keybindings:  *<Plug>PasteImpl*\n\nSpecial features:\n    * Supports member and non-member functions ;\n    * Scopes due to nested classes or namespaces are correctly supported:\n      + function names are produced according to the current (where the\n        function is declared) scope (nested classes + namespaces),\n      + jumps and insertions respect the current (where the insertion\n        happens) namespace ;\n    * Comments from the declaration stripped ;\n    * Comments in the implementation ignored (jumping only feature) ;\n    * Parameters names can be changed (as they have no incidence on the\n      signature) ;\n    * \"virtual\", \"static\" and default argument values can be commented ;\n    * The insertion of the default implementation can be automated and\n      deeply customized ;\n    * Not allowed to jump/insert to the implementation of pure virtual\n      functions (\"virtual t f(...) = 0;\") ;\n    * Will refuse to jump/insert from anything else that functions-\n      declarations. Still lazy ; may hang on member variables.\n    * Check the history for other minor details.\n\nOptions:\n    *(bg):[{ft}_]ext_4_impl_file*             (text)\n        This option specifies the default file-extension of the file where the\n        function definition should go.\n        Can be overridden on the fly with: :GOTOIMPL {ext}\n    *(bg):[{ft}_]ShowVirtual*             (0/[1])\n        When true, if the function is virtual, then the comment\n        /*virtual*/ will be added at the beginning of the proposed\n        implementation.\n        Can be overridden on the fly with: :GOTOIMPL ShowVirtual0/1\n    *(bg):[{ft}_]ShowStatic*              (0/[1])\n        When true, if the function is static, then the comment /*static*/\n        will be added at the beginning of the proposed implementation.\n        Can be overridden on the fly with: :GOTOIMPL ShowStatic0/1\n    *(bg):[{ft}_]ShowExplicit*            (0/[1])\n        When true, if the function is explicit then the comment /*explicit*/\n        will be added at the beginning of the proposed implementation.\n        Can be overridden on the fly with: :GOTOIMPL ShowExplicit0/1\n    *(bg):[{ft}_]ShowDefaultParams*       (0/[1]/2/3)\n        Determines if a comment will be added for every parameter having a\n        default value -- according to the function-signature.\n            0 -> No reminder\n            1 -> /* = {theDefaultValue} */\n            2 -> /*={theDefaultValue}*/\n            3 -> /*{theDefaultValue}*/\n        Can be overridden on the fly with: :GOTOIMPL ShowDefaultParam0/1\n    *(g):[{ft}_]FunctionPosition* ([0]/1/2/3) & *(g):[{ft}_]FunctionPosArg* ([0])\n        Determines where the default implementation, for a function not yet\n        defined, should be placed. We are placed ...\n            0 -> ... at |g:cpp_FunctionPosArg| lines from the end of the\n                 file.\n            1 -> ... at the line after the first occurrence of the pattern\n                 |g:cpp_FunctionPosArg|.\n                 By default, |cpp_options.vim| places us after: >\n                    /*============*/\n                    /*===[ «» ]===*/\n                    /*============*/\n<                       ... That I use to insert with |:BLINES|\n            2 -> ... according the hook (user-defined VimL-function)\n                 |g:cpp_FunctionPosArg|.\n                 By default, |cpp_options.vim| asks us for a title\n                 (actually a regex pattern), and places us after: >\n                    /*=====================*/\n                    /*===[ {the_title} ]===*/\n                    /*=====================*/\n<                       ... That I still use to insert with |:BLINES|\n            3 -> ... nowhere, and nothing is inserted. The insertion must\n                 be done _manually_ thanks to |:PASTEIMPL|.\n\n        Note: If the placement fails, it will still be possible to insert\n        manually the default function-implementation thanks to |:PASTEIMPL|.\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                                            *C++_templates*\nC++ skeletons and wizards~\n\nlh-cpp provides several template-files expanded thanks to |mu-template|.\n\n                                                    *C++_template_new*\nNew C/C++ file~\nWhen a new C or C++ (non-existing) file is opened, |mu-template| provides a\ndefault skeleton.\n\n... new header file~\nA header-file will have a header (where one's can put copyright information,\nRCS tags, etc.), anti-reinclusion guards. Some parts of what is generated can\nbe globally overridden, or overridden only for project specific needs ; see\n|MuT-paths-override|.\nThe variation points are:\n- the template-file {rtp}/template/c/internals/c-file-header.template\n  where file header is specified ;\n- the template-file {rtp}/template/c/internals/c-header-guard.template\n  where the computation of the header guard name, *s:guard* , is done ;\n- |b:sources_root| that can be used to specify the project root directory --\n  this information is used by the default header-guard name policy.\n\n... new implementation file~\nAn implementation-file will have a header, and if a header-file (and even an\ninline (.inl) file) file with the \"same\" name is found, it will be included.\nThe variation points are:\n- the template-file {rtp}/template/c/internals/c-file-header.template\n  where file header is specified ;\n- the template-file {rtp}/template/c/section-sep.template that is used to\n  specify the format of section header ;\n- the template-file {rtp}/template/c/internals/c-header-content.template\n  that is meant to be overridden if some default content is always expected\n  like a C++ namespace.\n- |(bg):cpp_included_paths|, |List| that is used to search for the related\n  header-file to include.\n\n\n                                                    *C++_template_class*\nNew C++ class~\nThis skeleton-file acts as a wizard.\nIt first asks the user the name of the new C++ class if it hasn't specified\n(by default it's the name of the current file).  Then it asks what semantics\nthe class shall have:\n- value-semantics (stack-based, copyable, assignable, and may be comparable) ;\n- Stack-based semantics, but non copyable ;\n- Entity semantics, and non copyable ;\n- Entity semantics, but clonable.\n\nSee the following articles if you want some more C++ insights on the\nimplications of the question:\n- <http://akrzemi1.wordpress.com/2012/02/03/value-semantics/>\n- [French]\n  <http://cpp.developpez.com/faq/cpp/?page=classes#CLASS_forme_canonique>\n\nAccordingly to user's choice, default functions for the class will be\ngenerated, or inhibited.\n\nIf you'd rather have more control over what is done, use instead the templates\n|C++_template_copy-and-swap|, |C++_template_copy-constructor|,\n|C++_template_assignment_operator|.\n\nTo-do: |C++_template_destructor| that detects visibility to add <+virtual+> or\nnothing.\nTo-do: support C++11 copy inhibition syntax\nTo-do: support C++11 move-construction and move-assignement.\n\nThe variation points are:\n- |(bg):[{ft}_]dox_CommentLeadingChar|, |(bg):[{ft}_]dox_TagLeadingChar|,\n  |(bg):[{ft}_]dox_brief|, |(bg):[{ft}_]dox_ingroup|,\n  |(bg):[{ft}_]dox_author_tag|, |(bg):[{ft}_]dox_author|,\n- |(bg):dox_group|\n  NB: As I've reached the conclusion that everything shall be sorted into\n  doxygen groups, I force the presence of this doxygen tag.\n- CppDox_ClassWizard()\n- the template-file {rtp}/template/cpp/internals/function-comment.template\n  that is used to order the documentation tags associated to generated\n  functions. This template file introduced its own variation points:\n  - *(bg):[{ft_}]pre_desc_ordered_tags*\n    default= [\"ingroup\", \"brief\", \"param\", \"return\", \"throw\", \"invariant\", \"pre\", \"post\"]\n  - *(bg):[{ft_}]post_desc_ordered_tags*\n    default= [\"note\", \"warning\"]\n  - |(bg):[{ft_}]template_expand_doc|\n  - the template-file {rtp}/template/cpp/internals/formatted-comment.template\n    that is used to convert the final list of documentation tag into the\n    embedded comments. The default format used is Doxygen format.\n\n                               *:Constructor*\n                               *:ConstructorInit*\n                               *:ConstructorDefault*  *C++_template_default-constructor*\n                               *:ConstructorCopy*     *C++_template_copy-constructor*\n                                                    *C++_template_copy-and-swap*\n                               *:AssignmentOperator*  *C++_template_assignment-operator*\n                                                    *C++_template_destructor*\nSnippets for constructors and related functions~\nVarious |mu-template| snippets are provided to insert construction/destruction related functions.\nAll detect the current class-name, they can receive some other parameters. (to\nbe documented)\nThey will apply naming conventions from |lh#dev#naming|\nSee |C++_template_class| documentation for a more complete list of the\nparameters and other variation points involved in these snippets.\n\nThey can also be run from |:Constructor| (or the other commands). In that\ncase, a ctag database will be used to find which attributes the current class\nis made of in order to fill the implementation of the function as weel as we\ncan.\n\nTODO: rely of libclang when ctags in not used\n\n                                                    *C_snippet_realloc*\nSnippet for realloc()~\nrealloc() is a tricky C function that most C developers mis-use. One shall\nnever write: >\n    p = realloc(p, new_size);\nbut instead: >\n    T* p_temp = realloc(p, new_size);\n    if (!p_temp) {\n        free(p) ;\n        + other reset ;\n        + error notification ;\n        return false;\n    }\n    p = p_temp;\nHence this snippet aimed at simpliying our life.\n\n|lh-refactor| defines |:FixRealloc| that corrects the first snippet above by\nthe second one. -- this command is likelly fall back in |lh-cpp| scope in\nfuture versions.\n\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                                          *C++_Override*\n                                                          *:Override*\nFunction overridding helper~\n>\n    :Override\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                                *C++_unmatched_functions*\n                                                *:CppDisplayUnmatchedFunctions*\nSearch for declared ad undefined functions (or the other way around)~\n>\n    :CppDisplayUnmatchedFunctions\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                                        *C++_inspection*\nInspection of various properties~\n*:Ancestor* [classname]\n*:Children* [!] [namespace] [classname]\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                                            *C++_options*\nC++ options~\nlh-cpp supports many options directly, or indirectly (through |mu-template|\nfor instance).\n\n                                                *C++_options_global*\nSome options are global, i.e. they applies on the current vim session for all\nopen files. They are implemented as vim |global-variable|s.\n\n                                                *C++_options_local*\nOther options are local, i.e. restricted to each buffer. This does not prevent\nus to have an option having the same value in several buffers, however\nchanging the value of the option in one buffer won't affect the value of the\noption in other buffers. They are implemented as vim |buffer-variable|s.\nSemantically speaking, there are two kind of local options:\n- options specific to a filetype ;\n- options specific to a project.\nNB: lh-cpp doesn't use the other kinds of vim variables as options\n(|window-variable|s, |tabpage-variable|s).\n\n                                            *C++_options_local_filetype*\nThese options are meant to be set in |ftplugins|. Actually they are of two\nnatures: vim |options| (indenting settings, etc.), and vim |buffer-variable|s\n((ft)plugins settings).\nMost of lh-cpp options are expected to begin with \"cpp_\". As a consequence,\nthey won't actually clash with equivalent settings from other filetypes.\n\nOther plugins I'm maintaining (see |lh-refactor| for instance) support\nmulti-filetype options, which support default values that can be overridden for\nspecific filetypes (by appending \"{ft}_\" to the name of the options when\nsetting them), or specific projects. See |lhdev-filetype| for the actual\nnaming policy.\n\n                                            *C++_options_local_project*\nThese options are meant to be set by plugins oriented to the management of\nprojects. Typical examples are |project.vim|, or one of the numerous\n|local_vimrc| plugin (I'm also maintaining one...).\nOnce again one can set vim |options| or |buffer-variable|s in the\nbuffer specific zone of its |local_vimrc|.\n\n\n                                            *C++_options_local_conclusion*\nDefault options for a specific filetype shall be defined as |buffer-variable|s\n(/vim local |options|) in a |ftplugin| placed in $HOME/.vim/ftplugin/cpp/ (or\n/c/) (or the windows equivalent location, see 'runtimepath').\n\nProject specific settings shall override the previous default settings in\n|local_vimrc|s.\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                                            *C++_doxygen-options*\nC++ options for doxygen~\n\n*(bg):[{ft}_]dox_CommentLeadingChar* Character used at «»?; default: \"*\"\n*(bg):[{ft}_]dox_TagLeadingChar*     Character used to introduce tags: \"!\"/\"[@]\"\n*(bg):[{ft}_]dox_brief*              Shall we have a @brief tag?  -> yes/no/[short]\n*(bg):[{ft}_]dox_ingroup*            Shall we have a @ingroup tag?  -> yes/[no]\n*(bg):dox_group*                     Name of the doxygen group.\n*(bg):[{ft}_]dox_author_tag*         Name of the tag to use: [\"author\"]/\"authors\"\n*(bg):[{ft}_]dox_author*             Name(s) of the author(s).\n\n*(bg):[{ft_}]template_expand_doc* is a boolean option (default: 1)\n    Tells whether embedded documentation (as comments) shall be generated when\n    template-files are expanded.\n    Used by:\n    - the template-file {rtp}/template/cpp/internals/function-comment.template\n    - the template-file {rtp}/template/cpp/internals/formatted-comment.template\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nMichael Sharpe's a.vim~\nFile: a.vim\n\nNotes:\n* An old version of this plugin is required by |cpp_BuildTemplates.vim|.\n  The latest version doesn't suit as I use its private functions...\n* Otherwise, it is really nice and useful with C programming\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nGeorgi Slavchev's previewWord.vim~\nFile:       *previewWord.vim*\nRequires:   |Triggers.vim| (supported)\nNotes:      From a vim tip on sourceforge. ; Not required by anything\n\nOption:\n    *g:previewIfHold* ([0]/1)\n        Automatic search when the cursor hold its position ?\n\nMappings:\n    <C-Space>       Looks for the declaration of the function name under\n                    the cursor.\n    <M-Space>       Toggles on/off the automatic search when the cursor\n                    hold its position.\n                    Defined only if |Triggers.vim| is installed.\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                            *C_folding* *C++_folding*\nC & C++ folding~\nFiles: fold/c-fold.vim fold/cpp-fold.vim\nNotes:\n    * Initially developed by Johannes Zellner\n    * To test and use them, drop them your ftplugin folders or look at\n        cleaner solutions like the one used by Johannes Zellner.\n    * Need to be tuned ; there are still some imperfections I haven't fixed\n      yet. The major one beeing that the plugin may drastiscally slow down\n      the loading of any C or C++ file.\n\n\n------------------------------------------------------------------------------\n                                                        *lh-cpp-first-steps*\nFirst steps with lh-cpp-ftplugins~\n\nThe first steps with these ftplugins can be quite disorienting.\nI expect you did read the |lh-cpp-features| section before trying to write your\nfirst C or C++ files with the new ftplugins activated.\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nStep 1 : Opening a C or C++ file~\nYou do ~\n>\n    vim foo.h\nor : >\n    vim\n    :e foo.h\n<\nThen you see ~\n-> the new buffer filled with many things.\nDon't worry, it is a feature set by default: a template skeleton is inserted\nin the new buffer. This is done thanks to |mu-template|.\n\nIf you don't like this feature ~\n-> you have several options :\n(*) you don't want template skeletons at all:\n    then you can erase |mu-template.vim| and the {rtp}/after/templates/ folder\n(*) you don't want template skeletons to be inserted automatically:\n    then add into your .vimrc: >\n    let g:mt_IDontWantTemplatesAutomaticallyInserted = 1\n<   You will still have the possibility to _explicitly_ insert a template\n    skeleton with: >\n    :MuTemplate c                    \" for the C skeleton\n    :MuTemplate cpp                  \" for the C++ skeleton\n    :MuTemplate cpp/class            \" for a heavily documented classes\n    :MuTemplate cpp/singleton        \" for Scott Meyers' singleton model.\n    :MuTemplate cpp/stream-extractor \" for op<< (beta, smart & slow)\n    :MuTemplate cpp/stream-inserter  \" for op>> (beta, smart & slow)\n    :MuTemplate cpp/my-cpp           \" for a specific C++ skeleton\n(*) you don't want C++ skeleton (only) be inserted automatically,\n    [ie: you are OK for HTML and other skeletons] :\n    Then override the file {rtp}/after/template/cpp.template\n    Don't change anything else than the extension of the file.\n    See |MuT-paths-override|.\n(*) you don't like the template skeletons I propose to you:\n    easy ! Override them. See |MuT-paths-override|.\n(*) you don't want to be in insert- or select-mode and at an odd place when\n    opening a new file:\n    This is |mu-template|'s fault. Deactivate this feature thanks to the\n    option: |g:mt_jump_to_first_markers|.\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nStep 2 : Writing code and control statements~\nYou write ~\n>\n    if (foo)\n\nThen you see ~\n>\n    if ((foo)«») {\n        «»\n    }«»\n\nThis is also a feature. Except you are not supposed to type \"if (foo)\", but\nonly \"if foo\".\nYou should by the way notice that \"if\", \"else\", \"for\", ... are expanded only\nwithin normal code context: not within comments or strings contexts. Try for\ninstance: '// if foo' or '\"if foo\"'\n\nIf you don't like this feature ~\n(*) What the hell are those '«»' characters that appear ?\n    They are |markers|. They are supposed to help us reaching the next\n    position in the file where we are supposed to add code.\n    By default hit |<M-Del>| (/|<M-S-Del>|) to jump to the next (/previous) marker.\n    (If you are using vim and not gvim, the mappings will be binded to <C-J>)\n    If you don't want them, hit <M-F9> to toggle their activation state (only\n    if |Triggers.vim| is installed), or set |[bg]:usemarks| to 0 into your .vimrc.\n    You should also be able to simply erase the file |bracketing.base.vim|\n(*) You want some \"\\n\" before the '(':\n    Easy: tell it to |:AddStyle|\n    * in $HOME/.vim/after/plugin/my-style.vim: >\n      :AddStyle -ft=c -prio=10 ( \\n(\\n\n<    * or in a |local_vimrc|: >\n      :AddStyle -b -ft=c -prio=10 ( \\n(\\n\n(*) You want some \"\\n\" between ')' and '{':\n    Easy: tell it to |:AddStyle|\n    * in $HOME/.vim/after/plugin/my-style.vim: >\n      :AddStyle -ft=c -prio=10 { \\n{\\n\n<    * or in a |local_vimrc|: >\n      :AddStyle -b -ft=c -prio=10 { \\n{\\n\n(*) You don't want the control statements to be expanded:\n    Then, don't install |c_set.vim| and |cpp_set.vim|. Instead look and take\n    the stuff you could be interested in, like for instance some vim-|options|.\n\nIf you only see~\n>\n    if (foo)\n\nThen, it is probable that you haven't configured Vim to support ftplugins. To do\nthis, add one of the following lines into your .vimrc: >\n    filetype plugin on\n    filetype plugin indent on \" is fine as well\nCheck |:filetype-plugin-on| for more info.\n\n\n------------------------------------------------------------------------------\n                                                        *lh-cpp_API*\nlh-cpp API~\nHere are the function made available to write your own ftplugins and\ntemplate-files.\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                                    *lh#cpp#dox#*\n\nDoxygen related functions~\nThe following functions are parametrized, see |C++_doxygen-options|.\n\n- Purely stylistic options~\n *lh#dox#comment_leading_char()*\n    @see |(bg):[{ft}_]dox_CommentLeadingChar|\n *lh#dox#tag_leading_char()*\n    @see |(bg):[{ft}_]dox_TagLeadingChar|\n *lh#dox#tag()*\n    @returns |lh#dox#tag_leading_char()| + parameter\n\n- Semantics options, i.e. that return a tag and sometimes more~\n *lh#dox#semantics()*\n    @returns \"<p><b>Semantics</b><br>\"\n *lh#dox#ingroup()*\n    @param name\n    @see |(bg):[{ft}_]dox_ingroup|\n *lh#dox#brief()*\n    @see |(bg):[{ft}_]dox_brief|\n *lh#dox#param()*\n    @param p parameter description: text, or |Dictionary| {dir: in,out,inout; name}.\n    @return lh#dox#tag(\"param\") + p\n *lh#dox#author()*\n    @param names (optional)\n    @returns lh#dox#tag(|(bg):[{ft}_]dox_author_tag|)\n             + names or |(bg):[{ft}_]dox_author| if no names specified\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                                    *lh#cpp#ftplugin#*\nConvinience functions for ftplugin definitions only~\n *lh#cpp#ftplugin#OptionalClass()*\n    Function that can be used to write |:command|s in |ftplugins| that tries\n    to deduce the name of the current C++ class if none is provided.\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                                    *lh#cpp#style*\nFunctions dedicated to obtain information on the current style~\n *lh#cpp#style#get()*\n    @param datakind\n    @param pos\n    @returns lh#option#get(datakind + pos, '')\n *lh#cpp#style#attribute2parameter_name()*\n    @param attrb_name\n    Applies the chosen naming style for parameters to a attribute name.\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                            *lh#cpp#AnalysisLib_Function#*\nFunctions dedicated to the analysis of C/C++ functions~\n\n*lh#cpp#AnalysisLib_Function#GetFunctionPrototype()*\n*lh#cpp#AnalysisLib_Function#GetListOfParams()*\n*lh#cpp#AnalysisLib_Function#AnalysePrototype()*\n*lh#cpp#AnalysisLib_Function#HaveSameSignature()*\n*lh#cpp#AnalysisLib_Function#BuildSignatureAsString()*\n*lh#cpp#AnalysisLib_Function#IsSame()*\n*lh#cpp#AnalysisLib_Function#LoadTags()*\n*lh#cpp#AnalysisLib_Function#SearchUnmatched()*\n*lh#cpp#AnalysisLib_Function#SearchAllDeclarations()*\n*lh#cpp#AnalysisLib_Function#SignatureToSearchRegex2()*\n*lh#cpp#AnalysisLib_Function#SignatureToSearchRegex()*\n*lh#cpp#AnalysisLib_Function#TrimParametersNames()*\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                            *lh#cpp#AnalysisLib_Class#*\nFunctions dedicated to the analysis of C/C++ classes~\n*lh#cpp#AnalysisLib_Class#SearchClassDefinition()*\n*lh#cpp#AnalysisLib_Class#CurrentScope()*\n*lh#cpp#AnalysisLib_Class#BaseClasses0()*\n*lh#cpp#AnalysisLib_Class#GetClassTag()*\n*lh#cpp#AnalysisLib_Class#FetchDirectParents()*\n*lh#cpp#AnalysisLib_Class#Ancestors()*\n*lh#cpp#AnalysisLib_Class#FetchDirectChildren()*\n*lh#cpp#AnalysisLib_Class#used_namespaces()*\n*lh#cpp#AnalysisLib_Class#attributes()*\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n                                            *lh#cpp#tags#*\nFunctions analysis current situation~\n*lh#cpp#tags#find_compiler()*\n    Returns the current known C++ compiler.\n    Works best on CMake projects when |lh-cmake| is installed. Looks into\n    `$CXX` or returns which of `c++`, `g++` or `clang++` is found first.\n*lh#cpp#tags#compiler_includes()*\n    Returns the standard (hard-coded) include directories associated to the\n    current C++ compiler (|lh#cpp#tags#find_compiler()|).\n*lh#cpp#tags#get_included_paths()*\n    Returns declared included paths:\n    - the first between |(bpg):sources_root| (deprecated) and |(bpg):paths.sources|\n    - the first between |(bpg):paths.includes| and |(bpg):includes|\n      (deprecated), or optional |list| passed.\n*lh#cpp#tags#strip_included_paths()*\n    Returns the first parameter (a filename) stripped of its leading dirname\n    that belongs to the |list| of include directories (likelly obtained with\n    |lh#cpp#tags#get_included_paths()|).\n*lh#cpp#tags#fetch()*\n    Look up the symbol under the cursor in the |tag| database in header files\n    And returns its relevant information.\n    Tuned by the options *(bpg):[{ft}_]tag_kinds_for_inclusion* and\n    *(bpg):[{ft}_]file_regex_for_inclusion*\n\n------------------------------------------------------------------------------\nCredits~\n\nMany people have to be credited:\n* the Vim & VimL gurus ;\n* the people I've stolen scripts and functions from: Stephen Riehm, Michael\n  Sharpe, Georgi Slavchev, Johannes Zellner, Saul Lubkin ;\n* the people that gave me many great ideas and even feedback: Gergely Kontra,\n  Leif Wickland, Robert Kelly IV [I've also stolen scripts from them] ;\n* Thomas Ribo for his feedback and features-requirements.\n* and many more that I have probably forgotten.\n\nTODO:~\n- c_compile.vim / BTW\n\n\n------------------------------------------------------------------------------\n © Luc Hermitte, 2001-2016 <http://github.com/LucHermitte/lh-cpp> CC by SA 3.0\n VIM: let b:VS_language = 'american'\n vim:ts=8:sw=4:tw=80:fo=tcq2:isk=!-~,^*,^\\|,^\\\":ft=help:\n"
  },
  {
    "path": "doc/options.md",
    "content": "## lh-cpp Options\n\n### Contents\n\n  * [Options types](#options-types)\n    * [Global options: `g:`_{option-name}_](#global-options-g_option-name_)\n    * [Local/project-wise options: `p:`_{option-name}_ or `b:`_{option-name}_](#localproject-wise-options-p_option-name_-or-b_option-name_)\n    * [Project-wise options with default: `(bpg):`_{option-name}_](#project-wise-options-with-default-bpg_option-name_)\n    * [[lh-dev options](https://github.com/LucHermitte/lh-dev#options-1): `(bpg):`_[{filetype}__]{option-name}_](#lh-dev-optionshttpsgithubcomluchermittelh-devoptions-1-bpg_filetype__option-name_)\n  * [Option list](#option-list)\n    * [`(bpg):cpp_always_a_destructor_when_there_is_a_pointer_attribute'`](#bpgcpp_always_a_destructor_when_there_is_a_pointer_attribute)\n    * [`(bpg):cpp_std_flavour` and `$CXXFLAGS`](#bpgcpp_std_flavour-and-cxxflags)\n    * [`(bpg):({ft}_)FunctionPosArg`, `(bpg):({ft}_)FunctionPosition`](#bpgft_functionposarg-bpgft_functionposition)\n    * [`(bpg):({ft}_)ShowDefaultParams`, `(bpg):({ft}_)ShowExplicit`, `(bpg):({ft}_)ShowStatic`, `(bpg):({ft}_)ShowVirtual`](#bpgft_showdefaultparams-bpgft_showexplicit-bpgft_showstatic-bpgft_showvirtual)\n    * [`(bpg):accessor_comment_get`, `(bpg):accessor_comment_set`, `(bpg):accessor_comment_ref`](#bpgaccessor_comment_get-bpgaccessor_comment_set-bpgaccessor_comment_ref)\n    * [`(bpg):({ft}_)alternateSearchPath`](#bpgft_alternatesearchpath)\n    * [`(bpg):cpp_begin_end_includes`](#bpgcpp_begin_end_includes)\n    * [`(bpg):cpp_begin_end_style`](#bpgcpp_begin_end_style)\n    * [`(bpg):c_menu_name`, `(bpg):c_menu_priority`, `(bpg):cpp_menu_name`, `(bpg):cpp_menu_priority`](#bpgc_menu_name-bpgc_menu_priority-bpgcpp_menu_name-bpgcpp_menu_priority)\n    * [`(bpg):cpp_defaulted`](#bpgcpp_defaulted)\n    * [`(bpg):cpp_defines_to_ignore`](#bpgcpp_defines_to_ignore)\n    * [`(bpg):cpp_deleted`](#bpgcpp_deleted)\n    * [`(bpg):cpp_noexcept`](#bpgcpp_noexcept)\n    * [`(bpg):cpp_noncopyable_class`](#bpgcpp_noncopyable_class)\n    * [`(bpg):cpp_nullptr`](#bpgcpp_nullptr)\n    * [`(bpg):cpp_explicit_default`](#bpgcpp_explicit_default)\n    * [`(bpg):cpp_make_ptr`](#bpgcpp_make_ptr)\n    * [`(bpg):cpp_noexcept`](#bpgcpp_noexcept)\n    * [`(bpg):cpp_return_ptr_type`](#bpgcpp_return_ptr_type)\n    * [`(bpg):cpp_root_exception`](#bpgcpp_root_exception)\n    * [`(bpg):cpp_use_copy_and_swap`](#bpgcpp_use_copy_and_swap)\n    * [`(bpg):cpp_use_nested_namespaces`](#bpgcpp_use_nested_namespaces)\n    * [`g:c_no_assign_in_condition`](#gc_no_assign_in_condition)\n    * [`g:c_no_hl_fallthrough_case`](#gc_no_hl_fallthrough_case)\n    * [`g:cpp_no_catch_by_reference`](#gcpp_no_catch_by_reference)\n    * [`g:cpp_no_hl_c_cast`](#gcpp_no_hl_c_cast)\n    * [`g:cpp_no_hl_funcdef`](#gcpp_no_hl_funcdef)\n    * [`g:cpp_no_hl_throw_spec`](#gcpp_no_hl_throw_spec)\n    * [`(bpg):({ft}_)array_size`](#bpgft_array_size)\n    * [`(bpg):({ft}_)exception_args`](#bpgft_exception_args)\n    * [`(bpg):({ft}_)exception_type`](#bpgft_exception_type)\n    * [`(bpg):({ft}_)ext_4_impl_file`](#bpgft_ext_4_impl_file)\n    * [`(bpg):({ft}_)file_regex_for_inclusion`](#bpgft_file_regex_for_inclusion)\n    * [`(bpg):({ft}_)filename_simplify_for_inclusion`](#bpgft_filename_simplify_for_inclusion)\n    * [`(bpg):({ft}_)gcov_files_path`](#bpgft_gcov_files_path)\n    * [`(bpg):({ft}_)guard_headers_with`](#bpgft_guard_headers_with)\n    * [`(bpg):({ft}_)implPlace`](#bpgft_implplace)\n    * [`g:inlinesPlace`](#ginlinesplace)\n    * [`(bpg):({ft}_)includes`](#bpgft_includes)\n    * [`(bpg):({ft}_)multiple_namespaces_on_same_line`](#bpgft_multiple_namespaces_on_same_line)\n    * [`(bpg):({ft}_)nl_before_bracket` (deprecated)](#bpgft_nl_before_bracket-deprecated)\n    * [`(bpg):({ft}_)nl_before_curlyB` (deprecated)](#bpgft_nl_before_curlyb-deprecated)\n    * [`(bpg):({ft}_)pre_desc_ordered_tags`, `(bpg):({ft}_post_desc_ordered_tags)`](#bpgft_pre_desc_ordered_tags-bpgft_post_desc_ordered_tags)\n    * [`(bpg):({ft}_)project_namespace`](#bpgft_project_namespace)\n    * [`(bpg):({ft}_)tag_kinds_for_inclusion`](#bpgft_tag_kinds_for_inclusion)\n    * [`(bpg):tags_select`](#bpgtags_select)\n    * [`(bpg):({ft}_)template_expand_doc`](#bpgft_template_expand_doc)\n    * [`(bpg):xsltproc`](#bpgxsltproc)\n    * [Doxygen related options](#doxygen-related-options)\n      * [`(bpg):({ft}_)dox_CommentLeadingChar`](#bpgft_dox_commentleadingchar)\n      * [`(bpg):({ft}_)dox_TagLeadingChar`](#bpgft_dox_tagleadingchar)\n      * [`(bpg):({ft}_)dox_author_tag`](#bpgft_dox_author_tag)\n      * [`(bpg):({ft}_)dox_author`](#bpgft_dox_author)\n      * [`(bpg):({ft}_)dox_brief`](#bpgft_dox_brief)\n      * [`(bpg):({ft}_)dox_group`](#bpgft_dox_group)\n      * [`(bpg):({ft}_)dox_ingroup`](#bpgft_dox_ingroup)\n      * [`(bpg):({ft}_)dox_sep`](#bpgft_dox_sep)\n      * [`(bpg):({ft}_)dox_throw`](#bpgft_dox_throw)\n      * [`(bpg):ProjectVersion`](#bpgprojectversion)\n\n### Options types\n\n##### Global options: `g:`_{option-name}_\n\nThey are best set from the `.vimrc`;\n##### Local/project-wise options: `p:`_{option-name}_ or `b:`_{option-name}_\nThey are best set from a [`local_vimrc` file](https://github.com/LucHermitte/local_vimrc);\n\nSee\n[lh-vim-lib](https://github.com/LucHermitte/lh-vim-lib/blob/master/doc/Project.md)\nregarding `p:options`.\n\n##### Project-wise options with default: `(bpg):`_{option-name}_\nTheir default value can be set in the `.vimrc`, but its best to set them from a\n[`local_vimrc` file](https://github.com/LucHermitte/local_vimrc);\n##### [lh-dev options](https://github.com/LucHermitte/lh-dev#options-1): `(bpg):`_[{filetype}__]{option-name}_\n\n### Option list\n\n#### `(bpg):cpp_always_a_destructor_when_there_is_a_pointer_attribute'`\nBoolean option that enforces the expansion of a destructor in classes that have\npointer attributes, even when it isn't required.\n\n**Default value:** 0 (false)\n\n**See:**\n  * [`lh#cpp#snippets#_this_param_requires_a_destructor`](APID.md#lhcppsnippets_this_param_requires_a_destructor) which is used in turn by ...\n  * [`lh#cpp#snippets#requires_destructor`](APID.md#lhcppsnippetsrequires_destructor) which is used in turn by ...\n  * [`cpp/internals/class-skeleton.template`](snippets.md#cppinternalsclass-skeleton.template)\n\n#### `(bpg):cpp_std_flavour` and `$CXXFLAGS`\nThese options are exploited by [C++ flavour decoding functions](API.md#c++-flavour)\n\nThe expected values for `(bpg):cpp_std_flavour` are \"03\", \"05\" (TR1), \"11\", \"14\", or \"17\".\nOther values will lead into Unspecified Behaviour.\n\n**warning:** \"98\" is not a valid value.\n\nIf `(bpg):cpp_std_flavour` is not set, the flavour will be extracted from the\n`-std=` option in `$CXXFLAGS` or else from the CMake `$CMAKE_CXXFLAGS` option.\nValid values are `-std=c++98`, `-std=c++03`, `-std=c++0x`, `-std=c++11`,\n`-std=c++1y`,  `-std=c++14`, `-std=c++1z`, `-std=c++17` (the `-std=gnu++xx`\nones are also handled)\n\n**Note:** The `$CMAKE_CXXFLAGS` option is obtained thanks to\n[lh-cmake](https://github.com/LucHermitte/lh-cmake). BTW, this plugin is not\nautomatically installed with lh-cpp (if you are using a dependencies aware\nplugin manager like VAM or vim-flavor ; with dependencies unaware plugin\nmanagers, you'll will also have to install it as well)\n\n\n#### `(bpg):({ft}_)FunctionPosArg`, `(bpg):({ft}_)FunctionPosition`\nDetermines where the default implementation, for a function not yet defined,\nshould be placed by [`:GOTOIMPL`](features.md#gotoimpl). We are placed ...\n- 0 -> ... at `cpp_FunctionPosArg` lines from the end of the file.\n- 1 -> ... at the line after the first occurrence of the pattern\n  `cpp_FunctionPosArg`.\n  By default, we are placed after: >\n```C++\n/*============*/\n/*===[ «» ]===*/\n/*============*/\n```\n  That I use to insert with `:BLINES`\n- 2 -> ... according the hook (user-defined VimL-function)\n  `cpp_FunctionPosArg`.\n  By default, we are asked for a title (actually a regex pattern), and placed\n  after:\n```C++\n/*=====================*/\n/*===[ {the_title} ]===*/\n/*=====================*/\n```\n  ... That I still use to insert with |:BLINES|\n- 3 -> ... nowhere, and nothing is inserted. The insertion must be done\n  _manually_ thanks to [`:PASTEIMPL`](features.md#pasteimpl) .\n\n#### `(bpg):({ft}_)ShowDefaultParams`, `(bpg):({ft}_)ShowExplicit`, `(bpg):({ft}_)ShowStatic`, `(bpg):({ft}_)ShowVirtual`\nBoolean options used by [`:GOTOIMPL`](features.md#gotoimpl). They tells whether\nthe C++ keywords `explicit`, `static` or `virtual` shall be kept in the empty\nimplementation skeleton generated for a function declaration. Same thing for\ndefault parameter values.\n\nDefault values to all: 1 (true)\n\n#### `(bpg):accessor_comment_get`, `(bpg):accessor_comment_set`, `(bpg):accessor_comment_ref`\nStrings to customize the comments inserted on `:ADDATTRIBUTE`.\n\n`\"%a\"` will be substituted with the name of the attribute.\n\n#### `(bpg):({ft}_)alternateSearchPath`\nTells how to alternate between a source file and a header file.\n\nDefault value: `'sfr:../source,sfr:../src,sfr:../include,sfr:../inc'`\n\nAccording to alternate.vim documentation:\n\nA path with a prefix of `\"wdr:\"` will be treated as relative to the working\ndirectory (i.e. the directory where vim was started.) A path prefix of `\"abs:\"`\nwill be treated as absolute. No prefix or `\"sfr:\"` will result in the path\nbeing treated as relative to the source file (see sfPath argument).\n\nA prefix of `\"reg:\"` will treat the pathSpec as a regular expression\nsubstitution that is applied to the source file path. The format is:\n\n```\nreg:<sep><pattern><sep><subst><sep><flag><sep>\n```\n\n- `<sep>` seperator character, we often use one of `[/|%#]`\n- `<pattern>` is what you are looking for\n- `<subst>` is the output pattern\n- `<flag>` can be `g` for global replace or empty\n\nEXAMPLE: `'reg:/inc/src/g/'` will replace every instance of `'inc'` with\n`'src'` in the source file path. It is possible to use match variables so you\ncould do something like:\n```\n'reg:|src/\\([^/]*\\)|inc/\\1||'\n```\n(see `help :substitute`, `help pattern` and `help sub-replace-special` for more\ndetails)\n\nNOTE: a.vim uses `,` (comma) internally so DON'T use it in your regular\nexpressions or other pathSpecs unless you update the rest of the a.vim code to\nuse some other seperator.mentation:\n\n#### `(bpg):cpp_begin_end_includes`\nTells which header files shall be includes when expanding `begin()`/`end()`.\n\nThis option is meant to override the include files returned by\n[`lh#cpp#snippets#_include_begin_end()`](API.md#lhcppsnippets_include_begin_end).\n\n**See:** `CTRL-X_be`, `CTRL-X_cbe`, `CTRL-X_rbe`, `CTRL-X_crbe`, [`cpp/b-e` snippet](snippets.md#cppb-e)\n\n#### `(bpg):cpp_begin_end_style`\nTells which style to use to generate a couple of calls to `begin()`/`end()`:\n- \"`c++98`\": -> `container.begin()`\n- \"`std`\": -> `std::begin(container)`\n- \"`boost`\": -> `boost::begin(container)`\n- \"`adl`\": -> `begin(container)`\n\n**See:** `CTRL-X_be`, `CTRL-X_cbe`, `CTRL-X_rbe`, `CTRL-X_crbe`, [`cpp/b-e` snippet](snippets.md#cppb-e)\n\n#### `(bpg):c_menu_name`, `(bpg):c_menu_priority`, `(bpg):cpp_menu_name`, `(bpg):cpp_menu_priority`\nThese options tells where the |menu| for all C and C++ item goes.\nSee `:h :menu`\n\n#### `(bpg):cpp_defaulted`\nString option.\n\n**Default Value:** `= default`\n\n**See:** API function\n[`lh#cpp#snippets#defaulted()`](API.md#lhcppsnippetsdefaulted)\n\n#### `(bpg):cpp_defines_to_ignore`\nRegex (default: none) that specifies which patterns (`#define`) shall be\nignored when parsing the source code to detect the current scope\n(`ns1::..::nsn::cl1::.....cln`).\n\n**See:** API functions\n- [`lh#cpp#AnalysisLib_Class#SearchClassDefinition()`](API.md#lh-cpp-analysislib_class-searchclassdefinition)\n- [`lh#cpp#AnalysisLib_Class#CurrentScope()`](API.md#lh-cpp-analysislib_class-currentscope)\n\n#### `(bpg):cpp_deleted`\nString option.\n\n**Default Value:** `= delete`\n\n**See:** API function [`lh#cpp#snippets#deleted()`](API.md#lhcppsnippetsdeleted)\n\n#### `(bpg):cpp_noexcept`\nString format option (for\n[`lh#fmt#printf()`](https://github.com/LucHermitte/lh-vim-lib))\n\n**Default Value:** `noexcept%1` in C++11, `throw()` in C++98\n\n**See:**\n  * [`lh#fmt#printf()`](https://github.com/LucHermitte/lh-vim-lib))\n  * API function [`lh#cpp#snippets#nullptr()`](API.md#lhcppsnippetsnoexcept)\n\n#### `(bpg):cpp_noncopyable_class`\nPolicy option that is used to tell how classes are made non-copyable.\n  * by inheriting from a dedicated noncopyable class.\n  ```\n  {\"name\": \"ITK::NonCopyable\", \"include\": \"<itkNoncopyable.h>\"}\n  ```\n  If the class is known by the [type database](types.md) , there is no need to\n  explicit\n  which file shall be included:\n  ```\n  {\"name\": \"boost:noncopyable\"}\n  ```\n  * by explictly deleting copy operations (with `= delete` in C++11, or with\n    declared but undefined private copy operations). This done by setting the\n    option to an empty string.\n\n**Default value:** `{\"name\": \"boost:noncopyable\"}`\n\n**See:**\n  * [Type database](types.md)\n  * [`cpp/base-class.template`](snippets.md#cppbaseclass.template)\n  * [`cpp/internals/class-skeleton.template`](snippets.md#cppinternalsclass-skeleton.template)\n\n#### `(bpg):cpp_nullptr`\nReturned by `lh#cpp#snippets#nullptr()`.\n\n**Default Value:** `nullptr` in C++11, `0` in C++98/03.\n\n**Other Typical values:** `NULL`, `ITK_NULLPTR_, etc.\n\n**See:** API function [`lh#cpp#snippets#nullptr()`](API.md#lhcppsnippetsnullptr)\n\n#### `(bpg):cpp_explicit_default`\nBoolean option that forces to explicitly add `= default` in snippets when C++11\nis detected.\n\n**Warning:** For now, this option has priority over\n[`(bpg):cpp_noncopyable_class`](#bpgcpp_noncopyable_class). i.e. deleted copy operations will still appear even if the class inherits from a _non-copyable_ class.\n\n**Default value:** undefined (=> ask the user)\n\n**See:**\n  * [`lh#cpp#snippets#shall_explicit_defaults()`](API.md#lhcppsnippetsshall_explicit_defaults) which encapsulates its use.\n  * [`cpp/internals/class-skeleton.template`](snippets.md#cppinternalsclass-skeleton.template) which uses its result\n\n#### `(bpg):cpp_make_ptr`\nString format option for [`lh#fmt#printf()`](https://github.com/LucHermitte/lh-vim-lib)).\n\nIt tells how pointers are best created. Used only from [cpp/clonable-clas.template](snippets.md#cppclonable-clas.template) snippet.\n\n**Default Value**:\n * C++14: `std::make_unique(%3)`\n * C++11: `std::unique_ptr<%2>(new %2(%3))`\n * C++98: `std::auto_ptr<%1>(new %2(%3))`\n\n**See:**\n * [cpp/clonable-clas.template](snippets.md#cppclonable-clas.template) which\n   uses it\n * [`(bpg):cpp_return_ptr_type`](#bpgcpp_return_ptr_type)\n\n#### `(bpg):cpp_noexcept`\nString format option (for\n[`lh#fmt#printf()`](https://github.com/LucHermitte/lh-vim-lib))\n\n**Default Value:** `override` in C++11, `/* override */` in C++98\n\n**See:**\n  * [`lh#fmt#printf()`](https://github.com/LucHermitte/lh-vim-lib))\n\n#### `(bpg):cpp_return_ptr_type`\nString format option for `printf()` (TODO: migrate to [`lh#fmt#printf()`](https://github.com/LucHermitte/lh-vim-lib))).\n\nIt tells how pointers are best returned from functions. Used only from [cpp/clonable-clas.template](snippets.md#cppclonable-clas.template) snippet.\n\n**Default Value**:\n * C++11: `std::unique_ptr<>`\n * C++98: `std::auto_ptr<>`\n\n**See:**\n * [cpp/clonable-clas.template](snippets.md#cppclonable-clas.template) which\n   uses it\n * [`(bpg):cpp_make_ptr`](#bpgcpp_make_ptr)\n\n#### `(bpg):cpp_root_exception`\nTDB\n\n#### `(bpg):cpp_use_copy_and_swap`\nBoolean option that suggest to use copy-and-swap idiom when expanding\nassignment-operator snippet directly, or indirectly through value classes snippets.\n\n**Default value:** 0 (false)\n\n**See:**\n  * [`cpp/assignment-operator.template`](snippets.md#cppassignment-operator.template) which uses it directly\n  * [`cpp/internals/class-skeleton.template`](snippets.md#cppinternalsclass-skeleton.template) which uses it indirectly\n\n#### `(bpg):cpp_use_nested_namespaces`\nBoolean option that enables the generation of _nested_ namespaces in C++17\ncodes with [`namespace` snippet](snippets.md#cppnamespace).\n\n__Default value:__ is 1 (true).\n\n#### `g:c_no_assign_in_condition`\nBoolean option that disables syntax highlighting that detects assignments in\nconditions.\n\n__Default value:__ is 0 (false).\n\n#### `g:c_no_hl_fallthrough_case`\nBoolean option that disables syntax highlighting that detects uses of `case`\nthat fall through other `case`s.\n\nThis feature isn't detecting correctly situation like: `break; } case`, that\nwhy it's disabled for the moment.\n\n__Default value:__ is 1 (true).\n\n#### `g:cpp_no_catch_by_reference`\nBoolean option that disables syntax highlighting that detects exceptions caught\nby value.\n\n__Default value:__ is 0 (false).\n\n#### `g:cpp_no_hl_c_cast`\nBoolean option that disables syntax highlighting that detects C casts in C++.\n\n__Default value:__ is 0 (false).\n\n#### `g:cpp_no_hl_funcdef`\nBoolean option that disables syntax highlighting that hightlight function\ndefinitions.\n\n__Default value:__ is 0 (false).\n\n#### `g:cpp_no_hl_throw_spec`\nBoolean option that disables syntax highlighting that detects throw\nspecifications in C++.\n\n__Default value:__ is 0 (false).\n\n#### `(bpg):({ft}_)array_size`\nTells how ` [cpp/array_size`](snippets.md#cpparray_size) snippet shall behave.\n\nThis variable is meant to be a dictionary than contains the following entries:\n - `\"file\"`: Filename to be included.\n - `\"funcname\"`: Text to be included when the snippet is expanded. The special\n   `\"%1\"` placeholder will be replaced with the array name.\n\n__Default value:__ not defined\n\n**See:**\n- [`cpp/array_size` snippet](snippets.md#cpparray_size)\n\n#### `(bpg):({ft}_)exception_args`\nArguments to inject in the exception called in\n[`throw` snippet](snippets.md#cppthrow).\n\n#### `(bpg):({ft}_)exception_type`\nException type to use in snippets like the\n[`throw` snippet](snippets.md#cppthrow).\n\n__Default__ is `std::runtime_error`\n\n#### `(bpg):({ft}_)ext_4_impl_file`\nTells the extension to use when [`:GOTOIMPL`](features.md#gotoimpl) generates a\nnew implementation skeleton for a function.\n\n__Default__ is \".cpp\".\n\n#### `(bpg):({ft}_)file_regex_for_inclusion`\nRegex used by API function [`lh#cpp#tags#fetch()`](API.md#lh-cpp-tags-fetch) to\nfilter filenames to keep.\n\n__Default value:__ \"`\\.h`\"\n\n#### `(bpg):({ft}_)filename_simplify_for_inclusion`\nTells API function\n[`lh#cpp#tags#strip_included_paths()`](API.md#lh-cpp-tags-strip_included_paths)\nhow to simplify filenames with |`fnamemodify()`|.\n\n__Default value:__ \"`:t`\"\n\n#### `(bpg):({ft}_)gcov_files_path`\nThis option tells where gcov files are expected. The default value is the\nsame path as the one where the current file is.\n\n**See:** `<localleader>g` which permits to swap between a `.gcov` file and its\nsource.\n\n#### `(bpg):({ft}_)guard_headers_with`\nThis option tells how multiple inclusions of header files is prevented. This\ncan be done with (portable) `#ifndef SOME_GUARD` + `#define SOME_GUARD`, or\nwith `#pragma once` (non-standard) directive.\n\nValid values for this option are: `ifndef`, `ifndef,pragma`, or `pragma`\n\n**Note:** This option is actually used by the default template-file from\nmu-template.\n\n#### `(bpg):({ft}_)implPlace`\nTells where a generated accessor shall go (with `:ADDATTRIBUTE`):\n\n- 0 -> Near the prototype/definition (Java's way)\n- 1 -> Within the inline section of the header/inline/current file\n- 2 -> Within the implementation file (.cpp)\n- 3 -> Use the pimpl idiom (In the Todo-List)\n\n#### `g:inlinesPlace`\nWhere inlines are written on `:ADDATTRIBUTE`\n\n- 0 -> In the inline section of the header/current file\n- 1 -> In the inline section of a dedicated inline file\n\n#### `(bpg):({ft}_)includes`\nOption used by the C-ftplugin that completes the names of files to include.\nThe options tells which directories shall be searched.\n\n__Default value:__ is vim option `&path`\n\n**See:** `<PlugCompleteIncludes>` (`i_CTRL-X_I`) and `<Plug>OpenIncludes`\n(`n_CTRL_L`)\n\n#### `(bpg):({ft}_)multiple_namespaces_on_same_line`\nBoolean option wrapped into API function\n[`lh#cpp#option#multiple_namespaces_on_same_line()`](API.md#lh-cpp-option-multiple-namespaces-on-same-line).\n\n__Default value:__ 1 (true)\n\nPermits snippets like [`namespace`](snippets.md#cppnamespace) to write all names\non a same line (when _nested namespaces_ aren't supported). i.e:\n\n```C++\n// If true\nnamespace ns1 { namespace ns2 {\n} } // namespaces ns1::ns2\n\n// If false\nnamespace ns1 {\nnamespace ns2 {\n} // namespace ns1::ns2\n} // namespace ns1\n```\n\n#### `(bpg):({ft}_)nl_before_bracket` (deprecated)\n#### `(bpg):({ft}_)nl_before_curlyB` (deprecated)\n#### `(bpg):({ft}_)pre_desc_ordered_tags`, `(bpg):({ft}_post_desc_ordered_tags)`\nIn [`function-comment` snippet](snippets.md#cppinternalsinternalsfunction-comment), these |List|\noptions tell in which order the various documentation information are inserted\naround the description the user will have to type:\n\nThe default before the user typed information is:\n- \"_ingroup_\", \"_brief_\", \"_tparam_\", \"_param_\", \"_return_\", \"_throw_\", \"_invariant_\", \"_pre_\", \"_post_\"\n\nThe default after the user typed information is:\n- \"_note_\", \"_warning_\"\n\n#### `(bpg):({ft}_)project_namespace`\nName of the project namespace used by the snippet\n[`namespace`](snippets.md#cppnamespace).\n\n__Default value:__ the placeholder `«ns»`\n\nThis is also what is returned by API function\n[`lh#cpp#snippets#current_namespace()`](API.md#lh-cpp-snippets#current_namespace)\n-- in that case, the default value used is an empty string.\n\n#### `(bpg):({ft}_)tag_kinds_for_inclusion`\nRegex used by API function [`lh#cpp#tags#fetch()`](API.md#lh-cpp-tags-fetch) to\nfilter tags kind to keep.\n\n__Default value:__ \"`[dfptcs]`\"\n\n#### `(bpg):tags_select`\nTags selection policy used by API function [`lh#cpp#tags#fetch()`](API.md#lh-cpp-tags-fetch).\n\n__Default value:__ \"`expand('<cword>')`\".\n\n#### `(bpg):({ft}_)template_expand_doc`\nBoolean option used in snippets to tell whether documentation generation is\nrequired.\n\n**See:**\n- [`formatted-comment` snippet](snippets.md#cppinternalsformatted-comment)\n- [`function-comment` snippet](snippets.md#cppinternalsfunction-comment)\n\n#### `(bpg):xsltproc`\nPath to where the executable `xsltproc` is.\n\n__Default Value:__ `xsltproc`.\n\nThis options is used by the C-ftplugin that converts PVS-studio output into a\nformat compatible with quickfix.\n\n**See:** `:PVSLoad`, `:PVSIgnore`, `:PVSShow` and `:PVSRedraw`\n\n#### Doxygen related options\n\n##### `(bpg):({ft}_)dox_CommentLeadingChar`\nTells which character to use on each line of a Doxygen comment.\n\n__Default value:__ `\"*\"`\n\nWrapped in API function\n[`lh#dox#comment_leading_char()`](API.md#lh-dox-comment_leading_char)\n\n##### `(bpg):({ft}_)dox_TagLeadingChar`\nTells which character to use on each line of a Doxygen comment.\n\n__Default value:__ `\"*\"`. Other typical value: `\"!\"`\n\nWrapped in API function\n[`lh#dox#tag_leading_char()`](API.md#lh-dox-tag_leading_char)\n\n##### `(bpg):({ft}_)dox_author_tag`\nTells which tag to use to introduce authors.\n\n__Default value:__ `\"author\"`.\n\nWrapped in API function [`lh#dox#author()`](API.md#lh-dox-author)\n\n##### `(bpg):({ft}_)dox_author`\nReturns the default value to use as the author tagged in Doxygen comments.\n\n__Default value:__ None\n\nWrapped in API function [`lh#dox#author()`](API.md#lh-dox-author)\n\n##### `(bpg):({ft}_)dox_brief`\nTells if `brief` tag shall be used.\n\n__Default value:__ `\"short\"`.\n\n__Other possible values:__ `\"yes\"/\"always\"/\"1\"`, `\"no\"/\"never\"/\"0\"/\"short\"`\n\nWrapped in API function [`lh#dox#brief()`](API.md#lh-dox-brief)\n\n##### `(bpg):({ft}_)dox_group`\nDefault Doxygen group name used in snippets and templates.\n\n__Default value:__ the placeholder `«Project»`\n\n**See:**\n- [`dox/ingroup` snippet](snippets.md#doxingroup)\n- [`dox/file` snippet](snippets.md#doxfile)\n- [`cpp/class` snippet](snippets.md#cppclass)\n- [`cpp/singleton` snippet](snippets.md#cppsingleton)\n- [`cpp/enum2` snippet](snippets.md#cppenum2)\n\n##### `(bpg):({ft}_)dox_ingroup`\nTells if `ingroup` tag shall be used.\n\n__Default value:__ `\"0\"`.\n\n__Other possible values:__ `\"yes\"/\"always\"/\"1\"`, `\"no\"/\"never\"/\"0\"`, or a group\nname to use.\n\nWrapped in API function [`lh#dox#ingroup()`](API.md#lh-dox-ingroup)\n\n##### `(bpg):({ft}_)dox_sep`\nTells which character use between a tag and its value.\n\n__Default value:__ `\" \"`. Other typical value: `\"\\t\"`\n\nWrapped in API function [`lh#dox#tag()`](API.md#lh-dox-tag)\n\n##### `(bpg):({ft}_)dox_throw`\nTells which tag name to use to document exceptions.\n\n__Default value:__ `\"throw\"`. Other typical value: `\"exception\"`\n\nWrapped in API function [`lh#dox#throw()`](API.md#lh-dox-throw)\n\n##### `(bpg):ProjectVersion`\nVersion of the project. Can be used in Doxygen comment through API function\n[`lh#dox#since()`](API.md#lh-dox-since).\n\n\n### TODO: Options to be documented\n##### `(bpg):({ft}_)place_const_after_type`\nUsed in `lh#dev#cpp#types#const_correct_type()`\n\nDefault: true\n"
  },
  {
    "path": "doc/snippets.md",
    "content": "# lh-cpp Snippets, templates and wizards\n\n## Contents\n\n  * [Remarks](#remarks)\n  * [Control Statements](#control-statements)\n      * [cpp/catch](#cppcatch)\n      * [cpp/for-enum](#cppfor-enum)\n      * [cpp/for-iterator](#cppfor-iterator)\n      * [cpp/for-range](#cppfor-range)\n      * [cpp/fori](#cppfori)\n      * [cpp/foriN](#cppforin)\n      * [cpp/namespace](#cppnamespace)\n      * [cpp/throw](#cppthrow)\n      * [cpp/try](#cpptry)\n      * [cpp/while-getline](#cppwhile-getline)\n  * [Standard (and boost) Types](#standard-and-boost-types)\n      * [cpp/auto_ptr](#cppauto_ptr)\n      * [cpp/auto_ptr-instance](#cppauto_ptr-instance)\n      * [cpp/file](#cppfile)\n      * [cpp/list](#cpplist)\n      * [cpp/map](#cppmap)\n      * [cpp/noncopyable](#cppnoncopyable)\n      * [cpp/path](#cpppath)\n      * [cpp/ptr_vector](#cppptr_vector)\n      * [cpp/set](#cppset)\n      * [cpp/shared_ptr](#cppshared_ptr)\n      * [cpp/string](#cppstring)\n      * [cpp/unique_ptr](#cppunique_ptr)\n      * [cpp/unordered_map](#cppunordered_map)\n      * [cpp/unordered_set](#cppunordered_set)\n      * [cpp/vector](#cppvector)\n      * [cpp/weak_ptr](#cppweak_ptr)\n  * [Standard (and boost) Functions and Idioms](#standard-and-boost-functions-and-idioms)\n      * [c/assert](#cassert)\n      * [c/rand_init](#crand_init)\n      * [c/realloc](#crealloc)\n      * [cpp/array_size](#cpparray_size)\n      * [cpp/internals/get-b-e](#cppinternalsget-b-e)\n      * [cpp/b-e](#cppb-e)\n      * [cpp/cerr](#cppcerr)\n      * [cpp/cin](#cppcin)\n      * [cpp/copy](#cppcopy)\n      * [cpp/copy-back_inserter](#cppcopy-back_inserter)\n      * [cpp/cout](#cppcout)\n      * [cpp/ends_with](#cppends_with)\n      * [cpp/erase-remove](#cpperase-remove)\n      * [cpp/forward](#cppforward)\n      * [cpp/iss](#cppiss)\n      * [cpp/oss](#cpposs)\n      * [cpp/sort](#cppsort)\n      * [cpp/starts_with](#cppstarts_with)\n      * [cpp/static_assert](#cppstatic_assert)\n      * [cpp/typeid](#cpptypeid)\n  * [Classes](#classes)\n    * [Class Elements](#class-elements)\n      * [cpp/assignment-operator](#cppassignment-operator)\n      * [cpp/bool-operator](#cppbool-operator)\n      * [cpp/copy-and-swap](#cppcopy-and-swap)\n      * [cpp/copy-constructor](#cppcopy-constructor)\n      * [cpp/default-constructor](#cppdefault-constructor)\n      * [cpp/destructor](#cppdestructor)\n      * [cpp/operator-binary](#cppoperator-binary)\n      * [cpp/stream-extractor](#cppstream-extractor)\n      * [cpp/stream-inserter](#cppstream-inserter)\n    * [Class Patterns](#class-patterns)\n      * [cpp/abs-rel](#cppabs-rel)\n      * [cpp/abstract-class](#cppabstract-class)\n      * [cpp/base-class](#cppbase-class)\n      * [cpp/base-class-non-virtual](#cppbase-class-non-virtual)\n      * [cpp/class](#cppclass)\n      * [cpp/empty-exception-class](#cppempty-exception-class)\n      * [cpp/enum](#cppenum)\n      * [cpp/enum2](#cppenum2)\n      * [cpp/enum2-impl](#cppenum2-impl)\n      * [cpp/exception-class](#cppexception-class)\n      * [cpp/singleton](#cppsingleton)\n      * [cpp/traits](#cpptraits)\n  * [Doxygen](#doxygen)\n      * [dox/author](#doxauthor)\n      * [dox/code](#doxcode)\n      * [dox/em](#doxem)\n      * [dox/file](#doxfile)\n      * [dox/function](#doxfunction)\n      * [dox/group](#doxgroup)\n      * [dox/html](#doxhtml)\n      * [dox/ingroup](#doxingroup)\n      * [dox/since](#doxsince)\n      * [dox/tt](#doxtt)\n  * [Miscellaneous](#miscellaneous)\n      * [c/comment](#ccomment)\n      * [cpp/benchmark](#cppbenchmark)\n      * [cpp/otb-sug-latex](#cppotb-sug-latex)\n      * [cpp/otb-sug-snippet](#cppotb-sug-snippet)\n      * [cpp/utf8](#cpputf8)\n  * [Internal templates](#internal-templates)\n      * [cpp/internals/abs-rel-shared](#cppinternalsabs-rel-shared)\n      * [cpp/internals/class-skeleton](#cppinternalsclass-skeleton)\n      * [cpp/internals/formatted-comment](#cppinternalsformatted-comment)\n      * [cpp/internals/function-comment](#cppinternalsfunction-comment)\n      * [cpp/internals/stream-common](#cppinternalsstream-common)\n      * [cpp/internals/stream-implementation](#cppinternalsstream-implementation)\n      * [cpp/internals/stream-signature](#cppinternalsstream-signature)\n\n## Remarks\n\n * Styling options from\n   [lh-style](https://lh-style.readthedocs.io/en/latest/code-formatting.html)\n   are applied on the snippets. In other words, the code presented here may be\n   formatted differently regarding spaces and newlines.\n\n * [Placeholders](http://github.com/LucHermitte/lh-brackets) are represented\n   within «French quotation marks».\n\n * Default snippets from\n   [mu-template](http://github.com/LucHermitte/mu-template) aren't documented\n   yet.\n\n * About variation points ... TBD\n * About so called snippet _parameter_ ... TBD\n * About surrounding numbers ... TBD\n\n## Control Statements\n#### cpp/catch\n**Produces:**\n```C++\ncatch(«...») {\n    «catch-code»\n}\n```\n\n**Surround:**\n  1. The selection can be surrounded to become the catch-code\n\n#### cpp/for-enum\n**Produces:**\n```C++\nfor («Enum»::type «exception_type»(«exception_args»)=«Enum»::type()\n   ; «exception_type»(«exception_args»)!=«Enum»::MAX__\n   ; ++«exception_type»(«exception_args»))\n{\n    «code»\n}\n```\n\n**Surround:**\n  1. The selection can be surrounded to become the loop code\n\n**Note:**\n  *  This snippet is meant to be used with [cpp/enum](#cppenum) snippets\n\n#### cpp/for-iterator\n**Produces:**\n```C++\nfor («clsname»::«const_»iterator «b»=«cont»begin(), «exception_type»(«exception_args»)=«cont».end()\n    ; «b»!=«exception_type»(«exception_args»)\n    ; ++«b»)\n{\n    «code»\n}\n```\n\n**Surround:**\n  1. The selection can be surrounded to become the loop code\n\n**Notes:**\n  *  Container name («cont»), and iterators names («b» and «exception_type»(«exception_args»)) are asked to the end user\n\n#### cpp/for-range\n**Produces:**\n```C++\nfor («type» «elem» : «range») {\n    «code»\n}\n```\n\n**Parameters:**\n  * _type_, default: `auto&&`\n  * _elem_, default: `e`\n  * _range_, default: `«range»`\n\n**Surround:**\n  1. The selection can be surrounded to become the loop code\n\n#### cpp/fori\n**Produces:**\n```C++\nfor («int» «i»=0;«i»!=«N»;++«i») {\n    «code»\n}\n```\n\n**Surround:**\n  1. The selection can be surrounded to become the loop code\n\n#### cpp/foriN\n**Produces:**\n```C++\nfor («std::size_t» «i»=0, «N»=...;«i»!=«N»;++«i») {\n    «code»\n}\n```\n\n**Surround:**\n  1. The selection can be surrounded to become the loop code\n\n#### cpp/namespace\n**Produces:** `namespace «ns» { ... } // «ns»`\n\n**Parameters:**\n  * _ns_, default: `(bpg):[{ft}_]project_namespace`\n\n**Options:**\n  * [`(bpg):[{ft}_]project_namespace`](options.md#bpgft_project_namespace), which\n    defaults to `«ns»`\n  * [`lh#cpp#use_cpp17()`](options.md#bpgcpp_std_flavour)\n  * [`(bpg):cpp_use_nested_namespaces`](options.md#bpgcpp_use_nested_namespaces)\n\n**Surround:**\n  1. The selection can be surrounded to become the namespace code\n\n**Notes:**\n  * If the namespace parameter is `foo::bar`, this snippet produces two nested\n    namespace definitions.\n  * If C++17 flavour is selected, and `(bpg):cpp_use_nested_namespaces` is true,\n    then a C++17 _nested namespace_ will be used.\n\n#### cpp/throw\n**Produces:**\n  * `throw «exception_type»(«exception_args»);«»` (within code context)\n  * or `@throw «exception_type»«»` (within Doxygen comments)\n\n**Parameters:**\n  * `exception_text`, default: cpp/internals/formatted-comm\n\n**Options:**\n  * `(bpg):({ft}_)exception_type`, default: `std:runtime_error`\n  * `(bpg):({ft}_)exception_args`, default: `v:1_`, functor that gets `exception_txt` injected as parameter. A typical value would be:\n\n  ```vim\n:let b:exception_args = 'v:1_.lh#marker#txt(\", \".b:cpp_project_namespace.\"::ExitCode::\")'\n  ```\n  Note that this expression dynamically adapts to the current\n  `b:cpp_project_namespace`, and to the current marker characters.\n  *  Doxygen related options:\n    * [`(bpg):({ft_}dox_TagLeadingChar)`](options.mg#bpgft_dox_tagleadingchar)\n    * [`(bpg):({ft_}dox_throw)`](options.mg#bpgft_dox_throw)\n\n**Relies on:**\n  * [`lh#dox#tag()`](API.md#lhdoxtag)\n  * [`lh#dox#throw()`](API.md#lhdoxthrow)\n\n**Also includes:**\n  * `<stdexcept>` if `exception_type` starts with `std::`\n\n#### cpp/try\n**Produces:**\n```C++\ntry {\n    «code»\n} catch(«std::exception const& e») {\n    «catch-code»\n}\n```\n\n**Surround:**\n  1. The selection can be surrounded to become the try-code\n  2. The selection can be surrounded to become the catch-code\n\n#### cpp/while-getline\n**Produces:**\n```C++\nwhile(std::getline(«stream»,«line»)) {\n    «code»;\n}\n```\n\n**Surround:**\n  1. The selection can be surrounded to become the loop code\n\n**Also includes:**\n  * `<string>`\n\n\n## Standard (and boost) Types\n#### cpp/auto_ptr\n**Produces:** `std::auto_ptr<«type»>`\n\n**Surround:**\n  1. The selection can be surrounded to become the value type\n\n**Also includes:**\n  * `<memory>`\n\n#### cpp/auto_ptr-instance\n**Produces:** `std::auto_ptr<«type»> ptr(new «type»(args));`\n\n**Surround:**\n  1. The selection can be surrounded to become the value type\n\n**Also includes:**\n  * `<memory>`\n\n**Notes:**\n  * I hesitate to call it `cpp/make_auto_ptr`\n\n#### cpp/file\n**Produces:** `«i»fstream f(«filename»);`\n\n**Surround:**\n  1. The selection can be surrounded to become the filename\n\n**Also includes:**\n  * `<fstream>`\n\n#### cpp/list\n**Produces:** `std::list<«type»> «»`\n\n**Surround:**\n  1. The selection can be surrounded to become the value type\n\n**Also includes:**\n  * `<list>`\n\n#### cpp/map\n**Produces:** `std::map<«key»,«value»> «»`\n\n**Surround:**\n  1. The selection can be surrounded to become the value type\n  2. The selection can be surrounded to become the key type\n\n**Also includes:**\n  * `<map>`\n\n#### cpp/noncopyable\n**Produces:** `boost::noncopyable`\n\n**Also includes:**\n  * `<boost/noncopyable.hpp>`\n\n#### cpp/path\n**Produces:** `boost::filesystem::path`\n\n**Also includes:**\n  * `<boost/filesystem.hpp>`\n\n#### cpp/ptr_vector\n**Produces:** `boost::ptr_vector<«type»> «»`\n\n**Surround:**\n  1. The selection can be surrounded to become the value type\n\n**Also includes:**\n  * `<boost/ptr_container/ptr_vector.hpp>`\n\n#### cpp/set\n**Produces:** `std::set<«type»> «»`\n\n**Surround:**\n  1. The selection can be surrounded to become the value type\n\n**Also includes:**\n  * `<set>`\n\n#### cpp/shared_ptr\n**Produces:**\n  * `std::shared_ptr<«type»> «»`, in [C++11 or more](options.md#bpgcpp_std_flavour)\n  * `boost::shared_ptr<«type»> «»`, otherwise\n\n**Options:**\n  * [`lh#cpp#use_cpp11()`](options.md#bpgcpp_std_flavour)\n\n**Surround:**\n  1. The selection can be surrounded to become the value type\n\n**Also includes:**\n  * `<memory>` in C++11\n  * `<boost/shared_ptr.hpp>` otherwise\n\n#### cpp/string\n**Produces:** `std::string «»`\n\n**Also includes:**\n  * `<string>`\n\n#### cpp/unique_ptr\n**Produces:** `std::unique_ptr<«type»>`\n\n**Surround:**\n  1. The selection can be surrounded to become the value type\n\n**Also includes:**\n  * `<memory>`\n\n#### cpp/unordered_map\n**Produces:** `std::unordered_map<«key»,«value»> «»`\n\n**Surround:**\n  1. The selection can be surrounded to become the value type\n  2. The selection can be surrounded to become the key type\n\n**Also includes:**\n  * `<unordered_map>`\n\n#### cpp/unordered_set\n**Produces:** `std::unordered_set<«key»,«value»> «»`\n\n**Surround:**\n  1. The selection can be surrounded to become the value type\n  2. The selection can be surrounded to become the key type\n\n**Also includes:**\n  * `<unordered_set>`\n\n#### cpp/vector\n**Produces:** `std::vector<«type»> «»`\n\n**Surround:**\n  1. The selection can be surrounded to become the value type\n\n**Also includes:**\n  * `<vector>`\n\n#### cpp/weak_ptr\n**Produces:**\n  * `std::weak_ptr<«type»> «»`, in [C++11 or more](options.md#bpgcpp_std_flavour)\n  * `boost::weak_ptr<«type»> «»`, otherwise\n\n**Options:**\n  * [`lh#cpp#use_cpp11()`](options.md#bpgcpp_std_flavour)\n\n**Surround:**\n  1. The selection can be surrounded to become the value type\n\n**Also includes:**\n  * `<memory>` in C++11\n  * `<boost/shared_ptr.hpp>` otherwise\n\n\n## Standard (and boost) Functions and Idioms\n#### c/assert\n**Produces:** `assert(«assertion»)`\n\n**Surround:**\n  1. The selection can be surrounded to become the «assertion»\n\n**Also includes:**\n  * `<assert.h>` in C, `<cassert>` in C++\n\n#### c/rand_init\n**Produces:** `srand(time(NULL));`\n\n**Also includes:**\n  * `<time.h>` in C, `<ctime>` in C++\n  * `<stdlib.h>` in C, `<cstdlib>` in C++\n\n**TODO:**\n  * Adapt the snippet to C++11 new random functions\n\n#### c/realloc\n**Produces:**\n```C++\ntype lhs = (type) realloc(ptr, size); macro\nif (! lhs) {                          macro\n    free(ptr);                        macro\n    ptr = NULL;                       macro\n    count = 0;                        macro\n    «error_message»;                  macro\n    return false                      macro\n}                                     macro\nptr = lhs;\n```\n\n**Parameters:**\n  * A dictionary that contains:\n    * `\"ptr\"`, default `«p»`\n    * `\"lhs\"`, default `new ` + _ptr_\n    * `\"type\"`, default `«clsname»`\n    * `\"count\"`, default `«count»`\n    * `\"size\"`, default _count_ `* sizeof(`_type_`)`\n    * `\"realloc\"`, default `realloc`\n    * `\"free\"`, default `free`\n    * `\"false\"`, default `false`\n    * `\"macro\"`, default: an empty string, expected value: `\\\\`\n\n#### cpp/array_size\n**Produces:**\n```C++\n// C++98/03\narray_size(«array»)\n// C++11\nstd::extent<decltype(«array»)>::value`\n// C++17\nstd::size(«array»)\n```\n\nOr whatever is specified into\n[`(bpg):({ft}_)array_size`](options.md#bpgcpp_array_size). Up to C++14, it's\nrecommended to follow the instructions generated as comments, and to put an\nequivalent of C++17 `std::size()` in a header file and use it. Let's say the\nfunction is named `myarray_size()` and put into `myrange.h`, then define into\nyour project configuration file (e.g. a\n[`_vimrc_local.vim`](https://github.com/LucHermitte/local_vimrc)):\n\n```vim\nlet b:cpp_array_size = {'file': 'myrange.h', 'funcname': 'myarray_size(%1)'}\n```\n\n**Parameters:**\n  * _array_, default «array»\n\n**Options:**\n  * [`lh#cpp#use_cpp11()` and `lh#cpp#use_cpp17()`](options.md#bpgcpp_std_flavour)\n  * [`(bpg):({ft}_)array_size`](options.md#bpgcpp_array_size)\n\n**Surround:**\n  1. The selection can be surrounded to become the array name\n\n**Also includes:**\n  * `<type_traits>` in C++11 and C++14\n  * `<iterator>` from C++17 onward\n\n**Notes:**\n  * In C++98/03, the definition of `array_size()` macro is provided along the\n    way\n\n**TODO:**\n  * Define the unsafe C equivalent `c/array_size`:\n    `sizeof «array»/sizeof «array»[0]`\n  * In C++17, detect whether there is a `using std::size` in the context to\n    rely on ADL and/or\n    [`(bpg):cpp_begin_end_style`](options.md#bpgft_begin_end_style) equals\n    \"adl ;\"\n\n#### cpp/internals/get-b-e\n**Assign values to mu-template snippet variables:**\n  * `s:begin`\n  * `s:end`\n  * `s:container`\n\nTheir values will be:\n  * either `std::begin(«container»)` and `std::end(«container»)`\n    if [C++11 flavour](options.md#bpgcpp_std_flavour) is used, or\n    if [`(bpg):cpp_begin_end_style`](options.md#bpgft_begin_end_style) equals\n    \"std ;\"\n  * or `boost::begin(«container»)` and `boost::end(«container»)`\n    if [`(bpg):cpp_begin_end_style`](options.md#bpgft_begin_end_style) equals\n    \"boost ;\"\n  * or `begin(«container»)` and `end(«container»)`\n    if [`(bpg):cpp_begin_end_style`](options.md#bpgft_begin_end_style) equals\n    \"adl ;\"\n  * or `«container».begin()` and `«container».end()` otherwise.\n\n**Also includes:**\n  * `<iterator>` when [`(bpg):cpp_begin_end_style`](options.md#bpgcpp_begin_end_style) is `\"std\"`\n  * `<boost/range/begin.hpp>` and `<boost/range/end.hpp>` when [`(bpg):cpp_begin_end_style`](options.md#bpgcpp_begin_end_style) is `\"boost\"`\n  * or whatever [`(bpg):cpp_begin_end_includes`](options.md#bpgcpp_begin_end_includes) specifies\n\n**Parameters:**\n  * _container_, default: «container»\n\n**Surround:**\n  1. The selection can be surrounded to become the container name\n\n**Options:**\n  * [C++11 flavour](options.md#bpgcpp_std_flavour)\n  * [`(bpg):cpp_begin_end_style`](options.md#bpgcpp_begin_end_style)\n  * [`(bpg):cpp_begin_end_includes`](options.md#bpgcpp_begin_end_includes)\n\n#### cpp/b-e\n**Produces:**\n  * either `std::begin(«container»), std::end(«container»)`\n    if [C++11 flavour](options.md#bpgcpp_std_flavour) is used, or\n    if [`(bpg):cpp_begin_end_style`](options.md#bpgft_begin_end_style) equals\n    \"std\" ;\n  * or `boost::begin(«container»), boost::end(«container»)`\n    if [`(bpg):cpp_begin_end_style`](options.md#bpgft_begin_end_style) equals\n    \"boost\" ;\n  * or `«container».begin(), «container».end()`\n    if [`(bpg):cpp_begin_end_style`](options.md#bpgft_begin_end_style) equals\n    \"adl\" ;\n  * or `begin(«container»), end(«container»)` otherwise.\n\n**Also includes:**\n  * `<iterator>` when [`(bpg):cpp_begin_end_style`](options.md#bpgcpp_begin_end_style) is `\"std\"`\n  * `<boost/range/begin.hpp>` and `<boost/range/end.hpp>` when [`(bpg):cpp_begin_end_style`](options.md#bpgcpp_begin_end_style) is `\"boost\"`\n  * or whatever [`(bpg):cpp_begin_end_includes`](options.md#bpgcpp_begin_end_includes) specifies\n\n**Parameters:**\n  * _container_, default: «container»\n\n**Surround:**\n  1. The selection can be surrounded to become the container name\n\n**Options:**\n  * [C++11 flavour](options.md#bpgcpp_std_flavour)\n  * [`(bpg):cpp_begin_end_style`](options.md#bpgcpp_begin_end_style)\n  * [`(bpg):cpp_begin_end_includes`](options.md#bpgcpp_begin_end_includes)\n\n**Variation Points:**\n  * [`cpp/internals/get-b-e`](#cppinternalsget-b-e) snippet\n\n#### cpp/cerr\n**Produces:** `std::cerr <<`\n\n**Also includes:**\n  * `<iostream>`\n\n#### cpp/cin\n**Produces:** `std::cin >>`\n\n**Also includes:**\n  * `<iostream>`\n\n#### cpp/copy\n**Produces:** `std::copy(first, last, dest)`\n\n**Parameters:**\n  * _container_, default: «container»\n\n**Surround:**\n  1. The selection can be surrounded to become the container name\n\n**Also includes:**\n  * `<algorithm>`\n\n**TODO:**\n  * Use `cpp/b-e` snippet\n\n#### cpp/copy-back_inserter\n**Produces:** `std::copy(«origin».begin(), «origin».end(), std::back_inserter(«dest»));`\n\n**Parameters:**\n  * _origin_, default: «origin»\n  * _dest_, default: «destination»\n\n**Surround:**\n  1. The selection can be surrounded to become the container name\n  2. The selection can be surrounded to become the destination name\n\n**Also includes:**\n  * `<algorithm>`\n  * `<iterator>`\n\n**TODO:**\n  * Use `cpp/b-e` snippet\n\n#### cpp/cout\n**Produces:** `std::cout <<`\n\n**Also includes:**\n  * `<iostream>`\n\n#### cpp/ends_with\n**Produces:** `boost::algorithm::ends_with(«input», «prefix_searched»)`\n\n**Also includes:**\n  * `<boost/algorithm/string/predicate.hpp>`\n\n#### cpp/erase-remove\n**Produces:** `erase-remove idiom`\n\n**Parameters:**\n  * _container_, default: «container»\n\n**Surround:**\n  1. The selection can be surrounded to become the container name\n\n**Also includes:**\n  * `<algorithm>`\n\n**TODO:**\n  * Use `cpp/b-e` snippet\n\n#### cpp/forward\n**Produces:** `forward<«type»>(«var»)`\n\n**Parameters:**\n  *  _type_, default: «type»\n  *  _var_, default: «var»\n\n**Surround:**\n  1. The selection can be surrounded to become the variable\n  2. The selection can be surrounded to become the type\n\n#### cpp/iss\n**Produces:**\n```C++\nstd::istringstream iss(str);\nif (iss >> «»)\n{ ... }\n```\n\n**Also includes:**\n  * `<sstream>`\n\n#### cpp/oss\n**Produces:**\n```C++\nstd::ostringstream oss(str);\noss << «»;\n```\n\n**Also includes:**\n  * `<sstream>`\n\n#### cpp/sort\n**Produces:** `std::sort(range.begin(), range.end());`\n\n**Parameters:**\n  * _range_, default: «range»\n\n**Surround:**\n  1. The selection can be surrounded to become the range name\n\n**Also includes:**\n  * `<algorithm>`\n\n**TODO:**\n  * Use `cpp/b-e` snippet\n\n#### cpp/starts_with\n**Produces:** `boost::algorithm::starts_with(«input», «prefix_searched»)`\n\n**Also includes:**\n  * `<boost/algorithm/string/predicate.hpp>`\n\n#### cpp/static_assert\n**Produces:**\n```C++\n// C++11\nstatic_assert(«cond», «msg»)\n// C++98/03\nBOOST_STATIC_ASSERT(«cond»)\n```\n\n**Parameters:**\n  *  _condition_, default: «condition»\n  *  _message_, default: «message»\n\n**Options:**\n  * [C++11 flavour](options.md#bpgcpp_std_flavour)\n\n**Also includes:**\n  * `<boost/static_assert.hpp>`, in C++98/03\n\n\n#### cpp/typeid\n**Produces:** `typeid(«type»).name()`\n\n**Parameters:**\n  *  _type_, default: «type»\n\n**Surround:**\n  1. The selection can be surrounded to become the type\n\n**Also includes:**\n  * `<typeinfo>`\n\n## Classes\n\n### Class Elements\n#### cpp/assignment-operator\n**Produces:** `«clsname»& operator=(«clsname» const&);`\n\n**Parameters:**\n  1. `\"clsname\"`, the class name, default: automatically deduced by\n    [`lh#cpp#AnalysisLib_Class#CurrentScope`](API.md#lhcppanalysislib_classcurrentscope), «clsname» otherwise\n  2. `\"use_copy_and_swap\"`: boolean, default: asked to the end-user\n  * `\"copy-constructor\"`: (dictionary)\n    * \"visibility\": *\"public\"*/\"protected\"/\"private\"\n    * \"how\": *\"\"*/\"deleted\"/\"defaulted\"\n\n**Options:**\n  * [lh-style naming conventions](https://lh-style.readthedocs.io/en/latest/naming.html)\n  * [`(bpg):cpp_use_copy_and_swap`](#bpgcpp_use_copy_and_swap)\n\n**Variation Points:**\n  * [`cpp/copy-and-swap`](#cppcopy-and-swap) snippet, if the idiom is used\n  * [`cpp/internals/function-comment`](#cppinternalsfunction-comment) snippet\n\n**Relies on:**\n  * [`cpp/copy-and-swap`](#cppcopy-and-swap)\n  * [`cpp/internals/get-class-name`](#cppinternalsget-class-name)\n  * [`cpp/internals/function-comment`](#cppinternalsfunction-comment)\n\n**TODO:**\n  * Detect C++11 to insert `noexcept` (through a variation point\n    (snippet/option) as some frameworks have their own macro/keyword for\n    `noexcept`)\n\n#### cpp/bool-operator\n**Produces:** A safe `bool operator` compatible with C++98/03\n\n**Notes:**\n  * The code produced follows the pattern presented by Matthew Wilson in\n    _Imperfect C++_, Addisson-Welsey, §24.6\n\n**See:**\n  * The [snippet code](../after/template/cpp/bool-operator.template)\n\n**TODO:**\n  *  Detect C++11 to produce an `explicit bool operator()` instead.\n\n#### cpp/copy-and-swap\n**Produces:** `assignment operator + swap`\n```C++\n// + comments generated with cpp/function-comment\nT& operator=(R rhs) {\n    this->swap(rhs);\n    return * this;\n}\n\n// + comments generated with cpp/function-comment\nvoid swap(T & other);\n```\n\n**Parameters:**\n  1. `\"clsname\"`, the class name, default: automatically deduced by\n    [`lh#cpp#AnalysisLib_Class#CurrentScope`](API.md#lhcppanalysislib_classcurrentscope), «clsname» otherwise\n\n**Options:**\n  * [lh-style naming conventions](https://lh-style.readthedocs.io/en/latest/naming.html)\n\n**Variation Points:**\n  * [`cpp/internals/function-comment`](#cppinternalsfunction-comment) snippet\n\n**TODO:**\n  * Detect C++11 to insert `noexcept` (through a variation point\n    (snippet/option) as some frameworks have their own macro/keyword for\n    `noexcept`)\n\n#### cpp/copy-constructor\n**Produces:** `T(T const&);`\n\n**Parameters:**\n  1. `\"clsname\"`, the class name, default: automatically deduced by\n    [`lh#cpp#AnalysisLib_Class#CurrentScope`](API.md#lhcppanalysislib_classcurrentscope), «clsname» otherwise\n  * `\"copy-constructor\"`: (dictionary)\n    * \"visibility\": *\"public\"*/\"protected\"/\"private\"\n    * \"how\": *\"\"*/\"deleted\"/\"defaulted\"\n\n**Options:**\n  * [lh-style naming conventions](https://lh-style.readthedocs.io/en/latest/naming.html)\n\n**Variation Points:**\n  * [`cpp/internals/function-comment`](#cppinternalsfunction-comment) snippet\n\n**TODO:**\n  * Add move copy-constructor, and move assignment-operator\n  * Detect C++11 to insert `noexcept` (through a variation point\n    (snippet/option) as some frameworks have their own macro/keyword for\n    `noexcept`)\n\n#### cpp/default-constructor\n**Produces:** `T();`\n\n**Parameters:**\n  1. `\"clsname\"`, the class name, default: automatically deduced by\n    [`lh#cpp#AnalysisLib_Class#CurrentScope`](API.md#lhcppanalysislib_classcurrentscope), «clsname» otherwise\n  * `\"default-constructor\"`: (dictionary)\n    * \"visibility\": *\"public\"*/\"protected\"/\"private\"\n    * \"how\": *\"\"*/\"deleted\"/\"defaulted\"\n\n**Options:**\n  * [lh-style naming conventions](https://lh-style.readthedocs.io/en/latest/naming.html)\n\n**Variation Points:**\n  * [`cpp/internals/function-comment`](#cppinternalsfunction-comment) snippet\n\n**TODO:**\n  * Detect C++11 to insert `noexcept` (through a variation point\n    (snippet/option) as some frameworks have their own macro/keyword for\n    `noexcept`)\n\n#### cpp/destructor\n**Produces:** `«virtual »~T();`\n\n**Parameters:**\n  1. `\"clsname\"`, the class name, default: automatically deduced by\n    [`lh#cpp#AnalysisLib_Class#CurrentScope`](API.md#lhcppanalysislib_classcurrentscope), «clsname» otherwise\n  2. `\"is_virtual\"`: boolean, default: «virtual »\n  * `\"copy-constructor\"`: (dictionary)\n    * \"visibility\": *\"public\"*/\"protected\"/\"private\"\n    * \"how\": *\"\"*/\"deleted\"/\"defaulted\"/\"pure\"\n\n**Variation Points:**\n  * [`cpp/internals/function-comment`](#cppinternalsfunction-comment) snippet\n\n**Options:**\n  * [lh-style naming conventions](https://lh-style.readthedocs.io/en/latest/naming.html)\n\n#### cpp/operator-binary\n**Produces:**\n```C++\n«clsname» operator«X»(«clsname» lhs, «clsname» const& rhs)\n{ return lhs «X»= rhs; }\n```\n\n**Parameters:**\n  * `\"operator\"`: binary operation name, default: «X»\n  * `\"clsname\"`, the class name, default: automatically deduced by\n    [`lh#cpp#AnalysisLib_Class#search_closest_class`](API.md#lhcppanalysislib_classsearch_closest_class)\n\n**Options:**\n  * [lh-style naming conventions](https://lh-style.readthedocs.io/en/latest/naming.html)\n\n**Note:**\n  *  The code generated may change to encompass C++11 best practices and\n     performances. See\n     [some experimentations I've done](http://github.com/LucHermitte/LucHermitte.github.io/source/_posts/code/test-arithmetic-operators).\n\n**TODO:**\n  * [`cpp/internals/function-comment`](#cppinternalsfunction-comment) snippet\n\n#### cpp/stream-extractor\n**Produces:** `istream& operator>>(istream &, class-type)`\n\n**Relies on:**\n  * [`cpp/internals/stream-common`](#cppinternalsstream-common)\n\n#### cpp/stream-inserter\n**Produces:** `ostream& operator<<(ostream &, class-type)`\n\n**Relies on:**\n  * [`cpp/internals/stream-common`](#cppinternalsstream-common)\n\n### Class Patterns\n\nThe following snippets will generate new classes that follow the chosen\nsemantics as closely as possible.\n\nThe currently supported semantics and idioms are:\n * _class_, the simpliest snippet, unaware of anything\n * _value class_, copyable, comparable\n * _entity class_, non-copyable\n   * _base class non virtual_, **NOT** deletable through a pointer to the parent\n   * _base class_, deletable through a pointer to the parent\n     * _abstract class_\n     * _interface_ (synonym to _abstract class_, for the moment)\n     * _clonable class_, bastard class, neither a real entity nor a value\n       class.\n   * _singleton_\n * _exception_\n   * _empty exception_\n * _traits_\n\n**Surrounding:** When used to surround a list of attributes (type + name),\nthese will produce classes with:\n * all these attributes,\n * plus an initializing constructor that'll forward parameters to construct the\n   attributes,\n * plus all the related copy operations when the class has value semantics, and\n   when there are non trivially-correctly copiable attributes (like a non\n   view-pointer).\n\nIf you don't want to see an attribute used when generating these operations,\nadd the attribute later, manually. Currently, neither _getters_ no _setters_\nare generated automatically. As a few others I\n[consider](http://martinfowler.com/bliki/GetterEradicator.html)\n[them](http://www.adam-bien.com/roller/abien/entry/encapsulation_violation_with_getters_and)\n[to](http://stackoverflow.com/questions/565095/are-getters-and-setters-poor-design-contradictory-advice-seen)\n[be](http://www.javaworld.com/article/2073723/core-java/why-getter-and-setter-methods-are-evil.html)\n[bad](http://www.yegor256.com/2014/09/16/getters-and-setters-are-evil.html)\n[practice](https://pragprog.com/articles/tell-dont-ask) .\nFor now, use\n[vim-refactor](http://github.com/LucHermitte/vim-refactor) to generate\n[const correct](https://isocpp.org/wiki/faq/const-correctness) getters\nand setters that follow the\n[naming policy](https://lh-style.readthedocs.io/en/latest/naming.html)\nconfigured for my plugins.\n\n**API:** All these snippets can be used programmatically to generate even more\ncomplex classes. See the [related `*-class_spec.rb` tests](../spec).\n\n**Licencing:** Unlike other snippets, a few class patterns are under a BSL license.\n\n#### cpp/abs-rel\nTBD\n\n**Licence:** BSL\n\n#### cpp/abstract-class\n**Produces:** A base class to inherit from with:\n * A virtual pure public destructor\n * A protected default constructor (unless specified otherwise)\n * Non-copy-ability enforced\n\n**Parameters:**\n  * Any parameter passed to\n    [`cpp/internals/class-skeleton`](#cppinternalsclass-skeleton)\n\n**Options:**\n  * Any options used by\n    [`cpp/internals/class-skeleton`](#cppinternalsclass-skeleton). In\n    particular:\n    * [`lh#cpp#use_cpp11()`](options.md#bpgcpp_std_flavour)\n    * [`(bpg):cpp_deleted`](options.md#bpgcpp_deleted)\n    * [`(bpg):cpp_noncopyable_class`](#bpgcpp_noncopyable_class)\n\n**Relies on:**\n  * [`cpp/base-class`](#cppbase-class)\n  * [`cpp/entity-class`](#cppentity-class)\n  * [`cpp/internals/class-skeleton`](#cppinternalsclass-skeleton)\n\n#### cpp/base-class\n**Produces:** A base class to inherit from with:\n * A virtual public destructor, not necessarily pure (see [`cpp/abstract-class`](#cppabstract-class))\n * A protected default constructor (unless specified otherwise)\n * Non-copy-ability enforced\n\n**Parameters:**\n  * Any parameter passed to\n    [`cpp/internals/class-skeleton`](#cppinternalsclass-skeleton)\n\n**Options:**\n  * Any options used by\n    [`cpp/internals/class-skeleton`](#cppinternalsclass-skeleton). In\n    particular:\n    * [`lh#cpp#use_cpp11()`](options.md#bpgcpp_std_flavour)\n    * [`(bpg):cpp_deleted`](options.md#bpgcpp_deleted)\n\n**Relies on:**\n  * [`cpp/entity-class`](#cppentity-class)\n  * [`cpp/internals/class-skeleton`](#cppinternalsclass-skeleton)\n\n#### cpp/base-class-non-virtual\n**Produces:** A base class to inherit from with:\n * A protected non-virtual destructor\n * A protected default constructor (unless specified otherwise)\n * Non-copy-ability enforced\n\n**Parameters:**\n  * Any parameter passed to\n    [`cpp/internals/class-skeleton`](#cppinternalsclass-skeleton)\n\n**Options:**\n  * Any options used by\n    [`cpp/internals/class-skeleton`](#cppinternalsclass-skeleton). In\n    particular:\n    * [`lh#cpp#use_cpp11()`](options.md#bpgcpp_std_flavour)\n    * [`(bpg):cpp_deleted`](options.md#bpgcpp_deleted)\n\n**Relies on:**\n  * [`cpp/entity-class`](#cppentity-class)\n  * [`cpp/internals/class-skeleton`](#cppinternalsclass-skeleton)\n\n**Screencast:**\n![base-class-non-virtual snippet demo](screencast-snippet-baseNV-class.gif \"Snippet demo for a base class with a non virtual destructor\")\n\n#### cpp/class\n**Produces:** a simplistic class definition, unaware of semantics.\n\n**Parameters:**\n  * Any parameter passed to\n    [`cpp/internals/class-skeleton`](#cppinternalsclass-skeleton)\n\n**Options:**\n  * [`(bpg):dox_group`](options.md#bpgdox_group) , default: «Project»\n  * [`(bpg):({ft_}dox_TagLeadingChar)`](options.mg#bpgft_dox_tagleadingchar)\n  * Any options used by\n    [`cpp/internals/class-skeleton`](#cppinternalsclass-skeleton).\n\n**Relies on:**\n  * [`cpp/internals/class-skeleton`](#cppinternalsclass-skeleton)\n\n**Todo:**\n  * Have all class variations in their own template-file, and have the\n    wizard glob compatible files to ask the use which one he prefers\n  * Enhance the semantics (see _Big Rule of Two_ in C++98/03, Rule of _All or\n    Nothing_ is C++11). We should have:\n    * value-semantics, no resources\n    * value-semantics, responsible for one resource\n    * value-semantics, with RAII encapsulated resource(s)\n\n#### cpp/empty-exception-class\nTBD:\n#### cpp/entity-class\n**Produces:** A non-copiable class.\n\n**Parameters:**\n  * Any parameter passed to\n    [`cpp/internals/class-skeleton`](#cppinternalsclass-skeleton)\n\n**Options:**\n  * Any options used by\n    [`cpp/internals/class-skeleton`](#cppinternalsclass-skeleton). In\n    particular:\n    * [`lh#cpp#use_cpp11()`](options.md#bpgcpp_std_flavour)\n    * [`(bpg):cpp_deleted`](options.md#bpgcpp_deleted)\n\n**Relies on:**\n  * [`cpp/internals/class-skeleton`](#cppinternalsclass-skeleton)\n\n#### cpp/enum\nTBD:\n\n**See:** [lh-cpp enums generation](Enums.md)\n\n#### cpp/enum2\nTBD\n\nMeant to be used through [`:InsertEnum`](Enum.md#enum-snippet) command.\n\n**Options:**\n  * [`(bpg):({ft}_)dox_group`](#options.md#bpgft_dox_group)\n  * [`(bpg):cpp_begin_end_style`](options.md#bpgft_begin_end_style)\n  * [`lh#cpp#use_cpp11()` and `lh#cpp#use_cpp17()`](options.md#bpgcpp_std_flavour)\n  * [`(bpg):({ft}_)array_size`](options.md#bpgcpp_array_size)\n  * `(bpg):({ft}_)exception_type`, default: `std:runtime_error`\n  * `(bpg):({ft}_)exception_args`, default: `v:1_`, functor that gets `exception_txt` injected as parameter\n\n**Variation Points/Relies on:**\n  * [`cpp/array_size`](#cpparray_size) snippet\n  * [`cpp/static_assert`](#cppstatic_assert) snippet\n  * [`cpp/throw`](#cppthrow) snippet\n  * [`cpp/internals/formatted-comment`](#cppinternalsformatted-comment) snippet\n\n**See:** [lh-cpp enums generation](Enums.md#enum-snippet)\n\n#### cpp/enum2-impl\nTBD:\n\nMeant to be used through [`:InsertEnum`](Enum.md#enum-snippet) command.\n\n**Options:**\n  * `(bpg):({ft}_)exception_type`, default: `std:runtime_error`\n  * `(bpg):({ft}_)exception_args`, default: `v:1_`, functor that gets `exception_txt` injected as parameter\n  * [`(bpg):cpp_begin_end_style`](options.md#bpgcpp_begin_end_style)\n  * [`(bpg):cpp_begin_end_includes`](options.md#bpgcpp_begin_end_includes)\n\n**Variation Points/Relies on:**\n  * [`cpp/throw`](#cppthrow) snippet\n  * [`cpp/internals/get-b-e`](#cppinternalsget-b-e) snippet\n  * [`cpp/internals/formatted-comment`](#cppinternalsformatted-comment) snippet\n\n**See:** [lh-cpp enums generation](Enums.md#enum-snippet)\n\n#### cpp/exception-class\nTBD:\n#### cpp/interface\n**Produces:** An interface class to inherit from with:\n * A virtual pure public destructor\n * A protected default constructor (unless specified otherwise)\n * Non-copy-ability enforced\n\n**Parameters:**\n  * Any parameter passed to\n    [`cpp/internals/class-skeleton`](#cppinternalsclass-skeleton)\n\n**Options:**\n  * Any options used by\n    [`cpp/internals/class-skeleton`](#cppinternalsclass-skeleton). In\n    particular:\n    * [`lh#cpp#use_cpp11()`](options.md#bpgcpp_std_flavour)\n    * [`(bpg):cpp_deleted`](options.md#bpgcpp_deleted)\n    * [`(bpg):cpp_noncopyable_class`](#bpgcpp_noncopyable_class)\n\n**Relies on:**\n  * [`cpp/base-class`](#cppbase-class)\n  * [`cpp/entity-class`](#cppentity-class)\n  * [`cpp/internals/class-skeleton`](#cppinternalsclass-skeleton)\n\n**Note:**\n  * At this moment, there is no difference between the `cpp/interface` and the\n    [`cpp/abstract-class`](#cppabstract-class) snippets. I may eventually add\n    simplified support for\n    [NVI](https://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Non-Virtual_Interface)\n    idiom in `cpp/interface` snippet.\n\n#### cpp/singleton\n**Produces:** Wizard that produces a singleton class definition\n\n**Parameters:**\n  * _singleton name_, default: asked to the user\n\n**Options:**\n  * [`(bpg):dox_group`](options.md#bpgdox_group) , default: «Project»\n  * [`(bpg):({ft_}dox_TagLeadingChar)`](options.mg#bpgft_dox_tagleadingchar)\n\n**Notes:**\n  * A Doxygen documentation skeleton is inserted\n  * The user is asked to choose the kind of singleton implementation he desires\n    * Scott Meyer's singleton (local-static, MT-safe (C++11), lazy-construction\n      supported)\n    * My own appreciation of what a singleton shall look like (MT-safe, no lazy\n      construction, but explicit initialisation)\n\n**Also includes:**\n  * `<boost/noncopyable.hpp>`\n\n**Variation Points:**\n  * mu-template \"c/section-sep\" snippet\n\n**Relies on:**\n  * `CppDox_SingletonWizard()`\n\n**Todo:**\n  * Have all singleton variations in their own template-file, and have the\n    wizard glob compatible files to ask the use which one he prefers\n  * Use [cpp/internals/function-comment](#cppinternalsfunction-comment)\n\n#### cpp/traits\n**Produces:** traits-class\n```C++\n/** «name» traits class.\n */\ntemplate <typename «T»> struct «name»_traits\n{ <++> };\n```\n\n## Doxygen\n#### dox/author\n**Produces:** `@author`\n\n**Options:**\n  * [`(bpg):({ft_}dox_author_tag)`](options.mg#bpgft_dox_author_tag)\n  * [`(bpg):({ft_}dox_author)`](options.mg#bpgft_dox_author)\n  * [`(bpg):({ft_}dox_TagLeadingChar)`](options.mg#bpgft_dox_tagleadingchar)\n\n**Relies on:**\n  * [`lh#dox#author()`](API.md#lhdoxauthor)\n\n#### dox/code\n**Produces:** `<code>«code»</code>`\n\n**Parameters:**\n  * «code», default: empty placeholder «»\n\n**Options:**\n  * [`(bpg):({ft_}dox_TagLeadingChar)`](options.mg#bpgft_dox_tagleadingchar)\n\n**Surround:**\n  1. The selection can be surrounded by `<code>` tags.\n\n**Relies on:**\n  * [`lh#dox#tag()`](API.md#lhdoxtag)\n\n#### dox/em\n**Produces:** `<em>cpp/internals/formatted-comm</em>`\n\n**Parameters:**\n  * cpp/internals/formatted-comm, default: empty placeholder «»\n\n**Options:**\n  * [`(bpg):({ft_}dox_TagLeadingChar)`](options.mg#bpgft_dox_tagleadingchar)\n\n**Surround:**\n  1. The selection can be surrounded by `<em>` tags.\n\n**Relies on:**\n  * [`lh#dox#tag()`](API.md#lhdoxtag)\n\n#### dox/file\n**Produces:** `/** @file ... */`\n\n**Options:**\n  * [`(bpg):dox_group`](options.md#bpgdox_group) , default: «Project»\n  * [`(bpg):ProjectVersion`](options.md#bpgproject_version) , default: «1.0»\n  * [`(bpg):({ft_}dox_TagLeadingChar)`](options.mg#bpgft_dox_tagleadingchar)\n\n**Notes:**\n  * The filename written with the `@file` tag is deduced from `expand(%:t)`\n\n**Relies on:**\n  * [`lh#dox#tag()`](API.md#lhdoxtag)\n  * [`lh#dox#since()`](API.md#lhdoxsince)\n\n**TODO:**\n  * Recognize SVN/CVS context to not always include RCS tags like `$Id$`\n\n#### dox/function\n**Produces:** `/** @ingroup, @params, @exceptions, @pre, ... */`\n\n**Note:**\n  * This snippet is used to organize the various elements computed by [`:DOX`](features.md#DOX)\n  * Its internal are likely to change in the future to factorize the code with\n    `autoload/lh/dox.vim` and other snippets like\n    [cpp/internals/function-comment](#cppinternalsfunction-comment)\n\n#### dox/group\n**Produces:** Doxygen local group\n```C++\n//@{\n«»\n//@}\n```\n\n**Surround:**\n  1. The selection can be surrounded by the group tags\n\n#### dox/html\n**Produces:** `<html-tag>cpp/internals/formatted-comm</html-tag>`\n\n**Parameters:**\n  * cpp/internals/formatted-comm, default: empty placeholder «»\n\n**Options:**\n  * [`(bpg):({ft_}dox_TagLeadingChar)`](options.mg#bpgft_dox_tagleadingchar)\n\n**Surround:**\n  1. The selection can be surrounded by the html-tags\n  2. The selection can become the HTML tags\n\n**Relies on:**\n  * [`lh#dox#tag()`](API.md#lhdoxtag)\n\n#### dox/ingroup\n**Produces:** `/**@ingroup ... */`\n\n**Options:**\n  * [`(bpg):dox_group`](options.md#bpgdox_group) , default: «Project»\n  * [`(bpg):({ft_}dox_TagLeadingChar)`](options.mg#bpgft_dox_tagleadingchar)\n\n**Relies on:**\n  * [`lh#dox#tag()`](API.md#lhdoxtag)\n\n#### dox/since\n**Produces:** `@since Version`\n\n**Options:**\n  * [`(bpg):ProjectVersion`](options.md#bpgproject_version) , default: «1.0»\n  * [`(bpg):({ft_}dox_TagLeadingChar)`](options.mg#bpgft_dox_tagleadingchar)\n\n**Relies on:**\n  * [`lh#dox#tag()`](API.md#lhdoxtag)\n  * [`lh#dox#since()`](API.md#lhdoxsince)\n\n#### dox/tt\n**Produces:** `<tt>cpp/internals/formatted-comm</tt>`\n\n**Parameters:**\n  * cpp/internals/formatted-comm, default: empty placeholder «»\n\n**Options:**\n  * [`(bpg):({ft_}dox_TagLeadingChar)`](options.mg#bpgft_dox_tagleadingchar)\n\n**Surround:**\n  1. The selection can be surrounded by `<tt>` tags.\n\n**Relies on:**\n  * [`lh#dox#tag()`](API.md#lhdoxtag)\n\n## Miscellaneous\n#### c/comment\n**Produces:**\n  * in insert-mode, or with no count when surrounding:\n```C++\n#if 0\n«code;»\n#endif\n```\n  * with a count when surrounding:\n```C++\n#if 1\nv:count first lines\n#else\nremaining lines\n#endif\n```\n\n**Options:**\n  * `v:count`, when surrounding\n\n**Surround:**\n  1. The selection can be surrounded by this snippet.\n\n#### cpp/benchmark\n#### cpp/otb-sug-latex\n#### cpp/otb-sug-snippet\n#### cpp/utf8\n\n## Internal templates\n#### cpp/internals/abs-rel-shared\n#### cpp/internals/class-skeleton\n\nThis template file can be assimilated to the core routine used to generate all\nC++ classes (values, entities, base classes, interfaces, exceptions, etc).\n\n**Parameters**\n  * `comments`: List of Doxygen entries for the class that are passed to\n    [cpp/internals/formatted-comment](#cppinternalsformatted-comment).\n  * `clsname`: The name of the class to generate.\n  * `final`: Boolean that tells whether the class is `final` (C++11)\n  * `noncopyable`/`copyable`: Tells whether the copyability of the class is\n    known (0 or 1), or unknown (-1)\n  * `functions`: List of functions to declare in the class -- object built\n    through `lh#cpp#snippets#new_function_list()`\n    * `public|protected|private`:\n      * `signature`\n      * `implementation`\n      * `visibility`: `'public'`, `'protected'`, `'private'`, `'none'`\n      * `how`: `'deleted'`, `'defaulted'`, `'pure'`, `''`\n      * `virtual`\n      * `comments`\n  * `attributes`: List of attributes to declare in the class -- elements are\n    tag entries, or built with `lh#cpp#snippets#_decode_selected_attributes()`.\n    Typical keys are:\n    * `name`\n    * `type`\n    * `functions`\n  * `parents`: List that describes the parent classes\n  * Special functions: Parameters that tune the various special functions:\n    * `init-constructor`\n    * `default-constructor`\n    * `copy-constructor`\n    * `destructor`\n    * `assignment-operator`\n   Typical keys are:\n    * `visibility`: `'public'`, `'protected'`, `'private'`, `'none'`\n    * `how`: `'deleted'`, `'defaulted'`, `'pure'`, `''`\n    * `virtual`\n    * `comments`\n\n**TODO:**\n  * find a way to order members\n  * find a way to group members\n  * option to disable comments in defaulted functions\n  * C++11 move copy & move assign\n  * Enforce rule of \"all or nothing\"\n  * Find a way to specify attributes to use in init-ctr and w/ getters/setters when surrounding.\n  * Add option to force copiable classes to always be `final`\n  * Add option to force the generation of getters and setters when surrounding\n    attributes.\n\n#### cpp/internals/formatted-comment\n#### cpp/internals/function-comment\n#### cpp/internals/stream-common\n**Produces:** The empty definition for a stream operation.\n\n**Parameters**\n  * `s:direction`: `i` or `o`\n\n**Notes:**\n  * `s:clsname`: The name of the current class/type is searched with\n    `Cpp_SearchClassDefinition()`, it will be asked to the user if none is\n    found\n  * `s:friend` is assigned to `friend` if a class was found\n  * `s:const` is assigned to `const` if a class was found\n  * `s:op`, `s:type` and `s:stream_param` are deduced from `s:direction`\n\n**Relies on:**\n  * [`cpp/internals/stream-signature`](#cppinternalsstream-signature)\n  * [`cpp/internals/stream-implementation`](#cppinternalsstream-implementation)\n\n#### cpp/internals/stream-implementation\n**Produces:**\n```C++\n{\n   return «s:stream_param» «s:op» «fields»;\n}\n```\n\n**Parameters**\n  * `s:stream_param`: `is` or `os`\n  * `s:op`: `>>` or `<<`\n  * `s:direction`: `i` or `o`\n\n**Options:**\n  * [lh-style naming conventions](https://lh-style.readthedocs.io/en/latest/naming.html)\n\n**Also includes:**\n  * `<istream>` if `s:direction == \"i\"`\n  * or `<ostream>` if `s:direction == \"o\"`\n\n#### cpp/internals/stream-signature\n**Produces:**\n```C++\n«s:friend»«s:type»& operator«s:op»(«s:type» & «s:stream_param», «s:clsname» «s:const»& v)\n```\n\n**Parameters**\n  * `s:clsname`: The name of the class/type the operator applies to.\n  * `s:stream_param`: `is` or `os`\n  * `s:type`: `std::istream` or `std::ostream`\n  * `s:op`: `>>` or `<<`\n  * `s:friend`: `friend` or empty string\n  * `s:const`: `const` or empty string\n\n**Options:**\n  * [lh-style naming conventions](https://lh-style.readthedocs.io/en/latest/naming.html)\n\n"
  },
  {
    "path": "doc/types.md",
    "content": "## lh-cpp Type DataBase\n\nlh-cpp provides a database for most standard types and some semi-standard\ntypes, i.e.  [Boost](http://www.boost.org) types.\n\n### Accessing type information\n\n#### `lh#cpp#types#get_info(type[, default-value])`\nFunction that returns the type information associated to `type`.\n\nIf no information is found for `type`, the `default-value` will be returned.\n\nA type information is a dictionary object made of:\n  * `\"name\"`: simplified name of the type (acts as a key to retrieve its\n    associated information)\n  * `\"namespace\"`: its namespace\n  * `\"type\"`: the full type name (with template parameters)\n  * `\"includes`\"`: list of headers file that may define the type.\n  * `\"typename_for_header(...)\"` function.\n\nSee the [related unit test](../tests/lh/test-types.vim)\n\n#### `lh#cpp#types#get_includes(type)`\n\nReturns the list of header files that are know to define the `type`.\n\n\n### Current database status\n\nThe best way to see which types are defined is to consult the source code of\n[autoload/lh/cpp/types.vim](../autoload/lh/cpp/types.vim).\n"
  },
  {
    "path": "ftplugin/c/LoadHeaderFile.vim",
    "content": "\" LoadHeaderFile\n\" Last Change: 29th july 2001 by Luc Hermitte\n\" -> Split lines and change indentation in order to fit within 80 cols\n\" -> Change the way the filename is extracted from the include line\n\" Maintainer: Garner Halloran (garner@havoc.gtf.org)\n\nif !exists( \"g:loaded_LoadHeaderFile\" ) \n  \"\"finish \n\"\"endif\n  let g:loaded_LoadHeaderFile = 1\n\nfun! LoadHeaderFile( arg, loadSource )\n  if match( a:arg, \"#include\" ) >= 0\n      \" extract the file name\n      let matchPattern = '\\s*#include\\s*\\(<\\|\"\\)\\(.*\\)\\(>\\|\"\\)\\s*'\n      let $filename = substitute( a:arg, matchPattern, '\\2', 'g')\n\n      if strlen($filename) != 0\n\t\" if loadSource is 1, then replace .h with .cpp and load that file\n\t\" instead\n\tif a:loadSource == 1\n\t  let $filename = substitute( $filename, '\\V.h', \".cpp\", \"\" )\n\t\" if loadSource is 2, then replace .h with .c and load that file\n\t\" instead\n\telseif a:loadSource == 2\n\t  let $filename = substitute( $filename, '\\V.h', \".c\", \"\" )\n\tendif\n\n\tsfind $filename\n\treturn\n      endif\n  endif\nendfun\n\n\nendif\n"
  },
  {
    "path": "ftplugin/c/c_AddInclude.vim",
    "content": "\"=============================================================================\n\" File:         ftplugin/c/c_AddInclude.vim                       {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://code.google.com/p/lh-vim/>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://code.google.com/p/lh-vim/wiki/License>\n\" Version:      2.1.3\nlet s:k_version = 213\n\" Created:      22nd May 2012\n\" Last Update:  28th Oct 2015\n\"------------------------------------------------------------------------\n\" Description:\n\"       This ftplugin defines a mapping to insert missing includes (given we\n\"       know which symbol shall be defined...)\n\"\n\"------------------------------------------------------------------------\n\" Installation:\n\"       Drop this file into {rtp}/ftplugin/c\n\"       Requires Vim7+, lh-dev\n\" History:\n\"\tv2.0.0  GPLv3 w/ exception\n\" TODO:\n\"       Handle the case where several files are found\n\"       Move to autoload plugin\n\"       Recognize commented includes\n\" }}}1\n\"=============================================================================\n\nfinish \" This ftplugin has been deprecated in favour of lh-dev/ImportModule feature\n\" Buffer-local Definitions {{{1\n\" Avoid local reinclusion {{{2\nif &cp || (exists(\"b:loaded_ftplug_c_AddInclude\")\n      \\ && (b:loaded_ftplug_c_AddInclude >= s:k_version)\n      \\ && !exists('g:force_reload_ftplug_c_AddInclude'))\n  finish\nendif\nlet b:loaded_ftplug_c_AddInclude = s:k_version\nlet s:cpo_save=&cpo\nset cpo&vim\n\" Avoid local reinclusion }}}2\n\n\"------------------------------------------------------------------------\n\" Local mappings {{{2\n\nnnoremap <silent> <buffer> <Plug>InsertInclude :call <sid>InsertInclude()<cr>\nif !hasmapto('<Plug>InsertInclude', 'n')\n  nmap <silent> <buffer> <unique> <c-x>i <Plug>InsertInclude\nendif\n\n\"=============================================================================\n\" Global Definitions {{{1\n\" Avoid global reinclusion {{{2\nif &cp || (exists(\"g:loaded_ftplug_c_AddInclude\")\n      \\ && (g:loaded_ftplug_c_AddInclude >= s:k_version)\n      \\ && !exists('g:force_reload_ftplug_c_AddInclude'))\n  let &cpo=s:cpo_save\n  finish\nendif\nlet g:loaded_ftplug_c_AddInclude = s:k_version\n\" Avoid global reinclusion }}}2\n\"------------------------------------------------------------------------\n\" Functions {{{2\n\" Note: most filetype-global functions are best placed into\n\" autoload/«your-initials»/c/«c_AddInclude».vim\n\" Keep here only the functions are are required when the ftplugin is\n\" loaded, like functions that help building a vim-menu for this\n\" ftplugin.\nfunction! s:InsertInclude() abort\n  \" If there are several choices, ask which one to use.\n  \" But first: check the files.\n  let [id, info] = lh#cpp#tags#fetch(\"insert-include\")\n\n  let files = {}\n  for t in info\n    if ! has_key(files, t.filename)\n      let files[t.filename] = {}\n    endif\n    let files[t.filename][t.kind[0]] = ''\n  endfor\n  \" NB: there shouldn't be any to prioritize between p and f kinds as the\n  \" filtering on include files shall get rid of the f kinds (that exist along\n  \" with a prototype)\n  if len(files) > 1\n    call lh#common#error_msg(\"insert-include: too many acceptable tags for `\"\n          \\ .id.\"': \".string(files))\n    return\n  endif\n  mark '\n  let fullfilename = keys(files)[0]\n  let filename = fullfilename \" this is the full filename\n  \" echo filename\n  try\n    call lh#cpp#include#add(filename, fullfilename=~ '\\<usr\\>\\|\\<local\\>')\n  catch /^insert-include:.* is already included/\n    call lh#common#warning_msg(\"insert-include: \".filename.\", where `\"\n          \\ .id.\"' is defined, is already included\")\n  endtry\n  echo \"Use CTRL-O to go back to previous cursor position\"\nendfunction\n\n\" Functions }}}2\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/c/c_Doxygen.vim",
    "content": "\"=============================================================================\n\" File:\t\tftplugin/c/c_Doxygen.vim                                  {{{1\n\" Author:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\" \t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://code.google.com/p/lh-vim/wiki/License>\n\" Version:\t2.2.0\nlet s:k_version = 220\n\" Created:\t22nd Nov 2005\n\" Last Update:\t26th Nov 2019\n\"------------------------------------------------------------------------\n\" Description:\n\" \tProvides the command :DOX that expands a doxygened documentation for\n\" \tthe current C|C++ function.\n\"\n\" \t:DOX tries to guess various things like:\n\" \t- the direction ([in], [out], [in,out]) of the parameters\n\" \t- pointers that should not be null\n\" \t- ...\n\"\n\" \tIt also comes with the following template-file:\n\" \t- a\\%[uthor-doxygen] + CTRL-R_TAB\n\"\n\"\n\" Options:\n\" \t- [bg]:[&ft_]dox_CommentLeadingChar\n\" \t- [bg]:[&ft_]dox_TagLeadingChar\n\" \t- [bg]:[&ft_]dox_author_tag\n\" \t- [bg]:[&ft_]dox_ingroup\n\" \t- [bg]:[&ft_]dox_brief\n\" \t- [bg]:[&ft_]dox_throw\n\"\n\"------------------------------------------------------------------------\n\" Installation:\tSee |lh-cpp-readme.txt|\n\" Dependencies:\tMu-template\n\" }}}1\n\"=============================================================================\n\nif version < 700\n  finish \" Vim 7 required\nendif\n\n\"=============================================================================\n\" Avoid buffer reinclusion {{{1\nif exists('b:loaded_ftplug_c_Doxygen') && !exists('g:force_reload_c_Doxygen')\n  finish\nendif\nlet b:loaded_ftplug_c_Doxygen = s:k_version\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\" }}}1\n\"------------------------------------------------------------------------\n\" Commands and mappings {{{1\n\n\" todo: arguments (with auto completion) for brief, ingroup, author, since, ...\n\" todo: align arguments and their descriptions\n\ncommand! -buffer -nargs=0 DOX :call s:Doxygenize()\n\n\" Commands and mappings }}}1\n\"=============================================================================\n\" Avoid global reinclusion {{{1\nif exists(\"s:loaded_c_Doxygen\")\n      \\ && !exists('g:force_reload_c_Doxygen')\n  let &cpo=s:cpo_save\n  finish\nendif\nlet s:loaded_c_Doxygen_vim = 1\n\" Avoid global reinclusion }}}1\n\"------------------------------------------------------------------------\n\" Functions {{{1\n\n\" require Cpp_GetListOfParams and Cpp_GetFunctionPrototype\n\nfunction! CppDox_snippet(tagname, commentLeadingChar)\n  let varType = type(g:CppDox_{a:tagname}_snippet)\n  if varType == type([]) \" List\n    let sValue = join(g:CppDox_{a:tagname}_snippet, \"\\n\".a:commentLeadingChar)\n  else\n    let sValue = g:CppDox_{a:tagname}_snippet\n  endif\n  if strlen(sValue) != 0\n    let sValue = a:commentLeadingChar . sValue\n  endif\n  \" echomsg a:tagname . \" -> \" . sValue\n  return sValue\nendfunction\n\n\" Function: s:Doxygenize()                            {{{2\nfunction! s:Doxygenize() abort\n  let cleanup = lh#on#exit()\n        \\.restore('g:CppDox_Params_snippet')\n        \\.restore('g:CppDox_preconditions_snippet')\n        \\.restore('g:CppDox_return_snippet')\n        \\.restore('g:CppDox_exceptions_snippet')\n        \\.restore('g:CppDox_ingroup_snippet')\n        \\.restore('g:CppDox_brief_snippet')\n  try\n    \" Obtain informations from the function at the current cursor position.\n    let info   = lh#cpp#AnalysisLib_Function#get_function_info(line('.'), 0)\n    let params = info.parameters\n    let ret    = info.return\n\n    \" Build data to insert\n    \"\n    \" Parameters & preconditions\n    let g:CppDox_Params_snippet = []\n    let g:CppDox_preconditions_snippet = []\n    for param in get(info, 'tparams', [])\n      \" @tparam\n      let sValue =\n            \\  lh#dox#tag(\"tparam\")\n            \\ . ' ' . param.name\n            \\ . '  ' . lh#marker#txt((param.name).'-explanations')\n      call add (g:CppDox_Params_snippet, sValue)\n    endfor\n    for param in params\n      \" @param\n      let sValue =\n            \\  lh#dox#tag(\"param\")\n            \\ . lh#dox#_parameter_direction(param.type)\n            \\ . ' ' . param.name\n            \\ . '  ' . lh#marker#txt((param.name).'-explanations')\n      call add (g:CppDox_Params_snippet, sValue)\n      \" pointer ? -> default non null precondition\n      \" todo: add an option if we don't want that by default (or even better, use\n      \" clang to check whether an assert is being used for that purpose...)\n      if lh#dev#cpp#types#IsPointer(param.type)\n        let sValue =\n              \\  lh#dox#tag(\"pre\")\n              \\ . ' <tt>'.(param.name).' != NULL</tt>'\n              \\ . lh#marker#txt()\n        call add(g:CppDox_preconditions_snippet, sValue)\n      endif\n    endfor\n\n    \" Ingroup\n    let g:CppDox_ingroup_snippet = lh#dox#ingroup()\n\n    \" Brief\n    let g:CppDox_brief_snippet = lh#dox#brief('')\n\n    if ret =~ 'void\\|^$'\n      let g:CppDox_return_snippet = ''\n    else\n      let g:CppDox_return_snippet\t  = lh#dox#tag('return ').lh#marker#txt(ret)\n    endif\n\n    \" empty => <+@throw None+>\n    \" list => n x @throw list\n    \" non-existant => markerthrow\n    \" noexcept\n    let noexcept = get(info, 'noexcept')\n    if !empty(noexcept)\n      if noexcept == 'noexcept'\n        let noexcept = 'None'\n      else\n        let noexcept = 'None if `'.noexcept.'`'\n      endif\n      let g:CppDox_exceptions_snippet = lh#dox#throw(noexcept)\n    elseif !has_key(info, 'throw') || len(info.throw) == 0\n      let g:CppDox_exceptions_snippet = lh#dox#throw()\n    else\n      let throws = info.throw\n      let empty_marker = lh#marker#txt('')\n      if len(throws) == 1 && strlen(throws[0]) == 0\n        let g:CppDox_exceptions_snippet = lh#dox#throw('None').empty_marker\n      else\n        call map(throws, 'lh#dox#throw(v:val). empty_marker')\n        let g:CppDox_exceptions_snippet = throws\n      endif\n    endif\n\n    \" goto begining of the function\n    if has_key(info, 'start')\n      exe info.start.line\n    endif\n    :put!=''\n    \" Load the template\n    :MuTemplate dox/function\n\n  finally\n    call cleanup.finalize()\n  endtry\nendfunction\n\n\" Functions }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/c/c_UnmatchedFunctions.vim",
    "content": "\"=============================================================================\n\" File:         ftplugin/c/c_UnmatchedFunctions.vim                       {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"               <URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/tree/master/License.md>\n\" Version:      2.2.0\nlet s:k_version = '220'\n\" Created:      14th Feb 2008\n\" Last Update:  14th Mar 2017\n\"------------------------------------------------------------------------\n\" Description:  description\n\"\n\"------------------------------------------------------------------------\n\" Installation: install details\n\" History:      history\n\" TODO:         missing features\n\" }}}1\n\"=============================================================================\n\n\" Buffer-local Definitions {{{1\n\" Avoid local reinclusion {{{2\nif exists(\"b:loaded_ftplug_c_UnmatchedFunctions\") && !exists('g:force_reload_ftplug_c_UnmatchedFunctions')\n  finish\nendif\nlet s:cpo_save=&cpo\nset cpo&vim\n\" Avoid local reinclusion }}}2\n\n\"------------------------------------------------------------------------\n\" Local mappings {{{2\n\nvnoremap <buffer> <c-x>u <c-\\><c-n>:call <sid>DisplaySelected()<cr>\nnmap <buffer> <c-x>u viw<c-x>u\n\n\"------------------------------------------------------------------------\n\" Local commands {{{2\n\ncommand! -b -nargs=? CppDisplayUnmatchedFunctions :call <sid>DisplayCmd(<q-args>)\n\n\"=============================================================================\n\" Global Definitions {{{1\n\" Avoid global reinclusion {{{2\nif exists(\"g:loaded_ftplug_c_UnmatchedFunctions\") && !exists('g:force_reload_ftplug_c_UnmatchedFunctions')\n  let &cpo=s:cpo_save\n  finish\nendif\n\" Avoid global reinclusion }}}2\n\"------------------------------------------------------------------------\n\" Functions {{{2\n\" Note: most filetype-global functions are best placed into\n\" autoload/your-initials/cpp/c_UnmatchedFunctions.vim\n\" Keep here only the functions are are required when the ftplugin is\n\" loaded, like functions that help building a vim-menu for this\n\" ftplugin.\n\nfunction! s:DisplaySelected()\n  let a_save = @a\n  try\n    normal! gv\"ay\n    call lh#cpp#UnmatchedFunctions#Display(@a)\n  finally\n    let @a = a_save\n  endtry\nendfunction\n\nfunction! s:DisplayCmd(...)\n  if a:0 > 0\n    \" todo: support option -file/-class\n    let what\n          \\ = (a:1 =~ '-f\\%[ile]') ? 'File'\n          \\ : (a:1 =~ '-c\\%[lass]') ? 'Class'\n          \\ : a:1\n  else\n    let what = lh#ui#which( 'lh#ui#confirm',\n          \\ \"Displaying unmatched functions for the current ...\",\n          \\ \"&Class\\n&File\\n&Abort\", 1)\n  endif\n  let id = ''\n  if what == 'Class'\n    let id = lh#cpp#AnalysisLib_Class#CurrentScope(line('.'), 'any')\n  elseif what == 'File'\n    let id = expand('%:t')\n  elseif what != \"\" && what !='Abort'\n    let id = what\n  endif\n  if strlen(id) > 0\n    \" echomsg 'lh#cpp#UnmatchedFunctions#Display('.id.')'\n    call lh#cpp#UnmatchedFunctions#Display(id)\n  else\n    echohl WarningMsg\n    echo 'abort'\n    echohl None\n  endif\nendfunction\n\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/c/c_complete_include.vim",
    "content": "\"=============================================================================\n\" File:         ftplugin/c/c_complete_include.vim                 {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      2.2.1\nlet s:k_version = 221\n\" Created:      08th Nov 2011\n\" Last Update:  16th Jan 2019\n\"------------------------------------------------------------------------\n\" Description:\n\"       Mapping to complete #include filename not based on &path (as\n\"       |i_CTRL-X_CTRL-F| is).\n\"       The completion is based instead on {bg}:{ft_}_includes_path + &include\n\"\n\"------------------------------------------------------------------------\n\" Installation:\n\"       Drop this file into {rtp}/ftplugin/c\n\"       Requires Vim7+, lh-vim-lib 2.2.7+\n\"       «install details»\n\" History:      «history»\n\" TODO:         «missing features»\n\" }}}1\n\"=============================================================================\n\n\" Buffer-local Definitions {{{1\n\" Avoid local reinclusion {{{2\nlet s:cpo_save=&cpo\nset cpo&vim\n\nif &cp || (exists(\"b:loaded_ftplug_c_complete_include\")\n      \\ && (b:loaded_ftplug_c_complete_include >= s:k_version)\n      \\ && !exists('g:force_reload_ftplug_c_complete_include'))\n  let &cpo=s:cpo_save\n  finish\nendif\nlet b:loaded_ftplug_c_complete_include = s:k_version\n\" Avoid local reinclusion }}}2\n\n\"------------------------------------------------------------------------\n\" Local mappings {{{2\n\ninoremap <silent> <buffer> <Plug>CompleteIncludes <c-r>=<sid>Complete()<cr>\nif !hasmapto('<Plug>CompleteIncludes', 'i')\n  imap <buffer> <unique> <c-x>i <Plug>CompleteIncludes\nendif\n\nnnoremap <silent> <buffer> <Plug>OpenIncludes :call <sid>Open()<cr>\nif !hasmapto('<Plug>OpenIncludes', 'n')\n  nmap <buffer> <unique> <c-l>i <Plug>OpenIncludes\nendif\n\n\"=============================================================================\n\" Global Definitions {{{1\n\" Avoid global reinclusion {{{2\nif exists(\"g:loaded_ftplug_c_complete_include\")\n      \\ && (g:loaded_ftplug_c_complete_include >= s:k_version)\n      \\ && !exists('g:force_reload_ftplug_c_complete_include')\n  let &cpo=s:cpo_save\n  finish\nendif\nlet g:loaded_ftplug_c_complete_include = s:k_version\n\" Avoid global reinclusion }}}2\n\"------------------------------------------------------------------------\n\" Functions {{{2\n\" Note: most filetype-global functions are best placed into\n\" autoload/«your-initials»/c/«c_complete_include».vim\n\" Keep here only the functions are are required when the ftplugin is\n\" loaded, like functions that help building a vim-menu for this\n\" ftplugin.\n\n\" Function: s:Complete() {{{3\nfunction! s:Complete() abort\n  let cleanup = lh#on#exit()\n        \\.restore('&isk')\n  try\n    set isk+=/\n    let prev = lh#ui#GetLikeCTRL_W()\n  finally\n    call cleanup.finalize()\n  endtry\n  let paths = lh#cpp#tags#get_included_paths(&path)\n  let files = lh#path#glob_as_list(paths, [prev.'*'])\n  \" Keep headers files and directories\n  call filter(files, 'v:val =~? \"\\\\v\\.(h|hpp|hxx|txx|h\\\\+\\\\+)$\" || isdirectory(v:val)')\n  call map(files, 'v:val . (isdirectory(v:val)?\"/\":\"\")')\n  let files = lh#list#unique_sort(files)\n  let entries = map(copy(files), '{\"word\": lh#path#strip_start(v:val, paths), \"menu\": v:val}')\n  call lh#icomplete#new(col('.')-lh#encoding#strlen(prev)-1, entries, []).start_completion()\n  return ''\nendfunction\n\n\" Function: s:Open() {{{3\n\" built on top of SearchInRuntime\nfunction! s:Open() abort\n  try\n    let path = &path\n    let paths = lh#cpp#tags#get_included_paths()\n    exe 'set path+='.join(paths, ',')\n    exe \"normal \\<c-w>f\"\n  finally\n    let &path = path\n  endtry\nendfunction\n\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/c/c_doc.vim",
    "content": "\"=============================================================================\n\" File:         ftplugin/c/c_doc.vim                                      {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"               <URL:http://code.google.com/p/lh-vim/>\n\" Version:      v2.0.0\n\" Created:      22nd Jan 2004\n\" Last Update:  $Date$\n\"------------------------------------------------------------------------\n\" Description:  Open documentation for C & C++ code\n\"\n\"------------------------------------------------------------------------\n\" Installation: ?install details?\n\" History:\n\"       v2.0.0  GPLv3 w/ exception + deprecation\n\" TODO:\n\" - config variables to tell where to search the documentation\n\" - fix VAM dependencies if lh#path#fix is still used\n\" }}}1\n\"=============================================================================\n\n\" This plugin is deprecated for now.\n\" I'll have to clean it up, and permit to tune where to find the documentation\nfinish\n\n\"=============================================================================\n\" Local stuff {{{1\n\" Avoid buffer reinclusion {{{2\nif exists('b:loaded_ftplug_c_doc')  && !exists('g:force_reload_c_doc')\n  finish\nendif\nlet b:loaded_ftplug_c_doc = 1\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\" }}}2\n\"------------------------------------------------------------------------\n\" Commands and mappings {{{2\n\nnnoremap <buffer> <C-F1> :CHelp <c-r><c-a><cr>\ncommand! -buffer -nargs=1 CHelp :call s:CHelp(<f-args>)\n\n\" Commands and mappings }}}2\n\" }}}1\n\"=============================================================================\n\" Global stuff {{{1\n\" Avoid global reinclusion {{{2\nif exists(\"g:loaded_c_doc\") && !exists('g:force_reload_c_doc')\n  let &cpo=s:cpo_save\n  finish\nendif\nlet g:loaded_c_doc = 1\n\" Avoid global reinclusion }}}2\n\"------------------------------------------------------------------------\n\" Functions {{{2\n\"\n\" s:Error               {{{3\nfunction! s:Error(msg)\n  if has('gui')\n    call confirm(a:msg, '&Ok', 1, \"Error\")\n  else\n    echohl ErrorMsg\n    echo a:msg\n    echohl None\n  endif\nendfunction\n\n\n\n\" Definitions           {{{3\nlet s:std_doc = 'F:/Users/Luc/Prog/C++/docs/ref & cours/SL/www.dinkumware.com/htm_cpl/'\n\nlet s:boost_doc = 'F:/Users/Luc/Prog/C++/libs/boost_1_32_cvs/doc/html/'\nlet s:boost_lib = 'F:/Users/Luc/Prog/C++/libs/boost_1_32_cvs/libs/'\n\n\" s:Build_boost_url     {{{3\nfunction! s:Build_boost_url(class)\n  return s:boost_lib . a:class . '/index.html'\nendfunction\n\n\" s:Build_std_url       {{{3\nfunction! s:Build_std_url(class)\n  \" dinkumware doc\n  exe 'sp '.s:std_doc.'_index.html'\n  let l = 1\n  let urls = ''\n  while 1\n    let l = search('<a HREF=.\\{-}>.\\{-}\\<'.a:class.'</a>', 'W')\n    if l <= 0 | break | endif\n    let url = matchstr(getline(l), '\"\\zs[^<>]\\{-}\\ze\">[^<>]\\{-}\\<'.a:class)\n    let urls = urls . \"\\n\" . url\n  endwhile\n  bw!\n  let g:urls = urls\n  let nb = strlen(substitute(urls, \"[^\\n]\", '', 'g'))\n  if     nb == 0 | return ''\n  elseif nb == 1 | return s:std_doc . strpart(urls, 1)\n  else\n    let n = confirm('chose:', strpart(urls, 1), 1)\n    if n > 0\n      let url = matchstr(urls, '\\%('.\"[^\\n]*\\n\".'\\)\\{'.n.'}\\zs'.\"[^\\n]*\")\n      return s:std_doc . url\n    endif\n  endif\nendfunction\n\n\" s:CHelp               {{{3\nfunction! s:CHelp(WORD)\n  let url = ''\n  if     a:WORD =~ 'boost'\n    let class = matchstr(a:WORD, 'boost::\\zs[^()[<>.?]*\\>')\n    let url = s:Build_boost_url(class)\n  elseif a:WORD =~ 'std'\n    let class = matchstr(a:WORD, 'std::\\zs[^()[<>.?]*\\>')\n    let url = s:Build_std_url(class)\n  else\n  endif\n\n  if strlen(url)\n    call s:DisplayInBrowser(url)\n  endif\nendfunction\n\n\" s:DisplayInBrowser    {{{3\nfunction! s:DisplayInBrowser(url)\n  if exists('g:html_browser')\n    \" ... into g:html_browser if specified\n    call system(g:html_browser. \" \" .\n          \\ lh#path#fix(a:url,0,((&sh=~'sh')?\"'\":'\"')))\n  elseif has('win32')\n    \" ... into Ms's Internet Explorer ; for MsWindows only\n    \" :exe ':!start explorer ' . escape(lh#path#fix(a:url,0), '#')\n    call system(\"explorer file:///\" .\n          \\ lh#path#fix(a:url,0,((&sh=~'sh')?\"'\":'\"')))\n  else\n    call s:Error('Please set <<g:html_browser>> '\n          \\ . 'to the path of the browser you are using')\n  endif\nendfunction\n\n\" Functions }}}2\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/c/c_gcov.vim",
    "content": "\"=============================================================================\n\" File:         ftplugin/c/c_gcov.vim                             {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      221\nlet s:k_version = 221\n\" Created:      30th Oct 2012\n\" Last Update:  16th Jan 2019\n\"------------------------------------------------------------------------\n\" Description:\n\"       ftplugin to swap between a .gcov file and its source\n\"\n\"------------------------------------------------------------------------\n\" Installation:\n\"       Drop this file into {rtp}/ftplugin/c\n\"       Requires Vim7+\n\"       «install details»\n\" History:      «history»\n\" TODO:         «missing features»\n\" }}}1\n\"=============================================================================\n\n\" Buffer-local Definitions {{{1\n\" Avoid local reinclusion {{{2\nlet s:cpo_save=&cpo\nset cpo&vim\n\nif &cp || (exists(\"b:loaded_ftplug_c_gcov\")\n      \\ && (b:loaded_ftplug_c_gcov >= s:k_version)\n      \\ && !exists('g:force_reload_ftplug_c_gcov'))\n  let &cpo=s:cpo_save\n  finish\nendif\nlet b:loaded_ftplug_c_gcov = s:k_version\n\" Avoid local reinclusion }}}2\n\n\"------------------------------------------------------------------------\n\" Local mappings {{{2\n\nnnoremap <buffer> <localleader>g :call <sid>JumpOrToggleGCOVFile(expand('%:p'), 'e')<cr>\n\n\"------------------------------------------------------------------------\n\" Local commands {{{2\n\n\n\"=============================================================================\n\" Global Definitions {{{1\n\" Avoid global reinclusion {{{2\nif exists(\"g:loaded_ftplug_c_gcov\")\n      \\ && (g:loaded_ftplug_c_gcov >= s:k_version)\n      \\ && !exists('g:force_reload_ftplug_c_gcov')\n  let &cpo=s:cpo_save\n  finish\nendif\nlet g:loaded_ftplug_c_gcov = s:k_version\n\" Avoid global reinclusion }}}2\n\"------------------------------------------------------------------------\n\" Functions {{{2\n\" Note: most filetype-global functions are best placed into\n\" autoload/«your-initials»/c/«c_gcov».vim\n\" Keep here only the functions are are required when the ftplugin is\n\" loaded, like functions that help building a vim-menu for this\n\" ftplugin.\n\" Function: s:FindGCOVFile(source_file) {{{3\nlet s:k_gcov_ext = '.gcov'\nfunction! s:FindGCOVFile(source_file) abort\n  let current_file = fnamemodify(a:source_file, ':t')\n  let current_path = fnamemodify(a:source_file,':p:h')\n  let gcov_files_path = lh#ft#option#get('gcov_files_path', &ft, current_path)\n  let files = lh#path#glob_as_list(gcov_files_path, current_file.s:k_gcov_ext)\n  if empty(files)\n    throw \"Cannot find <\".current_file.s:k_gcov_ext.\"> in \".string(files).\". Please set b:[{ft}_]gcov_files_path\"\n  else\n    let gcov_file = lh#path#select_one(files, \"Which gcov file matches <\".current_file.\"> ?\")\n    return gcov_file\n  endif\nendfunction\n\nfunction! s:JumpOrToggleGCOVFile(source_file, cmd) abort\n  let gcov_file = s:FindGCOVFile(a:source_file)\n  call lh#buffer#jump(gcov_file, a:cmd)\nendfunction\n\" Functions }}}2\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/c/c_menu.vim",
    "content": "\"=============================================================================\n\" File:\t\tftplugin/c/c_menu.vim                                 {{{1\n\" Author:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://code.google.com/p/lh-vim/>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://code.google.com/p/lh-vim/wiki/License>\n\" Version:\t2.0.0\n\" Created:\t14th Oct 2006\n\" Last Update:\t$Date$\n\"------------------------------------------------------------------------\n\" Description:\t\n\" \tVarious C++ menu definitions\n\" }}}1\n\"=============================================================================\n\n\n\"=============================================================================\n\" Avoid buffer reinclusion {{{1\nlet s:cpo_save=&cpo\nset cpo&vim\nif exists('b:loaded_ftplug_c_menu')\n       \\ && !exists('g:force_reload_c_menu')\n  let &cpo=s:cpo_save\n  finish\nendif\nlet b:loaded_ftplug_c_menu = 200\n \n\" }}}1\n\"------------------------------------------------------------------------\n\" Commands and mappings {{{1\n\" Commands and mappings }}}1\n\"=============================================================================\n\" Avoid global reinclusion {{{1\nif exists(\"g:loaded_c_menu\") \n      \\ && !exists('g:force_reload_c_menu')\n  let &cpo=s:cpo_save\n  finish \nendif\nlet g:loaded_c_menu = 200\n\" Avoid global reinclusion }}}1\n\"------------------------------------------------------------------------\n\" Menu      {{{1\nlet s:menu_prio = lh#option#get('c_menu_priority', '50', 'g')\nlet s:menu_name = lh#option#get('c_menu_name',     '&C++', 'g')\n\n\" 80 wizards\n\" 90 options\n\"\n\" --------------------------------------------------[ 50 debug with pyclewn\nif exists(':Pyclewn')\n  call lh#menu#make('n', s:menu_prio.'.50.1', s:menu_name.'.&Pyclewn.&Run', '<F5>', '', ':Crun<cr>')\n  call lh#menu#make('n', s:menu_prio.'.50.2', s:menu_name.'.&Pyclewn.&Start', '', '', ':Cstart<cr>')\n  call lh#menu#make('n', s:menu_prio.'.50.3', s:menu_name.'.&Pyclewn.&Stop', '', '', ':Cstop<cr>')\n  exe 'amenu <silent> '.s:menu_prio.'.50.20 '.escape(s:menu_name.'.&Pyclewn.-20-', '\\ '). ' <Nop>'\n  call lh#menu#make('n', s:menu_prio.'.50.21', s:menu_name.'.&Pyclewn.Add &Breakpoint', '', '', ':Cbreak')\n  call lh#menu#make('n', s:menu_prio.'.50.22', s:menu_name.'.&Pyclewn.Clear Breakpoint', '', '', ':Cclear')\n  exe 'amenu <silent> '.s:menu_prio.'.50.30 '.escape(s:menu_name.'.&Pyclewn.-30-', '\\ '). ' <Nop>'\n  call lh#menu#make('n', s:menu_prio.'.50.31', s:menu_name.'.&Pyclewn.&Next', '', '', ':Cnext<cr>')\n  call lh#menu#make('n', s:menu_prio.'.50.32', s:menu_name.'.&Pyclewn.&Step', '', '', ':Cstep<cr>')\n  call lh#menu#make('n', s:menu_prio.'.50.33', s:menu_name.'.&Pyclewn.&Cont', '', '', ':Ccont<cr>')\n  exe 'amenu <silent> '.s:menu_prio.'.50.98 '.escape(s:menu_name.'.&Pyclewn.-98-', '\\ '). ' <Nop>'\n  call lh#menu#make('n', s:menu_prio.'.50.99', s:menu_name.'.&Pyclewn.Help', '', '', ':Chelp<cr>')\nendif\n\n\" --------------------------------------------------[ 100 help\nexe 'amenu <silent> '.s:menu_prio.'.100 '.escape(s:menu_name.'.-100-', '\\ '). ' <Nop>'\nexe 'amenu <silent> '.s:menu_prio.'.100.1 '.\n      \\ escape(s:menu_name.'.&Help.&Contents', '\\ ').\n      \\ ' :help lh-cpp-readme.txt<cr>'\nexe 'amenu <silent> '.s:menu_prio.'.100.2 '.\n      \\ escape(s:menu_name.'.&Help.&Features', '\\ ').\n      \\ ' :help lh-cpp-features<cr>'\nexe 'amenu <silent> '.s:menu_prio.'.100.3 '.\n      \\ escape(s:menu_name.'.&Help.&First Steps', '\\ ').\n      \\ ' :help lh-cpp-first-steps<cr>'\n\nexe 'amenu <silent> '.s:menu_prio.'.100.20.10 '.\n      \\ escape(s:menu_name.'.&Help.Code &snippets.&Brackets', '\\ ').\n      \\ ' :help brackets-for-C<cr>'\nexe 'amenu <silent> '.s:menu_prio.'.100.20.20 '.\n      \\ escape(s:menu_name.'.&Help.Code &snippets.&C snippets', '\\ ').\n      \\ ' :help C_control-statements<cr>'\nexe 'amenu <silent> '.s:menu_prio.'.100.20.20 '.\n      \\ escape(s:menu_name.'.&Help.Code &snippets.&C++ snippets', '\\ ').\n      \\ ' :help C++_control-statements<cr>'\nexe 'amenu <silent> '.s:menu_prio.'.100.20.100 '.\n      \\ escape(s:menu_name.'.&Help.Code &snippets.-100-', '\\ '). ' <Nop>'\nexe 'amenu <silent> '.s:menu_prio.'.100.20.100 '.\n      \\ escape(s:menu_name.'.&Help.Code &snippets.&Placeholders', '\\ ').\n      \\ ' :help markers<cr>'\n\nexe 'amenu <silent> '.s:menu_prio.'.100.50.10 '.\n      \\ escape(s:menu_name.'.&Help.&Wizards.&Accessors', '\\ ').\n      \\ ' :help C++_accessors<cr>'\nexe 'amenu <silent> '.s:menu_prio.'.100.50.20 '.\n      \\ escape(s:menu_name.'.&Help.&Wizards.&Goto Implementation', '\\ ').\n      \\ ' :help C++_jump_implementation<cr>'\nexe 'amenu <silent> '.s:menu_prio.'.100.50.30 '.\n      \\ escape(s:menu_name.'.&Help.&Wizards.&Override function', '\\ ').\n      \\ ' :help C++_Override<cr>'\nexe 'amenu <silent> '.s:menu_prio.'.100.50.40 '.\n      \\ escape(s:menu_name.'.&Help.&Wizards.&Doxygen function', '\\ ').\n      \\ ' :help C++_function_doxygenation<cr>'\nexe 'amenu <silent> '.s:menu_prio.'.100.50.50 '.\n      \\ escape(s:menu_name.'.&Help.&Wizards.&C++ Templates', '\\ ').\n      \\ ' :help C++_templates<cr>'\n\" -> class\n\" -> enum generator\nexe 'amenu <silent> '.s:menu_prio.'.100.50.100 '.\n      \\ escape(s:menu_name.'.&Help.&Wizards.-100-', '\\ '). ' <Nop>'\nexe 'amenu <silent> '.s:menu_prio.'.100.50.100 '.\n      \\ escape(s:menu_name.'.&Help.&Wizards.mu&Template', '\\ ').\n      \\ ' :help mu-template<cr>'\n\nexe 'amenu <silent> '.s:menu_prio.'.100.80 '.\n      \\ escape(s:menu_name.'.&Help.See &Unmatched functions', '\\ ').\n      \\ ' :help C++_unmatched_functions<cr>'\nexe 'amenu <silent> '.s:menu_prio.'.100.90 '.\n      \\ escape(s:menu_name.'.&Help.-90-', '\\ '). ' <Nop>'\nexe 'amenu <silent> '.s:menu_prio.'.100.90 '.\n      \\ escape(s:menu_name.'.&Help.&API', '\\ ').\n      \\ ' :help lh-cpp-API<cr>'\n\n\n\" Functions {{{1\n\" Functions }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/c/c_mu-template_api.vim",
    "content": "\"=============================================================================\n\" File:\t\tftplugin/c/c_mu-template_api.vim                          {{{1\n\" Author:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\" \t\t<URL:http://code.google.com/p/lh-vim/>\n\" Version:\t2.2.0\n\" Created:\t14th Apr 2006\n\" Last Update:\t16th Jan 2019\n\"------------------------------------------------------------------------\n\" Description:\n\" \tProvides API functions used in mu-template's C template-files.\n\"\n\" \t- C_nl_before_bracket() that returns the text to insert before a\n\" \t  bracket according to the option |g:c_nl_before_bracket|\n\" \t- C_nl_before_curlyB() that returns the text to insert before a\n\" \t  curly-bracket according to the option |g:c_nl_before_bracket|\n\"\n\"------------------------------------------------------------------------\n\" Installation:\tSee |lh-cpp-readme.txt|\n\" Dependancies:\tmu-template (=> lh-map-tools, searchInRuntime)\n\" TODO: move to an autoload plugin\n\" }}}1\n\"=============================================================================\n\n\"=============================================================================\n\" Avoid global reinclusion {{{1\nlet s:cpo_save=&cpo\nset cpo&vim\nif exists(\"g:loaded_c_mu_template_api\")\n      \\ && !exists('g:force_reload_c_mu_template_api')\n  let &cpo=s:cpo_save\n  finish\nendif\nlet g:loaded_c_mu_template_api = 1\n\" Avoid global reinclusion }}}1\n\"------------------------------------------------------------------------\n\" Functions {{{1\n\n\" note: The space is needed after the \"\\n\" to avoid mu-template from joining\n\" the two next lines.\nfunction! C_nl_before_bracket() abort\n  return lh#cpp#option#nl_before_bracket() ? \"\\n \" : \" \"\nendfunction\n\nfunction! C_nl_before_curlyB() abort\n  return lh#cpp#option#nl_before_curlyB() ? \"\\n \" : \" \"\nendfunction\n\n\" Functions }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/c/c_navigate_functions.vim",
    "content": "\"=============================================================================\n\" File:         ftplugin/c/c_navigate_functions.vim {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://code.google.com/p/lh-vim/>\n\" Version:      221\nlet s:k_version = 221\n\" Created:      08th Jul 2011\n\" Last Update:  16th Jan 2019\n\"------------------------------------------------------------------------\n\" Description:\n\"       mappings ]m, ]M, [m and [M to navigate into functions begin/end\n\"\n\"------------------------------------------------------------------------\n\" Installation:\n\"       Drop this file into {rtp}/lh-cpp/ftplugin/c\n\"       Requires Vim7+, lh-dev\n\" History:\n\" 08th Jul 2011: first implementation\n\" TODO:         «missing features»\n\" }}}1\n\"=============================================================================\n\n\" Buffer-local Definitions {{{1\n\" Avoid local reinclusion {{{2\nlet s:cpo_save=&cpo\nset cpo&vim\nif &cp || (exists(\"b:loaded_ftplug_c_navigate_functions\")\n      \\ && (b:loaded_ftplug_c_navigate_functions >= s:k_version)\n      \\ && !exists('g:force_reload_ftplug_c_navigate_functions'))\n  let &cpo=s:cpo_save\n  finish\nendif\nlet b:loaded_ftplug_c_navigate_functions = s:k_version\n\" Avoid local reinclusion }}}2\n\n\"------------------------------------------------------------------------\n\" Local mappings {{{2\n\nnnoremap <buffer> <Plug>NextFunctionStart :call <sid>NextFunction('s')<cr>\nif !hasmapto('<Plug>NextFunctionStart', 'n')\n      \\ || exists('g:force_reload_ftplug_c_navigate_functions')\n  nmap <buffer> ]m <Plug>NextFunctionStart\nendif\n\nnnoremap <buffer> <Plug>PrevFunctionStart :call <sid>PrevFunction('s')<cr>\nif !hasmapto('<Plug>PrevFunctionStart', 'n')\n      \\ || exists('g:force_reload_ftplug_c_navigate_functions')\n  nmap <buffer> [m <Plug>PrevFunctionStart\nendif\n\nnnoremap <buffer> <Plug>NextFunctionEnd :call <sid>NextFunction('e')<cr>\nif !hasmapto('<Plug>NextFunctionEnd', 'n')\n      \\ || exists('g:force_reload_ftplug_c_navigate_functions')\n  nmap <buffer> ]M <Plug>NextFunctionEnd\nendif\n\nnnoremap <buffer> <Plug>PrevFunctionEnd :call <sid>PrevFunction('e')<cr>\nif !hasmapto('<Plug>PrevFunctionEnd', 'n')\n      \\ || exists('g:force_reload_ftplug_c_navigate_functions')\n  nmap <buffer> [M <Plug>PrevFunctionEnd\nendif\n\n\"=============================================================================\n\" Global Definitions {{{1\n\" Avoid global reinclusion {{{2\nif exists(\"g:loaded_ftplug_c_navigate_functions\")\n      \\ && (g:loaded_ftplug_c_navigate_functions >= s:k_version)\n      \\ && !exists('g:force_reload_ftplug_c_navigate_functions')\n  let &cpo=s:cpo_save\n  finish\nendif\nlet g:loaded_ftplug_c_navigate_functions = s:k_version\n\" Avoid global reinclusion }}}2\n\"------------------------------------------------------------------------\n\" Functions {{{2\n\" Note: most filetype-global functions are best placed into\n\" autoload/«your-initials»/c/«navigate_functions».vim\n\" Keep here only the functions are are required when the ftplugin is\n\" loaded, like functions that help building a vim-menu for this\n\" ftplugin.\n\nfunction! s:NextFunction(start_or_end) abort\n  let line = line('.')\n  let info = lh#dev#__FindFunctions(line)\n  let crt_function = info.idx \" function starting just after the current line\n  let lFunctions   = info.fn\n\n  if crt_function == -1\n    throw \"No known function after line \".line.\" in ctags base\"\n  endif\n\n  let first_line = lFunctions[crt_function].line\n  if a:start_or_end == 's'\n    exe first_line\n  else\n    \" we need to be sure the end of the previous function is < line\n    let prev_end = lh#dev#__FindEndFunc(lFunctions[crt_function-1].line)[1]\n    if prev_end <= line\n      let last_line = lh#dev#__FindEndFunc(first_line)\n      exe last_line[1]\n    else\n      exe prev_end\n    endif\n  endif\nendfunction\n\nfunction! s:PrevFunction(start_or_end) abort\n  let line = line('.')\n  let info = lh#dev#__FindFunctions(line)\n  let crt_function = info.idx \" function starting just after the current line\n  let lFunctions   = info.fn\n\n  if crt_function == 0\n    throw \"No known function before line \".line.\" in ctags base\"\n  endif\n\n  let crt_function -= 1\n  let first_line = lFunctions[crt_function].line\n  if a:start_or_end == 's'\n    while first_line >= line\n      let crt_function -= 1\n      let first_line = lFunctions[crt_function].line\n    endwhile\n    exe first_line\n  else\n    let last_line = lh#dev#__FindEndFunc(first_line)\n    while last_line[1] >= line\n      \" \"while\" because sometimes tags are dedoubled\n      let crt_function -= 1\n      let first_line = lFunctions[crt_function].line\n      let last_line = lh#dev#__FindEndFunc(first_line)\n    endwhile\n    exe last_line[1]\n  endif\nendfunction\n\n\" Functions }}}2\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/c/c_pvs-2-qf.vim",
    "content": "\"=============================================================================\n\" File:         ftplugin/c/c_pvs-2-qf.vim                         {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      221\nlet s:k_version = 221\n\" Created:      10th Jul 2012\n\" Last Update:  16th Jan 2019\n\"------------------------------------------------------------------------\n\" Description:\n\"       «description»\n\"\n\"------------------------------------------------------------------------\n\" Installation:\n\"       Drop this file into {rtp}/ftplugin/c\n\"       Requires Vim7+\n\"       «install details»\n\" History:      «history»\n\" TODO:         «missing features»\n\" }}}1\n\"=============================================================================\n\n\" Buffer-local Definitions {{{1\n\" Avoid local reinclusion {{{2\nlet s:cpo_save=&cpo\nset cpo&vim\nif &cp || (exists(\"b:loaded_ftplug_c_pvs_2_qf\")\n      \\ && (b:loaded_ftplug_c_pvs_2_qf >= s:k_version)\n      \\ && !exists('g:force_reload_ftplug_c_pvs_2_qf'))\n  let &cpo=s:cpo_save\n  finish\nendif\nlet b:loaded_ftplug_c_pvs_2_qf = s:k_version\n\" Avoid local reinclusion }}}2\n\n\"------------------------------------------------------------------------\n\" Local commands {{{2\n\ncommand! -b -nargs=1 -complete=file PVSLoad   call s:PVSLoad(\"<args>\")\ncommand! -b -nargs=* PVSIgnore call s:PVSAddFilters(<f-args>)\ncommand! -b -nargs=+ PVSShow   call s:PVSDelFilters(<f-args>)\ncommand! -b -nargs=0 PVSRedraw call s:ReDisplay()\n\n\"=============================================================================\n\" Global Definitions {{{1\n\" Avoid global reinclusion {{{2\nif exists(\"g:loaded_ftplug_c_pvs_2_qf\")\n      \\ && (g:loaded_ftplug_c_pvs_2_qf >= s:k_version)\n      \\ && !exists('g:force_reload_ftplug_c_pvs_2_qf')\n  let &cpo=s:cpo_save\n  finish\nendif\nlet g:loaded_ftplug_c_pvs_2_qf = s:k_version\n\" Avoid global reinclusion }}}2\n\"------------------------------------------------------------------------\n\" Functions {{{2\n\" Note: most filetype-global functions are best placed into\n\" autoload/«your-initials»/c/«c_pvs_2_qf».vim\n\" Keep here only the functions are are required when the ftplugin is\n\" loaded, like functions that help building a vim-menu for this\n\" ftplugin.\nlet s:xsl = lh#path#glob_as_list(&rtp, 'script/PVS2qf.xsl')[0]\n\" Function: s:PVSLoad(plog) {{{3\nfunction! s:PVSLoad(plog) abort\n  let xsltproc = lh#option#get('xsltproc', 'xsltproc')\n  if !executable(xsltproc)\n    throw \"Sorry <\" . xsltproc . \"> is not a valid executable. Please set g:xsltproc or $PATH\"\n  endif\n  if !filereadable(a:plog)\n    throw \"PVS-Studio file <\".a:plog.\"> cannot be read.\"\n  endif\n  let errors = system(xsltproc . ' ' . s:xsl . ' ' . a:plog)\n  let errors = substitute(errors, '\\n\\|\\r', '', 'g')\n  silent! unlet s:qf\n  let s:qf = eval(errors)\n  call s:ReDisplay()\nendfunction\n\nif !exists('s:filters_nr') \" filter for error numbers\n  let s:filters_nr = []\nendif\n\nif !exists('s:filters_mess') \" filter for messages\n  let s:filters_mess = []\nendif\n\n\" Function: s:PVSAddFilters(filters...) {{{3\nfunction! s:PVSAddFilters(...) abort\n  if len(a:000) == 0\n    echo \"Errors ignored are: \" . join(map(copy(s:filters_nr), '\"V\".v:val'), ', ') . ', and messages containing: ' . join(s:filters_mess, ', ')\n  else\n    for pat in a:000\n      if pat =~ '^\\d\\+$'\n        let s:filters_nr += [pat]\n      else\n        let s:filters_mess += [pat]\n      endif\n    endfor\n    call s:ReDisplay()\n  endif\nendfunction\n\n\" Function: s:PVSDelFilters(filters...) {{{3\nfunction! s:PVSDelFilters(...) abort\n  let to_remove_nr = []\n  let to_remove_mess = []\n  for pat in a:000\n    if pat =~ '^\\d\\+$'\n      let to_remove_nr += [pat]\n    else\n      let to_remove_mess += [pat]\n    endif\n  call filter(s:filters_nr, 'match(to_remove_nr, v:val) < 0')\n  call filter(s:filters_mess, 'match(to_remove_mess, v:val) < 0')\n  endfor\n  call s:ReDisplay()\nendfunction\n\n\" Function: s:ReDisplay() {{{3\nfunction! s:ReDisplay() abort\n  let qf = filter(copy(s:qf), 'match(s:filters_nr, v:val.nr)<0')\n  call filter(qf, 'lh#list#find_if(s:filters_mess, escape(string(v:val.text), \"[\") . \"=~ v:1_\")<0')\n  call setqflist(qf)\n  Copen \" from BTW\n  call lh#common#warning_msg(len(qf).'/'.len(s:qf).' warnings found')\nendfunction\n\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/c/c_set.vim",
    "content": "\" ========================================================================\n\" File:\t\tftplugin/c/c_set.vim\n\" Author:\tLuc Hermitte <MAIL:hermitte {at} free {dot} fr>\n\" \t\t<URL:http://code.google.com/p/lh-vim/>\n\" Version:\t2.1.3\nlet s:k_version = 213\n\" Last Update:\t28th Oct 2015\n\"\n\" Purpose:\tftplugin for C (-like) programming\n\"\n\"------------------------------------------------------------------------\n\" Installation:\tSee |lh-cpp-readme.txt|\n\" Dependencies:\n\" \t\tLoadHeaderFile.vim\n\" \t\tflist & flistmaps.vim\t-- Dr Chips\n\" \t\tVIM >= 6.00 only\n\" ========================================================================\n\n\" 4 log:\n\" 14th Apr 2007: &isk-=-\n\" for changelog: 02nd Jun 2006 -> suffixesadd\n\n\n\" ========================================================================\n\" Buffer local definitions {{{1\n\" ========================================================================\nif exists(\"b:loaded_c_set\") && !exists('g:force_reload_c_set')\n  finish\nendif\nlet b:loaded_c_set = s:k_version\nlet s:cpo_save = &cpo\nset cpo&vim\n\n\" ------------------------------------------------------------------------\n\" Includes {{{\n\" ------------------------------------------------------------------------\nsource $VIMRUNTIME/ftplugin/c.vim\nlet b:did_ftplugin = 1\n\" }}}\n\" ------------------------------------------------------------------------\n\" Options to set {{{\n\" ------------------------------------------------------------------------\n\" Note: these options can be overrided into a ftplugin placed in an after/\n\" directory.\n\"\nsetlocal formatoptions=croql\nsetlocal cindent\nsetlocal cinoptions=g0,t0\nsetlocal define=^\\(#\\s*define\\|[a-z]*\\s*const\\(expr\\)\\=\\s*[a-z]*\\)\nsetlocal comments=sr:/*,mb:*,exl:*/,:///,://\n\" setlocal isk+=#\t\t\" so #if is considered as a keyword, etc\n\" setlocal isk-=-\t\t\" so ptr- (in ptr->member) is not\n\" setlocal isk-=<\n\" setlocal isk-=>\n\" setlocal isk-=:\nsetlocal isk=#,a-z,A-Z,48-57,_\nsetlocal suffixesadd+=.h,.c\n\nsetlocal cmdheight=3\nsetlocal nosmd\n\n\" Dictionary from Dr.-Ing. Fritz Mehner\nlet s:dictionary=expand(\"<sfile>:p:h\").'/word.list'\nif filereadable(s:dictionary)\n  let &l:dictionary=s:dictionary\n  setlocal complete+=k\nendif\nsetlocal complete-=i\n\" }}}\n\" ------------------------------------------------------------------------\n\" File loading {{{\n\" ------------------------------------------------------------------------\n\"\n\" Things on :A and :AS\n\"\"so $VIM/macros/a.vim\n\"\n\"\"so <sfile>:p:h/LoadHeaderFile.vim\nif exists(\"*LoadHeaderFile\")\n  nnoremap <buffer> <buffer> <C-F12>\n\t\\ :call LoadHeaderFile(getline('.'),0)<cr>\n  inoremap <buffer> <buffer> <C-F12>\n\t\\ <esc>:call LoadHeaderFile(getline('.'),0)<cr>\nendif\n\n\" flist (Dr Chips)\n\"\"so <sfile>:p:h/flistmaps.vim\nif filereadable(expand(\"hints\"))\n  au BufNewFile,BufReadPost *.h,*.ti,*.inl,*.c,*.C,*.cpp,*.CPP,*.cxx\n\t\\ so hints<CR>\nendif\n\n\" }}}\n\" ------------------------------------------------------------------------\n\"}}}1\n\" ========================================================================\nlet &cpo = s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/c/c_show_scope.vim",
    "content": "\"=============================================================================\n\" File:         ftplugin/c/c_show_scope.vim                       {{{1\n\" Author:       Luc Hermitte <EMAIL:luc {dot} hermitte {at} gmail {dot} com>\n\"               <URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      2.2.1.\nlet s:k_version = '221'\n\" Created:      29th May 2017\n\" Last Update:  16th Jan 2019\n\"------------------------------------------------------------------------\n\" Description:\n\"       Display the context on the current function/namespace/class/...\n\"\n\"------------------------------------------------------------------------\n\" History:      «history»\n\" TODO:         «missing features»\n\" }}}1\n\"=============================================================================\n\n\" Buffer-local Definitions {{{1\n\" Avoid local reinclusion {{{2\nlet s:cpo_save=&cpo\nset cpo&vim\nif &cp || (exists(\"b:loaded_ftplug_c_show_scope\")\n      \\ && (b:loaded_ftplug_c_show_scope >= s:k_version)\n      \\ && !exists('g:force_reload_ftplug_c_show_scope'))\n  let &cpo=s:cpo_save\n  finish\nendif\nlet b:loaded_ftplug_c_show_scope = s:k_version\n\" Avoid local reinclusion }}}2\n\n\"------------------------------------------------------------------------\n\" Local mappings {{{2\n\nnnoremap <silent> <buffer> <localleader>sc :<c-u>echo lh#cpp#analyse#context()<cr>\n\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/c/c_snippets.vim",
    "content": "\"=============================================================================\n\" File:         ftplugin/c/c_snippets.vim                               {{{1\n\" Author:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/License.md>\n\" Version:      2.2.0\nlet s:k_version = '220'\n\" Created:      14th Apr 2008\n\" Last Update:  30th Apr 2019\n\"------------------------------------------------------------------------\n\" Description:  Snippets of C Control Statements\n\"\n\"------------------------------------------------------------------------\n\" Dependencies: lh-vim-lib\n\"               a.vim                   -- alternate files\n\"               VIM >= 7.3 only\n\"\n\" History:\n\" 06th,26th Mar 2006: InsertReturn() for smart insertion of return.\n\" for changelog: 27th Jun 2006 -> C_SelectExpr4Surrounding used in\n\"                                 <leader><leader> mappings\n\" TODO:         missing features\n\" }}}1\n\"=============================================================================\n\n\" Buffer-local Definitions {{{1\n\" Avoid local reinclusion {{{2\nif (exists(\"b:loaded_ftplug_c_snippets\") && !exists('g:force_reload_ftplug_c_snippets')) || get(g:, 'lh_cpp_snippets', 1) == 0\n  finish\nendif\nlet s:cpo_save=&cpo\nset cpo&vim\nlet b:loaded_ftplug_c_snippets = s:k_version\n\" Avoid local reinclusion }}}2\n\n\"------------------------------------------------------------------------\n\" Local mappings {{{2\n\n\" Some C++ abbreviated Keywords {{{3\n\" ------------------------------------------------------------------------\n\" Are you also dyslexic ?\ninoreab <buffer> ocnst      const\ninoreab <buffer> earse      erase\n\n\" C keywords {{{3\n\" ------------------------------------------------------------------------\n\" Pre-processor\n\"\n\"-- insert \"#define\" at start of line\n\" iab  <buffer> <m-d>  <C-R>=lh#map#no_context(\"\\<M-d> \",'\\<esc\\>0i#define')<CR>\niab <silent> <buffer> #d     <C-R>=lh#map#no_context(\"#d \",'\\<esc\\>0i#define')<CR>\n\"-- insert \"#include\" at start of line\n\" iab  <buffer> <m-i>  <C-R>=lh#map#no_context(\"\\<M-i> \",'\\<esc\\>0i#include')<CR>\niab <silent> <buffer> #n    <C-R>=lh#map#no_context(\"#n \",'\\<esc\\>0i#include')<CR>\n\n\"-- insert \"#ifdef/endif\" at start of line\niab <silent> <buffer> #i    <C-R>=lh#map#no_context('#i ','\\<esc\\>0i#ifdef')<CR>\niab <silent> <buffer> #e    <C-R>=lh#map#no_context(\"#e \",'\\<esc\\>0i#endif')<CR>\n\n\"-- surrounds with \"#if 0 ... endif\"\n:Brackets #if\\ 0 #endif -insert=0 -nl -trigger=<localleader>0\nxmap <buffer> <localleader><k0> <localleader>0\nnmap <buffer> <localleader><k0> <localleader>0\n:Brackets #if\\ 0 #else!mark!\\n#endif -insert=0 -nl -trigger=<localleader>1\nxmap <buffer> <localleader><k1> <localleader>1\nnmap <buffer> <localleader><k1> <localleader>1\n\n\" ------------------------------------------------------------------------\n\" Control statements {{{3\n\" ------------------------------------------------------------------------\n\"\nnnoremap <Plug>C_SelectExpr4Surrounding :call lh#cpp#snippets#select_expr_4_surrounding()<cr>\n\n\" --- if ---------------------------------------------------------{{{4\n\"--if    insert \"if\" statement                   {{{5\n  Inoreabbr <buffer> <silent> if <C-R>=lh#cpp#snippets#def_abbr('if ',\n        \\ '\\<c-f\\>if(!cursorhere!){!mark!}!mark!')<cr>\n\"--,if    insert \"if\" statement\n  xnoremap <buffer> <silent> <localleader>if\n        \\ <c-\\><c-n>@=lh#style#surround('if(!cursorhere!){', '}!mark!',\n        \\ 0, 1, '', 1, 'if ')<cr>\n  xnoremap <buffer> <silent> <LocalLeader><localleader>if\n        \\ <c-\\><c-n>@=lh#style#surround('if(', '!cursorhere!) {!mark!}!mark!',\n        \\ 0, 1, '', 1, 'if ')<cr>\n      nmap <buffer> <LocalLeader>if V<LocalLeader>if\n      nmap <buffer> <LocalLeader><LocalLeader>if\n            \\ <Plug>C_SelectExpr4Surrounding<LocalLeader><LocalLeader>if\n\n\"--elif  insert else if () { ... }             {{{5\n  Inoreabbr <buffer> <silent> elif <C-R>=lh#cpp#snippets#def_abbr('elif ',\n        \\ '\\<c-f\\>else if(!cursorhere!) {!mark!}!mark!')<cr>\n\"--,elif  insert else clause of if statement with following if statement\n  xnoremap <buffer> <silent> <localleader>elif\n        \\ <c-\\><c-n>@=lh#style#surround('else if(!cursorhere!){', '}!mark!',\n        \\ 0, 1, '', 1, 'elif ')<cr>\n  xnoremap <buffer> <silent> <localleader><localleader>elif\n        \\ <c-\\><c-n>@=lh#style#surround('else if(', '!cursorhere!){!mark!}!mark!',\n        \\ 0, 1, '', 1, 'elif ')<cr>\n      nmap <buffer> <localleader><LocalLeader>elif\n            \\ <Plug>C_SelectExpr4Surrounding<localleader><LocalLeader>elif\n      nmap <buffer> <LocalLeader>elif V<LocalLeader>elif\n\n\"--else  insert else clause of if statement      {{{5\n  Inoreabbr <buffer> <silent> else <C-R>=lh#cpp#snippets#insert_if_not_before('else ',\n        \\ '\\<c-f\\>else{!cursorhere!}!mark!', 'if')<cr><c-f>\n\"--,else  insert else clause of if statement\n  xnoremap <buffer> <silent> <localleader>else\n        \\ <c-\\><c-n>@=lh#style#surround('else {', '}',\n        \\ 0, 1, '``l', 1, 'else ')<cr>\n      nmap <buffer> <LocalLeader>else V<LocalLeader>else\n\n\"--- for ---------------------------------------------------------{{{4\n\"--for   insert \"for\" statement\n\" TODO: pb when c_nl_before_bracket = 1, cursor is not placed correctly\n  Inoreabbr <buffer> <silent> for <C-R>=lh#cpp#snippets#def_abbr('for ',\n      \\ {\n      \\ '! lh#cpp#use_cpp11()': '\\<c-f\\>for(!cursorhere!;!mark!;!mark!){!mark!}!mark!',\n      \\ '  lh#cpp#use_cpp11()': '\\<c-f\\>for(!cursorhere!){!mark!}!mark!'\n      \\ })<cr>\n\"--,for   insert \"for\" statement\n  xnoremap <buffer> <silent> <localleader>for\n        \\ <c-\\><c-n>@=lh#style#surround('for(!cursorhere!;!mark!;!mark!){', '}!mark!',\n        \\ 0, 1, '', 1, 'for ')<cr>\n      nmap <buffer> <LocalLeader>for V<LocalLeader>for\n\n\"--- while -------------------------------------------------------{{{4\n\"--while insert \"while\" statement\n  Inoreabbr <buffer> <silent> while <C-R>=lh#cpp#snippets#def_abbr('while ',\n        \\ '\\<c-f\\>while(!cursorhere!){!mark!}!mark!')<cr>\n\"--,while insert \"while\" statement\n  xnoremap <buffer> <silent> <localleader>wh\n        \\ <c-\\><c-n>@=lh#style#surround('while(!cursorhere!){', '}!mark!',\n        \\ 0, 1, '', 1, 'while ')<cr>\n\n  xnoremap <buffer> <silent> <localleader><localleader>wh\n        \\ <c-\\><c-n>@=lh#style#surround('while(',\n        \\ '!cursorhere!){!mark!}!mark!',\n        \\ 0, 1, '', 1, 'while ')<cr>\n  \" Note: \\<esc\\>lcw is used to strip every spaces at the beginning of the\n  \" selected-area\n      nmap <buffer> <LocalLeader>while V<LocalLeader>wh\n      nmap <buffer> <LocalLeader><LocalLeader>while\n            \\ <Plug>C_SelectExpr4Surrounding<LocalLeader><LocalLeader>wh\n\n\"--- do ----------------------------------------------------------{{{4\n\"--do insert \"do\" statement\n  Inoreabbr <buffer> <silent> do <C-R>=lh#cpp#snippets#def_abbr('do ',\n        \\ '\\<c-f\\>do{!cursorhere!}while(!mark!);!mark!')<cr><c-f>\n\"--,do insert \"do\" statement\n  xnoremap <buffer> <silent> <localleader>do\n        \\ <c-\\><c-n>@=lh#style#surround('do{', '!cursorhere!}while(!mark!);!mark!',\n        \\ 0, 1, '', 1, 'do ')<cr>\n  xnoremap <buffer> \n        \\ <c-\\><c-n>@=SurroundBySubstitute('do{', '!cursorhere!}while(!mark!);!mark!',\n        \\ 0, 1, '', 1, 'do ')<cr>\n  \" problem here with fix_indent !!!\n\n  xnoremap <buffer> <silent> <localleader><localleader>do\n        \\ <c-\\><c-n>@=Surround('do{!cursorhere!}while(',\n        \\ ');!mark!',\n        \\ 0, 1, '', 1, 'do ')<cr>\n  xnoremap <buffer> <localleader><localleader>d2\n        \\ <c-\\><c-n>@=SurroundBySubstitute('do{!cursorhere!}while(',\n        \\ ');!mark!',\n        \\ 0, 1, '', 1, 'do ')<cr>\n  \" Note: \\<esc\\>lcw is used to strip every spaces at the beginning of the\n  \" selected-area\n      nmap <buffer> <LocalLeader>do V<LocalLeader>do\n      nmap <buffer> <LocalLeader><LocalLeader>do\n            \\ <Plug>C_SelectExpr4Surrounding<LocalLeader><LocalLeader>do\n\n\"--- switch ------------------------------------------------------{{{4\n\"--switch insert \"switch\" statement\n  Inoreabbr <buffer> <silent> switch <C-R>=lh#cpp#snippets#def_abbr('switch ',\n        \\ '\\<c-f\\>switch(!cursorhere!){!mark!}!mark!')<cr>\n\"--,switch insert \"switch\" statement\n  xnoremap <buffer> <silent> <localleader>switch\n        \\ <c-\\><c-n>@=lh#style#surround('switch(!cursorhere!){case !mark!:',\n        \\ '}!mark!', 1, 1, '', 1, 'switch ')<cr>\n      nmap <buffer> <LocalLeader>switch V<LocalLeader>switch\n\n\"--- {\\n} --------------------------------------------------------{{{4\n  \" xnoremap <buffer> <silent> <localleader>{\n        \" \\ <c-\\><c-n>@=lh#style#surround('{!cursorhere!', '}!mark!',\n        \" \\ 1, 1, '', 1, ',{ ')<cr>\n      \" nmap <buffer> <LocalLeader>{ V<LocalLeader>{\n\n\" --- return -----------------------------------------------------{{{4\n\"-- <m-r> insert \"return ;\"\n  inoremap <buffer> <m-r> <c-r>=lh#cpp#snippets#insert_return()<cr>\n\n\" --- ?: ---------------------------------------------------------{{{4\n\"-- ?: insert \"? : ;\"\n  inoremap <buffer> ?: <c-r>=lh#map#build_map_seq('() ?!mark!:!mark!\\<esc\\>F(a')<cr>\n\n\"--- Commentaires automatiques -----------------------------------{{{4\n\"--/* insert /*<curseur>*/\n  Brackets /* */ -visual=0\n  Brackets /* */ -visual=0 -trigger=<kDivide><kMultiply>\n\"--<*M-v>- Surrounds a selection (/word) with C comments.\n  Brackets /* */ -insert=0 -trigger=<m-v>\n\n\"--/*- insert /*-----[  ]-------*/\n  inoreab <buffer> /- 0<c-d>/*<esc>75a-<esc>a*/<esc>45<left>R[\n\n\"--/*= insert /*=====[  ]=======*/\n  inoreab <buffer> /= 0<c-d>/*<esc>75a=<esc>a*/<esc>45<left>R[\n\n\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/c/c_stl.vim",
    "content": "\"=============================================================================\n\" File:\t\tftplugin/c/c_stl.vim\n\" Author:\tLuc Hermitte <EMAIL:hermitte at free.fr>\n\" \t\t<URL:http://code.google.com/p/lh-vim/>\n\" Version:\t1.1.0\n\" Created:\t24th oct 2002\n\" Last Update:\t$Date$\n\"------------------------------------------------------------------------\n\" Description:\tShow current the name of the current function, we are within,\n\" \t\ton status line.\n\" \n\"------------------------------------------------------------------------\n\" Installation:\tSee |lh-cpp-readme.txt|\n\"=============================================================================\n\" Local Definitions: {{{\n\" Avoid reinclusion\nfinish\n\" deactivated because it could be very, very slow in some cases\nif exists('b:loaded_ftplug_c_stl') | finish | endif\nlet b:loaded_ftplug_c_stl = 1\n\"\nlet s:cpo_save=&cpo\nset cpo&vim\n\"\n\"------------------------------------------------------------------------\n\" setlocal stl=%{C_ShowFuncName()}\n\" setlocal statusline=%<%f%h%{1==&modified?'[+]':''}%r%=\\ %-16(%l,%c%V\\ %)\\ %P\n\" setlocal statusline=%-30(%<%f\\ %h%{1==&modified?'[+]':''}%r%)%{C_ShowFuncName()}%=\\ %-16(%l,%c%V\\ %)\\ %P\nsetlocal statusline=%<%f\\ %h%{1==&modified?'[+]':''}%r%{C_ShowFuncName()}%=\\ %-16(%l,%c%V\\ %)\\ %P\n\" }}}\n\"=============================================================================\n\" Global Definitions: {{{\nif exists(\"g:loaded_c_stl\") \n  let &cpo=s:cpo_save\n  finish \nendif\nlet g:loaded_c_stl = 1\n\"------------------------------------------------------------------------\n\" Function: C_ShowFuncName() {{{\nfunction! C_ShowFuncName()\n  let s:type = '\\<\\I\\i*\\>'\n  let s:name = '\\%(::\\)\\=\\<\\I\\i*\\>\\%(::\\<\\I\\i*\\>\\)*'\n  let s:param= '[^)]\\+'\n\n  \" spaces, line-breaks, C comments or C++ comments\n  let s:blan0='\\%(//.*$\\|\\_s\\|/\\*.\\{-}\\*/\\)*'\n  let s:blank_ne0='\\%(\\_s\\|/\\*.\\{-}\\*/\\|//.*$\\)\\+'\n\n  \" let s:blank0='\\%(//.*$\\|\\_s\\|/\\*.\\{-}\\*/\\)*'\n  \" let s:blank_ne0='\\%(\\_s\\|/\\*.\\{-}\\*/\\|//.*$\\)\\+'\n  \" let s:blank = '\\%('.s:blank0.'\\)\\@>'\n  \" let s:blank_ne = '\\%('.s:blank_ne0.'\\)\\@>'\n\n  let s:begin= '\\%(\\%^\\|[;}]\\)'.s:blank.'\\zs'\n\n  let s:function= s:type. s:blank_ne .s:name.s:blank\n\t\\ .'(\\%('.s:blank_ne.'\\|'.s:param.'\\)*)'\n\t\\ .s:blank.'\\%(\\<const\\>\\)\\='.s:blank\n\t\" \\ .'(\\%('.s:param.'\\)*)'\n  let g:fn = s:function\n\n  let l1 = 0\n  let l2 = line('.')+1\n  while 1\n    let l2 = searchpair( '{\\_[^{]*\\%<'.l2.'l', '', '}', 'bnW' )\n    if l2 <= 0 \n      return '' | endif\n    \" let l1 = searchpair( s:function.'\\%'.l2.'l{', '', '\\%$', 'bnW' ) \n    let l1 = searchpair( s:function.'\\%'.l2.'l{', '', '}', 'bnW' ) \n    if l1 > 0 | break | endif\n  endwhile\n    call confirm('l1='.l1, '&ok', 1)\n\n\n\t\" \\ what_is_good_to_skip_comments)\n\n  \" ... then getlines from line l (if > 0) to '{'.\n  if l1 <= 0 | return '' | endif\n  let l = exists('r') ? r : ''\n  let ln=line('$')\n  while l1 < ln\n    let l = l. substitute(getline(l1), s:blank_ne, ' ', 'g')\n    if -1 != match(l, '{')\n      let l = substitute(l, '\\s\\+\\|{.*$', ' ', 'g')\n      return ' -> '.l\n    endif\n    let l1 = l1 + 1\n  endwhile\nendfunction\n\" }}}\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\" }}}\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/c/c_switch-enum.vim",
    "content": "\"=============================================================================\n\" File:\t\tftplugin/c/c_switch-enum.vim                             {{{1\n\" Author:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\" \t\t<URL:http://code.google.com/p/lh-vim/>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://code.google.com/p/lh-vim/wiki/License>\n\" Version:\t2.0.0\n\" Created:\t24th Jun 2006\n\" Last Update:\t$Date$\n\"------------------------------------------------------------------------\n\" Description:\n\" \tBuilds a switch statement from all the possible values that define an\n\" \tenum.\n\" \n\"------------------------------------------------------------------------\n\" Requirements:\n\" \tVim 7.0+\n\" \tlh-dev, mu-template, an up-to-date ctags database\n\" \tword_tools.vim\n\"\n\" TODO:\t\t\n\"\t- indirections with C typedef definitions\n\"\t  -> typedef enum <faculative name> { ... } <type-alias>;\n\"\t- Work with embedded C++ scopes\n\"\t- Use libclang when available\n\" Cannot manage:\n\" - the order of enumerated values, try to see with libclang\n\"\n\" }}}1\n\"=============================================================================\n\n\" Avoid buffer reinclusion {{{1\nlet s:cpo_save=&cpo\nset cpo&vim\nif exists('b:loaded_ftplug_switch_enum')\n       \\ && !exists('g:force_reload_c_switch_enum')\n  let &cpo=s:cpo_save\n  finish\nendif\nlet b:loaded_ftplug_switch_enum = 200\n \n\" }}}1\n\"------------------------------------------------------------------------\n\" Commands and mappings {{{1\ncommand! -b -nargs=0 SwitchEnum call lh#cpp#enum#expand_enum_to_switch()\ninoremap <buffer> <silent> <Plug>SwitchEnum <c-\\><c-n>:SwitchEnum<cr>\nif !hasmapto('<Plug>SwitchEnum', 'i')\n  imap <buffer> <silent> <unique> <c-x>se <Plug>SwitchEnum\nendif\n\n\" Commands and mappings }}}1\n\"=============================================================================\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/c/flistmaps.vim",
    "content": "\" flist.vim maps for Vim\n\"  Author  : Charles E. Campbell, Jr.\n\" Copyright: Charles E. Campbell, Jr.\n\" License  : refer to the <Copyright> file for flist\n\"\nif !exists(\"g:loaded_flistmaps_vim\")\n  let g:loaded_flistmaps_vim = 1\n\n  \" Make various lists of C/C++ functions\n  \"  \\p? prototypes : \\[px]g: globals   \\pc: comment   \\pp: all prototypes\n  \"  \\x? externs    : \\[px]s: statics                  \\xx: all externs\n  nnoremap \\pc   :w<CR>:!${CECCMD}/flist -c  % >tmp.vim<CR>:r tmp.vim<CR>:!rm tmp.vim<CR>\n  nnoremap \\pg   :w<CR>:!${CECCMD}/flist -pg % >tmp.vim<CR>:r tmp.vim<CR>:!rm tmp.vim<CR>\n  nnoremap \\pp   :w<CR>:!${CECCMD}/flist -p  % >tmp.vim<CR>:r tmp.vim<CR>:!rm tmp.vim<CR>\n  nnoremap \\ps   :w<CR>:!${CECCMD}/flist -ps % >tmp.vim<CR>:r tmp.vim<CR>:!rm tmp.vim<CR>\n  nnoremap \\xg   :w<CR>:!${CECCMD}/flist -xg % >tmp.vim<CR>:r tmp.vim<CR>:!rm tmp.vim<CR>\n  nnoremap \\xs   :w<CR>:!${CECCMD}/flist -xs % >tmp.vim<CR>:r tmp.vim<CR>:!rm tmp.vim<CR>\n  nnoremap \\xx   :w<CR>:!${CECCMD}/flist -x  % >tmp.vim<CR>:r tmp.vim<CR>:!rm tmp.vim<CR>\nendif\n"
  },
  {
    "path": "ftplugin/c/keep_pound_if_path.vim",
    "content": "\"=============================================================================\n\" File:         ftplugin/c/keep_pound_if_path.vim                 {{{1\n\" Author:       Luc Hermitte <EMAIL:luc {dot} hermitte {at} gmail {dot} com>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      2.2.1.\nlet s:k_version = '221'\n\" Created:      30th Jun 2016\n\" Last Update:  16th Jan 2019\n\"------------------------------------------------------------------------\n\" Description:\n\"    Remove the true/false path into a `#if ... #else ... #endif` construct\n\"\n\"------------------------------------------------------------------------\n\" History:      «history»\n\" TODO:         «missing features»\n\" }}}1\n\"=============================================================================\n\n\" Buffer-local Definitions {{{1\n\" Avoid local reinclusion {{{2\nlet s:cpo_save=&cpo\nset cpo&vim\nif &cp || (exists(\"b:loaded_ftplug_keep_pound_if_path\")\n      \\ && (b:loaded_ftplug_keep_pound_if_path >= s:k_version)\n      \\ && !exists('g:force_reload_ftplug_keep_pound_if_path'))\n  let &cpo=s:cpo_save\n  finish\nendif\nlet b:loaded_ftplug_keep_pound_if_path = s:k_version\n\" Avoid local reinclusion }}}2\n\n\"------------------------------------------------------------------------\n\" Local commands {{{2\n\ncommand! -b -nargs=1 KeepPoundIfPath call lh#cpp#macros#keep(<f-args>)\n\n\"=============================================================================\n\"------------------------------------------------------------------------\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/c/previewWord.vim",
    "content": "\"=============================================================================\n\" File:         ftplugin/c/previewWord.vim\n\" Author:       Georgi Slavchev <EMAIL:goyko@gbg.bg>\n\"               From <URL:http://vim.sf.net>\n\"               Adapted by Luc Hermitte <EMAIL:hermitte at free.fr>\n\"               <URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      2.2.1\nlet s:k_version = '2.2.1'\n\" Created:      ?\n\" Last Update:  16th Jan 2019\n\"------------------------------------------------------------------------\n\" Description:  {{{\n\" Have you ever tried to call a function which parameters you have forgotten?\n\" Especially those long named and with long parameter list GTK+ functions like\n\" gtk_menu_item_image_from_stock_new(..........) !!!\n\" By accident I saw a function in Vim help. It's name was PreviewWord and it\n\" allowed one to jump in the preview window to the tag for the word cursor is\n\" on.\n\" I _slightly_ modified this function not to need tags file, but to search\n\" included files instead.  I wrote another function, which uses the above said\n\" one, which triggers PreviewWord when you open the parenthesis after a\n\" function name.\n\" }}}\n\"------------------------------------------------------------------------\n\" Installation: See |lh-cpp-readme.txt|\n\"=============================================================================\n\" Buffer-local Definitions {{{1\n\" Avoid local reinclusion {{{2\nlet s:cpo_save=&cpo\nset cpo&vim\nif &cp || (exists(\"b:loaded_ftplug_previewWord\")\n      \\ && (b:loaded_ftplug_previewWord >= s:k_version)\n      \\ && !exists('g:force_reload_ftplug_previewWord'))\n  let &cpo=s:cpo_save\n  finish\nendif\nlet b:loaded_ftplug_previewWord = s:k_version\n\" Avoid local reinclusion }}}2\n\n\" Settings {{{2\nsetlocal previewheight=4\n\n\"------------------------------------------------------------------------\n\" Mappings {{{2\ninoremap <buffer> <Plug>PreviewWord <C-o>:call <sid>PreviewWord()<CR>\nnnoremap <buffer> <Plug>PreviewWord :call <sid>PreviewWord()<CR>\ncall lh#mapping#plug({'lhs': '<localleader>pw', 'rhs': '<Plug>PreviewWord', 'buffer':1}, 'in')\n\ninoremap <buffer> <Plug>ClosePreviewWindow <C-o>:call <sid>ClosePreviewWindow()<CR>\nnnoremap <buffer> <Plug>ClosePreviewWindow :call <sid>ClosePreviewWindow()<CR>\ncall lh#mapping#plug({'lhs': '<localleader>cpw', 'rhs': '<Plug>ClosePreviewWindow', 'buffer':1}, 'in')\n\n\" I've (LH) desactivated the '(' key because I use a bracketing system.\n\" inoremap <buffer> <c-space> <C-R>=<sid>PreviewFunctionSignature()<CR>\n\n\" g:preview_if_hold {{{2\nlet g:preview_if_hold = get(g:, 'preview_if_hold', 0)\nlet s:toggle_menu = {\n      \\ 'variable': 'preview_if_hold',\n      \\ 'values': [0, 1],\n      \\ 'texts': [ \"No\", \"Yes\" ],\n      \\ 'menu': {'priority': '50.10', 'name': 'C++.preview_if_hold'}\n      \\}\ncall lh#menu#def_toggle_item(s:toggle_menu)\nnnoremap <Plug>TogglePreviewIfHold :Toggle Cpreview_if_hold<cr>\ncall lh#mapping#plug({'lhs': '<localleader>ctpw', 'rhs': '<Plug>TogglePreviewIfHold'}, 'n')\n\n\" autocommands {{{2\naugroup PreviewWord\n  au!\n  au! CursorHold *.[ch] nested :call <sid>DoPreviewWord()\naugroup END\n\"=============================================================================\n\" Global Definitions {{{1\n\" Avoid global reinclusion {{{2\nif exists(\"g:loaded_ftplug_previewWord\")\n      \\ && (g:loaded_ftplug_previewWord >= s:k_version)\n      \\ && !exists('g:force_reload_ftplug_previewWord')\n  let &cpo=s:cpo_save\n  finish\nendif\nlet g:loaded_ftplug_previewWord = s:k_version\n\" Avoid global reinclusion\n\"------------------------------------------------------------------------\n\" Functions {{{2\n\"------------------------------------------------------------------------\n\" s:ClosePreviewWindow() {{{3\nfunction! s:ClosePreviewWindow() abort\n  silent! wincmd P \" jump to preview window\n  if &previewwindow \" if we really get there...\n    silent wincmd c \" close the window\n  endif\nendfunction\n\"------------------------------------------------------------------------\n\" s:PreviewWord() {{{3\n\" Note:\n\" This is literally stolen from Vim help (|CursorHold-example|).\n\" The only changes are:\n\" (1) if w != \"\"               becomes       if w =~ \"\\k\"\n\" (2) exe \"silent! ptag \" . w  becomes       exe \"silent! psearch \" . w\n\" * The first change prevents PreviewWord of searching while cursor is on some\n\"   non-keyword characters, e.g. braces, asterisks, etc.\nfunction! s:PreviewWord() abort\n  if &previewwindow \" don't do this in the preview window\n    return\n  endif\n  \" let w = expand(\"<cword>\") \" get the word under cursor\n  let w = GetNearestKeyword() \" get the word under cursor\n  if w =~ '\\k\\+' \" if there is one ':ptag' to it\n\n    \" Delete any existing highlight before showing another tag\n    silent! wincmd P \" jump to preview window\n    if &previewwindow \" if we really get there...\n      match none \" delete existing highlight\n      wincmd p \" back to old window\n    endif\n\n    \" Try previewing a matching tag for the word under the cursor\n    let v:errmsg = \"\"\n    \" doing a search this way (ie, pattern ended by '\\s*(') gives a better\n    \" chance to find a function prototype\n    exe \"silent! psearch /\" . w .'\\s*(/'\n    \" exe \"silent! psearch \" . w\n    if v:errmsg =~ \"tag not found\"\n      return\n    endif\n\n    silent! wincmd P \" jump to preview window\n    if &previewwindow \" if we really get there...\n      if has(\"folding\")\n        silent! .foldopen \" don't want a closed fold\n      endif\n      call search(\"$\", \"b\") \" to end of previous line\n      let w = substitute(w, '\\', '\\\\\\', \"\")\n      call search('\\<\\V' . w . '\\>') \" position cursor on match\n      \" Add a match highlight to the word at this position\n      hi previewWord term=bold ctermbg=green guibg=green\n      exe 'match previewWord \"\\%' . line(\".\") . 'l\\%' . col(\".\") . 'c\\k*\"'\n      wincmd p \" back to old window\n    endif\n  endif\nendfunction\n\"------------------------------------------------------------------------\n\" s:PreviewFunctionSignature() {{{3\n\" Note:\n\" When you open a parenthesis after a function name, and at the line end, that\n\" function's definition is previewed through PreviewWord().\n\" This is inspired from Delphi's CodeInsight technology.\n\" Something similar (PreviewClassMembers) could be written for the C++ users,\n\" for previewing the class members when you type a dot after an object name.\n\" If somebody decides to write it, please, mail it to me.\nfunction! s:PreviewFunctionSignature() abort\n    \" let CharOnCursor = strpart( getline('.'), col('.')-2, 1)\n    if col(\".\") == col(\"$\")\n        call s:PreviewWord()\n    endif\n    return \"(\"\nendfunction\n\"------------------------------------------------------------------------\n\" s:DoPreviewWord(), automatically called when the cursor is holded {{{3\nfunction! s:DoPreviewWord() abort\n  if g:preview_if_hold\n    call s:PreviewWord()\n  endif\nendfunction\n\n\" }}}1\nlet &cpo = s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/c/word.list",
    "content": "__cpp_aggregate_bases\n__cpp_aggregate_nsdmi\n__cpp_aggregate_paren_init\n__cpp_alias_templates\n__cpp_aligned_new\n__cpp_attributes\n__cpp_binary_literals\n__cpp_capture_star_this\n__cpp_char8_t\n__cpp_conditional_explicit\n__cpp_constexpr\n__cpp_coroutines\n__cpp_decltype\n__cpp_decltype_auto\n__cpp_deduction_guides\n__cpp_delegating_constructors\n__cpp_enumerator_attributes\n__cpp_fold_expressions\n__cpp_generic_lambdas\n__cpp_guaranteed_copy_elision\n__cpp_hex_float\n__cpp_if_constexpr\n__cpp_impl_destroying_delete\n__cpp_impl_three_way_comparison\n__cpp_inheriting_constructors\n__cpp_init_captures\n__cpp_initializer_lists\n__cpp_inline_variables\n__cpp_lambdas\n__cpp_lib_addressof_constexpr\n__cpp_lib_allocator_traits_is_always_equal\n__cpp_lib_any\n__cpp_lib_apply\n__cpp_lib_array_constexpr\n__cpp_lib_as_const\n__cpp_lib_atomic_is_always_lock_free\n__cpp_lib_atomic_ref\n__cpp_lib_bind_front\n__cpp_lib_bit_cast\n__cpp_lib_bool_constant\n__cpp_lib_bounded_array_traits\n__cpp_lib_boyer_moore_searcher\n__cpp_lib_byte\n__cpp_lib_char8_t\n__cpp_lib_chrono\n__cpp_lib_chrono_udls\n__cpp_lib_clamp\n__cpp_lib_complex_udls\n__cpp_lib_concepts\n__cpp_lib_constexpr\n__cpp_lib_constexpr_swap_algorithms\n__cpp_lib_destroying_delete\n__cpp_lib_enable_shared_from_this\n__cpp_lib_erase_if\n__cpp_lib_exchange_function\n__cpp_lib_execution\n__cpp_lib_filesystem\n__cpp_lib_gcd_lcm\n__cpp_lib_generic_associative_lookup\n__cpp_lib_generic_unordered_lookup\n__cpp_lib_hardware_interference_size\n__cpp_lib_has_unique_object_representations\n__cpp_lib_hypot\n__cpp_lib_incomplete_container_elements\n__cpp_lib_integer_sequence\n__cpp_lib_integral_constant_callable\n__cpp_lib_interpolate\n__cpp_lib_invoke\n__cpp_lib_is_aggregate\n__cpp_lib_is_constant_evaluated\n__cpp_lib_is_final\n__cpp_lib_is_invocable\n__cpp_lib_is_null_pointer\n__cpp_lib_is_swappable\n__cpp_lib_launder\n__cpp_lib_list_remove_return_type\n__cpp_lib_logical_traits\n__cpp_lib_make_from_tuple\n__cpp_lib_make_reverse_iterator\n__cpp_lib_make_unique\n__cpp_lib_map_try_emplace\n__cpp_lib_math_special_functions\n__cpp_lib_memory_resource\n__cpp_lib_node_extract\n__cpp_lib_nonmember_container_access\n__cpp_lib_not_fn\n__cpp_lib_null_iterators\n__cpp_lib_optional\n__cpp_lib_parallel_algorithm\n__cpp_lib_quoted_string_io\n__cpp_lib_ranges\n__cpp_lib_raw_memory_algorithms\n__cpp_lib_result_of_sfinae\n__cpp_lib_robust_nonmodifying_seq_ops\n__cpp_lib_sample\n__cpp_lib_scoped_lock\n__cpp_lib_shared_mutex\n__cpp_lib_shared_ptr_arrays\n__cpp_lib_shared_ptr_weak_type\n__cpp_lib_shared_timed_mutex\n__cpp_lib_string_udls\n__cpp_lib_string_view\n__cpp_lib_three_way_comparison\n__cpp_lib_to_chars\n__cpp_lib_transformation_trait_aliases\n__cpp_lib_transparent_operators\n__cpp_lib_tuple_element_t\n__cpp_lib_tuples_by_type\n__cpp_lib_type_trait_variable_templates\n__cpp_lib_uncaught_exceptions\n__cpp_lib_unordered_map_try_emplace\n__cpp_lib_variant\n__cpp_lib_void_t\n__cpp_namespace_attributes\n__cpp_noexcept_function_type\n__cpp_nontype_template_args\n__cpp_nontype_template_parameter_auto\n__cpp_nontype_template_parameter_class\n__cpp_nsdmi\n__cpp_range_based_for\n__cpp_raw_strings\n__cpp_ref_qualifiers\n__cpp_return_type_deduction\n__cpp_rvalue_references\n__cpp_sized_deallocation\n__cpp_static_assert\n__cpp_structured_bindings\n__cpp_template_template_args\n__cpp_threadsafe_static_init\n__cpp_unicode_characters\n__cpp_unicode_literals\n__cpp_user_defined_literals\n__cpp_variable_templates\n__cpp_variadic_templates\n__cpp_variadic_using\n_heap\nabort\nabsolute\naccumulate\nadd_const\nadd_const_t\nadd_cv\nadd_cv_t\nadd_lvalue_reference\nadd_lvalue_reference_t\nadd_pointer\nadd_pointer_t\nadd_rvalue_reference\nadd_rvalue_reference_t\nadd_volatile\nadd_volatile_t\naddress\nadjacent_difference\nadjacent_find\nadvance\nalignas\naligned_storage\naligned_storage_t\naligned_union\naligned_union_t\nalignment_of\nalignment_of_v\nalignof\nall\nall_of\nall_view\nallocation\nallocator\nallocator_type\nand\nand_eq\nany\nany_cast\nappend\napply\nargument\narithmetic\narray\nas_bytes\nas_const\nas_writable_bytes\nasm\nassign\nassignable_from\nassignement\nassoc_laguerre\nassoc_laguerref\nassoc_laguerrel\nassoc_legendre\nassoc_legendref\nassoc_legendrel\nasync\natexit\natomic\natomic_ref\nauto\nback\nback_insert_iterator\nback_inserter\nbad_any_cast\nbad_cast\nbad_optional_access\nbad_typeid\nbad_variant_access\nbasic_filebuf\nbasic_ios\nbasic_iostream\nbasic_istream\nbasic_istream_view\nbasic_istringstream\nbasic_ostream\nbasic_ostringstream\nbasic_osyncstream\nbasic_regex\nbasic_streambuf\nbasic_string\nbasic_string_view\nbasic_stringbuf\nbasic_stringstream\nbasic_syncbuf\nbegin\nbernoulli_distribution\nbeta\nbetaf\nbetal\nbidirectional_iterator\nbidirectional_iterator_tag\nbidirectional_range\nbinary_compose\nbinary_function\nbinary_negate\nbinary_search\nbind\nbind1st\nbind2nd\nbinder1st\nbinder2nd\nbinomial_distribution\nbit_vector\nbitand\nbitor\nbitset\nbitwise\nblock\nbool\nbool_constant\nboolean\nbreak\nbucket\nbucket_count\nbucket_size\nbyte\ncall_once\ncanonical\ncapacity\ncarries_dependency\ncase\ncatch\ncauchy_distribution\ncbegin\ncdata\ncend\ncerr\nchar\nchar_8t\nchar_producer\nchar_traits\ncharacter\nchars_format\nchi_squared_distribution\nchrono\ncin\nclass\nclear\nclock\nclog\nco_await\nco_return\nco_yield\ncode\ncommand\ncommon\ncommon_range\ncommon_reference_with\ncommon_type\ncommon_type_t\ncommon_view\ncommon_with\ncomp_ellint_1\ncomp_ellint_1f\ncomp_ellint_1l\ncomp_ellint_2\ncomp_ellint_2f\ncomp_ellint_2l\ncomp_ellint_3\ncomp_ellint_3f\ncomp_ellint_3l\ncompare\ncompare_exchange_strong\ncompare_exchange_weak\ncompare_partial_order_fallback\ncompare_strong_order_fallback\ncompare_three_way\ncompare_three_way_category\ncompare_three_way_result\ncompare_weak_order_fallback\ncompl\nconcat\nconcept\ncondition\ncondition_variable\ncondition_variable_any\nconditional\nconditional_t\nconjuction\nconjuction_t\nconst\nconst_cast\nconst_iterator\nconst_pointer\nconst_reference\nconst_reverse_iterator\nconstant\nconsteval\nconstexpr\nconstinit\nconstruct\nconstructible_from\ncontiguous_range\ncontinue\nconversion\nconvertible_to\ncopy\ncopy_backward\ncopy_constructible\ncopy_file\ncopy_if\ncopy_n\ncopy_options\ncopy_symlink\ncopyable\ncount\ncount_if\ncounted\ncout\ncrbegin\ncreate_directories\ncreate_directory\ncreate_directory_symlink\ncreate_hard_link\ncreate_symlink\ncref\ncrend\ncurrent_path\ncv_status\ncyl_bessel_i\ncyl_bessel_if\ncyl_bessel_il\ncyl_bessel_j\ncyl_bessel_jf\ncyl_bessel_jl\ncyl_bessel_k\ncyl_bessel_kf\ncyl_bessel_kl\ncyl_neumann\ncyl_neumannf\ncyl_neumannl\ndangling\ndata\ndecay\ndecay_t\ndeclaration\ndecltype\ndeclval\ndecrement\ndefault\ndefault_constructible\ndefault_random_engine\ndefined\ndefinition\ndelete\ndenorm_absent\ndenorm_indeterminate\ndenorm_min\ndenorm_present\ndeprecated\ndeque\nderived_from\ndescription\ndescriptor\ndestroy\ndestroy_at\ndestroy_n\ndestructible\ndifference_type\ndigits\ndigits10\ndimension\ndirectory_entry\ndirectory_iterator\ndirectory_options\ndisable_if\ndisable_if_t\ndisable_recursion_pending\ndiscard_block_engine\ndiscrete_distribution\ndisjunction\ndisjunction_t\ndistance\ndistance_type\ndivides\ndo\ndouble\ndrop_view\ndrop_while\ndrop_while_view\nduration\ndynamic_cast\ndynamic_extent\nelements\nelements_view\nellint_1\nellint_1f\nellint_1l\nellint_2\nellint_2f\nellint_2l\nellint_3\nellint_3f\nellint_3l\nelse\nemplace\nemplace_back\nemplace_hint\nemplace_insert\nempty\nempty_view\nenable_if\nenable_if_t\nend\nends_with\nenum\nepsilon\nequal\nequal_range\nequal_to\nequality_comparableequality_comparable_with\nequivalent\nerase\nerror_type\nevaluation\nexchange\nexists\nexpint\nexpintf\nexpintl\nexplicit\nexponential_distribution\nexport\nexpression\nextent\nextent_v\nextention\nextern\nexternal\nextreme_value_distribution\nfallthrough\nfalse\nfalse_type\nfetch_add\nfetch_and\nfetch_or\nfetch_sub\nfetch_xor\nfile_size\nfile_status\nfile_time_type\nfile_type\nfilebuf\nfilename\nfilesystem_error\nfill\nfill_n\nfilter_view\nfinal\nfind\nfind_end\nfind_first_not_of\nfind_first_of\nfind_if\nfind_if_not\nfind_last_not_of\nfind_last_of\nfirst\nfisher_f_distribution\nfloat\nfloat_denorm_style\nfloat_round_style\nfloating_point\nfollow_directory_symlink\nfor\nfor_each\nformat\nformat_to\nformat_to_n\nformatted\nformatted_size\nforward\nforward_iterator\nforward_iterator_tag\nforward_list\nforward_range\nfpos\nfriend\nfrom_chars\nfront\nfront_insert_iterator\nfunction\nfuture\nfuture_category\nfuture_errc\nfuture_error\nfuture_status\ngamma_distribution\ngenerate\ngenerate_canonical\ngenerate_n\ngeneric_string\ngeneric_u16string\ngeneric_u32string\ngeneric_u8string\ngeneric_wstring\ngeometric_distribution\nget_allocator\nget_id\nget_if\nget_temporary_buffer\nglobal\ngoto\ngreater\ngreater_equal\ngroup_all\ngroup_exec\ngroup_read\ngroup_write\nhandling\nhard_link_count\nhas_denorm\nhas_denorm_loss\nhas_extension\nhas_filename\nhas_infinity\nhas_inifinity\nhas_parent_path\nhas_quiet_NaN\nhas_relative_path\nhas_root_directory\nhas_root_name\nhas_root_path\nhas_signaling_NaN\nhas_stem\nhas_value\nhas_virtual_destructor\nhash\nhash_function\nhash_map\nhash_multimap\nhash_multiset\nhash_set\nhermite\nhermitef\nhermitel\nhigh_resolution_clock\nholds_alternative\nidentifier\nidentity\nif\nif_floatting_point\nignore\nimplementation\nimport\nin_place\nin_place_index\nin_place_index_t\nin_place_t\nin_place_type\nin_place_type_t\nincludes\nincrement\nindependent_bits_engine\nindex\nindirect_relation\nindirect_result_t\nindirect_strict_weak_order\nindirect_unary_predicate\nindirectly_comparable\nindirectly_copyable\nindirectly_copyable_storable\nindirectly_movable\nindirectly_movable_storable\nindirectly_regular_unary_invocable\nindirectly_swappable\nindirectly_unary_invocable\ninfinity\ninitialization\ninitializer_list\ninline\ninner_product\ninplace_merge\ninput\ninput_iterator\ninput_iterator_tag\ninput_range\ninsert\ninsert_iterator\ninsert_or_assign\ninserter\nint\nint16_t\nint32_t\nint64_t\nint8_t\nint_fast16_t\nint_fast32_t\nint_fast64_t\nint_fast8_t\nint_least16_t\nint_least32_t\nint_least64_t\nint_least8_t\ninteger_sequence\nintegral\nintegral_constant\ninterface\ninterger_sequence\ninvocable\nio_errc\nios\niostream\niostream_category\niota\niota_view\nis_absolute\nis_abstract\nis_abstract_v\nis_always_lock_free\nis_arithmetic\nis_arithmetic_v\nis_array\nis_array_v\nis_assignable\nis_assignable_v\nis_baseof\nis_baseof_v\nis_block_file\nis_bounded\nis_character_file\nis_class\nis_class_v\nis_compound\nis_compound_v\nis_const\nis_const_v\nis_constructible\nis_constructible_v\nis_convertible\nis_convertible_v\nis_copy_assignable\nis_copy_assignable_v\nis_copy_constructible\nis_copy_constructible_v\nis_default_constructible\nis_default_constructible_v\nis_destructible\nis_destructible_v\nis_directory\nis_ed\nis_ed_until\nis_empty\nis_empty_v\nis_enum\nis_enum_v\nis_eq\nis_exact\nis_fifo\nis_final\nis_final_v\nis_function\nis_function_v\nis_fundamental\nis_fundamental_v\nis_gt\nis_gteq\nis_heap\nis_heap_until\nis_heap_until_v\nis_heap_v\nis_iec559\nis_integer\nis_integral\nis_integral_v\nis_literal_type\nis_lock_free\nis_lt\nis_lteq\nis_lvalue_reference\nis_member_function_pointer\nis_member_object_pointer\nis_member_pointer\nis_modulo\nis_move_assignable\nis_move_constructible\nis_neq\nis_nothrow_assignable\nis_nothrow_constructible\nis_nothrow_copy_assignable\nis_nothrow_copy_constructible\nis_nothrow_default_constructible\nis_nothrow_destructible\nis_nothrow_move_assignable\nis_nothrow_move_constructible\nis_null_pointer\nis_object\nis_other\nis_partioned\nis_permutation\nis_placeholder\nis_pod\nis_pointer\nis_polymorphic\nis_reference\nis_regular_file\nis_relative\nis_rvalue_reference\nis_same\nis_scalar\nis_signed\nis_socket\nis_specialized\nis_standard_layout\nis_symlink\nis_trivial\nis_trivially_assignable\nis_trivially_constructible\nis_trivially_copy_assignable\nis_trivially_copy_constructible\nis_trivially_copyable\nis_trivially_default_constructible\nis_trivially_destructible\nis_trivially_move_assignable\nis_trivially_move_constructible\nis_union\nis_unsigned\nis_void\nis_volatile\nistream\nistream_iterator\nistream_view\nistringstream\niter_swap\niterator\niterator_category\niterator_t\niterator_traits\njoin\njoin_view\nkey_comp\nkey_eq\nkeys\nkeys_view\nknuth_b\nlabel\nlaguerre\nlaguerref\nlaguerrel\nlast\nlast_write_time\nlaunch\nlaunder\nlegendre\nlegendref\nlegendrel\nless\nless_equal\nlexical\nlexical_normal\nlexical_proximate\nlexical_relative\nlexicographical_compare\nlexicographical_compare_3way\nlikely\nlinear_congruential_engine\nlist\nload\nload_factor\nlocal\nlock\nlock_guard\nlogical\nlogical_and\nlogical_not\nlogical_or\nlognormal_distribution\nlong\nlookup\nloop\nlower_bound\nlowest\nlvalue\nmake_any\nmake_from_tuple\nmake_heap\nmake_iterator\nmake_move_iterator\nmake_pair\nmake_preferred\nmake_reverse_iterator\nmake_shared\nmake_signed\nmake_signed_t\nmake_tuple\nmake_unique\nmake_unsigned\nmake_unsigned_t\nmap\nmask\nmatch_flag_type\nmatch_results\nmax\nmax_align_t\nmax_bucket_count\nmax_digits10\nmax_element\nmax_exponent\nmax_exponent10\nmax_load_factor\nmax_size\nmaybe_unused\nmem_fun\nmem_fun1_ref_t\nmem_fun1_t\nmem_fun_ref\nmem_fun_ref_t\nmem_fun_t\nmerge\nmergeable\nmersenne_twister_engine\nmin\nmin_element\nmin_exponent\nmin_exponent10\nminmax\nminmax_element\nminstd_rand\nminstd_rand0\nminus\nmiscellaneous\nmismatch\nmodule\nmodulus\nmonostate\nmovable\nmove\nmove_backward\nmove_constructible\nmove_if_noexcept\nmove_iterator\nmt19937\nmt19937_64\nmultimap\nmultiplies\nmultiset\nmutable\nmutex\nnamespace\nnative\nnegate\nnegation\nnegation_t\nnegative_binomial_distribution\nnew\nnext\nnext_permutation\nno_unique_address\nnodiscard\nnoexcept\nnofollow\nnoncopyable\nnone\nnone_of\nnoreturn\nnormal_distribution\nnot\nnot_eq\nnot_equal_to\nnotation\nnotify_all\nnotify_all_at_thread_exit\nnotify_one\nnpos\nnth_element\nnullopt\nnullopt_t\nnullptr\nnullptr_t\nnumeric_limits\nnumerical\noffsetof\nonce_flag\noperation\noperator\noptional\nor\nor_eq\nostream\nostream_iterator\nostringstream\nosyncstream\nothers_all\nothers_exec\nothers_read\nothers_write\noutput\noutput_iterator\noutput_iterator_tag\noutput_range\noverride\nowner_all\nowner_exec\nowner_read\nowner_write\npackaged_task\npair\nparent_path\npartial\npartial_copy\npartial_order\npartial_ordering\npartial_sum\npartition\npartition_copy\npartition_point\npath\nperm_options\npermissions\nperms\npermutable\npiecewise_constant_distribution\npiecewise_construct\npiecewise_construct_t\npiecewise_linear_distribution\nplaceholders\nplus\npointer\npointer_to_binary_function\npointer_to_unary_function\npoisson_distribution\npop\npop_back\npop_front\npop_heap\npower\nprecedence\npredicate\npreprocessing\npreprocessor\nprev\nprev_permutation\npriority_queue\nprivate\nprogram\nproject1st\nproject2nd\nprojected\npromise\nprotected\nproximate\nptr_fun\nptr_list\nptr_map\nptr_set\nptr_vector\nptrdiff_t\npublic\npush_back\npush_heap\nqueue\nquiet_NaN\nradix\nrandom\nrandom_access_iterator\nrandom_access_iterator_tag\nrandom_access_range\nrandom_device\nrandom_sample\nrandom_sample_n\nrandom_shuffle\nrange\nrange_difference_t\nrange_reference_t\nrange_rvalue_reference_t\nrange_value_t\nranges\nrank\nrank_v\nranlux24\nranlux24_base\nranlux48\nranlux48_base\nraw_storage_iterator\nrbegin\nread_symlink\nrecursion\nrecursive\nrecursive_directory_iterator\nrecursive_mutex\nref\nref_view\nreference\nreference_wrapper\nreferential\nrefresh\nregex\nregex_error\nregex_iterator\nregex_match\nregex_replace\nregex_search\nregex_token_iterator\nregex_traits\nregister\nregular\nregular_invocable\nrehash\nreinterpret_cast\nrelation\nrelational\nrelative\nrelative_path\nremove\nremove_all\nremove_all_extents\nremove_all_extents_t\nremove_const\nremove_const_t\nremove_copy\nremove_copy_if\nremove_copy_if_t\nremove_copy_t\nremove_cv\nremove_cv_t\nremove_extent\nremove_extent_t\nremove_filename\nremove_if\nremove_if_t\nremove_pointer\nremove_pointer_t\nremove_prefix\nremove_reference\nremove_reference_t\nremove_suffix\nremove_t\nremove_volatile\nremove_volatile_t\nrename\nrend\nreplace\nreplace_copy\nreplace_copy_if\nreplace_extension\nreplace_filename\nreplace_if\nrequired_alignment\nrequires\nreserve\nreset\nresize\nresize_file\nresult_of\nresult_of_t\nreturn\nreturn_temporary_buffer\nreverse\nreverse_bidirectional_iterator\nreverse_copy\nreverse_iterator\nreverse_view\nrfind\nriemann_zeta\nriemann_zetaf\nriemann_zetal\nroot_directory\nroot_name\nroot_path\nrope\nrotate\nrotate_copy\nround_error\nround_indeterminate\nround_style\nround_to_nearest\nround_toward_infinity\nround_toward_neg_infinity\nround_toward_zero\nruntime_error\nsafe_iterator_t\nsafe_subrange_t\nsame_as\nscope\nsearch\nsearch_n\nseed_seq\nselect1st\nselect2nd\nsemiregular\nsentinel_t\nsequence_buffer\nset\nset_difference\nset_gid\nset_intersection\nset_symmetric_difference\nset_uid\nset_union\nshared_future\nshared_lock\nshared_mutex\nshared_ptr\nshared_timed_mutex\nshort\nshrink_to_fit\nshuffle\nshuffle_order_engine\nsignaling_NaN\nsigned\nsigned_integral\nsingle\nsingle_view\nsize\nsize_bytes\nsize_t\nsize_type\nsized_range\nsizeof\nskip_permission_denied\nsleep_for\nsleep_until\nslist\nsortable\nspace\nspace_info\nspan\nsph_bessel\nsph_besself\nsph_bessell\nsph_legendre\nsph_legendref\nsph_legendrel\nsph_neumann\nsph_neumannf\nsph_neumannl\nsplit\nsplit_view\nstable_\nstable_partition\nstack\nstandard\nstarts_with\nstatement\nstatic\nstatic_assert\nstatic_cast\nstatus\nstatus_known\nsteady_clock\nstem\nsticky_bit\nstore\nstreambuf\nstreamoff\nstreampos\nstreamsize\nstrict_weak_order\nstring\nstring_view\nstringbuf\nstringstream\nstrong_order\nstrong_ordering\nstruct\nstructure\nstudent_t_distribution\nsub_match\nsubrange\nsubspan\nsubstr\nsubtract_with_carry_engine\nsubtractive_rng\nswap\nswap_ranges\nswappableswappable_with\nswitch\nsymlink_status\nsyncbuf\nsyntax_option_type\nsystem\nsystem_clock\nsystem_error\ntake\ntake_view\ntake_while\ntake_while_view\ntemp_directory_path\ntemplate\ntemporary_buffer\nthis\nthread\nthree_way_comparable\nthree_way_comparable_with\nthrow\ntie\ntime\ntime_point\ntimed_mutex\ntimed_recursive_mutex\ntinyness_before\nto_chars\ntotally_orderedtotally_ordered_with\ntransform\ntransform_view\ntraps\ntrue\ntrue_type\ntry\ntry_emplace\ntry_lock\ntuple\ntuple_element\ntuple_size\ntype_index\ntype_info\ntype_traits\ntypedef\ntypeid\ntypename\nu16string\nu16string_view\nu32string\nu32string_view\nu8path\nu8string\nu8string_view\nuint16_t\nuint32_t\nuint64_t\nuint8_t\nuint_fast16_t\nuint_fast32_t\nuint_fast64_t\nuint_fast8_t\nuint_least16_t\nuint_least32_t\nuint_least64_t\nuint_least8_t\nuintmax_t\nunary_compose\nunary_function\nunary_negate\nundefined\nunderlying_type\nunderlying_type_t\nuniform_int_distribution\nuniform_real_distribution\nuninitialized_copy\nuninitialized_copy_n\nuninitialized_default_construct\nuninitialized_default_construct_n\nuninitialized_fill\nuninitialized_fill_n\nuninitialized_move\nuninitialized_move_n\nuninitialized_value_construct\nuninitialized_value_construct_n\nunion\nunique\nunique_copy\nunique_lock\nunique_ptr\nunlikely\nunordered_map\nunordered_multimap\nunordered_multiset\nunordered_set\nunsigned\nunsigned_integral\nupper_bound\nusing\nvalue\nvalue_comp\nvalue_or\nvalue_type\nvalueless_by_exception\nvalues\nvalues_view\nvariable\nvariant\nvariant_alternative\nvariant_alternative_t\nvariant_npos\nvariant_size\nvariant_size_v\nvector\nview\nview_interface\nviewable_range\nviews\nvirtual\nvisit\nvoid\nvoid_t\nvolatile\nwait\nwcerr\nwchar_t\nwcin\nwclog\nwcout\nweak_order\nweak_ordering\nweak_ptr\nweakly_canonical\nweibull_distribution\nwfilebuf\nwhat\nwhile\nwios\nwiostream\nwistream\nwistringstream\nwostream\nwostringstream\nwosyncstream\nwstreambuf\nwstreampos\nwstring_view\nwstringbuf\nwstringstream\nwsyncbuf\nxor\nxor_eq\nyield\n"
  },
  {
    "path": "ftplugin/cpp/changelog",
    "content": "[08 Dec 2005] {{{1\n(*) cpp_set.vim {{{2\n    (*) mapping to <m-t> => insert \"typename\" (after a '<', or after\n    \"typedef\"), or \"typedef\"\n\n[26 Aug 2005] {{{1\n(*) cpp_set.vim {{{2\n    (*) New visual mode mappings to convert C-style casts into C++\n        style casts\n       => ,,sc  ,,rc  ,,cc  ,,dc\n(*) todo {{{2\n    (*) Merge ,sc and ,,sc => auto detect a C-style cast to apply\n        translation ; hint: looks like (.*).*\n\n[14th Apr 2005] {{{1\n(*) common_brackets.vim\n    (*) Triggers.vim can be installed into {rtp}/macros\n\n[02nd Feb 2005] {{{1\n(*) ftplugin/cpp/cpp_set.vim\n    (*) Does not expand `namespace' if there is a `using' on the same\n        line\n    (*) New vmappings for the vaious C++ castings -> ,dc ,sc ,rc ,sc\n        ,,dc ,,sc ,,rc ,,sc\n(*) ftplugin/c/c_set.vim\n    (*) New N&V mappings, on <M-v>, that surround a selection (/word)\n        with a C-comment (/*...*/)\n\n[31st Jan 2005] {{{1\n(*) after/ftplugin/c/c_brackets.vim\n    (*) `<' expands into `<!cursorhere!>!mark!' after a `#include',\n    `template', `typename', or a `xxxx_cast'\n\n[16th Jan 2005] {{{1\n(*) ftplugin/c/c_set.vim\n    (*) Don't expand #if anymore\n\n[22nd Nov 2004] {{{1\n(*) plugin/bracketing_base.vim\n    (*) New behaviour for !mark! in visual mode: \n        If a marker is selected, then the marker is replaced by its\n\tcontents. Otherwise the visual slection is wrapped into a\n\tmarker.\n    (*) New mappings !mark! and <Plug>MarkersMark added to the normal\n        mode.\n\n[25th Jul 2004] {{{1\n(*) macros/options.vim {{{2\n    (*) New plugin: Fatorizes a very common function: LHOption()\n(*) ftplugin/c/c_compile.vim {{{2\n    (*) Requires: macros/options.vim\n    (*) New Options: [bg]:key_make, key_execute and key_config\n        -> override the default keybindings to <F7>, <C-F5>, <M-F7>\n(*) ftplugin/c/c_set.vim {{{2\n    (*) <localleader>while: changed into <localleader>wh\n(*) ftplugin/cpp/cpp_set.vim {{{2\n    (*) New mapping: \"<c-x>rbe\" : reverse version of \"<c-x>be\"\n    (*) New abbreviation: \"namespace\" that expands into \"namespace | {\\n\\n}\"\n    (*) Bug fix: <localleader>namespace is correctly expanded when we select a\n        marker.\n    (*) Bug Fix: \"<localleader>try\" is correctly expanded when\n        c_nl_before_curlyB == 1\n    (*) Behaviour change: c_nl_before_curlyB also applies with '}'\n        Modification noticeable with the abbreviation \"try\".\n\n[16th Jun 2004] {{{1\n(*) ftpugin/c/c_compile.vim {{{2\n    (*) New ftplugin: Defines helper mappings to compile, execute\n        and configure projects\n    (*) Requires: ui-functions.vim\n    (*) Takes advantage of: let-modeline.vim (not shipped)\n(*) mu-template {{{2\n    (*) Little improvements: with the function s:Include()\n    (*) New templates: C++'s operators >> and <<\n\n(*) misc_map.vim {{{2\n    (*) Bug fix in BuildMapSeq: the function was not compatible with\n        LaTeX-Suite ; as LS mapped '!' in order to protect ``!, \\`! and \"`!\n        => s/mapcheck/maparg/\n\n[07th May 2004] {{{1\n(*) misc_map.vim {{{2\n    (*) New function: Map4TheseContexts()\n    (*) The default value for: the parameter {default_value} of MapContext()\n        is now {key}\n    (*) New function: Surround()\n        Aimed to replace InsertAroundVisual() in the definition of mappings.\n\tThis new function emulates :smap-pings :\n\t- when a marker/placeholder is selected, an insert mode\n\tmapping/abbreviation is used,\n\t- otherwise, a visual-mode mapping (that inserts text arround\n\tthe selection) is used.\n(*) common_brackets.vim {{{2\n    (*) now compatible with Srinath Avadhanula's IMAP.vim\n    (*) smarter: \n\tThe behaviour of '\\(' and '\\%(' for Vim buffers has been changed.\n(*) c_set.vim & cpp_set.vim {{{2\n    (*) Rewritten: to use Surround() instead of InsertAroundVisual()\n\n[16th Mar 2004] {{{1\n(*) cpp_set {{{2\n    (*) imap:   <m-b> -> boost::\n    (*) imap:   <m-l> -> luc_lib::\n    (*) n/vmap: <localleader>ns -> \"namespace{\\n}\" around bloc/line\n\n[13th Jan 2004] {{{1\n(*) c_sep, cpp_set {{{2\n    (*) Def_Abbr_C() simplified => only two parameters now\n       => Bug happening when loading the control-structure abbreviations fixed\n    (*) Using InsertAroundVisual() instead of the old MapAroundVisualLine\n(*) cpp_set        {{{2\n    (*) the abbreviations (try, catch) don't mess the search history anymore.\n\n[25th Sep 2003] {{{1\n(*) c_set {{{2\n    (*) the abbreviations (if, for, switch, while) don't mess the search\n        history anymore.\n\n[26th Aug 2003] {{{1\n(*) c_set, cpp_set {{{2\n    (*) visual mappings behave correctly, even in select-mode (:h gV)\n(*) bracketing.base.vim {{{2\n    (*) New option: [bg]:marker_center\n    (*) New mappings: !jump-and-del! !bjump-and-del!\n        -> Always jump and delete the next/previous markers, whatever the\n\toptions are.\n\n[28th Jul 2003] {{{1\n(*) cpp_options, c_set {{{2\n    (*) b:nl_before_xxx changed into g:c_nl_before_xxx\n(*) cpp_InsertAccessors {{{2\n    (*) respects g:c_nl_before_curlyB\n\tBut the definition of g:c_nl_before_curlyB must be done into\n\t./cpp_options.vim.\n    (*) new option: g:accessorCap that enables to tune the capitalization of\n        the first letter of the attribute within accessor-names.\n\t-1 (lowcase), 0 (no change), 1 (upcase)\n    (*) new options: g:accessor_comment_{get,set,ref},\n                     g:accessor_comment_proxy_{get,set,ref}\n\t=> customize the comments written for the various accessors.\n\tNote: the comment may be an empty string\n\n(*) cpp_InsertAccessors, cpp_BuildTemplate, cpp_GotoFunctionImpl {{{2\n    (*) bug fixed regarding automatic !jump! and Template\n\n[20th Jul 2003] {{{1\n(*) misc_map.vim {{{2\n    (*) doxygen comments are correctly recognized as comments.\n\n[12th Jul 2003] {{{1\n(*) doxygen.vim {{{2\n    (*) Michael Geddes's syntax file has been move to: {rtp}/syntax/\n(*) c_set.vim {{{2\n    (*) Loads: doxygen.vim\n(*) cpp_options.vim {{{2\n    (*) comments added regarding b:nl_before_bracket\n        [I know, it is not unique to C++ but concerns C as well]\n\n[03rd Jul 2003 -- 04th Jul 2003] {{{1\n(*) c_set {{{2\n    (*) fix: the documentation wasn't find-able anymore\n    (*) Two new boolean options : b:nl_before_bracket and b:nl_before_curlyB\n        that specify wheither we require a newline character before the '('\n        and the '{' of the various control statements (if, for, while, ...)\n\tdefault values: false (0)\n(*) cpp_set {{{2\n    (*) Small changes in consequence\n(*) common_brackets.vim 4.0:  {{{2\n    (*) New option: b:cb_jump_on_close that specify weither the mappings for\n         the closing brackets are defined or not ; [default: true (1)]\n(*) Documentation {{{2\n    (*) Updated and minor changes.\n\n(*) todo {{{2\n    (*) \"imap }\" does not work correctly\n    (*) the control statements should not mess up the search history\n    (*) mutemplate... utf-8 & doc\n\n[... -- 09th Apr 2003] {{{1\n(*) Mu-template 0.31 {{{2\n\n(*) Documentation {{{2\n    (*) Little changes\n\n[10th oct 2002 -- 18th oct 2002] {{{1\n(*) cpp_FindContextClass.vim {{{2\n    (*) Cpp_CurrentScope(l,'class') supports: \n\t- inheritance -> 'class A : xx B, xx C ... {'\n\t- and declaration on several lines of the previous inheritance text.\n    (*) Cpp_SearchClassDefinition becomes obsolete. Instead, use\n\tCpp_CurrentScope(lineNo, scope_type) to search for a namespace::class\n\tscope.\n    (*) Functions that will return the list of the direct base classes of the\n\tcurrent class.\n    (*) Able to handle C-definitions like:\n\t    \"typedef struct foo{...} *PFoo,Foo;\"\n    (*) An inversion problem, with nested classes, fixed.\n\n(*) cpp_GotoFunctionImpl 0.6 {{{2\n    (*) Supports destructors\n    (*) Supports namespaces: \n\t+ If the zone where the function implementation is going to be\n\t  inserted is within a namespace, then the scope of the function\n\t  will be corrected.\n\t+ The |search-implementation| feature is able to differentiate\n\t  functions according to the namespace they are within, and thus\n\t  it is able to jump to the right function. For instance:\n\t    int NS::CL::FN(int i) {}\t\t// is NS::CL::FN\n\t    namespace NS0 {\n\t\tint NS::CL::FN(int i) {}\t// is NS0::NS::CL:FN\n\t    }\n    (*) Checks whether the function is a pure virtual method and refuse to\n\tdefine an implementation in such cases ...\n    (*) When searching for the implementation of a function within the\n\t.cpp file, comments before the signature will be ignored ; i.e.\n\tthe cursor will move to the return-type. The difference is\n\tnoticeable on virtual or static functions.\n(*) cpp_GotoFunctionImpl 0.5 {{{2\n    (*) The management of cpp_options.vim has been moved to another file.  \n    (*) Comments are completly ignored when searching for the implementation\n\tof a function. Actually, the match is done according to the list of\n\ttype only -- even parameter names will be ignored.\n    (*) Inlines functions (within the class def) (ie not prototypes) will be\n        ignored\n    (*) Enhancements and little bug corrections regaring default parameters\n    (*) We can specify where we want the default implementation code to be\n\twritten ; cf cpp_options.vim and g:cpp_FunctionPosition.\n\n(*) cpp_InsertAccessors.vim {{{2\n    (*) The management of cpp_options.vim has been moved to another file.  \n\n(*) cpp_options-commands.vim 1.0 {{{2\n    (*) New file that will centralize options management\n\n(*) Mu-template 0.23 {{{2\n    (*) New global boolean ([0]/1) option:\n\tg:mt_IDontWantTemplatesAutomaticallyInserted that forbids mu-template\n\tto automatically insert templates when opening new files.\n\tMust be set once before mu-template.vim is sourced -> .vimrc\n\n(*) Documentation {{{2\n    (*) Updated\n    (*) New sections: first steps, C++-options, ...\n\n}}}1\n==================================================================\nvim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/cpp/cpp_AddMissingScope.vim",
    "content": "\"=============================================================================\n\" File:         ftplugin/cpp/cpp_AddMissingScope.vim              {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      2.2.1\nlet s:k_version = 221\n\" Created:      25th Jun 2014\n\" Last Update:  16th Jan 2019\n\"------------------------------------------------------------------------\n\" Description:\n\"       Given an identifier under the cursor, search for its scope (namespace,\n\"       ...) and insert it.\n\"\n\"------------------------------------------------------------------------\n\" }}}1\n\"=============================================================================\n\n\" Buffer-local Definitions {{{1\n\" Avoid local reinclusion {{{2\nlet s:cpo_save=&cpo\nset cpo&vim\nif &cp || (exists(\"b:loaded_ftplug_cpp_AddMissingScope\")\n      \\ && (b:loaded_ftplug_cpp_AddMissingScope >= s:k_version)\n      \\ && !exists('g:force_reload_ftplug_cpp_AddMissingScope'))\n  let &cpo=s:cpo_save\n  finish\nendif\nlet b:loaded_ftplug_cpp_AddMissingScope = s:k_version\n\" Avoid local reinclusion }}}2\n\n\"------------------------------------------------------------------------\n\" Local mappings {{{2\n\nnnoremap <buffer> <silent> <Plug>AddMissingScope :call lh#cpp#scope#_add_missing()<cr>\nif !hasmapto('<Plug>AddMissingScope', 'n')\n  nmap <buffer> <silent> <unique> <m-n> <Plug>AddMissingScope\nendif\n\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/cpp/cpp_BuildTemplates.vim",
    "content": "\" ========================================================================\n\" File:         ftplugin/cpp/cpp_BuildTemplates.vim                   {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"               <URL:http://code.google.com/p/lh-vim/>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://code.google.com/p/lh-vim/wiki/License>\n\" Version:      2.1.6\n\" Last Update:  03rd Nov 2015\n\"------------------------------------------------------------------------\n\" Description:  description\n\"\n\"------------------------------------------------------------------------\n\" Installation: See |lh-cpp-readme.txt|\n\" Dependencies: a.vim (Alternate files)\n\" TODO:\n\" * Correct the ftplugin to be VIM 6 fully compliant\n\" * Delete what's redundant with Template's templates\n\" }}}1\n\" ========================================================================\n\n\" ========================================================================\n\" Buffer local definitions {{{1\n\" ========================================================================\nif exists(\"b:loaded_cpp_BuildTemplates_local_settings\")  && !exists('g:force_reload_cpp_BuildTemplates')\n  finish\nendif\nlet b:loaded_cpp_BuildTemplates_local_settings = 1\n  let s:cpo_save = &cpo\n  set cpo&vim\n\n\" ------------------------------------------------------------------------\n\" Commands {{{2\n\" ------------------------------------------------------------------------\n\" Command:      :HEADER\n\" Map shortcut: ;HE\n\" Purpose:      Insert the template for a header file (.h) plus a class\n\" Parameter:    <1> == Name of the main class of the file\n\" Note:         Use the same function than :CLASS for inserting the class\n\"               template.\n  command! -buffer -nargs=1 HEADER :call <sid>Cpp_newHeaderFile(<q-args>)\n  nnoremap <buffer> ;HE :HEADER<space>\n\"\n\" Command:      :CLASS\n\" Map shortcut: ;CL\n\" Purpose:      Insert the template for a class\n\" Parameter:    <1> == Name of the class\n  command! -buffer -nargs=1 CLASS :call <sid>Cpp_newClass(<q-args>)\n  nnoremap <buffer> ;CL :CLASS<space>\n\"\n\" Command:      :BLINE\n\" Map shortcut: ;BL\n\" Purpose:      Insert a 3 lines separator\n\" Parameter:    <1> == Title of the separation\n  command! -buffer -nargs=1 BLINE :call <sid>Cpp_bigLine(<q-args>)\n  nnoremap <buffer> ;BL :BLINE<space>\n\"\n\" Command:      :MGROUP\n\" Map shortcut: ;MGR\n\" Purpose:      Insert a group plus a separator line\n\" Parameter:    <1> == Name of the group\n  command! -buffer -nargs=1 MGROUP :call <sid>Cpp_megagroup(<q-args>)\n  nnoremap <buffer> ;MGR :MGROUP<space>\n\"\n\" Command:      :GROUP\n\" Map shortcut: ;GR\n\" Purpose:      Insert a group\n\" Parameter:    <1> == Name of the group\n  command! -buffer -nargs=1 GROUP :call <sid>Cpp_group(<q-args>)\n  nnoremap <buffer> ;GR :GROUP<space>\n\"\n\" Command:      :ADDATTRIBUTE\n\" Map shortcut: ;AA\n\" Purpose:      Insert an attribute plus its accessors to the current class\n  command! -buffer -nargs=0 ADDATTRIBUTE :call Cpp_AddAttribute()\n  nnoremap <buffer> ;AA :ADDATTRIBUTE<cr>\n\"\n\" Command:      :REACHINLINE\n\" Map shortcut: ;RI\n\" Purpose:      Reach the location of inlines for the specified class\n  command! -buffer -nargs=1 REACHINLINE :call Cpp_ReachInlinePart(<q-args>)\n  nnoremap <buffer> ;RI :REACHINLINE<space>\n\" ==========================================================================\n\" Mappings {{{2\n\" ;GR <foo>  inserts /**@name <foo>\n\"                     */\n\"                    //@{\n\"                    //@}\n\" suppose so=coqlr\ninoremap <buffer> <expr> //@{ lh#map#insert_seq('//@{',\n      \\ '//@{\\<cr\\> !cursorhere!\\<cr\\>@}')\n\"      \\ '//@{\\<cr\\>@}\\<esc\\>O\\<bs\\>\\<bs\\>')<cr>\n\n\n\" ========================================================================\n\" General Definitions {{{1\n\" ========================================================================\nif exists(\"g:loaded_cpp_BuildTemplates\") && !exists('g:force_reload_cpp_BuildTemplates')\n  let &cpo = s:cpo_save\n  finish\nendif\nlet g:loaded_cpp_BuildTemplates = 1\n\n\" Constants {{{2\nlet s:header_includes_text = 'Includes'\nlet s:header_inlines_text  = 'Inlines'\nlet s:header_inlines_type  = '='\nlet s:header_inlining_text = 'Inlinings for '\nlet s:header_inlining_type = '='\n\nlet s:EqLine= '/*===========================================================================*/'\nlet s:MnLine= '/*---------------------------------------------------------------------------*/'\n\n\" Functions {{{2\n  inoremap /*1 0<c-d>/*<esc>75a=<esc>a*/\nfunction! s:Cpp_group(name) abort \" {{{3\n  \" TODO: use indent()\n  silent put = '    /**'. lh#dox#tag('name')\n  silent put = '     */'\n  silent put = '    //@{'\n  silent put = '    //@}'\nendfunction\n\nfunction! s:Cpp_bigLine(title) abort \" {{{3\n  silent put = s:EqLine\n  let pos = (79-lh#encoding#strlen(a:title)-4)/2\n  silent put = substitute(s:EqLine,\n        \\ '\\(.\\{'.pos.'}\\).\\{'.(lh#encoding#strlen(a:title)+4).'}\\(.*\\)$',\n        \\ '\\1[ '.a:title.' ]\\2', '')\n  silent put = s:EqLine\nendfunction\n\nfunction! s:Cpp_littleLine(title) abort \" {{{3\n  let pos = (79-lh#encoding#strlen(a:title)-4)/2\n  silent put = substitute(s:MnLine,\n        \\ '\\(.\\{'.pos.'}\\).\\{'.(lh#encoding#strlen(a:title)+4).'}\\(.*\\)$',\n        \\ '\\1[ '.a:title.' ]\\2', '')\nendfunction\n\nfunction! s:Cpp_megagroup(name) abort \" {{{3\n  call s:Cpp_littleLine(a:name)\n  call s:Cpp_group(a:name)\nendfunction\n\nfunction! s:Cpp_emptyLine(nb) abort \" {{{3\n  let fo = &fo | set fo-=o\n  exe \"normal! \".a:nb.\"o\\<esc>\\<esc>\"\n  let &fo = fo\nendfunction\n\nfunction! s:Cpp_addGroup(emptyLine, name, access) abort \" {{{3\n  if a:emptyLine != 0\n    call s:Cpp_emptyLine( a:emptyLine )\n  endif\n  call s:Cpp_megagroup( a:name )\n  let fo = &fo | set fo-=o\n  exe \"normal! O\".a:access.\"\\<esc>\"\n  let &fo = fo\nendfunction\n\nfunction! s:Cpp_addMethod(name, sig) abort \" {{{3\n  silent put = '    /* '.a:name.' */'\n  silent put = '        '.a:sig\nendfunction\n\n\" ==========================================================================\n\" Search for parts {{{3\n\" ==========================================================================\n\" Function:     Cpp_search4line\n\" Returns:      line of the found pattern\nfunction! s:Cpp_search4line(title,type) abort\n  \" let v:errmsg = ''\n  let str = '\\/\\*' . a:type . '*\\[\\s*' . a:title . '\\s*\\]' . a:type . '*\\*\\/'\n  return search(str)\n  \" exe '/'.str\n  \"\"let str = '/\\*' . a:type . '*\\[\\s*' . a:title . '\\s*\\]' . a:type . '*\\*/'\n  \"\"exe '?'.str\n  \" return strlen(v:errmsg) != 0\nendfunction\n\" ==========================================================================\n\" Add classes {{{3\n\" ==========================================================================\nfunction! s:Cpp_newClass(name) abort\n  \" if lh#brackets#usemarks()\n    \" let bg:usemarks = 0\n    \" let recall_usemarks = 1\n  \" else\n    \" let recall_usemarks = 0\n  \" endif\n  \" class\n  let old_foldenable = &foldenable\n  set nofoldenable\n  call s:Cpp_bigLine( \"Class \".a:name )\n  silent put = 'class ' . a:name\n  silent put = '{'\n\n  \" contructions , added after every other group because of reindentation\n  call s:Cpp_addGroup(0, \"Construction\", \"public:\")\n  call s:Cpp_addMethod(\"Argument-less constructor\", a:name.\"();\")\n  call s:Cpp_addMethod(\"Copy constructor\", a:name.\"(const \".a:name.\" & rhs);\")\n  call s:Cpp_addMethod(\"Copy operator\", a:name.\"& operator=(const \".a:name.\" & rhs);\")\n  call s:Cpp_addMethod(\"Destructor\", \"virtual ~\".a:name.\"();\")\n\n  \" public methods\n  call search('}')\n  call s:Cpp_addGroup(1, \"Public methods\", \"public:\")\n\n  \" internal methods\n  call search('}')\n  call s:Cpp_addGroup(1, \"Internal methods\", \"protected:\")\n\n  \" Data\n  call search('}')\n  call s:Cpp_addGroup(1, \"Data\", \"private:\")\n\n  \" End of class\n  call search('}')\n  call s:Cpp_emptyLine( 1 )\n  call s:Cpp_littleLine( \"End of class\" )\n  silent put = '};'\n  \" if recall_usemarks == 1 | let gb:usemarks = 1 | endif\n  let &foldenable = old_foldenable\nendfunction\n\" ==========================================================================\nfunction! s:Cpp_newHeaderFile(name) abort \" {{{3\n  \" reinclusion\n  call s:Cpp_bigLine( \"Avoid re-inclusion\")\n  silent put = '#ifndef __'.toupper(a:name).'_H__'\n  silent put = '#define __'.toupper(a:name).'_H__'\n  call s:Cpp_emptyLine( 2 )\n\n  \" Includes\n  call s:Cpp_bigLine( s:header_includes_text )\n  if exists('*Marker_Txt')\n    silent put = '// ' . Marker_Txt('Includes')\n  endif\n  call s:Cpp_emptyLine( 2 )\n\n  \" Class\n  call s:Cpp_newClass(a:name)\n\n  \" reinclusion\n  normal! G\n  call s:Cpp_emptyLine( 2 )\n  call s:Cpp_bigLine( \"Avoid re-inclusion\")\n  silent $ put = '#endif'\nendfunction\n\" ==========================================================================\n\" Inlines {{{3\n\" ==========================================================================\n\" Function: Cpp_fileType(name) {{{4\n\" Returns:      A number indicating the kind of C++ file involved\n\"               0 : header file ; 1 : inlines file ; 2 : other (.cpp & co)\nfunction! s:Cpp_fileType(name) abort\n  if a:name =~'\\.hh\\=$'                               | return 0\n  elseif a:name =~ Cpp_FileExtension4Inlines() . '$'  | return 1\n  else                                                | return 2\n  endif\nendfunction\n\n\" Function: Cpp_fileExtension(type) {{{4\nfunction! s:Cpp_fileExtension(type) abort\n  if a:type == 0      | return 'h'\n  elseif a:type == 1  | let ret = Cpp_FileExtension4Inlines()\n  else                | let ret = Cpp_FileExtension4Implementation()\n  endif\n  return strpart(ret,1,strlen(ret)-1)\nendfunction\n\n\" Function: Cpp_fileName(name0,type) {{{4\n\" Purpose:      Substitute the file extension regarding the final type\n\"               expected.\n\" Returns:      A filename built on the basename from <name0> and of type\n\"               <type> (cf. Cpp_fileType for the value of <type>)\nfunction! s:Cpp_fileName(name0,type) abort\n  return expand(a:name0.\":r\") . '.' .s:Cpp_fileExtension(a:type)\nendfunction\n\n\" Function: Cpp_TestInlineFile(filename,type,class) {{{4\n\" Purpose:      Looks for inlining section of the class <class> in the file\n\"               of type <type>\n\" Returns:      The line of the section / -1 if no found\nfunction! s:Cpp_TestInlineFile(filename,type,class) abort\n  if exists('g:mu_template') &&\n        \\ (!exists('g:mt_jump_to_first_markers') || g:mt_jump_to_first_markers)\n    \" NB: g:mt_jump_to_first_markers is true by default\n    let mt = g:mt_jump_to_first_markers\n    let g:mt_jump_to_first_markers = 0\n  endif\n  let fn = s:Cpp_fileName(a:filename,a:type)\n  \"\"if filereadable(fn) || y a buffer du meme nom...\n    call FindOrCreateBuffer(fn,1)\n  if exists('mt')\n    let g:mt_jump_to_first_markers = mt\n  endif\n    if s:Cpp_search4line(s:header_inlining_text.a:class,s:header_inlining_type)\n      return line('.')\n    else\n      bdelete\n    endif\n  \"\"endif\n  return -1\nendfunction\n\nfunction! s:Cpp_addInlinesInHeader(name) abort       \" Internal use {{{4\n  normal! G\n  call s:Cpp_emptyLine( 3 )\n  call s:Cpp_bigLine( \"Inlines\")\n  call s:Cpp_littleLine( \"Check whether inlines required\" )\n  \" exe \"normal! i#ifdef __\".a:name.\"_INL__\\<esc>viwU\"\n  silent put = '#ifdef __'.toupper(a:name).'_INL__'\n  call s:Cpp_emptyLine( 3 )\n\n  call s:Cpp_littleLine( s:header_includes_text )\n\n  \" reinclusion\n  call s:Cpp_emptyLine( 2 )\n  call s:Cpp_bigLine( \"End of Inlinings\")\n  silent put = '#endif          // Check if asked : __'.toupper(a:name).'_INL__'\n  exe \"normal! 4\\<up>\"\nendfunction\n\nfunction! s:Cpp_newInlineFile(name) abort    \" Internal use {{{4\n  normal! G\n  call s:Cpp_bigLine( \"Inlines\")\n  call s:Cpp_littleLine( \"Avoid re-inclusion\")\n  silent put = '#ifndef __'.toupper(a:name).'_AvR_INL__'\n  silent put = '#define __'.toupper(a:name).'_AvR_INL__'\n  call s:Cpp_emptyLine( 2 )\n  call s:Cpp_bigLine( s:header_includes_text )\n  silent put = '#include \\\"'.a:name.'.h\\\"'\n  call s:Cpp_emptyLine( 2 )\n\n  call s:Cpp_littleLine( \"Avoid re-inclusion\")\n  silent put ='#endif          //Avoid re-inclusion : __'.toupper(a:name).'_AvR_INL__'\n  exe \"normal! 2\\<up>\"\nendfunction\n\n\" Function: ReachInlinesZone(type) {{{4\n\" Purpose:      Reach the inlines zone of a file, if the file does not\n\"               exist, create it ; if the zone does not exist, create it.\nfunction! s:ReachInlinesZone(type) abort\n  if s:Cpp_search4line(s:header_inlines_text, s:header_inlines_type)\n    call s:Cpp_search4line(s:header_includes_text, '[-=]')\n    exe \"normal! 2\\<down>\"\n    return\n  else\n    if exists('g:mu_template') &&\n          \\(!exists('g:mt_jump_to_first_markers') || g:mt_jump_to_first_markers)\n      \" NB: g:mt_jump_to_first_markers is true by default\n      let mt = g:mt_jump_to_first_markers\n      let g:mt_jump_to_first_markers = 0\n    endif\n    \" !!! expand(\"%:r:t\") does not work. \"%:t:r\" does.\n    if a:type == 0     | call s:Cpp_addInlinesInHeader(expand(\"%:t:r\"))\n    elseif a:type == 1 | call s:Cpp_newInlineFile(expand(\"%:t:r\"))\n    endif\n    if exists('mt')\n      let g:mt_jump_to_first_markers = mt\n    endif\n  endif\nendfunction\n\nfunction! s:WriteInlinePart(name) abort      \" Internal use {{{4\n  \" Class\n  call s:Cpp_emptyLine( 1 )\n  if s:header_inlining_type == '='\n    call s:Cpp_bigLine( s:header_inlining_text. a:name)\n  else\n    call s:Cpp_littleLine( s:header_inlining_text. a:name)\n  endif\n  call s:Cpp_emptyLine( 1 )\nendfunction\n\n\" =========================================================================\n\" Function: AddInlinePart(class,type)   {{{4\n\" Purpose:      Main function for accessing the inline zone of a class\nfunction! s:AddInlinePart(class,type)\n  call s:ReachInlinesZone(a:type)\n  call s:WriteInlinePart(a:class)\nendfunction\n\nfunction! s:TabSet(name,i,value) \"{{{4\n  exe 'let beg = strpart('.a:name.',0,'.a:i.')'\n  let b = a:i+1\n  let e = strlen(a:name)\n  exe 'let end = strpart('.a:name.',b,e)'\n  exe \"let \" . a:name . \"= beg . a:value . end \"\nendfunction\n\n\" Function: Cpp_ReachInlinePart(class)          <external use> {{{4\n\" Purpose:      Reach the inlining part for the specifed class.\n\"               Use the different options and already pre-existant\n\"               structures.\nfunction! Cpp_ReachInlinePart(class) abort\n  \" 1- look whether the part already exists\n  let g:lookedin = 'nnn'\n  \" a- current file\n  let i = s:Cpp_fileType(expand(\"%\"))\n  call s:TabSet('g:lookedin',i,'y')\n  if s:Cpp_search4line(s:header_inlining_text.a:class, s:header_inlining_type)\n    exe \"normal! 2\\<down>\"\n    return\n  endif\n  \" b- prefered file (regarding options) (.inl / .h)\n  let i = Cpp_fileTypeRegardingOption()\n  if g:lookedin[i] == 'n'\n    if s:Cpp_TestInlineFile(\"%\", i, a:class) != -1\n      exe \"normal! 2\\<down>\"\n      return\n    endif\n  endif\n  \" c- last possible location (.h / .inl), but never .cpp\n  let i = 1 - i\n  if g:lookedin[i] == 'n'\n    if s:Cpp_TestInlineFile(\"%\", i, a:class) != -1\n      exe \"normal! 2\\<down>\"\n      return\n    endif\n  endif\n\"---\n\"   2- Othewise, build/add the part in the correct file\n  exe ':silent AS ' . s:Cpp_fileExtension(1-i)\n  \" :CheckOptions\n  call s:AddInlinePart(a:class, 1-i)\nendfunction\n\" }}}1\n\" =========================================================================\n  let &cpo = s:cpo_save\n\" =========================================================================\n\" vim60: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/cpp/cpp_Constructor.vim",
    "content": "\"=============================================================================\n\" File:\t\tftplugin/cpp/cpp_Constructor.vim                          {{{1\n\" Author:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\" \t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/tree/master/License.md>\n\" Version:\t2.2.1\n\" Created:\t09th Feb 2009\n\" Last Update:\t16th Jan 2019\n\"------------------------------------------------------------------------\n\" Description:\n\" \tHelper MMIs to generate constructors\n\"\n\"------------------------------------------------------------------------\n\" Installation:\tinstall details\n\" History:\n\" \tv1.1.0: creation\n\"\tv.2.0.0b4\n\"\t        New commands: :ConstructorCopy, :ConstructorDefault,\n\"\t        :ConstructorInit, :AssignmentOperator\n\" }}}1\n\"=============================================================================\n\n\" Buffer-local Definitions {{{1\n\" Avoid local reinclusion {{{2\nlet s:cpo_save=&cpo\nset cpo&vim\nif &cp || (exists(\"b:loaded_ftplug_cpp_Constructor\")\n      \\ && !exists('g:force_reload_ftplug_cpp_Constructor'))\n  let &cpo=s:cpo_save\n  finish\nendif\nlet b:loaded_ftplug_cpp_Constructor = 221\n\" Avoid local reinclusion }}}2\n\n\"------------------------------------------------------------------------\n\" Local commands {{{2\n\ncommand! -b -nargs=?  -complete=customlist,lh#cpp#constructors#_complete\n      \\              Constructor        :call lh#cpp#constructors#Main(<f-args>)\ncommand! -b -nargs=0 ConstructorInit    :call lh#cpp#constructors#InitConstructor()\ncommand! -b -nargs=0 ConstructorCopy    :call lh#cpp#constructors#GenericConstructor('copy')\ncommand! -b -nargs=0 ConstructorDefault :call lh#cpp#constructors#GenericConstructor('default')\ncommand! -b -nargs=0 AssignmentOperator :call lh#cpp#constructors#AssignmentOperator()\n\n\"=============================================================================\n\"}}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/cpp/cpp_Enum.vim",
    "content": "\"=============================================================================\n\" File:         ftplugin/cpp/cpp_Enum.vim                         {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\" \t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/tree/master/License.md>\n\" Version:      2.2.1\nlet s:k_version = 221\n\" Created:      30th Apr 2014\n\" Last Update:  16th Jan 2019\n\"------------------------------------------------------------------------\n\" Description:\n\"       Defines the command\n\"         :InsertEnum [<EnumName>] [Enum Values...]\n\"       which insert a smart enum (the one defined in cpp/enum2)\n\" }}}1\n\"=============================================================================\n\n\" Buffer-local Definitions {{{1\n\" Avoid local reinclusion {{{2\nlet s:cpo_save=&cpo\nset cpo&vim\nif &cp || (exists(\"b:loaded_ftplug_cpp_Enum\")\n      \\ && (b:loaded_ftplug_cpp_Enum >= s:k_version)\n      \\ && !exists('g:force_reload_ftplug_cpp_Enum'))\n  let &cpo=s:cpo_save\n  finish\nendif\nlet b:loaded_ftplug_cpp_Enum = s:k_version\n\" Avoid local reinclusion }}}2\n\n\"------------------------------------------------------------------------\n\" Local commands {{{2\n\ncommand! -b -nargs=* InsertEnum call lh#cpp#enum#_new(<f-args>)\n\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/cpp/cpp_FindContextClass.vim",
    "content": "\" ========================================================================\n\" File:\t\tftplugin/cpp/cpp_FindContextClass.vim                 {{{1\n\" Author:\tLuc Hermitte <MAIL:hermitte at free.fr>\n\" \t\t<URL:http://code.google.com/p/lh-vim/>\n\" Version:\t1.1.0\n\" Last Update:\t$Date$ (16th May 2006)\n\"------------------------------------------------------------------------\n\" Description:\t\n\" \tLibrary C++ ftplugin.\n\" \tIt provides functions used by other C++ ftplugins.\n\" \tThe theme of this library is the analysis of C++ scopes.\n\"\n\" Defines: {{{2\n\" (*) Function: Cpp_CurrentScope(lineNo, scope_type)\n\"     Returns the scope (class name or namespace name) at line lineNo.\n\"     scope_type can value: \"any\", \"class\" or \"namespace\".\n\" (*) Function: Cpp_SearchClassDefinition(lineNo)\n\"     Returns the class name of any member at line lineNo -- could be of the\n\"     form: \"A::B::C\" for nested classes.\n\"     Note: Outside class-scope, an empty string is returned\n\"     Note: Classes must be correctly defined: don't forget the ';' after the\n\"     '}'\n\" (*) Function Cpp_BaseClasses(lineNo)\n\"     Return the list of the direct base classes of the class around lineNo.\n\"     form: \"+a_public_class, #a_protected_class, -a_private_class\"\n\" }}}2\n\"------------------------------------------------------------------------\n\" Installation:\tSee |lh-cpp-readme.txt|\n\" Dependencies:\tVIM 6.0+\n\n\" History:\t{{{2\n\" \t16th May 2006\n\" \t(*) Bug fix: \"using namespace\" was misdirecting Cpp_CurrentScope(), and\n\" \t    :GOTOIMPL as a consequence.\n\" \t29th Apr 2005\n\" \t(*) Not misdriven anymore by:\n\" \t    - forward declaration in namespaces\n\" \t      -> \"namespace N {class foo;} namespace M{ class bar{}; }\"\n\" \t09th Feb 2005\n\" \t(*) class_token += enum\\|union\n\" \t(*) Not misdriven anymore by:\n\" \t    - consecutive classes\n\" \t      -> \"namespace N {class foo {}; class bar{};}\"\n\" \t    - comments\n\" \t16th dec 2002\n\" \t(*) Bug fixed regarding forwarded classes.\n\" \t16th oct 2002\n\" \t(*) Able to handle C-definitions like \n\" \t    \"typedef struct foo{...} *PFoo,Foo;\"\n\" \t(*) An inversion problem, with nested classes, fixed.\n\" \t(*) Cpp_SearchClassDefinition becomes obsolete. Instead, use\n\" \t    Cpp_CurrentScope(lineNo, scope_type) to search for a \n\" \t    namespace::class scope.\n\" \t11th oct 2002\n\" \t(*) Cpp_SearchClassDefinition supports: \n\" \t    - inheritance -> 'class A : xx B, xx C ... {'\n\" \t    - and declaration on several lines of the previous inheritance\n\" \t    text.\n\" \t(*) Functions that will return the list of the direct base classes of\n\" \t    the current class.\n\"\n\" TODO: {{{2\n\" (*) Support templates -> A<T>::B, etc\n\" (*) Find the list of every base class ; aim: be able to retrieve the list of\n\"     every virtual function available to the class.\n\" (*) Must we differentiate anonymous namespaces from the global namespace ?\n\" }}}1\n\" ==========================================================================\n\" No reinclusion {{{1\nif exists(\"g:loaded_cpp_FindContextClass_vim\") \n      \\ && !exists('g:force_load_cpp_FindContextClass')\n  finish\nendif\nlet g:loaded_cpp_FindContextClass_vim = 1\n\"\" line continuation used here ??\nlet s:cpo_save = &cpo\nset cpo&vim\n\" }}}1\n\" ==========================================================================\n\" Internal constant regexes {{{1\n\" Note: this regex can be tricked with nasty comments\nlet s:id              = '\\(\\<\\I\\i*\\>\\)'\nlet s:class_token     = '\\<\\(class\\|struct\\|enum\\|union\\)\\>'\nlet s:class_part      = s:class_token  . '\\_s\\+' . s:id\nlet s:namespace_token = '\\<\\(namespace\\)\\>\\_s\\+'\nlet s:namespace_part  = s:namespace_token . s:id\n\nlet s:both_token     = '\\<\\(class\\|struct\\|enum\\|union\\|namespace\\)\\>'\nlet s:both_part      = s:both_token  . '\\_s\\+' . s:id\n\" let s:namespace_part = '\\<\\(namespace\\)\\>\\_s\\+' . s:id . '\\='\n\" Use '\\=' for anonymous namespaces\n\n\" let s:class_open      = '\\_.\\{-}{'\n\" '.' -> '[^;]' in order to avoid forward declarations.\nlet s:class_open00    = '\\_[^;]\\{-}{'\nlet s:class_open      = '\\_[^;]\\{-}'\nlet s:class_close     = '}\\%(\\_s\\+\\|\\*\\=\\s*\\<\\I\\i*\\>,\\=\\)*;'\n  \"Note: '\\%(\\_s*\\|\\*=\\s*\\<\\I\\i*\\>,\\=\\)*' is used to accept C typedef like :\n  \"  typedef struct foo {...} *PFoo, Foo;\nlet s:namespace_open00= '\\_s*{'\nlet s:namespace_open  = '\\_s*'\nlet s:namespace_close = '}'\n\" }}}1\n\" ==========================================================================\n\" Debug oriented command\nif exists('g:force_load_cpp_FindContextClass')\n  command! -nargs=1 CppFCCEcho :echo s:<arg>\nendi\n\n\n\" Search for current and most nested namespace/class <internal> {{{\n\nlet s:skip_comments = 'synIDattr(synID(line(\".\"), col(\".\"), 0), \"name\") =~?'\n      \\ . '\"string\\\\|comment\\\\|doxygen\"'\n\nfunction! s:SearchBracket()\n  let flag = 'bW'\n  return searchpair('{', '', '}', flag, s:skip_comments)\nendfunction\n\nfunction! s:CurrentScope(bMove, scope_type)\n  let flag = a:bMove ? 'bW' : 'bnW'\n  let pos = 'call cursor(' . line('.') . ',' . col('.') . ')'\n  let result = line('.')\n  while 1\n    let result = s:SearchBracket()\n    if result <= 0 \n      exe pos\n      break \n    endif\n\n    let skip_comments = '(synIDattr(synID(line(\".\"), col(\".\"), 0), \"name\") '\n\t  \\ . '!~? \"c\\\\%(pp\\\\)\\\\=Structure\")'\n    let skip_using_ns = '(getline(\".\") =~ \"using\\s*namespace\")'\n    \" let result = searchpair(\n\t\" \\ substitute(s:{a:scope_type}_part, '(', '%(', 'g')\n\t\" \\ . s:{a:scope_type}_open, '', '{', flag,\n\t\" \\ skip_comments)\n    let result = searchpair(\n\t\\ substitute(s:both_part, '(', '%(', 'g')\n\t\\ . s:{a:scope_type}_open, '', '{', flag,\n\t\\ skip_comments.'&&'.skip_using_ns)\n    if result > 0 \n      if getline(result) !~ '.*'.s:{a:scope_type}_token.'.*'\n\texe pos\n\tlet result = 0\n      endif\n      break \n    endif\n  endwhile\n  return result\nendfunction\n\n\n\" obsolete\nfunction! s:CurrentScope000(bMove,scope_type)\n  let flag = a:bMove ? 'bW' : 'bnW'\n  return searchpair(\n\t\\ substitute(s:{a:scope_type}_part, '(', '%(', 'g')\n\t\\ . s:{a:scope_type}_open00, '', s:{a:scope_type}_close00, flag,\n\t\\ s:skip_comments)\n  \"Note: '\\(..\\)' must be changed into '\\%(...\\)' with search() and\n  \"searchpair().\nendfunction\n\" }}}\n\" ==========================================================================\n\" Search for a class definition (not forwarded definition) {{{\n\" Checks whether lineNo is in between the '{' at line classStart and its\n\" '}' counterpart ; in that case, returns \"::\".className\nfunction! s:SearchClassOrNamespaceDefinition(class_or_ns)\n  let pos = 1\n  let scope = ''\n  while pos > 0\n    let pos = s:CurrentScope(1, a:class_or_ns)\n    if pos > 0\n      let current_scope = substitute(getline(pos),\n\t    \\ '^.*'.s:{a:class_or_ns}_part.'.*$', '\\2', '')\n      let scope = '::' . current_scope . scope\n    endif\n  endwhile\n  return substitute (scope, '^:\\+', '', 'g')\nendfunction\n\" }}}\n\" ==========================================================================\n\" Search for a class definition (not forwarded definition) {{{\n\" Function: Cpp_SearchClassDefinition(lineNo [, bNamespaces])\n\" Checks whether lineNo is in between the '{' at line classStart and its\n\" '}' counterpart ; in that case, returns \"::\".className\nfunction! Cpp_SearchClassDefinition(lineNo,...)\n  \" let pos = a:lineNo\n  exe a:lineNo\n  let scope = s:SearchClassOrNamespaceDefinition('class')\n  if (a:0 > 0) && (a:1 == 1)\n    let ns = s:SearchClassOrNamespaceDefinition('namespace') \n    let scope = ns . (((\"\"!=scope) && (\"\"!=ns)) ? '::' : '') . scope\n  endif\n  exe a:lineNo\n  return scope\nendfunction\n\n\" Possible Values:\n\"  - 'class'\n\"  - 'namespace'\n\"  - 'any'\nfunction! Cpp_CurrentScope(lineNo, scope_type)\n  exe a:lineNo\n  if a:scope_type =~ 'any\\|##'\n    let scope = s:SearchClassOrNamespaceDefinition('class')\n    let ns = s:SearchClassOrNamespaceDefinition('namespace') \n    let scope = ns . (((\"\"!=scope) && (\"\"!=ns)) \n\t  \\ ? ((a:scope_type == '##') ? '#::#' : '::') \n\t  \\ : '') . scope\n  elseif a:scope_type =~ 'class\\|namespace'\n    let scope = s:SearchClassOrNamespaceDefinition(a:scope_type)\n  else\n    echoerr 'cpp_FindContextClass.vim::Cpp_CurrentScope(): the only ' . \n\t  \\ 'scope-types accepted are {class}, {namespace} and {any}!'\n    return ''\n  endif\n  exe a:lineNo\n  return scope\nendfunction\n\" }}}\n\" ==========================================================================\n\" Search for templates specs <internal> {{{\nfunction! s:TemplateSpecs()\nendfunction\n\" }}}\n\" ==========================================================================\n\" Search for the direct base classes <internal>{{{\nfunction! s:BaseClasses(pos)\n  \" a- Retrieve the declaration: 'class xxx : yyy {' zone limits {{{\n  let pos = a:pos\n  let end_pos = line('$')\n  let decl = ''\n  while pos < end_pos\n    \" Concat lines and strip comments on the way to the '{'.\n    let text = substitute(getline(pos), '/\\*.\\{-}\\*/\\|//.*$', '', 'g')\n    let decl = decl . ' ' . text\n    if text =~ '{' | break | endif\n    let pos = pos + 1\n  endwhile\n  \" }}}\n  \" b- Get the base classes only {{{\n  let base = substitute(decl, '^.*'.s:class_part.'[^:]*:\\([^{]*\\){.*$', '\\3','')\n  let base = substitute(base, 'public',    '+', 'g')\n  let base = substitute(base, 'protected', '#', 'g')\n  let base = substitute(base, 'private',   '-', 'g')\n  let base = substitute(base, '\\s*', '', 'g')\n  let base = substitute(base, ',', ', ', 'g')\n  \" }}}\n  return base\nendfunction\n\" }}}\n\" ==========================================================================\n\" Search for the direct base classes {{{\nfunction! Cpp_BaseClasses(lineNo)\n  exe a:lineNo\n  let pos = s:CurrentScope(1, 'class')\n  exe a:lineNo\n  return (pos > 0) ? s:BaseClasses(pos) : ''\nendfunction\n\" }}}\n\" ==========================================================================\nlet &cpo = s:cpo_save\n\" ========================================================================\n\" vim60: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/cpp/cpp_GotoFunctionImpl.vim",
    "content": "\" ========================================================================\n\" File:\t\tftplugin/cpp/cpp_GotoFunctionImpl.vim                 {{{1\n\" Authors:\t{{{2\n\" \t\tFrom an original mapping by Leif Wickland (VIM-TIP#335)\n\" \t\tSee: http://vim.sourceforge.net/tip_view.php?tip_id=335\n\" \t\tFirstly changed into a plugin (Mangled by) Robert KellyIV\n\" \t\t<Feral at FireTop.Com>\n\" \t\tRewritten by Luc Hermitte <hermitte at free.fr>, but features\n\" \t\tand fixes still mainly coming from Robert's ideas.\n\" \t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/tree/master/License.md>\n\" }}}2\n\" Last Change:\t16th Jan 2019\n\" Version:\t2.2.1\n\"------------------------------------------------------------------------\n\" Description:\n\" \tDefines mappings and commands to jumps to the implementation of a\n\" \tfunction prototype. If the implementation cannot be found, then\n\" \tit provides a default one.\n\"\n\" Definitions: {{{2\n\" Commands:\n\" \t- :GOTOIMPL\n\" \t- :PASTEIMPL\n\" \t- :MOVETOIMPL\n\" Mappings:\n\" \t- ;GI\n\" \t- ;PI\n\" \t- ;MI\n\" }}}2\n\"------------------------------------------------------------------------\n\" Installation:\tSee |lh-cpp-readme.txt|\n\" \tRequirements:\n\" \t\tvim7+\n\" \t\t{rtp}/autoload/lh/cpp/CodeAnalysisLib.vim\n\" History: {{{2\n\" \tNote: for simplicity reasons, this ftplugin may accept illegal C++\n\" \tcode. If you find such a broken C++-rule, send me an email to see if I\n\" \tcan fix it.\n\"\n\"    [Luc: 12th Apr 2012] v2.0.0: {{{3\n\"       (*) GPLv3 w/ extension\n\"       (*) facultative option: extension of the file where to put the\n\"           definition of the function.\n\"    [Luc: 06th Oct 2006] v0.8.6: {{{3\n\"    \t(*) Code refactorized and moved to\n\" \t\t{rtp}/autoload/lh/cpp/CodeAnalysisLib.vim\n\"    \t    todo: search definition of operators\n\"    \t    todo: support the ellipsis -> \"...\"\n\"    [Luc: 13th Sep 2006] v0.8.5: {{{3\n\"    \t(*) :GOTOIMPL supports:\n\"    \t    - parameters with default value being a function (vim 7+ only)\n\"    \t    - C++ operators ; there is still a little issue with operator*\n\"    \t    - exceptions specifications are unsupported\n\"    \t    - pointer return types\n\"    [Luc: 16th May 2006] v0.8.4: {{{3\n\"\t(*) :GOTOIMPL inserts code at the line _after_ the matching pattern\n\"    [Luc: 05th May 2006] v0.8.3: {{{3\n\"\t(*) The alternate-file search has been patched for vim7.\n\"    [Luc: 18th Apr 2006] v0.8.2: {{{3\n\"\t(*) \"explicit\" is handled like \"static\" and \"virtual\".\n\"\tTodo:\n\"\t(*) escape() the return type pointers (and reference as well probably)\n\"\t    of functions.\n\"    [Luc: 27th Feb 2006] v0.8.1: {{{3\n\"\t(*) New command (and related mappings) :MOVETOIMPL\n\"    [Luc: 22nd Nov 2005] v0.8.0: {{{3\n\"    \t(*) Cpp_GetFunctionPrototype() can declarations from pure signatures\n\"\t    only, or from definitions as well.\n\"\t(*) Cpp_GetListOfParams()\n\"\n\"    [Luc: 29th Apr 2005] v0.7.0: {{{3\n\"    \t(*) Use g:alternateSearchPath (from a.vim) to check if the\n\"    \t    implementation file (.cpp) exists in another directory from the list\n\"    \t(*) New option: g:cpp_Split which tells where the implementation file\n\"    \t    should be opened. Possible values are \"h\\%[orizontal]\",\n\"    \t    \"v\\%[ertical]\" or anything which will be interpreted as \"no-split\".\n\"    \t    By default if g:cpp_Split is not set, \"vertical\" is assumed.\n\"    \tTodo:\n\"    \t(*) <bang> for PASTEIMPL and GOTOIMPL, same behavior than the one\n\"    \t    of :put-!\n\"\n\"    [Luc: 17th oct 2002] v0.6.0: {{{3\n\"\t(*) Supports destructors\n\"\t(*) Supports namespaces:\n\"\t    + If the zone where the function implementation is going to be\n\"\t      inserted is within a namespace, then the scope of the function\n\"\t      will be corrected.\n\"\t    + The |search-implementation| feature is able to differentiate\n\"\t      functions according to the namespace they are within, and thus\n\"\t      it is able jump to the right function. For instance:\n\"\t        int NS::CL::FN(int i) {}\t// is NS::CL::FN\n\"\t        namespace NS0 {\n\"\t            int NS::CL::FN(int i) {}\t// is NS0::NS::CL:FN\n\"\t        }\n\"    \t(*) Checks whether the function is a pure virtual method and refuse to\n\"    \t    define an implementation in such cases ...\n\"    \t(*) When searching for the implementation of a function within the\n\"    \t    .cpp file, comments before the signature will be ignored ; i.e.\n\"    \t    the cursor will move to the return-type. The difference is\n\"    \t    noticeable on virtual or static functions.\n\"    \t(*) s/GIMPL/GOTOIMPL\n\"\tTodo:\n\"\t(*) Pb (now hanging) when searching/building/checking when GOTOIMPL is\n\"\t    invoked on a non function\n\"\t(*) Pb when GOTOIMPL invoked on a function call within an\n\"\t    implementation -- searching/checking for {} may do the trick\n\"\t(*) Skip comments with searchpair()\n\"\n\"    [Luc: 15th oct 2002] v0.5.0: {{{3\n\"\t(*) The management of cpp_options.vim has been moved to another file.\n\"\t(*) Comments are completely ignored when searching for the\n\"    \t    implementation of a function. Actually, the match is done\n\"    \t    according to the list of types only -- even parameter names will\n\"    \t    be ignored.\n\"    \t    Hence: the programmer can change the name of the parameters and/or\n\"    \t    add comments wherever she want within the function's header.\n\"    \t    Parameters-types Supported:\n\"    \t    - simple types (int, unsigned short int, signed double, etc)\n\"    \t    - pointers, references and const modifiers usable\n\"    \t    - arrays \"T p[][xx]\"\n\"    \t    - arrays of pointers and pointers of arrays:\n\"    \t    \t\"T (*p)[][N]\", \"T* p[][N]\"\n\"    \t    - complex types with scopes : \"T1::T2::T3\"\n\"\t(*) Inlines functions (within the class def) (ie not prototypes) will\n\"    \t    be ignored\n\"\t(*) Enhancements and little bugs corrections regarding default\n\"\t    parameters\n\"\t(*) We can specify where we want the default implementation code to be\n\"\t    written ; cf cpp_options.vim and g:cpp_FunctionPosition.\n\"    \tTodo:\n\"    \t(*) Check about declared exceptions : 'throws'\n\"    \t(*) Possibility to extend the list of simple types (__int64, long\n\"    \t    long, UINT, etc) on user request/conf.\n\"    \t(*) Support very complex types : function types, template types.\n\"    \t    Must we consider that p for \"T p[10]\", \"T p[]\" and \"T p[N]\" have\n\"    \t    the same type ?\n\"    \t    Don't differentiate:\n\"    \t      \"T * p$\" and \"T (*p)$\" ; \"const T\" and \"T const\"\n\"\n\"    [Luc: 08th oct 2002] v0.4.0: {{{3\n\"    \t(*) Accepts comments within the signature and trim them.\n\"    \t(*) If something is written between the ')' and the ';', even on\n\"    \t    new line, it will be understood as part of the prototype\n\"    \t    (typically 'const' and '=0').\n\"    \t    But: We can not put the cursor on this particular line and then\n\"    \t    invoke the command ; the last line accepted is the one of the\n\"    \t    closing parenthesis.\n\"\n\"    [Luc: 08th oct 2002] v0.3.0: {{{3\n\"    \t(*) No more parameters don't require anymore to be on the same line\n\"    \t    But, the return type and the possible const modifier on the\n\"    \t    function must.\n\"    \t(*) No more registers,\n\"    \t(*) Works with member and non-member functions.\n\"    \t(*) Requires some other files of mine.\n\"    \t    => Can handle nested class.\n\"    \t(*) If an implementation already exists for the function, we go to\n\"    \t    this implementation, otherwise we add it at once.\n\"    \t(*) The command accept optional arguments\n\"    \t(*) Add two default mappings for normal and insert modes, can be\n\"    \t    easily remapped to anything we want.\n\"    \t(*) Divergence in the versionning from now\n\"    \tTodo:\n\"    \t(*) Enable multi-lines prototypes\n\"    \t    Status: Half implemented in 0.4\n\"    \t(*) Memorize the current cursor position ? -> option\n\"    \t(*) Use tags to achieve a more accurate search\n\"    \t(*) Check whether the function is a pure virtual method and refuse to\n\"    \t    define an implementation ...\n\"    \t    Status: done in 0.6\n\"\n\"    [Feral:274/02@20:42] v0.2.0: {{{3\n\"\tImprovements: from Leif's Tip (#335):\n\"\t(*) can handle any number of default params (as long as they are all\n\"\t    on the same line!)\n\"\t    Status: 2/3 fixed with ver 0.4\n\"\t(*) Options on how to format default params, virtual and static.\n\"\t         (see below) TextLink:||@|Prototype:|\n\"\t(*) placed commands into a function (at least I think it's an\n\"\t    improvement ;) )\n\"\t(*) Improved clarity of the code, at least I hope.\n\"\t(*) Preserves registers/marks. (rather does not use marks), Should not\n\"\t    dirty anything.\n\"\t(*) All normal operations do not use mappings i.e. :normal!\n\"\t   (I have Y mapped to y$ so Leif's mappings could fail.)\n\"\n\"\tLimitations:\n\"\t(*) fails on multi line declarations. All params must be on the same\n\"\t    line.\n\"\t    Status: 2/3 fixed with ver 0.4\n\"\t(*) fails for non member functions. (though not horribly, just have to\n\"\t    remove the IncorectClass:: text...\n\"\t    Status: fixed with 0.3.\n\"\n\"    [Leif:] v0.1 {{{3\n\"\t Leif's original VIM-Tip #335\n\"\n\" Requirements: {{{2\n\" \t\tVIM 6.0,\n\" \t\tcpp_FindContextClass.vim, cpp_options-commands.vim,\n\" \t\ta.vim\n\" }}}1\n\"#############################################################################\n\" Buffer Relative stuff {{{1\nlet s:cpo_save=&cpo\nset cpo&vim\nif &cp || (exists(\"b:loaded_ftplug_cpp_GotoFunctionImpl\")\n      \\ && !exists('g:force_load_cpp_GotoFunctionImpl'))\n  let &cpo=s:cpo_save\n  finish\nendif\nlet b:loaded_ftplug_cpp_GotoFunctionImpl = 221\n\n\" ==========================================================================\n\n\" Commands: {{{2\n\" Possible Arguments:\n\"  'ShowVirtualon', 'ShowVirtualoff', 'ShowVirtual0', 'ShowVirtual1',\n\"  'ShowStaticon', '..off', '..0' or '..1'\n\"  'ShowExplicitcon', '..off', '..0' or '..1'\n\"  'ShowDefaultParamson', '..off', '..0', '..1',  or '..2'\n\"  {extension} -> cpp,txx,cxx, etc when there can be a choice where to have the\n\"  function definition\n\ncommand! -buffer -nargs=* GOTOIMPL call lh#cpp#GotoFunctionImpl#GrabFromHeaderPasteInSource(<f-args>)\n\n\" In order to insert the default implementation when the user want it (with\n\" the option g:cpp_FunctionPosition set to 3 ; Robert's approach) or after a\n\" positioning error (ie: if a searched pattern is not found, them :PASTEIMPL\n\" will be usable).\ncommand! -buffer -nargs=0 PASTEIMPL call lh#cpp#GotoFunctionImpl#InsertCodeAtLine()\n\n\" Like GOTOIMPL, but instead move an inlined function to a separate .cpp file\ncommand! -buffer -nargs=* MOVETOIMPL call lh#cpp#GotoFunctionImpl#MoveImpl(<f-args>)\n\n\" Mappings: {{{2\n\" normal mode mapping ; still possible to set parameters\nnnoremap <buffer> <Plug>GotoImpl\t:GOTOIMPL<SPACE>\nnnoremap <buffer> <Plug>PasteImpl\t:PASTEIMPL<CR>\nnnoremap <buffer> <Plug>MoveToImpl\t:MOVETOIMPL<CR>\n\nif !hasmapto('<Plug>GotoImpl', 'n')\n  nmap <buffer> ;GI <Plug>GotoImpl\n  \" <LeftMouse> is used to position the cursor first\n  nmap <buffer> <M-LeftMouse>  <LeftMouse><Plug>GotoImpl<CR>\nendif\nif !hasmapto('<Plug>PasteImpl', 'n')\n  nmap <buffer> ;PI <Plug>PasteImpl\n  nmap <buffer> <M-RightMouse> <LeftMouse><Plug>PasteImpl\nendif\nif !hasmapto('<Plug>MoveToImpl', 'n')\n  nmap <buffer> ;MI <Plug>MoveToImpl\n  \" <LeftMouse> is used to position the cursor first\n  \" nmap <buffer> <M-LeftMouse>  <LeftMouse><Plug>MoveToImpl<CR>\nendif\n\" insert mode mapping ; use global parameters\ninoremap <buffer> <Plug>GotoImpl\t<C-O>:GOTOIMPL<CR>\ninoremap <buffer> <Plug>PasteImpl\t<C-O>:PASTEIMPL<CR>\nif !hasmapto('<Plug>GotoImpl', 'i')\n  imap <buffer> <C-X>GI <Plug>GotoImpl\n  imap <buffer> <M-LeftMouse>  <LeftMouse><Plug>GotoImpl\nendif\nif !hasmapto('<Plug>PasteImpl', 'i')\n  imap <buffer> <C-X>PI <Plug>PasteImpl\n  imap <buffer> <M-RightMouse> <LeftMouse><Plug>PasteImpl\nendif\nif !hasmapto('<Plug>MoveToImpl', 'i')\n  imap <buffer> <C-X>MI <Plug>MoveToImpl\nendif\n\n\" }}}1\n\"=============================================================================\n\" Global definitions {{{1\nif exists(\"g:loaded_cpp_GotoFunctionImpl\")\n      \\ && !exists('g:force_load_cpp_GotoFunctionImpl')\n  let &cpo=s:cpo_save\n  finish\nendif\nlet g:loaded_cpp_GotoFunctionImpl = 1\n\"------------------------------------------------------------------------\n\" Menus {{{2\n\"\nif 0\n  let s:menu_prio = lh#option#get('cpp_menu_priority', '50', 'g')\n  let s:menu_name = lh#option#get('cpp_menu_name',     '&C++', 'g')\n\n\n  let s:FunctionPositionMenu = {\n        \\ \"variable\": \"cpp_FunctionPosition\",\n        \\ \"idx_crt_value\": 0,\n        \\ \"texts\": [ 'end-of-file', 'pattern', 'function', 'other' ],\n        \\ \"values\": [ 0, 1, 2, 3 ],\n        \\ \"menu\": {\n        \\     \"priority\": s:menu_prio.'.90.10',\n        \\     \"name\": s:menu_name.'.&Options.&New-function-position'}\n        \\}\n\n  call lh#menu#def_toggle_item(s:FunctionPositionMenu)\nendif\n\"------------------------------------------------------------------------\n\" }}}2\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\" }}}\n\"=============================================================================\n\" Documentation {{{1\n\"*****************************************************************\n\" given:\n\"    virtual void Test_Member_Function_B3(int _iSomeNum2 = 5, char * _cpStr = \"Yea buddy!\");\n\n\" Prototype:\n\"GrabFromHeaderPasteInSource(VirtualFlag, StaticFlag, DefaultParamsFlag)\n\n\" VirtualFlag:\n\" 1:    if you want virtual commented in the implementation:\n\"    /*virtual*/ void Test_Member_Function_B3(int _iSomeNum2 = 5, char * _cpStr = \"Yea buddy!\");\n\" else:    remove virtual and any spaces/tabs after it.\n\"    void Test_Member_Function_B3(int _iSomeNum2 = 5, char * _cpStr = \"Yea buddy!\");\n\n\" StaticFlag:\n\" 1:    if you want static commented in the implementation:\n\"    Same as virtual, save deal with static\n\" else:    remove static and any spaces/tabs after it.\n\"    Same as virtual, save deal with static\n\n\" ExplicitFlag:\n\" 1:    if you want explicit commented in the implementation:\n\"    Same as virtual, save deal with explicit\n\" else:    remove explicit and any spaces/tabs after it.\n\"    Same as virtual, save deal with explicit\n\n\" DefaultParamsFlag:\n\" 1:    If you want to remove default param reminders, i.e.\n\"    Test_Member_Function_B3(int _iSomeNum2, char * _cpStr);\n\" 2:    If you want to comment default param assignments, i.e.\n\"    Test_Member_Function_B3(int _iSomeNum2/*= 5*/, char * _cpStr/*= \"Yea buddy!\"*/);\n\" 3:    Like 2 but, If you do not want the = in the comment, i.e.\n\"    Test_Member_Function_B3(int _iSomeNum2/*5*/, char * _cpStr/*\"Yea buddy!\"*/);\n\"\n\" Examples:\n\" smallest implementation:\n\"    void Test_Member_Function_B3(int _iSomeNum2, char * _cpStr);\n\":command! -nargs=0 GHPH call <SID>GrabFromHeaderPasteInSource(0,0,1)\n\"    Verbose...:\n\"    /*virtual*/ void Test_Member_Function_B3(int _iSomeNum2/*5*/, char * _cpStr/*\"Yea buddy!\"*/);\n\":command! -nargs=0 GHPH call <SID>GrabFromHeaderPasteInSource(1,1,3)\n\"    What I like:\n\"    void Test_Member_Function_B3(int _iSomeNum2/*5*/, char * _cpStr/*\"Yea buddy!\"*/);\n\" }}}1\n\"=============================================================================\n\" vim60:fdm=marker\n"
  },
  {
    "path": "ftplugin/cpp/cpp_InsertAccessors.vim",
    "content": "\" ========================================================================\n\" File:\t\tftplugin/cpp/cpp_InsertAccessors.vim                  {{{1\n\" Author:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\" \t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/tree/master/License.md>\n\" Version:\t2.2.1\nlet s:k_version = 221\n\" Last Change:\t$Date$ (28th July 2003)\n\"\n\"------------------------------------------------------------------------\n\" Description:\n\" \tDefines a function to insert const-correct accessors and mutators.\n\"\n\" \tUsed in cpp_BuildTemplates.vim\n\"\n\"------------------------------------------------------------------------\n\" Installation:\tSee |lh-cpp-readme.txt|\n\"       Requires Vim7+, lh-dev, lh-brackets v2.2.0\n\" Options:\tcf. lh_dev\n\"\n\" TODO:\t\t{{{2\n\"  * Clean up the inline file generated when mu-template is installed.\n\"  * Better place the members in respect of the different options.\n\"  * Extend the accessors feature to any member, and jump from a definition to\n\"    an implementation, and vice-versa.\n\"  * Use Cpp_FileExtensionXXX()\n\"  * Understand const, mutable, volatile as particular type specifiers ; and\n\"    then adapt the accessors : for instance, a const data can't have a\n\"    reference accessor ; a reference attribute must be defined in the\n\"    constructor (no parameter-less constructor), ...\n\"  * Do something about the pimpl idiom.\n\"  * g:BooleanAccessorPrefix -> \"is\" or \"\"\n\" }}}1\n\" ==========================================================================\n\n\" Buffer-local Definitions {{{1\n\" Avoid local reinclusion {{{2\nlet s:cpo_save=&cpo\nset cpo&vim\nif &cp || (exists(\"b:loaded_ftplug_cpp_InsertAccessors\")\n      \\ && (b:loaded_ftplug_cpp_InsertAccessors >= s:k_version)\n      \\ && !exists('g:force_reload_ftplug_cpp_InsertAccessors'))\n  let &cpo=s:cpo_save\n  finish\nendif\nlet b:loaded_ftplug_cpp_InsertAccessors = s:k_version\n\" Avoid local reinclusion }}}2\n\n\"=============================================================================\n\" Global Definitions {{{1\n\" Avoid global reinclusion {{{2\nif exists(\"g:loaded_ftplug_cpp_InsertAccessors\")\n      \\ && (g:loaded_ftplug_cpp_InsertAccessors >= s:k_version)\n      \\ && !exists('g:force_reload_ftplug_cpp_InsertAccessors')\n  let &cpo=s:cpo_save\n  finish\nendif\nlet g:loaded_ftplug_cpp_InsertAccessors = s:k_version\n\" Avoid global reinclusion }}}2\n\"------------------------------------------------------------------------\n\" Constants {{{2\nlet s:k_accessor_comment_attribute = '/** %a ... */'\nlet s:k_accessor_comment_get       = '/** Get accessor to %a */'\nlet s:k_accessor_comment_set       = '/** Set accessor to %a */'\nlet s:k_accessor_comment_proxy_get = '/** Proxy-Get accessor to %a */'\nlet s:k_accessor_comment_proxy_set = '/** Proxy-Set accessor to %a */'\nlet s:k_accessor_comment_ref       = '/** Ref. accessor to %a */'\nlet s:k_accessor_comment_proxy_ref = '/** Proxy-Ref. accessor to %a */'\n\n\"------------------------------------------------------------------------\n\" Functions {{{2\n\" Note: most filetype-global functions are best placed into\n\" autoload/your-initials/cpp/cpp_InsertAccessors.vim\n\" Keep here only the functions are are required when the ftplugin is\n\" loaded, like functions that help building a vim-menu for this\n\" ftplugin.\n\n\" Insertion of accessors {{{3\n\n\" Function: s:InsertLines(lines) \"{{{4\nfunction! s:InsertLines(lines) abort\n  silent put = a:lines\n  silent '[,']normal! ==\nendfunction\n\n\" Function: s:WriteAccessor\t{{{4\nfunction! s:WriteAccessor(returnType, signature, instruction, comment) abort\n  try\n    let old_foldenable = &foldenable\n    set nofoldenable\n    let lines = []\n    let lines += [a:comment]\n    if '' != a:instruction\n      let curly = lh#cpp#option#nl_before_curlyB() ? \"\" : \"\\<tab>{\"\n      if a:returnType =~ \"^inline\"\n        let lines += ['inline']\n        let lines += [ substitute(a:returnType,\"inline.\",'','')\n              \\ . \"\\<tab>\" . a:signature . curly]\n      else\n        let lines += [  a:returnType . \"\\<tab>\" . a:signature . curly ]\n      endif\n      if '' == curly\n        let lines += [  '{'  ]\n      endif\n      let lines += [  a:instruction  ]\n      let lines += [  '}'  ]\n    else\n      \" normal! ==<<\n      let lines += [  a:returnType . \"\\<tab>\" . a:signature .\";\"  ]\n    endif\n    call s:InsertLines(lines)\n  finally\n    let &foldenable = old_foldenable\n  endtry\nendfunction\n\n\" Function: s:InsertAccessor {{{4\nfunction! s:InsertAccessor(className, returnType, signature, instruction, comment) abort\n  try\n    let old_foldenable = &foldenable\n    set nofoldenable\n    if exists('g:mu_template') &&\n          \\ (   !exists('g:mt_jump_to_first_markers')\n          \\  || g:mt_jump_to_first_markers)\n      \" NB: g:mt_jump_to_first_markers is true by default\n      let mt_jump = 1\n      let g:mt_jump_to_first_markers = 0\n    endif\n\n    let implPlace = lh#ft#option#get('implPlace', 'cpp', 0)\n    let in_place = implPlace == 0\n          \\ || expand('%:e') =~? 'c\\|cpp\\|c++'\n    if in_place \" within the class definition / la/ Java\n      call s:WriteAccessor(a:returnType, a:signature, a:instruction, a:comment)\n    else\n      let returnType  = a:returnType\n      let instruction = a:instruction\n      \" 1- Insert the prototype\n      call s:WriteAccessor(a:returnType, a:signature, '', a:comment)\n      let fn = expand(\"%\")\n      let l_line = line('.')\n      \" 2- Find the right place\n      if     implPlace == 1 \" Inline section of the right file {{{\n        let returnType = \"inline\\n\" . returnType\n        call Cpp_ReachInlinePart(a:className)\n        \" }}}\n      elseif implPlace == 2 \" Within implementation file {{{\n        silent AS cpp\n        normal! G\n        \" }}}\n      elseif implPlace == 3 \" use the pimpl idiom {{{\n        silent AS cpp\n        normal! G\n        if exists('*Marker_Txt') && lh#brackets#usemarks()\n          let instruction = Marker_Txt(';;')\n        else\n          let instruction = ';;'\n        endif\n        \" does nothing !!!\n        \" }}}\n      endif\n      \" 3- Insert the implementation\n      let signature = a:className.\"::\".a:signature\n      call s:WriteAccessor(returnType, signature, instruction, a:comment)\n      \" 4- go back after the last prototype inserted\n      call FindOrCreateBuffer(fn,1)\n      exe \":\".(l_line)\n    endif\n  finally\n    let &foldenable = old_foldenable\n    if exists('mt_jump')\n      let g:mt_jump_to_first_markers = mt_jump\n      unlet mt_jump\n    endif\n  endtry\nendfunction\n\" Nb: the mt_jump stuff is required in order to not mess things up with\n\" automatically (by the mean of mu-template) built .cpp files.\n\nfunction! s:Comment(attribute, accessor_type) abort \"{{{4\n  let template = lh#option#get('accessor_comment_'.a:accessor_type,\n        \\ s:k_accessor_comment_{a:accessor_type})\n  return substitute(template, '%a',a:attribute,'g')\nendfunction\n\n\" Function:\tAddAttribute\t\t\t{{{4\n\" Options:\tg:getPrefix (default = \"get_\")\n\" \t\tg:setPrefix (default = \"set_\")\n\" \t\tg:refPrefix (default = \"ref_\")\nfunction! Cpp_AddAttribute() abort\n  :CheckOptions\n  \" Todo: factorize and move this elsewhere\n  \" GUI : request name and type  {{{\n  echo \"--------------------------------------------\"\n  echo \"Adding an attribute to the current class ...\"\n  echo \"--------------------------------------------\"\n  let type = input(\"Type of the new attribute : \")\n  echo \"\\n\"\n  if strlen(type)==0 | call input(\"Aborting...\") | return | endif\n  let name = input(\"Name of the new attribute : \")\n  echo \"\\n\"\n  if strlen(name)==0 | call input(\"Aborting...\") | return | endif\n  \" }}}\n  \"\n  \" TODO: Place the cursor where the attribute must be defined\n\n  \" Insert the attribute itself\n  let attrName = lh#naming#member(name)\n  let lines=[ s:Comment(name, 'attribute'),\n        \\ type . \"\\<tab>\" . attrName . ';'\n        \\ ]\n  call s:InsertLines(lines)\n\n  \" TODO: Place the cursor where accessors must be defined\n  let l_line = line('.')\n  let c_col  = col('.')\n  let className = lh#cpp#AnalysisLib_Class#CurrentScope(l_line, 'any')\n\n  \" const correct type\n  let ccType      = lh#dev#cpp#types#ConstCorrectType(type)\n\n  \" Insert the get accessor {{{\n  let proxyType   = 0\n  let choice = confirm('Do you want a get accessor ?', \"&Yes\\n&No\\n&Proxy\", 1)\n  if choice == 1\n    let comment     = s:Comment(name, 'get')\n    let signature   = lh#naming#getter(name) . \"()\\<tab>const\"\n    let instruction = 'return ' . attrName . ';'\n    call s:InsertAccessor(className, ccType, signature, instruction, comment)\n  elseif choice == 3\n    let proxyType = input( 'Proxy type                : ') | echo \"\\n\"\n    let comment     = s:Comment(name, 'proxy_get')\n    let signature   = lh#naming#getter(name) . \"()\\<tab>const\"\n    let instruction = 'return ' . proxyType.'('.attrName . ' /*,this*/);'\n    call s:InsertAccessor(className, 'const '.proxyType, signature, instruction, comment)\n  endif \" }}}\n\n  \" Insert the set accessor {{{\n  if confirm('Do you want a set accessor ?', \"&Yes\\n&No\", 1) == 1\n    let comment     = s:Comment(name, 'set')\n    let signature   = lh#naming#setter(name)\n          \\ . '('. ccType .' '. lh#naming#param(name) .')'\n    let instruction = attrName . ' = '.name.';'\n    call s:InsertAccessor(className, 'void', signature, instruction, comment)\n    if proxyType != \"\"\n      let comment     = s:Comment(name, 'proxy_set')\n      let signature   = lh#naming#setter(name) . '('. proxyType .'& '. name .')'\n      let instruction = attrName . ' = '.name.';'\n      call s:InsertAccessor(className, 'void', signature, instruction, comment)\n    endif\n  endif \" }}}\n\n  \" Insert the ref accessor {{{\n  if confirm('Do you want a reference accessor ?', \"&Yes\\n&No\", 1) == 1\n    if proxyType == \"\"\n      let comment     = s:Comment(name, 'ref')\n      let signature   = lh#naming#ref_getter(name) . \"()\\<tab>\"\n      let instruction = 'return ' . attrName . ';'\n      call s:InsertAccessor(className, type.'&', signature, instruction, comment)\n    else\n      let comment     = s:Comment(name, 'proxy_ref')\n      let signature   = lh#naming#proxy_getter(name) . \"()\\<tab>\"\n      let instruction = 'return ' . proxyType.'('.attrName . ' /*,this*/);'\n      call s:InsertAccessor(className, proxyType, signature, instruction, comment)\n    endif\n  endif \" }}}\n\n  \" TODO: Go back to the class initial cursor's position\n  \" -> l_line, l_col...\n  exe \":\" . l_line\nendfunction\n\n\" Functions }}}2\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/cpp/cpp_Inspect.vim",
    "content": "\"=============================================================================\n\" File:         ftplugin/cpp/cpp_Inspect.vim                             {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"               <URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/tree/master/License.md>\n\" Version:      2.2.1\nlet s:k_version = 221\n\" Created:      11th Sep 2008\n\" Last Update:  28th Nov 2019\n\"------------------------------------------------------------------------\n\" Description:\n\"       C++ ftplugin that provides command to inpect various information:\n\"       - ancestor of a class\n\"       - children of a class\n\" }}}1\n\"=============================================================================\n\n\" Buffer-local Definitions {{{1\n\" Avoid local reinclusion {{{2\nlet s:cpo_save=&cpo\nset cpo&vim\nif &cp || (exists(\"b:loaded_ftplug_cpp_Inspect\") && !exists('g:force_reload_ftplug_cpp_Inspect'))\n  let &cpo=s:cpo_save\n  finish\nendif\nlet b:loaded_ftplug_cpp_Inspect = s:k_version\n\" Avoid local reinclusion }}}2\n\n\"------------------------------------------------------------------------\n\" Local commands {{{2\n\nif lh#has#plugin('autoload/clang.vim') && clang#can_plugin_be_used()\n  command! -b -nargs=? Ancestors\n        \\ call lh#cpp#libclang#show_ancestors(<q-args>)\nelse\n  command! -b -nargs=? Ancestors\n        \\ echo lh#dev#option#call('class#ancestors', &ft, lh#cpp#ftplugin#OptionalClass(<q-args>))\nendif\ncommand! -b -nargs=? -bang Children  call s:Children(\"<bang>\", <f-args>)\n\n\"=============================================================================\n\" Global Definitions {{{1\n\" Avoid global reinclusion {{{2\nif exists(\"g:loaded_ftplug_cpp_Inspect\") && !exists('g:force_reload_ftplug_cpp_Inspect')\n  let &cpo=s:cpo_save\n  finish\nendif\nlet g:loaded_ftplug_cpp_Inspect = s:k_version\n\" Avoid global reinclusion }}}2\n\"------------------------------------------------------------------------\n\" Functions {{{2\n\" Note: most filetype-global functions are best placed into\n\" autoload/your-initials/cpp/cpp_Inspect.vim\n\" Keep here only the functions are are required when the ftplugin is\n\" loaded, like functions that help building a vim-menu for this\n\" ftplugin.\n\n\" s:Children(bang [, namespace [,classname]]\nfunction! s:Children(bang, ...) abort\n  let reset_namespace_cache = a:bang == \"!\"\n  let namespace = a:0 > 0 ? (a:1) : ''\n  let classname = lh#cpp#ftplugin#OptionalClass(a:000[1:])\n  let children = lh#dev#option#call('class#fetch_direct_children', &ft,\n        \\ classname, namespace, reset_namespace_cache)\n  \" lh#cpp#AnalysisLib_Class#FetchDirectChildren(classname, a:namespace, reset_namespace_cache)\n  echo children\nendfunction\n\n\" Functions }}}2\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/cpp/cpp_Override.vim",
    "content": "\"=============================================================================\n\" File:\t\tftplugin/cpp/cpp_Override.vim                             {{{1\n\" Author:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\" \t\t<URL:http://code.google.com/p/lh-vim/>\n\" Version:\t1.1.0\n\" Created:\t15th Apr 2008\n\" Last Update:\t$Date$\n\"------------------------------------------------------------------------\n\" Description:\tHelper MMI to overide functions\n\" \n\"------------------------------------------------------------------------\n\" Installation:\tinstall details\n\" History:\thistory\n\" TODO:\t\tmissing features\n\" }}}1\n\"=============================================================================\n\n\" Buffer-local Definitions {{{1\n\" Avoid local reinclusion {{{2\nif exists(\"b:loaded_ftplug_cpp_Override\") && !exists('g:force_reload_ftplug_cpp_Override')\n  finish\nendif\nlet b:loaded_ftplug_cpp_Override = 100\nlet s:cpo_save=&cpo\nset cpo&vim\n\" Avoid local reinclusion }}}2\n\n\"------------------------------------------------------------------------\n\" Local commands {{{2\n\ncommand! -b -nargs=? Override :call lh#cpp#override#Main(<f-args>)\n\n\"=============================================================================\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/cpp/cpp_options-commands.vim",
    "content": "\"=============================================================================\n\" File:\t\tftplugin/cpp/cpp_options-commands.vim                     {{{1\n\" Author:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\" \t\t<URL:http://code.google.com/p/lh-vim/>\n\" Version:\t1.1.0\n\" Created:\t10th oct 2002\n\" Last Update:\t$Date$ (10th oct 2002)\n\"------------------------------------------------------------------------\n\" Description:\n\"\tSome commands used to handle the local files cpp_options.vim\n\"\n\"\tTo define options for a project in a hierarchy tree, use |local_vimrc|\n\"\tinstead.\n\" \n\"------------------------------------------------------------------------\n\" Installation:\tDrop this files into $$/ftplugin/cpp/\n\" History:\t{{{\n\" \tVersion 1.0.0\n\" \t(*) Commands come from cpp_GotoFunctionImpl.vim\n\" }}}\n\" TODO:\t\tFind a way to define options for a project or a hierarchy\n\" tree.\n\"=============================================================================\n\" Avoid reinclusion {{{\nif exists('b:loaded_ftplug_cpp_options_commands_vim') | finish | endif\nlet b:loaded_ftplug_cpp_options_commands_vim = 1\n\"\nlet s:cpo_save=&cpo\nset cpo&vim\n\" }}}\n\"------------------------------------------------------------------------\ncommand! -buffer -nargs=0 CheckOptions :call <sid>CheckOptions()\n \n\"=============================================================================\n\" No reinclusion {{{\nif exists(\"g:loaded_cpp_options_commands_vim\") \n  let &cpo=s:cpo_save\n  finish \nendif\nlet g:loaded_cpp_options_commands_vim = 1\n\" }}}\n\"------------------------------------------------------------------------\nlet s:esc_pwd = ''\n\" Function: s:CheckOptions() {{{ \n\" Role: Checks whether we must reload the options file to match the current\n\" project.\nfunction! s:CheckOptions()\n  if s:esc_pwd != escape(getcwd(), '\\')\n    let s:pwd = getcwd()\n    let s:esc_pwd = escape(s:pwd, '\\')\n    let g:do_load_cpp_options = 1\n    if filereadable(\"./cpp_options.vim\")\n      so ./cpp_options.vim\n      \" elseif filereadable(\"$VIM/ftplugin/cpp/cpp_options.vim\")\n      \" so $VIM/ftplugin/cpp/cpp_options.vim\n    else \n      \" so <sfile>:p:h/cpp_options.vim\n      runtime ftplugin/cpp/cpp_options.vim\n    endif\n  endif\nendfunction\n\" }}}\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/cpp/cpp_options.vim",
    "content": "\" ========================================================================\n\" File:\t\tftplugin/cpp/cpp_InsertAccessors.vim                  {{{1\n\" Author:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\" \t\t<URL:http://code.google.com/p/lh-vim/>\n\" Last Change:\t$Date$ (28th July 2003)\n\" Version:\t2.0.0\n\"\n\"------------------------------------------------------------------------\n\" Description:\t\n\"\tOptions for C & C++ editing.\n\"\n\"------------------------------------------------------------------------\n\" Installation:\tSee |lh-cpp-readme.txt|\n\" \tOverride these definitions in each C|C++ project.\n\" TODO: move these definitions to autoload/lh/cpp/option.vim as the approach\n\" used in this file is now deprecated\n\" }}}1\n\" ==========================================================================\nif !exists(\"g:do_load_cpp_options\") | finish | endif\nunlet g:do_load_cpp_options\n\"\nexe 'command! -nargs=0 CppEditOptions :sp '.expand('<sfile>:p')\nexe 'command! -nargs=0 CppReloadOptions :so '.expand('<sfile>:p')\n\" ====================================================================\n\" Preferences for the names of classes' attributes and their accessors {{{\n\" ====================================================================\n\"\nlet g:accessorCap  = -1\n\" g:accessorCap = -1 (lowcase), 0 (no change), 1 (upcase)\n\nlet g:accessor_comment_attribute = '/** %a ... */'\nlet g:accessor_comment_get = '/** Get accessor to %a */'\nlet g:accessor_comment_set = '/** Set accessor to %a */'\nlet g:accessor_comment_proxy_get = '/** Proxy-Get accessor to %a */'\nlet g:accessor_comment_proxy_set = '/** Proxy-Set accessor to %a */'\nlet g:accessor_comment_ref = '/** Ref. accessor to %a */'\nlet g:accessor_comment_proxy_ref = '/** Proxy-Ref. accessor to %a */'\n\n\" To use markers/placeholders, use Marker_Txt()\n\" let g:accessor_comment_get = Marker_Txt('/** Get accessor to %a */')\n\n\" Luc's Preferences:\nlet g:setPrefix  = 'set_'\nlet g:getPrefix  = 'get_'\nlet g:refPrefix  = 'ref_'\nlet g:dataPrefix = 'm_'\nlet g:dataSuffix = ''\nlet g:paramPrefix = ''\nlet g:paramSuffix = ''\n\n\"\"\" Very Short Style:\n\"\"let g:setPrefix  = ''\n\"\"let g:getPrefix  = ''\n\"\"let g:refPrefix  = ''\n\"\"let g:dataPrefix = ''\n\"\"let g:dataSuffix = '_'\n\"\"let g:paramPrefix = ''\n\"\"let g:paramSuffix = ''\n\"\n\"\"\" Herb Sutter's Style:\n\"\"let g:setPrefix  = 'Set'\n\"\"let g:getPrefix  = 'Get'\n\"\"let g:refPrefix  = 'Get'\n\"\"let g:dataPrefix = ''\n\"\"let g:dataSuffix = '_'\n\"\"let g:paramPrefix = ''\n\"\"let g:paramSuffix = ''\n\" }}}\n\" ====================================================================\n\" Preference regarding where accessors' definitions occur {{{\n\" ====================================================================\n\"\n\" Possible Values:\n\"   0: Near the prototype/definition (Java's way)\n\"   1: Within the inline section of the header/inline/current file\n\"   2: Within the implementation file (.cpp)\n\"   3: Use the pimpl idiom\nlet g:implPlace = 1\n\" }}}\n\" ====================================================================\n\" Preference regarding where inlines are written {{{\n\" ====================================================================\n\" Possible values:\n\"   0: In the inline section of the header/current file\n\"   1: In the inline section of a dedicated inline file\nlet g:inlinesPlace = 1\n\n\" Function used by Cpp_reachInlinePart()\nfunction! Cpp_fileTypeRegardingOption()\n  return g:inlinesPlace\nendfunction\n\" }}}\n\" ====================================================================\n\" Preferences regarding what is shown in functions signatures {{{\n\" IE.: Should every element from the signature of a function be reminded along\n\" with the implementationof the function ?\n\"\n\" ShowVirtual = 0 -> '' ; 1 -> '/*virtual*/'\nlet g:cpp_ShowVirtual\t\t= 1\n\n\" ShowStatic  = 0 -> '' ; 1 -> '/*static*/'\nlet g:cpp_ShowStatic \t\t= 1\n\n\" ShowExplicit= 0 -> '' ; 1 -> '/*explicit*/'\nlet g:cpp_ShowExplicit \t\t= 1\n\n\" ShowDefaultParam = 0 -> '' ;\n\" \t\t     1 -> default value for params within comments ;\n\"\t\t     2 -> within comment as well, but spaces are trimmed ;\n\"\t\t     3 -> like 2, but the equal sign is not displayed.\nlet g:cpp_ShowDefaultParams\t= 1\n\" }}}\n\" ====================================================================\n\" Preference regarding where functions definitions are written {{{\n\" ====================================================================\n\"\n\" Possible Values:\n\"   0: At the end of the file plus offset g:cpp_FunctionPosArg\n\"   1: Search for a specific pattern g:cpp_FunctionPosArg\n\"      Useful if you use template skeletons\n\"   2: Call a user specified function : g:cpp_FunctionPosArg\n\"      Beware! This is a (security) back door.\n\"   3: Store the value in a temporary variable ; to be used in conjunction\n\"      with :PASTEIMPL -- Robert Kelly IV's approach\nlet g:cpp_FunctionPosition = 2\nif exists('g:cpp_FunctionPosArg') | unlet g:cpp_FunctionPosArg | endif\n\nfunction! s:GroupPattern(group) \" {{{\n  \" Yes the pattern is very, very complex.\n  \" It searches for \"/*===[ groupname ]===*/\\n/*=======*/\" followed by :\n  \"   - either the end of the file\n  \"   - or a line not made of one and only one comment\n  \" Todo: Support \"//\" comments\n  return '/\\*=*\\[ '.a:group.' \\]=*\\*/\\_s*/\\*=*\\*/\\zs'.\n\t\\ '\\%(\\%$\\|\\_s\\%(^/\\*\\%(\\*[^/]\\|[^*]\\)*\\*/\\s*$\\)\\@!\\)'\nendfunction\n\" }}}\n\n\" Some default definitions of g:cpp_FunctionPosArg regarding the chosen value\n\" of g:cpp_FunctionPosition. Use them as examples for your code preferences.\nif     g:cpp_FunctionPosition == 0 \" {{{\n  let g:cpp_FunctionPosArg = -1\n  \" }}}\nelseif g:cpp_FunctionPosition == 1 \" {{{\n  \" That one fit my own needs. Find your owns\n  let g:cpp_FunctionPosArg = s:GroupPattern('')\n  \" }}}\nelseif g:cpp_FunctionPosition == 2 \" {{{\n  let g:cpp_FunctionPosArg = 'Cpp_SearchForGroup'\n  function! Cpp_SearchForGroup()\n    \" Cf cpp_BuildTemplate.vim::BLINE for groups definitions:\n    \"    /*=================*/ (80 characters)\n    \"    /*====[ title ]====*/\n    \"    /*=================*/\n    \" Todo: Move this function into cpp_BuildTemplate.vim\n    let g = inputdialog('Which group do you want to search for ?')\n    if \"\" == g | return -1\n    else\n      let s = search(s:GroupPattern(g))\n      if 0 == s \n\techoerr \"Can't find group [ \".g.\" ]!!!\"\n\treturn -1\n      else      | return s\n      endif\n    endif\n  endfunction\n  \" }}}\nendif\n  \n\" }}}\n\" ====================================================================\n\" File extensions {{{\n\" ====================================================================\nfunction! Cpp_FileExtension4Inlines()\n  return '.inl'\nendfunction\n\nfunction! Cpp_FileExtension4Implementation()\n  return '.cpp'\nendfunction\n\" }}}\n\" ====================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/cpp/cpp_refactor.vim",
    "content": "\"=============================================================================\n\" File:         ftplugin/cpp/cpp_refactor.vim                             {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"               <URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/tree/master/License.md>\n\" Version:      2.2.1\n\" Created:      10th Feb 2005\n\" Last Update:  21st Feb 2019\n\"------------------------------------------------------------------------\n\" Description:  Some refactoring oriented mappings and commands\n\"\n\" Definitions:\n\" - :ToInitList\n\" - :AddBrief\n\"\n\"------------------------------------------------------------------------\n\" Installation: See |lh-cpp-readme.txt|\n\"\n\" History:\n\"       v0.1:   10th Feb 2005\n\"               Initial version\n\" }}}1\n\"=============================================================================\n\n\n\"=============================================================================\n\" Avoid buffer reinclusion {{{1\nlet s:cpo_save=&cpo\nset cpo&vim\nif &cp || (exists('b:loaded_ftplug_cpp_refactor')\n       \\ && !exists('g:force_reload_cpp_refactor'))\n  let &cpo=s:cpo_save\n  finish\nendif\nlet b:loaded_ftplug_cpp_refactor = 1\n\n\" }}}1\n\"------------------------------------------------------------------------\n\" Commands and mappings {{{1\n\n\" Adds Doxygen's keyword @brief into headers where it is missing.\ncommand! -buffer -range=% AddBrief\n      \\ <line1>,<line2>s#\\(/\\*\\*\\%(\\s*\\n\\s*\\*\\)*\\)\\s*\\([^@ ]\\)#\\1 @brief \\u\\2\n\n\" Changes a list of affectations (instruction) into an initialisation list.\n\" This is meant to be used into poorly-written constructors.\n\" How To use it:\n\" - Move first the '{' after the instructions you want to transform\n\" - Select (visual mode) the lines where the instructions are\n\" - Type ``:ToInitList''\n\" - Enjoy\n\" - You may have to change the leading ':' inserted into a ','.\n\" NB:\n\" - The initialisation list is reindented at the end of the operation.\ncommand! -buffer -range ToInitList\n      \\ <line1>,<line2>s#^\\s*\\(.\\{-}\\)\\s*=\\s*\\(.\\{-}\\);#, \\1( \\2 )#\n      \\ |<line1>s#^,#:#\n      \\ |<line1>,<line2>normal! ==\n\n\ncommand! -buffer -nargs=* Parents :call <sid>ShowParents(<f-args>)\n\ncommand! -buffer -range -nargs=0 Modernize :call lh#cpp#refactor#_modernize()\n\n\" Commands and mappings }}}1\n\"=============================================================================\n\" Avoid global reinclusion {{{1\nif exists(\"g:loaded_cpp_refactor\")\n      \\ && !exists('g:force_reload_cpp_refactor')\n  let &cpo=s:cpo_save\n  finish\nendif\nlet g:loaded_cpp_refactor = 1\n\" Avoid global reinclusion }}}1\n\"------------------------------------------------------------------------\n\" Functions {{{1\n\nfunction! s:ShowParents(...) abort\n  let classname = (a:0 == 0)\n        \\ ? lh#cpp#AnalysisLib_Class#CurrentScope(line('.'),'any')\n        \\ : a:1\n  let ancestors = lh#cpp#AnalysisLib_Class#Ancestors(classname)\n  echo string(ancestors)\nendfunction\n\n\n\" Functions }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/cpp/cpp_set.vim",
    "content": "\" ========================================================================\n\" File:         ftplugin/cpp/cpp_set.vim                              {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"               <URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      2.2.0\n\" Last Update:  07th Mar 2017\n\"\n\"------------------------------------------------------------------------\n\" Description:\n\"       Defines vim options for C++ programming.\n\" }}}1\n\" ========================================================================\n\n\" for changelog: 02nd Jun 2006 -> suffixesadd\n\n\" ========================================================================\n\" Buffer local definitions {{{1\n\" ========================================================================\nif exists(\"b:loaded_local_cpp_settings\") && !exists('g:force_reload_cpp_set')\n  finish\nendif\nlet b:loaded_local_cpp_settings = 1\n\n\"\" line continuation used here ??\nlet s:cpo_save = &cpo\nset cpo&vim\n\n\" ------------------------------------------------------------------------\n\" Commands {{{2\n\" ------------------------------------------------------------------------\n\" Cf. cpp_BuildTemplates.vim\n\"\n\" ------------------------------------------------------------------------\n\" VIM Includes {{{2\n\" ------------------------------------------------------------------------\nif exists(\"b:did_ftplugin\")\n  unlet b:did_ftplugin\nendif\nsource $VIMRUNTIME/ftplugin/cpp.vim\nlet b:did_ftplugin = 1\n\n\"\n\" ------------------------------------------------------------------------\n\" Options to set {{{2\n\" ------------------------------------------------------------------------\n\"  setlocal formatoptions=croql\n\"  setlocal cindent\n\"\nsetlocal cinoptions=g0,t0,h1s,i0\nif has('patch-7.3-202')\n  setlocal cinoptions+=N-s\nendif\nsetlocal suffixesadd+=.hpp,.cpp,.C,.h++,.c++,.hh\n\n\" Emulate [[ and ]] in C++\nnnoremap <silent> <buffer> [[ :call lh#dev#_goto_function_begin()<cr>\nonoremap <silent> <buffer> [[ :<c-u>call lh#dev#_goto_function_begin()<cr>\nnnoremap <silent> <buffer> ][ :call lh#dev#_goto_function_end()<cr>\nonoremap <silent> <buffer> ][ :<c-u>call lh#dev#_goto_function_end()<cr>\n\n\" browse filter\nif has(\"gui_win32\")\n  let b:browsefilter =\n        \\ \"C++ Header Files (*.hpp *.h++ *hh)\\t*.hpp;*.h++;*.hh\\n\" .\n        \\ \"C++ Source Files (*.cpp *.c++)\\t*.cpp;*.c++\\n\" .\n        \\ \"C Header Files (*.h)\\t*.h\\n\" .\n        \\ \"C Source Files (*.c)\\t*.c\\n\" .\n        \\ \"All Files (*.*)\\t*.*\\n\"\nendif\n\" }}}2\n\n\" ========================================================================\n\" General definitions {{{1\n\" ========================================================================\nif exists(\"g:loaded_cpp_set\") && !exists('g:force_reload_cpp_ftp')\n  let &cpo = s:cpo_save\n  finish\nendif\nlet g:loaded_cpp_set = 1\n\nlet &cpo = s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/cpp/cpp_snippets.vim",
    "content": "\"=============================================================================\n\" File:         ftplugin/cpp/cpp_snippets.vim                            {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"               <URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/License.md>\n\" Version:      2.2.0\nlet s:k_version = '220'\n\" Created:      15th Apr 2008\n\" Last Update:  08th Mar 2018\n\"------------------------------------------------------------------------\n\" Description:  Snippets of C++ Control Statements\n\"\n\"------------------------------------------------------------------------\n\" History:\n\" for changelog: 13th Dec 2005 -> little bug in vmaps for ,,sc ,,rc ,,dc ,,cc\n\" for changelog: 15th Feb 2006 -> abbr for firend -> friend\n\" for changelog: 10th Apr 2006 -> \"typename\" after commas as well\n\" for changelog: 12th Jun 2006 -> <m-t> is not expanded in comments/string\n\" }}}1\n\"=============================================================================\n\n\" Buffer-local Definitions {{{1\n\" Avoid local reinclusion {{{2\nif (exists(\"b:loaded_ftplug_cpp_snippets\") && !exists('g:force_reload_ftplug_cpp_snippets')) || get(g:, 'lh_cpp_snippets', 1) == 0\n  finish\nendif\nlet s:cpo_save=&cpo\nset cpo&vim\nlet b:loaded_ftplug_cpp_snippets = s:k_version\n\" Avoid local reinclusion }}}2\n\n\"------------------------------------------------------------------------\n\" This must be loaded before continuing\nruntime! ftplugin/c/c_snippets.vim\n\n\" Local mappings {{{2\n\"\n\"------------------------------------------------------------------------\n\" Some C++ abbreviated Keywords {{{3\n\" ------------------------------------------------------------------------\n\" TODO: check whether the line is empty\nInoreab <buffer> pub <c-r>='public'.lh#cpp#snippets#insert_if_not_after(' ', ':\\<CR\\>', '[:,]')<cr>\nInoreab <buffer> pro <c-r>='protected'.lh#cpp#snippets#insert_if_not_after(' ', ':\\<CR\\>', '[:,]')<cr>\nInoreab <buffer> pri <c-r>='private'.lh#cpp#snippets#insert_if_not_after(' ', ':\\<CR\\>', '[:,]')<cr>\n\nIabbr <buffer> tpl template <\n\ninoreab <buffer> vir virtual\ncnoreab          firend friend\ninoreab <buffer> firend friend\ninoreab <buffer> delate delta\n\ninoremap <buffer> <m-s> std::\ninoremap <buffer> <expr> <m-b> (getline('.')=~'#\\s*include') ? 'boost/' : 'boost::'\ninoremap <buffer> <expr> <m-n> lh#cpp#snippets#current_namespace(\"\\<m-n>\")\n\" We don't want ? (\\hat o) to be expanded in comments)\ninoremap <buffer> <m-t> <c-r>=lh#map#insert_seq('<m-t>', '\\<c-r\\>=lh#cpp#snippets#typedef_typename()\\<cr\\>')<cr>\n\n\n\"------------------------------------------------------------------------\n\" Control statements {{{3\n\"------------------------------------------------------------------------\n\"--- namespace ---------------------------------------------------{{{4\n\"--,ns insert \"namespace\" statement\n  Inoreabbr <buffer> namespace <C-R>=lh#cpp#snippets#insert_if_not_after('namespace ',\n        \\ '\\<c-f\\>namespace <+namespace+>{<++>}// namespace <+namespace+>', 'using')<cr>\n  \" Inoreabbr <buffer> namespace <C-R>=lh#cpp#snippets#insert_if_not_after('namespace ',\n        \" \\ '\\<c-f\\>namespace !cursorhere! {!mark!}!mark!', 'using')<cr>\n  vnoremap <buffer> <silent> <LocalLeader>ns\n        \\ <c-\\><c-n>@=lh#style#surround('namespace !cursorhere!{', '!mark!}!mark!',\n        \\ 0, 1, '', 1, 'namespace ')<cr>\n      nmap <buffer> <LocalLeader>ns V<LocalLeader>ns\n\n\"--- try ---------------------------------------------------------{{{4\n\"--try insert \"try\" statement\n  command! -nargs=0 PrivateCppSearchTry :call search('try\\_s*{\\_s*\\zs$', 'b')\n  \" Inoreabbr <buffer> <silent> try <C-R>=lh#cpp#snippets#def_abbr('try ',\n        \" \\ '\\<c-f\\>try{!cursorhere!}catch(!mark!){!mark!}!mark!\\<esc\\>')<CR>\n  Inoreabbr <buffer> <silent> try <C-R>=lh#cpp#snippets#def_abbr('try ',\n        \\ '\\<c-f\\>try{}catch(!mark!){!mark!}!mark!\\<esc\\>'\n        \\ .':PrivateCppSearchTry\\<cr\\>a\\<c-f\\>')<CR>\n        \"\n        \" \\ .'?try\\\\_s*\\\\zs{\\<cr\\>:PopSearch\\<cr\\>o')<CR>\n        \" pb with prev. line: { is replaced by \\n when c_nl_before_curlyB=1\n        \"\n        \" pb with next line: !cursorhere! is badly indented\n        \" \\ '\\<c-f\\>try {!cursorhere!} catch (!mark!) {!mark!}!mark!')<cr>\n\"--,try insert \"try - catch\" statement\n  vnoremap <buffer> <LocalLeader>try\n        \\ <c-\\><c-n>@=lh#style#surround('try{!cursorhere!', '!mark!}catch(!mark!){!mark!}',\n        \\ 0, 1, '', 1, 'try ')<cr>\n      nmap <buffer> <LocalLeader>try V<LocalLeader>try\n\n\"--- catch -------------------------------------------------------{{{4\n\"--catch insert \"catch\" statement\n  Inoreabbr <buffer> catch <C-R>=lh#cpp#snippets#def_abbr('catch ',\n        \\ '\\<c-f\\>catch(!cursorhere!){!mark!}!mark!')<cr>\n  vnoremap <buffer> <LocalLeader>catch\n        \\ <c-\\><c-n>@=lh#style#surround('catch(!cursorhere!){', '!mark!}',\n        \\ 0, 1, '', 1, 'catch ')<cr>\n      nmap <buffer> <LocalLeader>catch V<LocalLeader>catch\n  vnoremap <buffer> <LocalLeader><LocalLeader>catch\n        \\ <c-\\><c-n>@=lh#style#surround('catch(', '!cursorhere!){!mark!}',\n        \\ 0, 1, '', 1, 'catch ')<cr>\n      nmap <buffer> <LocalLeader><LocalLeader>catch V<LocalLeader><LocalLeader>catch\n\n\"------------------------------------------------------------------------\n\" Castings {{{3\n\"------------------------------------------------------------------------\n\n\" TODO: have s:k_cast_fmt be a [bg]:({ft}_) option.\nlet s:k_cast = {\n      \\ 'sc': 'static_cast',\n      \\ 'dc': 'dynamic_cast',\n      \\ 'cc': 'const_cast',\n      \\ 'rc': 'reinterpret_cast',\n      \\ 'lc': 'boost::lexical_cast'\n      \\ }\n\n\"  ,*c -> surround selection/current with \"cast<«cursor»>(«selection»)>\"\n\" 2,*c -> surround selection/current with \"cast<«selection»>(«cursor»)>\"\nfor cast in ['sc', 'cc', 'rc', 'dc', 'lc']\n  exe 'vnoremap <silent> <buffer> <LocalLeader>'.cast\n        \\ .\" <c-\\\\><c-n>@=lh#style#surround('\".s:k_cast[cast].\"<!cursorhere!>(', '!mark!)',\"\n        \\ .\"0, 0, '', 1, '\".s:k_cast[cast].\"<')<cr>\"\n  exe '    nmap <silent> <buffer> <LocalLeader>'.cast.' viw<LocalLeader>'.cast\nendfor\n\n\" ,*c -> change the C cast selected into the C++ cast\nfor cast in ['sc', 'cc', 'rc', 'dc']\n  exe 'vnoremap <silent> <buffer> <LocalLeader><LocalLeader>'.cast\n        \\ .\" <c-\\\\><c-n>:'<,'>call lh#cpp#snippets#_convert_to_cpp_cast('\".cast.\"')<cr>\"\n  exe '    nmap <silent> <buffer> <LocalLeader><LocalLeader>'.cast.' viw<LocalLeader><LocalLeader>'.cast\nendfor\n\"\n\n\"------------------------------------------------------------------------\n\" Misc {{{3\n\"------------------------------------------------------------------------\n\"--- Std oriented stuff-------------------------------------------{{{4\n\" In std::foreach and std::find algorithms, ..., expand 'algo(container?)'\n\" into:\n\" TODO: support begin(container) (std:: or boost::) as well\n\" - 'algo(container.begin(),container.end()?)',\n\" imap <buffer> <c-x>be .<esc>ci,<c-r>\"begin(),<c-r>\"end()\nimap <buffer> <c-x>be <c-r>=lh#cpp#snippets#_begin_end('begin')<cr>\nxmap <buffer> <c-x>be <c-\\><c-n>ci,<c-r>\".begin(),<c-r>\".end()\nnmap <buffer> <c-x>be viw<c-x>be\n\n\" - 'algo(container.rbegin(),container.rend()?)',\nimap <buffer> <c-x>rbe <c-r>=lh#cpp#snippets#_begin_end('rbegin')<cr>\nxmap <buffer> <c-x>rbe <c-\\><c-n>ci,<c-r>\".rbegin(),<c-r>\".rend()\nnmap <buffer> <c-x>rbe viw<c-x>rbe\n\n\" - 'algo(container.cbegin(),container.cend()?)',\nimap <buffer> <c-x>cbe <c-r>=lh#cpp#snippets#_begin_end('cbegin')<cr>\nxmap <buffer> <c-x>cbe <c-\\><c-n>ci,<c-r>\".cbegin(),<c-r>\".cend()\nnmap <buffer> <c-x>cbe viw<c-x>cbe\n\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "ftplugin/idl_set.vim",
    "content": "\"=============================================================================\n\" File:         ftplugin/cpp/idl_set.vim                                  {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"               <URL:http://code.google.com/p/lh-vim/>\n\" Version:      1.1.0\n\" Created:      09th Mar 2005\n\" Last Update:  30th Apr 2019\n\"------------------------------------------------------------------------\n\" Description:  Few definitions for IDL editing.\n\"\n\"------------------------------------------------------------------------\n\" Installation: Drop the file into {rtp}/ftplugin/\n\" History:\n\"       v1.0: first version\n\"               inspired from ftplugin/c/c_set.vim and ftplugin/cpp/cpp_set.vim\n\" TODO:\n\"       * Ensure Def_MapC from c_set.vim is loaded\n\" }}}1\n\"=============================================================================\n\n\n\"=============================================================================\n\" Avoid buffer reinclusion {{{1\nlet s:cpo_save=&cpo\nset cpo&vim\nif exists('b:loaded_ftplug_idl_set_vim')\n       \\ && !exists('g:force_reload_idl_set_vim')\n  let &cpo=s:cpo_save\n  finish\nendif\nlet b:loaded_ftplug_idl_set_vim = 1\n\n\n\" ------------------------------------------------------------------------\n\" VIM Includes {{{2\n\" ------------------------------------------------------------------------\nif exists(\"b:did_ftplugin\")\n  unlet b:did_ftplugin\nendif\n\n\" }}}1\n\"------------------------------------------------------------------------\n\" Commands and mappings {{{1\n\n\" ------------------------------------------------------------------------\n\" Options to set {{{2\n\" ------------------------------------------------------------------------\nsetlocal formatoptions=croql\nsetlocal cindent\nsetlocal comments=sr:/*,mb:*,exl:*/,://\nsetlocal isk+=#         \" so #if is considered as a keyword, etc\n\nsetlocal ch=2\nsetlocal nosmd\nsetlocal cinoptions=g0,t0,h1s\n\nruntime syntax/doxygen.vim\n\nruntime ftplugin/c/c_brackets.vim\n\n\" ------------------------------------------------------------------------\n\" Comments ; Javadoc/DOC++/Doxygen style {{{2\n\" ------------------------------------------------------------------------\n\" /**       inserts /** <cursor>\n\"                    */\n\" but only outside the scope of C++ comments and strings\n  inoremap <buffer> /**  <c-r>=Def_MapC('/**',\n        \\ '/**\\<cr\\>\\<BS\\>/\\<up\\>\\<end\\> ',\n        \\ '/**\\<cr\\>\\<BS\\>/!mark!\\<up\\>\\<end\\> ')<cr>\n\" /*<space> inserts /** <cursor>*/\n  inoremap <buffer> /*<space>  <c-r>=Def_MapC('/* ',\n        \\ '/** */\\<left\\>\\<left\\>',\n        \\ '/** */!mark!\\<esc\\>F*i')<cr>\n\n\" Commands and mappings }}}1\n\"=============================================================================\n\" Avoid global reinclusion {{{1\nif exists(\"g:loaded_idl_set_vim\")\n      \\ && !exists('g:force_reload_idl_set_vim')\n  let &cpo=s:cpo_save\n  finish\nendif\nlet g:loaded_idl_set_vim = 1\n\" Avoid global reinclusion }}}1\n\"------------------------------------------------------------------------\n\" Functions {{{1\n\n\" Functions }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "mkVba/mk-lh-cpp.vim",
    "content": "\"=============================================================================\n\" File:\t\tmkVba/mk-lh-cpp.vim\n\" Author:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\" \t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/License.md>\n\" Version:\t2.2.1\n\" Created:\t06th Nov 2007\n\" Last Update:\t28th Nov 2019\n\"------------------------------------------------------------------------\nlet s:version = '2.2.1'\nlet s:project = 'lh-cpp'\ncd <sfile>:p:h\ntry\n  let save_rtp = &rtp\n  let &rtp = expand('<sfile>:p:h:h').','.&rtp\n  exe '24,$MkVimball! '.s:project.'-'.s:version\n  set modifiable\n  set buftype=\nfinally\n  let &rtp = save_rtp\nendtry\nfinish\nVimFlavor\naddon-info.json\nafter/plugin/a.vim\nafter/template/c/assert.template\nafter/template/c/comment.template\nafter/template/c/internals/c-header-content.template\nafter/template/c/rand_init.template\nafter/template/c/realloc.template\nafter/template/cpp/abs-rel.template\nafter/template/cpp/abstract-class.template\nafter/template/cpp/array_size.template\nafter/template/cpp/assignment-operator.template\nafter/template/cpp/auto_ptr-instance.template\nafter/template/cpp/auto_ptr.template\nafter/template/cpp/b-e.template\nafter/template/cpp/base-class-non-virtual.template\nafter/template/cpp/base-class.template\nafter/template/cpp/benchmark.template\nafter/template/cpp/bool-operator.template\nafter/template/cpp/catch.template\nafter/template/cpp/cerr.template\nafter/template/cpp/chrono-how-long.template\nafter/template/cpp/cin.template\nafter/template/cpp/class.template\nafter/template/cpp/clonable-class.template\nafter/template/cpp/copy-and-swap.template\nafter/template/cpp/copy-back_inserter.template\nafter/template/cpp/copy-constructor.template\nafter/template/cpp/copy.template\nafter/template/cpp/cout.template\nafter/template/cpp/default-constructor.template\nafter/template/cpp/destructor.template\nafter/template/cpp/empty-exception-class.template\nafter/template/cpp/ends_with.template\nafter/template/cpp/entity-class.template\nafter/template/cpp/enum.template\nafter/template/cpp/enum2-impl.template\nafter/template/cpp/enum2.template\nafter/template/cpp/erase-remove.template\nafter/template/cpp/exception-class.template\nafter/template/cpp/file.template\nafter/template/cpp/for-enum.template\nafter/template/cpp/for-iterator.template\nafter/template/cpp/for-range.template\nafter/template/cpp/fori.template\nafter/template/cpp/foriN.template\nafter/template/cpp/forward.template\nafter/template/cpp/getter.template\nafter/template/cpp/init-constructor.template\nafter/template/cpp/interface.template\nafter/template/cpp/internals/abs-rel-shared.template\nafter/template/cpp/internals/attribute.template\nafter/template/cpp/internals/class-skeleton.template\nafter/template/cpp/internals/formatted-comment.template\nafter/template/cpp/internals/function-comment.template\nafter/template/cpp/internals/function.template\nafter/template/cpp/internals/get-b-e.template\nafter/template/cpp/internals/get-class-name.template\nafter/template/cpp/internals/includes.template\nafter/template/cpp/internals/list-constructors.template\nafter/template/cpp/internals/namespace-name.template\nafter/template/cpp/internals/shall_explicit_defaults.template\nafter/template/cpp/internals/stream-common.template\nafter/template/cpp/internals/stream-implementation.template\nafter/template/cpp/internals/stream-signature.template\nafter/template/cpp/iss.template\nafter/template/cpp/list.template\nafter/template/cpp/map.template\nafter/template/cpp/namespace.template\nafter/template/cpp/noncopyable.template\nafter/template/cpp/operator-binary.template\nafter/template/cpp/oss.template\nafter/template/cpp/otb-sug-latex.template\nafter/template/cpp/otb-sug-snippet.template\nafter/template/cpp/path.template\nafter/template/cpp/ptr_vector.template\nafter/template/cpp/ref_setter.template\nafter/template/cpp/scoped_ptr.template\nafter/template/cpp/set.template\nafter/template/cpp/setter.template\nafter/template/cpp/shared_ptr.template\nafter/template/cpp/singleton.template\nafter/template/cpp/sort.template\nafter/template/cpp/starts_with.template\nafter/template/cpp/static_assert.template\nafter/template/cpp/stream-extractor.template\nafter/template/cpp/stream-inserter.template\nafter/template/cpp/string.template\nafter/template/cpp/swap-function.template\nafter/template/cpp/throw.template\nafter/template/cpp/traits.template\nafter/template/cpp/try.template\nafter/template/cpp/typeid.template\nafter/template/cpp/unique_ptr.template\nafter/template/cpp/unordered_map.template\nafter/template/cpp/unordered_set.template\nafter/template/cpp/utf8.template\nafter/template/cpp/value-class.template\nafter/template/cpp/vector.template\nafter/template/cpp/weak_ptr.template\nafter/template/cpp/while-getline.template\nafter/template/dox/author.template\nafter/template/dox/code.template\nafter/template/dox/em.template\nafter/template/dox/file.template\nafter/template/dox/function.template\nafter/template/dox/group.template\nafter/template/dox/html.template\nafter/template/dox/ingroup.template\nafter/template/dox/since.template\nafter/template/dox/tt.template\nautoload/lh/cpp.vim\nautoload/lh/cpp/AnalysisLib_Class.vim\nautoload/lh/cpp/AnalysisLib_Function.vim\nautoload/lh/cpp/GotoFunctionImpl.vim\nautoload/lh/cpp/UnmatchedFunctions.vim\nautoload/lh/cpp/abs_rel.vim\nautoload/lh/cpp/constructors.vim\nautoload/lh/cpp/enum.vim\nautoload/lh/cpp/ftplugin.vim\nautoload/lh/cpp/include.vim\nautoload/lh/cpp/libclang.vim\nautoload/lh/cpp/macros.vim\nautoload/lh/cpp/option.vim\nautoload/lh/cpp/override.vim\nautoload/lh/cpp/refactor.vim\nautoload/lh/cpp/scope.vim\nautoload/lh/cpp/snippets.vim\nautoload/lh/cpp/style.vim\nautoload/lh/cpp/tags.vim\nautoload/lh/cpp/types.vim\nautoload/lh/dox.vim\ndoc/API.md\ndoc/Doxygen.md\ndoc/Enums.md\ndoc/TODO.md\ndoc/c.html\ndoc/lh-cpp-readme.txt\ndoc/options.md\ndoc/snippets.md\nftplugin/c/LoadHeaderFile.vim\nftplugin/c/c_AddInclude.vim\nftplugin/c/c_Doxygen.vim\nftplugin/c/c_UnmatchedFunctions.vim\nftplugin/c/c_complete_include.vim\nftplugin/c/c_doc.vim\nftplugin/c/c_gcov.vim\nftplugin/c/c_menu.vim\nftplugin/c/c_mu-template_api.vim\nftplugin/c/c_navigate_functions.vim\nftplugin/c/c_pvs-2-qf.vim\nftplugin/c/c_set.vim\nftplugin/c/c_snippets.vim\nftplugin/c/c_stl.vim\nftplugin/c/c_switch-enum.vim\nftplugin/c/flistmaps.vim\nftplugin/c/keep_pound_if_path.vim\nftplugin/c/previewWord.vim\nftplugin/c/word.list\nftplugin/cpp/cpp_AddMissingScope.vim\nftplugin/cpp/cpp_BuildTemplates.vim\nftplugin/cpp/cpp_Constructor.vim\nftplugin/cpp/cpp_Doxygen_class_stuff.vim\nftplugin/cpp/cpp_Enum.vim\nftplugin/cpp/cpp_FindContextClass.vim\nftplugin/cpp/cpp_GotoFunctionImpl.vim\nftplugin/cpp/cpp_InsertAccessors.vim\nftplugin/cpp/cpp_Inspect.vim\nftplugin/cpp/cpp_Override.vim\nftplugin/cpp/cpp_options-commands.vim\nftplugin/cpp/cpp_options.vim\nftplugin/cpp/cpp_refactor.vim\nftplugin/cpp/cpp_set.vim\nftplugin/cpp/cpp_snippets.vim\nftplugin/idl_set.vim\nmkVba/mk-lh-cpp.vim\nplugin/a-old.vim\nplugin/homeLikeVC++.vim\nplugin/omap-param.vim\nsyntax/c-assign-in-condition.vim\nsyntax/c-fallthrough-case.vim\nsyntax/c.vim\nsyntax/cpp-badcatch.vim\nsyntax/cpp-c-cast.vim\nsyntax/cpp-cxxtest.vim\nsyntax/cpp-funcdef.vim\nsyntax/cpp-throw-spec.vim\nsyntax/cpp.vim\ntests/lh/analysis.vim\ntests/lh/omap-param.vim\ntests/lh/snippets.vim\ntests/lh/test-flavours.vim\ntests/lh/test-types.vim\n"
  },
  {
    "path": "plugin/homeLikeVC++.vim",
    "content": "\"=============================================================================\n\" File:\t\tplugin/homeLikeVC++.vim\n\" Author:\tLuc Hermitte <EMAIL:hermitte at free.fr>\n\"\t\t<URL:http://code.google.com/p/lh-vim/>\n\" Version:\t2.0.1\n\" Created:\t23rd mar 2002\n\" Last Update:\t$Date$\n\"------------------------------------------------------------------------\n\" Description:\tMakes <Home> behaves like it does with Ms-VC++. \n\" -> Hitting <Home> once moves the cursor to the first non blank character of\n\"  the line, twice: to the first column of the line.\n\" -> <end> once moves the cursor at the last non blank character, then at the\n\"  last character (if different), ...\n\" \n\"------------------------------------------------------------------------\n\" Installation:\tDrop it into one of your plugin directories\n\"\n\"  This plugin does not propose, on purpose, windows-like keybindings\n\" combining <shift> with <arrows>, <home> nor <end>.\n\"  These keybinding are more generic, and may need to be implemented\n\" differently according to one's taste. If you come from a MsWindows\n\" background you may be interrested in \n\"\t:imap <S-home> <c-\\><c-n>gh<home>\n\"\t:nmap <S-home> gh<home>\n\"\t:vmap <S-home> <home>\n\" \n\"\t:imap <S-home> <c-\\><c-n>gh<end>\n\"\t:nmap <S-home> gh<end>\n\"\t:vmap <S-home> <end>\n\" \n\"  Personnally, I'd rather never end-up in SELECT-mode unless I\n\" explicitly say so, or unless I jumped to a |marker| (aka\n\" |placeholder|). For instance, I often need to (visually) select text\n\" and then surround it with a pair of brackets, while I expect '(' to\n\" expand into '()<left>' when I am in INSERT- or SELECT-mode.\n\" \n\"  Thus, In my .vimrc, I define the following mappings:\n\" \t:imap <s-home> <c-\\><c-n>vo<home>\n\"\t:nmap <S-home> v<home>\n\"\t:vmap <S-home> <home>\n\"       :imap <S-end>  <c-\\><c-n>v<end>\n\"       :nmap <S-end>  v<end>\n\"       :vmap <S-end>  <end>\n\" \n\"  Note: I use here :*map and not :*noremap.\n\"  \n\" History:\t\n\"  v1.0:   initial version\n\"  v1.1:   VISUAL-mode mapping added.\n\"  v2.0.0: <end> is supported as well\n\"  v2.0.1: silent mappings\n\"=============================================================================\n\"\n\" Avoid reinclusion\nif exists(\"g:loaded_homeLikeVC\") && !exists('g:force_reload_homelikeVC')\n  finish \nendif\nlet g:loaded_homeLikeVC = '2.0.1'\n\n\"------------------------------------------------------------------------\ninoremap <silent> <Home> <c-o>@=<SID>HomeLikeVCpp()<cr>\nnnoremap <silent> <Home> @=<SID>HomeLikeVCpp()<cr>\nvnoremap <silent> <Home> @=<SID>HomeLikeVCpp()<cr>\n\ninoremap <silent> <End> <c-\\><c-n>@=<SID>EndLikeVCpp()<cr>a\nnnoremap <silent> <End> @=<SID>EndLikeVCpp()<cr>\nvnoremap <silent> <End> @=<SID>EndLikeVCpp()<cr>\n\nfunction! s:HomeLikeVCpp()\n  let ll = strpart(getline('.'), -1, col('.'))\n  if ll =~ '^\\s\\+$' | return '0'\n  else              | return '^'\n  endif\nendfunction\n\n\nfunction! s:EndLikeVCpp()\n  let l = strpart(getline('.'), col('.')-1)\n  let ll = match(l, '^\\S\\s*$')\n\n  if getline('.') =~ '^\\s*$'\n    if col('.') + (mode()!='v') == col('$') | return 'g_'\n    else                                    | return '$'\n    endif\n  else\n    if ll >= 0 | return '$'\n    else       | return 'g_'\n    endif\n  endif\nendfunction\n"
  },
  {
    "path": "plugin/omap-param.vim",
    "content": "\"=============================================================================\n\" File:         plugin/omap-param.vim                                     {{{1\n\" Maintainer:   Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"               <URL:http://code.google.com/p/lh-vim/>\n\" Other Contributors:   A.Politz\n\" Version:      1.1.0\n\" Created:      03rd Sep 2007\n\" Last Update:  $Date$ (05th Sep 2007)\n\"------------------------------------------------------------------------\n\" Description:\n\"       Mappings for selecting functions parameters in various programming\n\"       langages where parameters are passed within braces, separated by\n\"       commas.\n\"\n\" See:\n\"       :h objet-select\n\"\n\"------------------------------------------------------------------------\n\" Installation:\n\"       Drop this file into {rtp}/plugin/\n\"       Requires\n\"       - Vim 7+,\n\"       - {rtp}/autoload/lh/position.vim\n\"       - {rtp}/autoload/lh/syntax.vim\n\" History:\n\"       v0.9.0 first version\n\" Credits:\n\"       <URL:http://vim.wikia.com/wiki/Indent_text_object>\n\"       A.Politz\n\" TODO:\n\"       Move this into lh-vim-lib or a plugin.\n\" Notes:\n\"       * \"i,\" can't be used to select several parameters with several uses of\n\"       \"i,\" ; use \"a,\" instead (-> \"va,a,a,\"). This is because of simple\n\"       letter parameters.\n\"       However, \"v2i,\" works perfectly.\n\"       * The following should be resistant to &magic, and other mappings\n\"       * select-mode is not parasited by this plugin\n\" }}}1\n\"=============================================================================\n\n\"=============================================================================\n\" Avoid global reinclusion {{{1\nlet s:cpo_save=&cpo\nset cpo&vim\nif exists(\"g:loaded_omap_param_vim\")\n      \\ && !exists('g:force_reload_omap_param_vim')\n  let &cpo=s:cpo_save\n  finish\nendif\nlet g:loaded_omap_param_vim = 1\n\" Avoid global reinclusion }}}1\n\"------------------------------------------------------------------------\n\" Public Mappings {{{1\nonoremap <silent> i, :<c-u>call <sid>SelectParam(1,0)<cr>\nxnoremap <silent> i, :<c-u>call <sid>SelectParam(1,1)<cr><esc>gv\nonoremap <silent> a, :<c-u>call <sid>SelectParam(0,0)<cr>\nxnoremap <silent> a, :<c-u>call <sid>SelectParam(0,1)<cr><esc>gv\n\n\" Private Functions {{{1\nfunction! s:SelectParam(inner, visual) abort\n  let saved_pos = getpos('.')\n  if a:visual ==1 && lh#position#char_at_mark(\"'>\") =~ '[(,]'\n        \\ && !lh#syntax#skip_at_mark(\"'>\")\n    normal! gv\n  elseif searchpair('(',',',')','bcW','lh#syntax#skip()') > 0 ||\n        \\ searchpair('(',',',')','bW','lh#syntax#skip()') > 0\n    \" Test necessary because 'c' flag and Skip() don't always work well together\n    call search('.')\n    normal! v\n  else\n    throw \"Not on a parameter\"\n  endif\n\n  let cnt = v:count <= 0 ? 1 : v:count\n\n  while cnt > 0\n    let cnt -= 1\n    if 0 == searchpair('(', ',',')', 'W','lh#syntax#skip()')\n      if lh#position#is_before(getpos('.'), saved_pos)\n        \" no \"vi,\" when starting from the last parameter\n        exe \"normal! \\<esc>\"\n        call setpos('.', saved_pos)\n        throw (a:visual?'v':'').(a:inner?'i':'a').\",: Cursor not on a parameter\"\n      else\n        echomsg (a:visual?'v':'').(a:inner?'i':'a').\",: No more parameters\"\n        \" 999di, silently deletes everything till the end\n        break\n      endif\n    endif\n  endwhile\n  \" Don't include the last closing paren\n  if a:inner == 1 || searchpair('(',',',')','n','lh#syntax#skip()') <= 0\n    call search('.','b')\n  endif\nendfunction\n\n\n\" Private Functions }}}1\n\nif 0\n  finish\n  call Un(Null,fun2(fun3(a,b,g(NULL))),t, titi, r  , zzz\n  call Un(Null,fun2(fun3(a,b,g(NULL))),t, titi,   , zzz)\nendif\n\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "script/PVS2qf.xsl",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">\n  <xsl:output method=\"text\" indent=\"no\"/>\n  <xsl:strip-space elements=\"*\"/>\n\n  <xsl:template name=\"escape\">\n    <xsl:param name=\"string\"/>\n    <xsl:variable name=\"strFrom\">&apos;&quot;</xsl:variable>\n    <xsl:value-of select=\"translate($string, $strFrom, '')\"/>\n  </xsl:template>\n\n  <!-- Version that produces a text for errorfmt\n\n\n\t<xsl:template match=\"PVS-Studio_Analysis_Log\">\n    <xsl:value-of select=\"File\"/>:<xsl:value-of select=\"Line\"/>: (L<xsl:value-of select=\"Level\"/>) <xsl:value-of select=\"Message\"/> -&gt; <xsl:value-of select=\"ErrorCode\"/>\n    <xsl:text>\n</xsl:text>\n  </xsl:template>\n  -->\n  <!-- Version that produces a qflist (vim dictionary) -->\n  <xsl:template match=\"Solution_Path\">[</xsl:template>\n  <xsl:template match=\"PVS-Studio_Analysis_Log\">\n    <!-- <xsl:if test=\"position()=1\">[</xsl:if>\n       - does not work => the match on Solution_Path\n       -->\n    { 'filename': '<xsl:value-of select=\"File\"/>',\n    'lnum': <xsl:value-of select=\"Line\"/>,\n    'nr'  : '<xsl:value-of select=\"translate(ErrorCode, 'V', '')\"/>',\n    'text': \n    '<xsl:call-template name=\"escape\">\n      <xsl:with-param name=\"string\" select=\"Message\"/>\n    </xsl:call-template>',\n    'type': <xsl:value-of select=\"Level\"/> }\n    <xsl:choose>\n      <xsl:when test=\"following-sibling::*\">,</xsl:when>\n      <xsl:otherwise>]</xsl:otherwise>\n    </xsl:choose>\n  </xsl:template>\n\n</xsl:stylesheet>\n"
  },
  {
    "path": "spec/abstract-class_spec.rb",
    "content": "# encoding: UTF-8\nrequire 'spec_helper'\nrequire 'pp'\n\n\nRSpec.describe \"C++ abstract class wizard\", :abstract, :cpp, :class do\n  let (:filename) { \"test.cpp\" }\n\n  # ====[ Executed once before all test {{{2\n  before :all do\n    if !defined? vim.runtime\n        vim.define_singleton_method(:runtime) do |path|\n            self.command(\"runtime #{path}\")\n        end\n    end\n    vim.runtime('spec/support/input-mock.vim')\n    expect(vim.command('verbose function lh#ui#input')).to match(/input-mock.vim/)\n    expect(vim.echo('lh#mut#dirs#get_templates_for(\"cpp/abstract-class\")')).to match(/abstract-class.template/)\n  end\n\n  # ====[ Always executed before each test {{{2\n  before :each do\n    expect(vim.echo('&enc')).to eq 'utf-8'\n    vim.command('filetype plugin on')\n    vim.command(\"file #{filename}\")\n    vim.set('ft=cpp')\n    vim.command('set fenc=utf-8')\n    vim.set('expandtab')\n    vim.set('sw=4')\n    vim.command('silent! unlet g:cpp_explicit_default')\n    vim.command('silent! unlet g:cpp_std_flavour')\n    clear_buffer\n    set_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    EOF\n    vim.command(%Q{call append(1, ['', ''])})\n    expect(vim.echo('line(\"$\")')).to eq '3'\n    expect(vim.echo('setpos(\".\", [1,3,1,0])')).to eq '0'\n    expect(vim.echo('line(\".\")')).to eq '3'\n  end\n\n  specify \"abstract-class noncopyable, with implicit definitions\", :cpp98, :cpp11, :noncopyable do\n    vim.command('silent! unlet g:cpp_noncopyable_class')\n    expect(vim.command('MuTemplate cpp/abstract-class')).to match(/^$|#include <boost\\/noncopyable.hpp> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <boost/noncopyable.hpp>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Abstract\n     * - Entity\n     * - Non-copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test» : private boost::noncopyable\n    {\n    public:\n\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~«Test»() = 0;\n\n    protected:\n\n        /**\n         * Default constructor.\n         * «@throw »\n         */\n        «Test»();\n    };\n    EOF\n  end\n\n  specify \"abstract-class noncopyable, no implicit definitions\", :cpp11, :noncopyable, :defaulted do\n    vim.command('silent! unlet g:cpp_noncopyable_class')\n    vim.command(\"let g:cpp_std_flavour = 11\")\n    vim.command(\"let g:cpp_explicit_default = 1\")\n    expect(vim.command('MuTemplate cpp/abstract-class')).to match(/^$|#include <boost\\/noncopyable.hpp> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <boost/noncopyable.hpp>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Abstract\n     * - Entity\n     * - Non-copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test» : private boost::noncopyable\n    {\n    public:\n\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~«Test»() = 0;\n\n    protected:\n\n        «Test»() = default;\n\n    private:\n\n        «Test»(«Test» const&) = delete;\n        «Test»& operator=(«Test» const&) = delete;\n    };\n    EOF\n  end\n\n  specify \"abstract-class C++98 alone\", :cpp98, :deleted do\n    vim.command('let g:cpp_noncopyable_class=\"\"')\n    vim.command('let g:cpp_std_flavour = 03')\n    expect(vim.command('MuTemplate cpp/abstract-class')).to eq \"\"\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Abstract\n     * - Entity\n     * - Non-copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~«Test»() = 0;\n\n    protected:\n\n        /**\n         * Default constructor.\n         * «@throw »\n         */\n        «Test»();\n\n    private:\n\n        «Test»(«Test» const&) /* = delete */;\n        «Test»& operator=(«Test» const&) /* = delete */;\n    };\n    EOF\n  end\n\n  specify \"abstract-class C++11 alone, w/ implicit definition\", :cpp11, :deleted do\n    vim.command('let g:cpp_noncopyable_class = \"\"')\n    vim.command('let g:cpp_std_flavour = 11')\n    expect(vim.command('MuTemplate cpp/abstract-class')).to eq \"\"\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Abstract\n     * - Entity\n     * - Non-copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~«Test»() = 0;\n\n    protected:\n\n        /**\n         * Default constructor.\n         * «@throw »\n         */\n        «Test»();\n\n    private:\n\n        «Test»(«Test» const&) = delete;\n        «Test»& operator=(«Test» const&) = delete;\n    };\n    EOF\n  end\n\n  specify \"abstract-class C++11 alone, no implicit definitions\", :cpp11, :deleted, :defaulted do\n    vim.command('let g:cpp_noncopyable_class = \"\"')\n    vim.command('let g:cpp_std_flavour = 11')\n    vim.command(\"let g:cpp_explicit_default = 1\")\n    expect(vim.command('MuTemplate cpp/abstract-class')).to eq \"\"\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Abstract\n     * - Entity\n     * - Non-copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~«Test»() = 0;\n\n    protected:\n\n        «Test»() = default;\n\n    private:\n\n        «Test»(«Test» const&) = delete;\n        «Test»& operator=(«Test» const&) = delete;\n    };\n    EOF\n  end\n\n\nend\n\n# vim:set sw=2:\n"
  },
  {
    "path": "spec/base-class-NV_spec.rb",
    "content": "# encoding: UTF-8\nrequire 'spec_helper'\nrequire 'pp'\n\n\nRSpec.describe \"C++ non virtual base class wizard\", :base_nv, :cpp, :class do\n  let (:filename) { \"test.cpp\" }\n\n  # ====[ Executed once before all test {{{2\n  before :all do\n    if !defined? vim.runtime\n        vim.define_singleton_method(:runtime) do |path|\n            self.command(\"runtime #{path}\")\n        end\n    end\n    vim.runtime('spec/support/input-mock.vim')\n    expect(vim.command('verbose function lh#ui#input')).to match(/input-mock.vim/)\n    expect(vim.echo('lh#mut#dirs#get_templates_for(\"cpp/base-class-non-virtual\")')).to match(/base-class-non-virtual.template/)\n  end\n\n  # ====[ Always executed before each test {{{2\n  before :each do\n    vim.command('filetype plugin on')\n    vim.command(\"file #{filename}\")\n    vim.set('ft=cpp')\n    vim.set('expandtab')\n    vim.set('sw=4')\n    vim.command('silent! unlet g:cpp_explicit_default')\n    vim.command('silent! unlet g:cpp_std_flavour')\n    clear_buffer\n    set_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    EOF\n    vim.command(%Q{call append(1, ['', ''])})\n    expect(vim.echo('line(\"$\")')).to eq '3'\n    expect(vim.echo('setpos(\".\", [1,3,1,0])')).to eq '0'\n    expect(vim.echo('line(\".\")')).to eq '3'\n  end\n\n  specify \"base-class-non-virtual noncopyable, with implicit definitions\", :cpp98, :cpp11, :noncopyable do\n    vim.command('silent! unlet g:cpp_noncopyable_class')\n    expect(vim.command('MuTemplate cpp/base-class-non-virtual')).to match(/^$|#include <boost\\/noncopyable.hpp> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <boost/noncopyable.hpp>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Entity\n     * - Non-copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test» : private boost::noncopyable\n    {\n    public:\n\n\n    protected:\n\n        /**\n         * Default constructor.\n         * «@throw »\n         */\n        «Test»();\n        /**\n         * Destructor.\n         * @throw Nothing\n         * @note This class is not meant to be destroyed polymorphically\n         */\n        ~«Test»();\n    };\n    EOF\n  end\n\n  specify \"base-class-non-virtual noncopyable, no implicit definitions\", :cpp11, :noncopyable, :defaulted do\n    vim.command('silent! unlet g:cpp_noncopyable_class')\n    vim.command(\"let g:cpp_std_flavour = 11\")\n    vim.command(\"let g:cpp_explicit_default = 1\")\n    expect(vim.command('MuTemplate cpp/base-class-non-virtual')).to match(/^$|#include <boost\\/noncopyable.hpp> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <boost/noncopyable.hpp>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Entity\n     * - Non-copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test» : private boost::noncopyable\n    {\n    public:\n\n\n    protected:\n\n        «Test»() = default;\n        /**\n         * Destructor.\n         * @throw Nothing\n         * @note This class is not meant to be destroyed polymorphically\n         */\n        ~«Test»() = default;\n\n    private:\n\n        «Test»(«Test» const&) = delete;\n        «Test»& operator=(«Test» const&) = delete;\n    };\n    EOF\n  end\n\n  specify \"base-class-non-virtual C++98 alone\", :cpp98, :deleted do\n    vim.command('let g:cpp_noncopyable_class=\"\"')\n    vim.command('let g:cpp_std_flavour = 03')\n    expect(vim.command('MuTemplate cpp/base-class-non-virtual')).to eq \"\"\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Entity\n     * - Non-copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n\n    protected:\n\n        /**\n         * Default constructor.\n         * «@throw »\n         */\n        «Test»();\n        /**\n         * Destructor.\n         * @throw Nothing\n         * @note This class is not meant to be destroyed polymorphically\n         */\n        ~«Test»();\n\n    private:\n\n        «Test»(«Test» const&) /* = delete */;\n        «Test»& operator=(«Test» const&) /* = delete */;\n    };\n    EOF\n  end\n\n  specify \"base-class-non-virtual C++11 alone, w/ implicit definition\", :cpp11, :deleted do\n    vim.command('let g:cpp_noncopyable_class = \"\"')\n    vim.command('let g:cpp_std_flavour = 11')\n    expect(vim.command('MuTemplate cpp/base-class-non-virtual')).to eq \"\"\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Entity\n     * - Non-copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n\n    protected:\n\n        /**\n         * Default constructor.\n         * «@throw »\n         */\n        «Test»();\n        /**\n         * Destructor.\n         * @throw Nothing\n         * @note This class is not meant to be destroyed polymorphically\n         */\n        ~«Test»();\n\n    private:\n\n        «Test»(«Test» const&) = delete;\n        «Test»& operator=(«Test» const&) = delete;\n    };\n    EOF\n  end\n\n  specify \"base-class-non-virtual C++11 alone, no implicit definition\", :cpp11, :deleted, :defaulted do\n    vim.command('let g:cpp_noncopyable_class = \"\"')\n    vim.command('let g:cpp_std_flavour = 11')\n    vim.command(\"let g:cpp_explicit_default = 1\")\n    expect(vim.command('MuTemplate cpp/base-class-non-virtual')).to eq \"\"\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Entity\n     * - Non-copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n\n    protected:\n\n        «Test»() = default;\n        /**\n         * Destructor.\n         * @throw Nothing\n         * @note This class is not meant to be destroyed polymorphically\n         */\n        ~«Test»() = default;\n\n    private:\n\n        «Test»(«Test» const&) = delete;\n        «Test»& operator=(«Test» const&) = delete;\n    };\n    EOF\n  end\n\n\nend\n\n# vim:set sw=2:\n"
  },
  {
    "path": "spec/base-class_spec.rb",
    "content": "# encoding: UTF-8\nrequire 'spec_helper'\nrequire 'pp'\n\n\nRSpec.describe \"C++ base class wizard\", :base, :cpp, :class do\n  let (:filename) { \"test.cpp\" }\n\n  # ====[ Executed once before all test {{{2\n  before :all do\n    if !defined? vim.runtime\n        vim.define_singleton_method(:runtime) do |path|\n            self.command(\"runtime #{path}\")\n        end\n    end\n    vim.runtime('spec/support/input-mock.vim')\n    expect(vim.command('verbose function lh#ui#input')).to match(/input-mock.vim/)\n    expect(vim.echo('lh#mut#dirs#get_templates_for(\"cpp/base-class\")')).to match(/base-class.template/)\n  end\n\n  # ====[ Always executed before each test {{{2\n  before :each do\n    vim.command('filetype plugin on')\n    vim.command(\"file #{filename}\")\n    vim.set('ft=cpp')\n    vim.set('expandtab')\n    vim.set('sw=4')\n    vim.command('silent! unlet g:cpp_explicit_default')\n    vim.command('silent! unlet g:cpp_std_flavour')\n    clear_buffer\n    set_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    EOF\n    vim.command(%Q{call append(1, ['', ''])})\n    expect(vim.echo('line(\"$\")')).to eq '3'\n    expect(vim.echo('setpos(\".\", [1,3,1,0])')).to eq '0'\n    expect(vim.echo('line(\".\")')).to eq '3'\n  end\n\n  specify \"base_class noncopyable, with implicit definitions\", :cpp98, :cpp11, :noncopyable do\n    vim.command('silent! unlet g:cpp_noncopyable_class')\n    expect(vim.command('MuTemplate cpp/base-class')).to match(/^$|#include <boost\\/noncopyable.hpp> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <boost/noncopyable.hpp>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Entity\n     * - Non-copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test» : private boost::noncopyable\n    {\n    public:\n\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~«Test»();\n\n    protected:\n\n        /**\n         * Default constructor.\n         * «@throw »\n         */\n        «Test»();\n    };\n    EOF\n  end\n\n  specify \"base_class noncopyable, no implicit definitions\", :cpp11, :noncopyable, :defaulted do\n    vim.command('silent! unlet g:cpp_noncopyable_class')\n    vim.command(\"let g:cpp_std_flavour = 11\")\n    vim.command(\"let g:cpp_explicit_default = 1\")\n    expect(vim.command('MuTemplate cpp/base-class')).to match(/^$|#include <boost\\/noncopyable.hpp> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <boost/noncopyable.hpp>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Entity\n     * - Non-copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test» : private boost::noncopyable\n    {\n    public:\n\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~«Test»();\n\n    protected:\n\n        «Test»() = default;\n\n    private:\n\n        «Test»(«Test» const&) = delete;\n        «Test»& operator=(«Test» const&) = delete;\n    };\n    EOF\n  end\n\n  specify \"base_class C++98 alone\", :cpp98, :deleted do\n    vim.command('let g:cpp_noncopyable_class=\"\"')\n    vim.command('let g:cpp_std_flavour = 03')\n    expect(vim.command('MuTemplate cpp/base-class')).to eq \"\"\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Entity\n     * - Non-copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~«Test»();\n\n    protected:\n\n        /**\n         * Default constructor.\n         * «@throw »\n         */\n        «Test»();\n\n    private:\n\n        «Test»(«Test» const&) /* = delete */;\n        «Test»& operator=(«Test» const&) /* = delete */;\n    };\n    EOF\n  end\n\n  specify \"base_class C++11 alone, w/ implicit definition\", :cpp11, :deleted do\n    vim.command('let g:cpp_noncopyable_class = \"\"')\n    vim.command('let g:cpp_std_flavour = 11')\n    expect(vim.command('MuTemplate cpp/base-class')).to eq \"\"\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Entity\n     * - Non-copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~«Test»();\n\n    protected:\n\n        /**\n         * Default constructor.\n         * «@throw »\n         */\n        «Test»();\n\n    private:\n\n        «Test»(«Test» const&) = delete;\n        «Test»& operator=(«Test» const&) = delete;\n    };\n    EOF\n  end\n\n  specify \"base_class C++11 alone, no implicit definition\", :cpp11, :deleted, :defaulted do\n    vim.command('let g:cpp_noncopyable_class = \"\"')\n    vim.command('let g:cpp_std_flavour = 11')\n    vim.command(\"let g:cpp_explicit_default = 1\")\n    expect(vim.command('MuTemplate cpp/base-class')).to eq \"\"\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Entity\n     * - Non-copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~«Test»();\n\n    protected:\n\n        «Test»() = default;\n\n    private:\n\n        «Test»(«Test» const&) = delete;\n        «Test»& operator=(«Test» const&) = delete;\n    };\n    EOF\n  end\n\n\nend\n\n# vim:set sw=2:\n"
  },
  {
    "path": "spec/class-with-attributes_spec.rb",
    "content": "# encoding: UTF-8\nrequire 'spec_helper'\nrequire 'pp'\n\n\nRSpec.describe \"C++ class w/ attributes wizard\", :cpp, :class, :with_attributes do\n  let (:filename) { \"test.cpp\" }\n\n  # ====[ Executed once before all test {{{2\n  before :all do\n    if !defined? vim.runtime\n        vim.define_singleton_method(:runtime) do |path|\n            self.command(\"runtime #{path}\")\n        end\n    end\n    vim.runtime('spec/support/input-mock.vim')\n    expect(vim.command('verbose function lh#ui#input')).to match(/input-mock.vim/)\n    expect(vim.echo('lh#mut#dirs#get_templates_for(\"cpp/value-class\")')).to match(/value-class.template/)\n    expect(vim.echo('lh#style#clear()')).to eq '0'\n    vim.command('UseStyle breakbeforebraces=stroustrup -ft=c')\n    vim.command('UseStyle spacesbeforeparens=control-statements -ft=c')\n    vim.command('UseStyle empty_braces=nl -ft=c')\n  end\n\n  # ====[ Always executed before each test {{{2\n  before :each do\n    vim.command('filetype plugin on')\n    vim.command(\"file #{filename}\")\n    vim.set('ft=cpp')\n    vim.set('expandtab')\n    vim.set('sw=4')\n    vim.command('silent! unlet g:cpp_explicit_default')\n    vim.command('silent! unlet g:cpp_std_flavour')\n    clear_buffer\n    set_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    EOF\n    vim.command(%Q{call append(1, ['', ''])})\n    expect(vim.echo('line(\"$\")')).to eq '3'\n    expect(vim.echo('setpos(\".\", [1,3,1,0])')).to eq '0'\n    expect(vim.echo('line(\".\")')).to eq '3'\n  end\n\n  specify \"attribute-class copy-neutral, C++98\", :cpp98 do\n    expect(vim.command('call lh#mut#expand_and_jump(0, \"cpp/internals/class-skeleton\", {\"attributes\": [{\"name\": \"foo\", \"type\": \"int\"}, {\"name\": \"str\", \"type\": \"string\", \"functions\": [\"set\", \"get\"]}, {\"name\": \"bar\", \"type\": \"Bar\", \"includes\":\"bar.h\"}]})')).to match(/^$|#include <string> added/)\n    vim.feedkeys('\\<c-\\>\\<c-n>:silent! $call append(\"$\", [\"\",\"\"])\\<cr>G')\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <string>\n    #include \"bar.h\"\n\n    /**\n     * «Test».\n     * @invariant «»\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n        /**\n         * Init constructor.\n         * @param[in] foo «foo-explanations»\n         * @param[in] str «str-explanations»\n         * @param[in] bar «bar-explanations»\n         * «@throw »\n         */\n        «Test»(int foo, std::string const& str, Bar const& bar)\n            : m_foo(foo)\n            , m_str(str)\n            , m_bar(bar)\n            {\n            }\n        void setStr(std::string const& str)\n        {\n            m_str = str;\n        }\n        std::string const& getStr() const\n        {\n            return m_str;\n        }\n\n    private:\n\n        int         m_foo;\n        std::string m_str;\n        Bar         m_bar;\n    };\n    EOF\n  end\n\n  specify \"attribute-class copy-neutral, C++11\", :cpp11 do\n    vim.command('silent! let g:cpp_std_flavour=11')\n    expect(vim.command('call lh#mut#expand_and_jump(0, \"cpp/internals/class-skeleton\", {\"attributes\": [{\"name\": \"foo\", \"type\": \"int\"}, {\"name\": \"bar\", \"type\": \"string\", \"functions\": [\"set\", \"get\"]}]})')).to match(/^$|#include <string> added/)\n    vim.feedkeys('\\<c-\\>\\<c-n>:silent! $call append(\"$\", [\"\",\"\"])\\<cr>G')\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <string>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n        /**\n         * Init constructor.\n         * @param[in] foo «foo-explanations»\n         * @param[in] bar «bar-explanations»\n         * «@throw »\n         */\n        «Test»(int foo, std::string const& bar)\n            : m_foo(foo)\n            , m_bar(bar)\n            {\n            }\n        void setBar(std::string const& bar)\n        {\n            m_bar = bar;\n        }\n        std::string const& getBar() const\n        {\n            return m_bar;\n        }\n\n    private:\n\n        int         m_foo;\n        std::string m_bar;\n    };\n    EOF\n  end\n\n\nend\n\n# vim:set sw=2:\n"
  },
  {
    "path": "spec/clonable-class_spec.rb",
    "content": "# encoding: UTF-8\nrequire 'spec_helper'\nrequire 'pp'\n\n\nRSpec.describe \"C++ clonable class wizard\", :clonable, :cpp, :class do\n  let (:filename) { \"test.cpp\" }\n\n  # ====[ Executed once before all test {{{2\n  before :all do\n    if !defined? vim.runtime\n        vim.define_singleton_method(:runtime) do |path|\n            self.command(\"runtime #{path}\")\n        end\n    end\n    vim.runtime('spec/support/input-mock.vim')\n    expect(vim.command('verbose function lh#ui#input')).to match(/input-mock.vim/)\n    expect(vim.echo('lh#mut#dirs#get_templates_for(\"cpp/clonable-class\")')).to match(/clonable-class.template/)\n    expect(vim.echo('lh#style#clear()')).to eq '0'\n    vim.command('UseStyle breakbeforebraces=stroustrup -ft=c')\n    vim.command('UseStyle spacesbeforeparens=control-statements -ft=c')\n    vim.command('UseStyle empty_braces=nl -ft=c')\n  end\n\n  # ====[ Always executed before each test {{{2\n  before :each do\n    vim.command('filetype plugin on')\n    vim.command(\"file #{filename}\")\n    vim.set('ft=cpp')\n    vim.set('expandtab')\n    vim.set('sw=4')\n    vim.command('silent! unlet g:cpp_explicit_default')\n    vim.command('silent! unlet g:cpp_std_flavour')\n    clear_buffer\n    set_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    EOF\n    vim.command(%Q{call append(1, ['', ''])})\n    expect(vim.echo('line(\"$\")')).to eq '3'\n    expect(vim.echo('setpos(\".\", [1,3,1,0])')).to eq '0'\n    expect(vim.echo('line(\".\")')).to eq '3'\n  end\n\n  # ===============[ The base class ]=============\n\n  specify \"clonable_class noncopyable, with implicit definitions\", :cpp98, :cpp11, :noncopyable do\n    vim.command('silent! unlet g:cpp_noncopyable_class')\n    expect(vim.command('MuTemplate cpp/clonable-class')).to match(/^$|#include <memory> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <memory>\n    #include <boost/noncopyable.hpp>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Clonable (but not assignable)\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test» : private boost::noncopyable\n    {\n    public:\n\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~«Test»();\n        virtual std::auto_ptr<«Test»> clone() const\n        {\n            return std::auto_ptr<«Test»>(new «Test»(*this));\n        }\n\n    protected:\n\n        /**\n         * Default constructor.\n         * «@throw »\n         */\n        «Test»();\n        «Test»(«Test» const&) /* = default */;\n    };\n    EOF\n  end\n\n  specify \"clonable_class noncopyable, no implicit definitions, C++11\", :cpp11, :noncopyable, :defaulted do\n    vim.command('silent! unlet g:cpp_noncopyable_class')\n    vim.command(\"let g:cpp_std_flavour = 11\")\n    vim.command(\"let g:cpp_explicit_default = 1\")\n    expect(vim.command('MuTemplate cpp/clonable-class')).to match(/^$|#include <memory> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <memory>\n    #include <boost/noncopyable.hpp>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Clonable (but not assignable)\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test» : private boost::noncopyable\n    {\n    public:\n\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~«Test»();\n        virtual std::unique_ptr<«Test»> clone() const\n        {\n            return std::unique_ptr<«Test»>(new «Test»(*this));\n        }\n\n    protected:\n\n        «Test»() = default;\n        «Test»(«Test» const&) = default;\n\n    private:\n\n        «Test»& operator=(«Test» const&) = delete;\n    };\n    EOF\n  end\n\n  specify \"clonable_class noncopyable, no implicit definitions, C++14\", :cpp14, :noncopyable, :defaulted do\n    vim.command('silent! unlet g:cpp_noncopyable_class')\n    vim.command(\"let g:cpp_std_flavour = 14\")\n    vim.command(\"let g:cpp_explicit_default = 1\")\n    expect(vim.command('MuTemplate cpp/clonable-class')).to match(/^$|#include <memory> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <memory>\n    #include <boost/noncopyable.hpp>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Clonable (but not assignable)\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test» : private boost::noncopyable\n    {\n    public:\n\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~«Test»();\n        virtual std::unique_ptr<«Test»> clone() const\n        {\n            return std::make_unique(*this);\n        }\n\n    protected:\n\n        «Test»() = default;\n        «Test»(«Test» const&) = default;\n\n    private:\n\n        «Test»& operator=(«Test» const&) = delete;\n    };\n    EOF\n  end\n\n  specify \"clonable_class C++98 alone\", :cpp98, :deleted do\n    vim.command('let g:cpp_noncopyable_class=\"\"')\n    vim.command('let g:cpp_std_flavour = 03')\n    expect(vim.command('MuTemplate cpp/clonable-class')).to match(/^$|#include <memory> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <memory>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Clonable (but not assignable)\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~«Test»();\n        virtual std::auto_ptr<«Test»> clone() const\n        {\n            return std::auto_ptr<«Test»>(new «Test»(*this));\n        }\n\n    protected:\n\n        /**\n         * Default constructor.\n         * «@throw »\n         */\n        «Test»();\n        «Test»(«Test» const&) /* = default */;\n\n    private:\n\n        «Test»& operator=(«Test» const&) /* = delete */;\n    };\n    EOF\n  end\n\n  specify \"clonable_class C++11 alone, w/ implicit definition\", :cpp11, :deleted do\n    vim.command('let g:cpp_noncopyable_class = \"\"')\n    vim.command('let g:cpp_std_flavour = 11')\n    expect(vim.command('MuTemplate cpp/clonable-class')).to match(/^$|#include <memory> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <memory>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Clonable (but not assignable)\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~«Test»();\n        virtual std::unique_ptr<«Test»> clone() const\n        {\n            return std::unique_ptr<«Test»>(new «Test»(*this));\n        }\n\n    protected:\n\n        /**\n         * Default constructor.\n         * «@throw »\n         */\n        «Test»();\n        «Test»(«Test» const&) = default;\n\n    private:\n\n        «Test»& operator=(«Test» const&) = delete;\n    };\n    EOF\n  end\n\n  specify \"clonable_class C++11 alone, no implicit definition\", :cpp11, :deleted, :defaulted do\n    vim.command('let g:cpp_noncopyable_class = \"\"')\n    vim.command('let g:cpp_std_flavour = 11')\n    vim.command(\"let g:cpp_explicit_default = 1\")\n    expect(vim.command('MuTemplate cpp/clonable-class')).to match(/^$|#include <memory> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <memory>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Clonable (but not assignable)\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~«Test»();\n        virtual std::unique_ptr<«Test»> clone() const\n        {\n            return std::unique_ptr<«Test»>(new «Test»(*this));\n        }\n\n    protected:\n\n        «Test»() = default;\n        «Test»(«Test» const&) = default;\n\n    private:\n\n        «Test»& operator=(«Test» const&) = delete;\n    };\n    EOF\n  end\n\n  # ===============[ base class + cloable child ]=============\n\n  specify \"clonable_class base noncopyable, with implicit definitions + child\", :cpp98, :cpp11, :noncopyable, :clonable_child do\n    vim.command('silent! unlet g:cpp_noncopyable_class')\n    # expect(vim.command('MuTemplate cpp/clonable-class')).to match(/^$|#include <memory> added/)\n    expect(vim.command('call lh#mut#expand_and_jump(0, \"cpp/clonable-class\", {\"clsname\": \"base\"})')).to match(/^$|#include <memory> added/)\n    # vim.feedkeys('\\<esc>G')\n    # vim.type('<c-\\><c-n>$:put=\"\"<cr>$:put=\"\"<cr>G')\n    vim.feedkeys('\\<c-\\>\\<c-n>:silent! $call append(\"$\", [\"\",\"\"])\\<cr>G')\n    vim.write()\n    # pp vim.echo('expand(\"%:p\")')\n    # pp system('pwd')\n    expect(system(\"ctags --c++-kinds=+p --fields=+imaS --extras=+q --language-force=C++ -f tags #{filename}\")).to be true\n    vim.command(\"let b:tags_dirname = expand('%:p:h')\")\n\n    expect(vim.command('call lh#mut#expand_and_jump(0, \"cpp/clonable-class\", {\"clsname\": \"child\", \"parents\": [{\"base\": {}}]})')).to match(/^$|memory is already included/)\n    # pp vim.echo('g:root_clones')\n\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <memory>\n    #include <boost/noncopyable.hpp>\n\n    /**\n     * base.\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Clonable (but not assignable)\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class base : private boost::noncopyable\n    {\n    public:\n\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~base();\n        virtual std::auto_ptr<base> clone() const\n        {\n            return std::auto_ptr<base>(new base(*this));\n        }\n\n    protected:\n\n        /**\n         * Default constructor.\n         * «@throw »\n         */\n        base();\n        base(base const&) /* = default */;\n    };\n\n    /**\n     * child.\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Clonable (but not assignable)\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class child : public base\n    {\n    public:\n\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~child();\n        /**\n         * Init constructor.\n         * @param «ctr-parameters» «»\n         * «@throw »\n         */\n        child(«ctr-parameters»);\n        virtual std::auto_ptr<base> clone() const /* override */\n        {\n            return std::auto_ptr<base>(new child(*this));\n        }\n\n    protected:\n\n        child(child const&) /* = default */;\n    };\n    EOF\n  end\nend\n\n# vim:set sw=2:\n"
  },
  {
    "path": "spec/constructor-command_spec.rb",
    "content": "# encoding: UTF-8\nrequire 'spec_helper'\nrequire 'pp'\n\n\n# ======[ :Constructor {{{1\n# Tests with parameters are done in *-class_spec.rb tests\n# Test expanding with <Plug>MuT_ckword don't seem to work correctly\n# TODO: C++11\nRSpec.describe \":Constructor command\", :cpp, :ctr_cmd do\n  let (:filename) { \"test.cpp\" }\n\n  # ====[ Executed once before all test {{{2\n  before :all do\n    if !defined? vim.runtime\n        vim.define_singleton_method(:runtime) do |path|\n            self.command(\"runtime #{path}\")\n        end\n    end\n    vim.runtime('spec/support/input-mock.vim')\n    expect(vim.command('verbose function lh#ui#input')).to match(/input-mock.vim/)\n    vim.set('report=9999')\n    expect(vim.echo('lh#mut#dirs#get_templates_for(\"cpp/value-class\")')).to match(/value-class.template/)\n    expect(vim.echo('lh#style#clear()')).to eq '0'\n    vim.command('UseStyle breakbeforebraces=stroustrup -ft=c')\n    vim.command('UseStyle spacesbeforeparens=control-statements -ft=c')\n    vim.command('UseStyle empty_braces=empty -ft=c')\n  end\n\n  # ====[ Always executed before each test {{{2\n  before :each do\n    vim.command('filetype plugin on')\n    vim.command(\"file #{filename}\")\n    vim.set('ft=cpp')\n    vim.set('expandtab')\n    vim.set('sw=4')\n    vim.command('silent! unlet g:cpp_explicit_default')\n    vim.command('silent! unlet g:cpp_std_flavour')\n    vim.command('silent! unlet g:mocked_input')\n    vim.command('silent! unlet g:mocked_confirm')\n    vim.command('silent! unlet g:cpp_use_copy_and_swap')\n    clear_buffer\n    set_buffer_contents <<-EOF\n      class Foo {\n      public:\n\n      private:\n          std::string m_bar;\n          int * m_foo;\n      };\n    EOF\n    vim.write()\n    vim.feedkeys('a\\<esc>') # pause\n    # expect(system(\"ctags --c++-kinds=+p --fields=+imaS --extras=+q --language-force=C++ -f tags #{filename}\")).to be true\n    # system('less tags')\n    vim.command(\"let b:tags_dirname = expand('%:p:h')\")\n    vim.command(\"let &l:tags.=','.b:tags_dirname.'/tags'\")\n    # system('echo \"'+vim.echo('lh#dev#class#attributes(\"Foo\")')+'\"')\n    assert_buffer_contents <<-EOF\n      class Foo {\n      public:\n\n      private:\n          std::string m_bar;\n          int * m_foo;\n      };\n    EOF\n    expect(vim.echo('line(\"$\")')).to eq '7'\n    expect(vim.echo('setpos(\".\", [1,3,1,0])')).to eq '0'\n    expect(vim.echo('line(\".\")')).to eq '3'\n  end\n\n  # ====[ default constructor {{{2\n  context \"when expanding default-constructor\", :default_ctr do\n\n    it \"has a pointer attribute\" do # {{{3\n      # TODO: In C++11, no need for m_bar() if there is a default\n      # initialisation at class scope\n      # expect(vim.echo('lh#dev#class#attributes(\"Foo\")')).to eq('m_bar')\n      # expect(vim.echo('lh#cpp#constructors#debug(\"s:Attributes(\\\"Foo\\\")\")')).to eq('m_bar')\n      # vim.command('Constructor default')\n      vim.echo('lh#cpp#constructors#Main(\"default\")')\n      # expect(vim.echo('g:step.\"--\".string(g:implproto)')).to eq('42')\n      # expect(vim.echo('g:step')).to eq('42')\n      vim.feedkeys('a\\<esc>') # pause\n      assert_buffer_contents <<-EOF\n        class Foo {\n        public:\n            /**\n             * Default constructor.\n             * «@throw »\n             */\n            Foo();\n        private:\n            std::string m_bar;\n            int * m_foo;\n        };\n\n        Foo::Foo()\n        : m_bar()\n        , m_foo()\n        {}\n      EOF\n    end\n\n  end # }}}3\n\n  # ====[ copy-constructor {{{2\n  context \"when expanding copy-constructor\", :copy_ctr do\n    it \"has a pointer attribute\" do # {{{3\n      # vim.command('Constructor copy')\n      vim.echo('lh#cpp#constructors#Main(\"copy\")')\n      vim.feedkeys('a\\<esc>') # pause\n      assert_buffer_contents <<-EOF\n        class Foo {\n        public:\n            /**\n             * Copy constructor.\n             * @param[in] rhs source data to be copied.\n             * «@throw »\n             */\n            Foo(Foo const& rhs);\n        private:\n            std::string m_bar;\n            int * m_foo;\n        };\n\n        Foo::Foo(Foo const& rhs)\n        : m_bar(rhs.m_bar)\n        , m_foo(«duplicate(rhs.m_foo)»)\n        {}\n      EOF\n    end\n\n  end # }}}3\n\n  # ====[ assignment-operator {{{2\n  context \"when expanding assignment-operator\", :assign_copy do\n\n    it \"has a pointer attribute\" do # {{{3\n      vim.command('let g:mocked_confirm = 0')\n      # expect(vim.echo('lh#dev#class#attributes(\"Foo\")')).to eq('m_bar')\n      # expect(vim.echo('lh#cpp#constructors#debug(\"s:Attributes(\\\"Foo\\\")\")')).to eq('m_bar')\n      vim.echo('lh#cpp#constructors#Main(\"assign\")')\n      # expect(vim.echo('lh#cpp#constructors#Main(\"assign\")')).to eq '0'\n      # vim.command('Constructor assign')\n      # expect(vim.echo('string(g:implproto)')).to eq('42')\n      # expect(vim.echo('g:step')).to eq('42')\n      vim.feedkeys('a\\<esc>') # pause\n      assert_buffer_contents <<-EOF\n        class Foo {\n        public:\n            /**\n             * Assignment operator.\n             * @param[in] rhs source data to be copied.\n             * «@throw »\n             */\n            Foo& operator=(Foo const& rhs);\n        private:\n            std::string m_bar;\n            int * m_foo;\n        };\n\n        Foo& Foo::operator=(Foo const& rhs)\n        {\n            m_bar = rhs.m_bar;\n            m_foo = «duplicate(rhs.m_foo)»;\n        }\n      EOF\n    end\n\n  end # }}}3\n\n  # ====[ copy'n'swap {{{2\n  context \"when expanding copy-and-swap\", :copy_n_swap do\n\n    it \"has a pointer attribute\" do # {{{3\n      vim.command('let g:mocked_confirm = 1')\n      # vim.command('Constructor assign')\n      vim.echo('lh#cpp#constructors#Main(\"assign\")')\n      vim.feedkeys('a\\<esc>') # pause\n      assert_buffer_contents <<-EOF\n        class Foo {\n        public:\n            /**\n             * Assignment operator.\n             * @param[in] rhs source data to be copied.\n             * «@throw »\n             *\n             * @note based on copy-and-swap idiom, with copy-elision exploited\n             * @note exception-safe\n             */\n            Foo& operator=(Foo rhs)\n            {\n                this->swap(rhs);\n                return *this;\n            }\n            /**\n             * Swap operation.\n             * @param[in,out] other data with which content is swapped\n             * @throw None\n             */\n            void swap(Foo & other) throw();\n        private:\n            std::string m_bar;\n            int * m_foo;\n        };\n\n        void Foo::swap(Foo & other) throw()\n        {\n            using std::swap;\n            swap(m_bar, other.m_bar);\n            swap(m_foo, other.m_foo);\n        }\n        EOF\n    end\n\n  end # }}}3\n\n  # ====[ init constructor {{{2\n  # No test for init-constructor as it requires a user-interaction and\n  # vimrunner+vim client-server architecture doesn't work very-well together\n\n# }}}2\nend\n\n# }}}1\n# vim:set sw=2:fdm=marker:\n"
  },
  {
    "path": "spec/deps_spec.rb",
    "content": "# encoding: UTF-8\nrequire 'spec_helper'\nrequire 'pp'\n\n\nRSpec.describe \"C++ check dependencies are loaded\", :cpp, :deps do\n  let (:filename) { \"test.cpp\" }\n\n  before :each do\n    # expect(vim.echo('&enc')).to eq 'utf-8'\n    # vim.command('let b:marker_open = \"\\u00AB\"')\n    # vim.command('let b:marker_close = \"\\u00BB\"')\n    # expect(vim.echo('b:marker_open')).to eq '«'\n    # expect(vim.echo('lh#marker#open()')).to eq '«'\n    vim.command('filetype plugin on')\n    vim.command(\"file #{filename}\")\n    vim.set('ft=cpp')\n    vim.set('expandtab')\n    vim.set('sw=4')\n    vim.command('silent! unlet g:cpp_explicit_default')\n    vim.command('silent! unlet g:cpp_std_flavour')\n    clear_buffer\n  end\n\n  it \"has loaded C++ ftplugin\" do\n    # pp vim.echo('&rtp')\n    # pp vim.command(':scriptnames')\n    expect(/plugin.mu-template\\.vim/).to be_sourced\n    # expect(/ftplugin.cpp.cpp_snippets\\.vim/).to be_sourced\n    vim.command('call lh#mut#dirs#update()')\n    expect(vim.echo('g:lh#mut#dirs#cache')).to match(/cpp/)\n    # pp vim.echo('g:lh#mut#dirs#cache')\n\n    expect(vim.echo('lh#naming#type(\"toto\")')).to eq \"Toto\"\n  end\n\nend\n"
  },
  {
    "path": "spec/empty-exception-class_spec.rb",
    "content": "# encoding: UTF-8\nrequire 'spec_helper'\nrequire 'pp'\n\n\nRSpec.describe \"C++ empty-exception class wizard\", :empty_exception, :cpp, :class do\n  let (:filename) { \"test.cpp\" }\n\n  # ====[ Executed once before all test {{{2\n  before :all do\n    if !defined? vim.runtime\n        vim.define_singleton_method(:runtime) do |path|\n            self.command(\"runtime #{path}\")\n        end\n    end\n    vim.runtime('spec/support/input-mock.vim')\n    expect(vim.command('verbose function lh#ui#input')).to match(/input-mock.vim/)\n    expect(vim.echo('lh#mut#dirs#get_templates_for(\"cpp/empty-exception-class\")')).to match(/empty-exception-class.template/)\n  end\n\n  # ====[ Always executed before each test {{{2\n  before :each do\n    vim.command('filetype plugin on')\n    vim.command(\"file #{filename}\")\n    vim.set('ft=cpp')\n    vim.set('expandtab')\n    vim.set('sw=4')\n    vim.command('silent! unlet g:cpp_explicit_default')\n    vim.command('silent! unlet g:cpp_std_flavour')\n    clear_buffer\n    set_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    EOF\n    vim.command(%Q{call append(1, ['', ''])})\n    expect(vim.echo('line(\"$\")')).to eq '3'\n    expect(vim.echo('setpos(\".\", [1,3,1,0])')).to eq '0'\n    expect(vim.echo('line(\".\")')).to eq '3'\n  end\n\n\n  specify \"empty_exception_class noncopyable, with implicit definitions, C++98\", :cpp98 do\n    expect(vim.command('MuTemplate cpp/empty-exception-class')).to match(/^$|#include <stdexcept> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <stdexcept>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Exception class\n     * - Copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test» : public std::runtime_error\n    {\n    public:\n\n        /**\n         * Init constructor.\n         * @param «ctr-parameters» «»\n         * «@throw »\n         */\n        «Test»(«ctr-parameters»);\n    };\n    EOF\n  end\n\n  specify \"empty_exception_class noncopyable, with implicit definitions, C++11\", :cpp11 do\n    vim.command('let g:cpp_std_flavour = 11')\n    expect(vim.command('MuTemplate cpp/empty-exception-class')).to match(/^$|#include <stdexcept> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <stdexcept>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Exception class\n     * - Copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test» : public std::runtime_error\n    {\n    public:\n\n        using std::runtime_error::runtime_error;\n    };\n    EOF\n  end\n\n  specify \"empty_exception_class noncopyable, no implicit definitions, C++11\", :cpp11, :defaulted do\n    vim.command('let g:cpp_std_flavour = 11')\n    vim.command(\"let g:cpp_explicit_default = 1\")\n    expect(vim.command('MuTemplate cpp/empty-exception-class')).to match(/^$|#include <stdexcept> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <stdexcept>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Exception class\n     * - Copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test» : public std::runtime_error\n    {\n    public:\n\n        «Test»(«Test» const&) = default;\n        «Test»& operator=(«Test» const&) = default;\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~«Test»() = default;\n        using std::runtime_error::runtime_error;\n    };\n    EOF\n  end\n\nend\n\n# vim:set sw=2:\n\n"
  },
  {
    "path": "spec/exception-class_spec.rb",
    "content": "# encoding: UTF-8\nrequire 'spec_helper'\nrequire 'pp'\n\n\nRSpec.describe \"C++ exception class wizard\", :exception, :cpp, :class do\n  let (:filename) { \"test.cpp\" }\n\n  # ====[ Executed once before all test {{{2\n  before :all do\n    if !defined? vim.runtime\n        vim.define_singleton_method(:runtime) do |path|\n            self.command(\"runtime #{path}\")\n        end\n    end\n    vim.runtime('spec/support/input-mock.vim')\n    expect(vim.command('verbose function lh#ui#input')).to match(/input-mock.vim/)\n    expect(vim.echo('lh#mut#dirs#get_templates_for(\"cpp/exception-class\")')).to match(/exception-class.template/)\n  end\n\n  # ====[ Always executed before each test {{{2\n  before :each do\n    vim.command('filetype plugin on')\n    vim.command(\"file #{filename}\")\n    vim.set('ft=cpp')\n    vim.set('expandtab')\n    vim.set('sw=4')\n    vim.command('silent! unlet g:cpp_explicit_default')\n    vim.command('silent! unlet g:cpp_std_flavour')\n    vim.command('silent! unlet g:cpp_root_exception')\n    clear_buffer\n    set_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    EOF\n    vim.command(%Q{call append(1, ['', ''])})\n    expect(vim.echo('line(\"$\")')).to eq '3'\n    expect(vim.echo('setpos(\".\", [1,3,1,0])')).to eq '0'\n    expect(vim.echo('line(\".\")')).to eq '3'\n  end\n\n\n  specify \"exception_class, with implicit definitions, C++98\", :cpp98 do\n    expect(vim.command('MuTemplate cpp/exception-class')).to match(/^$|#include <stdexcept> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <stdexcept>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Exception class\n     * - Copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test» : public std::runtime_error\n    {\n    public:\n\n        /**\n         * Init constructor.\n         * @param «ctr-parameters» «»\n         * «@throw »\n         */\n        «Test»(«ctr-parameters»);\n        virtual char const* what() const throw() /* override */;\n    };\n    EOF\n  end\n\n  specify \"exception_class, with implicit definitions, C++11\", :cpp11 do\n    vim.command('let g:cpp_std_flavour = 11')\n    expect(vim.command('MuTemplate cpp/exception-class')).to match(/^$|#include <stdexcept> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <stdexcept>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Exception class\n     * - Copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test» : public std::runtime_error\n    {\n    public:\n\n        using std::runtime_error::runtime_error;\n        virtual char const* what() const noexcept override;\n    };\n    EOF\n  end\n\n  specify \"exception_class, no implicit definitions, C++11\", :cpp11, :defaulted do\n    vim.command('let g:cpp_std_flavour = 11')\n    vim.command(\"let g:cpp_explicit_default = 1\")\n    expect(vim.command('MuTemplate cpp/exception-class')).to match(/^$|#include <stdexcept> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <stdexcept>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Exception class\n     * - Copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test» : public std::runtime_error\n    {\n    public:\n\n        «Test»(«Test» const&) = default;\n        «Test»& operator=(«Test» const&) = default;\n        /**\n         * Virtual destructor.\n         * @throw Nothing\n         */\n        virtual ~«Test»() = default;\n        using std::runtime_error::runtime_error;\n        virtual char const* what() const noexcept override;\n    };\n    EOF\n  end\n\n  # ----------------------------------------------------------------------\n  specify \"domain (param) exception_class, with implicit definitions, C++98\", :cpp98 do\n    expect(vim.command('call lh#mut#expand_and_jump(0, \"cpp/exception-class\", {\"root-exception\": {\"std::logic_error\": {\"includes\": \"<stdexcept>\"}}})')).to match(/^$|#include <stdexcept> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <stdexcept>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Exception class\n     * - Copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test» : public std::logic_error\n    {\n    public:\n\n        /**\n         * Init constructor.\n         * @param «ctr-parameters» «»\n         * «@throw »\n         */\n        «Test»(«ctr-parameters»);\n        virtual char const* what() const throw() /* override */;\n    };\n    EOF\n  end\n\n  specify \"domain (option) exception_class, with implicit definitions, C++98\", :cpp98 do\n    vim.command('let g:cpp_root_exception = {\"std::logic_error\": {\"includes\": \"<stdexcept>\"}}')\n    expect(vim.command('MuTemplate cpp/exception-class')).to match(/^$|#include <stdexcept> added/)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <stdexcept>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Exception class\n     * - Copyable\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test» : public std::logic_error\n    {\n    public:\n\n        /**\n         * Init constructor.\n         * @param «ctr-parameters» «»\n         * «@throw »\n         */\n        «Test»(«ctr-parameters»);\n        virtual char const* what() const throw() /* override */;\n    };\n    EOF\n  end\n\n\nend\n\n# vim:set sw=2:\n"
  },
  {
    "path": "spec/spe_func_spec.rb",
    "content": "# encoding: UTF-8\nrequire 'spec_helper'\nrequire 'pp'\n\n\n# ======[ Special functions {{{1\n# Tests with parameters are done in *-class_spec.rb tests\n# Test expanding with <Plug>MuT_ckword don't seem to work correctly\n# TODO: C++11\nRSpec.describe \"Special functions\", :cpp, :spe_func do\n  let (:filename) { \"test.cpp\" }\n\n  before :all do\n    if !defined? vim.runtime\n        vim.define_singleton_method(:runtime) do |path|\n            self.command(\"runtime #{path}\")\n        end\n    end\n    vim.runtime('spec/support/input-mock.vim')\n    expect(vim.command('verbose function lh#ui#input')).to match(/input-mock.vim/)\n    expect(vim.echo('lh#style#clear()')).to eq '0'\n    vim.command('UseStyle breakbeforebraces=stroustrup -ft=c')\n    vim.command('UseStyle spacesbeforeparens=control-statements -ft=c')\n    vim.command('UseStyle empty_braces=nl -ft=c')\n  end\n\n  # ====[ Always executed before each test {{{2\n  before :each do\n    vim.command('filetype plugin on')\n    vim.command(\"file #{filename}\")\n    vim.set('ft=cpp')\n    vim.set('expandtab')\n    vim.set('sw=4')\n    vim.command('silent! unlet g:cpp_explicit_default')\n    vim.command('silent! unlet g:cpp_std_flavour')\n    vim.command('silent! unlet g:mocked_input')\n    vim.command('silent! unlet g:mocked_confirm')\n    vim.command('silent! unlet g:cpp_use_copy_and_swap')\n    clear_buffer\n  end\n\n  # ====[ default constructor {{{2\n  context \"when expanding default-constructor\", :default_ctr do\n    it \"asks the user, when the only context is the filename\" do\n      expect(vim.command('MuTemplate cpp/default-constructor')).to match(/^$/)\n        assert_buffer_contents <<-EOF\n        /**\n         * Default constructor.\n         * «@throw »\n         */\n        «Test»();\n        EOF\n    end\n\n    it \"takes the class name as a parameter\" do\n      expect(vim.command('MuTemplate cpp/default-constructor FooBar')).to match(/^$/)\n        assert_buffer_contents <<-EOF\n        /**\n         * Default constructor.\n         * «@throw »\n         */\n        FooBar();\n        EOF\n    end\n\n    it \"recognizes it's within a class definition\" do\n      set_buffer_contents <<-EOF\n      class Foo {\n\n      };\n      EOF\n      assert_buffer_contents <<-EOF\n      class Foo {\n\n      };\n      EOF\n      expect(vim.echo('line(\"$\")')).to eq '3'\n      expect(vim.echo('setpos(\".\", [1,2,1,0])')).to eq '0'\n      expect(vim.echo('line(\".\")')).to eq '2'\n      expect(vim.command('MuTemplate cpp/default-constructor')).to match(/^$/)\n      assert_buffer_contents <<-EOF\n      class Foo {\n          /**\n           * Default constructor.\n           * «@throw »\n           */\n          Foo();\n      };\n      EOF\n    end\n  end\n\n  # ====[ copy-constructor {{{2\n  context \"when expanding copy-constructor\", :copy_ctr do\n    it \"asks the user, when the only context is the filename\" do\n      expect(vim.command('MuTemplate cpp/copy-constructor')).to match(/^$/)\n        assert_buffer_contents <<-EOF\n        /**\n         * Copy constructor.\n         * @param[in] rhs source data to be copied.\n         * «@throw »\n         */\n        «Test»(«Test» const& rhs);\n        EOF\n    end\n\n    it \"takes the class name as a parameter\" do\n      expect(vim.command('MuTemplate cpp/copy-constructor FooBar')).to match(/^$/)\n        assert_buffer_contents <<-EOF\n        /**\n         * Copy constructor.\n         * @param[in] rhs source data to be copied.\n         * «@throw »\n         */\n        FooBar(FooBar const& rhs);\n        EOF\n    end\n\n    it \"recognizes it's within a class definition\" do\n      set_buffer_contents <<-EOF\n      class Foo {\n\n      };\n      EOF\n      assert_buffer_contents <<-EOF\n      class Foo {\n\n      };\n      EOF\n      expect(vim.echo('line(\"$\")')).to eq '3'\n      expect(vim.echo('setpos(\".\", [1,2,1,0])')).to eq '0'\n      expect(vim.echo('line(\".\")')).to eq '2'\n      expect(vim.command('MuTemplate cpp/copy-constructor')).to match(/^$/)\n      assert_buffer_contents <<-EOF\n      class Foo {\n          /**\n           * Copy constructor.\n           * @param[in] rhs source data to be copied.\n           * «@throw »\n           */\n          Foo(Foo const& rhs);\n      };\n      EOF\n    end\n  end\n\n  # ====[ assignment-operator {{{2\n  context \"when expanding assignment-operator\", :assign_copy do\n\n    it \"asks the user, when the only context is the filename (copy'n'swap choice made by user)\" do\n      vim.command('let g:mocked_confirm = 0')\n      expect(vim.command('MuTemplate cpp/assignment-operator')).to match(/^$/)\n        assert_buffer_contents <<-EOF\n        /**\n         * Assignment operator.\n         * @param[in] rhs source data to be copied.\n         * «@throw »\n         */\n        «Test»& operator=(«Test» const& rhs);\n        EOF\n    end\n\n    it \"asks the user, when the only context is the filename\" do\n      vim.command('let g:cpp_use_copy_and_swap = 0')\n      expect(vim.command('MuTemplate cpp/assignment-operator')).to match(/^$/)\n        assert_buffer_contents <<-EOF\n        /**\n         * Assignment operator.\n         * @param[in] rhs source data to be copied.\n         * «@throw »\n         */\n        «Test»& operator=(«Test» const& rhs);\n        EOF\n    end\n\n    it \"takes the class name as a parameter (copy'n'swap choice made by user)\" do\n      vim.command('let g:mocked_confirm = 0')\n      expect(vim.command('MuTemplate cpp/assignment-operator FooBar')).to match(/^$/)\n        assert_buffer_contents <<-EOF\n        /**\n         * Assignment operator.\n         * @param[in] rhs source data to be copied.\n         * «@throw »\n         */\n        FooBar& operator=(FooBar const& rhs);\n        EOF\n    end\n\n    it \"recognizes it's within a class definition (copy'n'swap choice made by user)\" do\n      vim.command('let g:mocked_confirm = 0')\n      set_buffer_contents <<-EOF\n      class Foo {\n\n      };\n      EOF\n      assert_buffer_contents <<-EOF\n      class Foo {\n\n      };\n      EOF\n      expect(vim.echo('line(\"$\")')).to eq '3'\n      expect(vim.echo('setpos(\".\", [1,2,1,0])')).to eq '0'\n      expect(vim.echo('line(\".\")')).to eq '2'\n      expect(vim.command('MuTemplate cpp/assignment-operator')).to match(/^$/)\n      assert_buffer_contents <<-EOF\n      class Foo {\n          /**\n           * Assignment operator.\n           * @param[in] rhs source data to be copied.\n           * «@throw »\n           */\n          Foo& operator=(Foo const& rhs);\n      };\n      EOF\n    end\n  end\n\n  # ====[ copy'n'swap {{{2\n  context \"when expanding copy-and-swap\", :copy_n_swap do\n\n    it \"asks the user, when the only context is the filename (copy'n'swap choice made by user)\" do\n      vim.command('let g:mocked_confirm = 1')\n      expect(vim.command('MuTemplate cpp/assignment-operator')).to match(/^$/)\n        assert_buffer_contents <<-EOF\n        /**\n         * Assignment operator.\n         * @param[in] rhs source data to be copied.\n         * «@throw »\n         *\n         * @note based on copy-and-swap idiom, with copy-elision exploited\n         * @note exception-safe\n         */\n        «Test»& operator=(«Test» rhs)\n        {\n            this->swap(rhs);\n            return *this;\n        }\n        /**\n         * Swap operation.\n         * @param[in,out] other data with which content is swapped\n         * @throw None\n         */\n        void swap(«Test» & other) throw();\n        EOF\n    end\n\n    it \"asks the user, when the only context is the filename\" do\n      vim.command('let g:cpp_use_copy_and_swap = 1')\n      expect(vim.command('MuTemplate cpp/assignment-operator')).to match(/^$/)\n        assert_buffer_contents <<-EOF\n        /**\n         * Assignment operator.\n         * @param[in] rhs source data to be copied.\n         * «@throw »\n         *\n         * @note based on copy-and-swap idiom, with copy-elision exploited\n         * @note exception-safe\n         */\n        «Test»& operator=(«Test» rhs)\n        {\n            this->swap(rhs);\n            return *this;\n        }\n        /**\n         * Swap operation.\n         * @param[in,out] other data with which content is swapped\n         * @throw None\n         */\n        void swap(«Test» & other) throw();\n        EOF\n    end\n\n    it \"takes the class name as a parameter (copy'n'swap choice made by user)\" do\n      vim.command('let g:mocked_confirm = 1')\n      expect(vim.command('MuTemplate cpp/assignment-operator FooBar')).to match(/^$/)\n        assert_buffer_contents <<-EOF\n        /**\n         * Assignment operator.\n         * @param[in] rhs source data to be copied.\n         * «@throw »\n         *\n         * @note based on copy-and-swap idiom, with copy-elision exploited\n         * @note exception-safe\n         */\n        FooBar& operator=(FooBar rhs)\n        {\n            this->swap(rhs);\n            return *this;\n        }\n        /**\n         * Swap operation.\n         * @param[in,out] other data with which content is swapped\n         * @throw None\n         */\n        void swap(FooBar & other) throw();\n        EOF\n    end\n\n    it \"recognizes it's within a class definition (copy'n'swap choice made by user)\" do\n      vim.command('let g:mocked_confirm = 1')\n      set_buffer_contents <<-EOF\n      class Foo {\n\n      };\n      EOF\n      assert_buffer_contents <<-EOF\n      class Foo {\n\n      };\n      EOF\n      expect(vim.echo('line(\"$\")')).to eq '3'\n      expect(vim.echo('setpos(\".\", [1,2,1,0])')).to eq '0'\n      expect(vim.echo('line(\".\")')).to eq '2'\n      expect(vim.command('MuTemplate cpp/assignment-operator')).to match(/^$/)\n      assert_buffer_contents <<-EOF\n      class Foo {\n          /**\n           * Assignment operator.\n           * @param[in] rhs source data to be copied.\n           * «@throw »\n           *\n           * @note based on copy-and-swap idiom, with copy-elision exploited\n           * @note exception-safe\n           */\n          Foo& operator=(Foo rhs)\n          {\n              this->swap(rhs);\n              return *this;\n          }\n          /**\n           * Swap operation.\n           * @param[in,out] other data with which content is swapped\n           * @throw None\n           */\n          void swap(Foo & other) throw();\n      };\n      EOF\n    end\n  end\n\n  # ====[ destructor {{{2\n  context \"when expanding destructor\", :destructor do\n    it \"asks the user, when the only context is the filename\" do\n      expect(vim.command('MuTemplate cpp/destructor')).to match(/^$/)\n        assert_buffer_contents <<-EOF\n        /**\n         * «virtual »destructor.\n         * @throw Nothing\n         */\n        «virtual »~«Test»();\n        EOF\n    end\n\n    it \"takes the class name as a parameter\" do\n      expect(vim.command('MuTemplate cpp/destructor FooBar')).to match(/^$/)\n        assert_buffer_contents <<-EOF\n        /**\n         * «virtual »destructor.\n         * @throw Nothing\n         */\n        «virtual »~FooBar();\n        EOF\n    end\n\n    it \"recognizes it's within a class definition\" do\n      set_buffer_contents <<-EOF\n      class Foo {\n\n      };\n      EOF\n      assert_buffer_contents <<-EOF\n      class Foo {\n\n      };\n      EOF\n      expect(vim.echo('line(\"$\")')).to eq '3'\n      expect(vim.echo('setpos(\".\", [1,2,1,0])')).to eq '0'\n      expect(vim.echo('line(\".\")')).to eq '2'\n      expect(vim.command('MuTemplate cpp/destructor')).to match(/^$/)\n      assert_buffer_contents <<-EOF\n      class Foo {\n          /**\n           * «virtual »destructor.\n           * @throw Nothing\n           */\n          «virtual »~Foo();\n      };\n      EOF\n    end\n  end\n\n  # ====[ init constructor {{{2\n  context \"when expanding init-constructor\", :init_ctr do\n    it \"asks the user, when the only context is the filename\" do\n      expect(vim.command('MuTemplate cpp/init-constructor')).to match(/^$/)\n        assert_buffer_contents <<-EOF\n        /**\n         * Init constructor.\n         * @param «ctr-parameters» «»\n         * «@throw »\n         */\n        «Test»(«ctr-parameters»);\n        EOF\n    end\n\n    it \"takes the class name as a parameter\" do\n      expect(vim.command('MuTemplate cpp/init-constructor FooBar')).to match(/^$/)\n        assert_buffer_contents <<-EOF\n        /**\n         * Init constructor.\n         * @param «ctr-parameters» «»\n         * «@throw »\n         */\n        FooBar(«ctr-parameters»);\n        EOF\n    end\n\n    it \"recognizes it's within a class definition\" do\n      set_buffer_contents <<-EOF\n      class Foo {\n\n      };\n      EOF\n      assert_buffer_contents <<-EOF\n      class Foo {\n\n      };\n      EOF\n      expect(vim.echo('line(\"$\")')).to eq '3'\n      expect(vim.echo('setpos(\".\", [1,2,1,0])')).to eq '0'\n      expect(vim.echo('line(\".\")')).to eq '2'\n      expect(vim.command('MuTemplate cpp/init-constructor')).to match(/^$/)\n      assert_buffer_contents <<-EOF\n      class Foo {\n          /**\n           * Init constructor.\n           * @param «ctr-parameters» «»\n           * «@throw »\n           */\n          Foo(«ctr-parameters»);\n      };\n      EOF\n    end\n  end\n\n# }}}2\nend\n\n# }}}1\n# vim:set sw=2:fdm=marker:\n"
  },
  {
    "path": "spec/spec_helper.rb",
    "content": "require 'tmpdir'\nrequire 'vimrunner'\nrequire 'vimrunner/rspec'\nrequire 'support/vim'\nrequire 'rspec/expectations'\nrequire 'support/vim_matchers'\n# require 'simplecov'\n\n# SimpleCov.start\n\nmodule Vimrunner\n  class Client\n    def runtime(script)\n        script_path = Path.new(script)\n        command(\"runtime #{script_path}\")\n    end\n  end\nend\n\n\nVimrunner::RSpec.configure do |config|\n  config.reuse_server = true\n\n  vim_plugin_path = File.expand_path('.')\n  vim_flavor_path = ENV['HOME']+'/.vim/flavors'\n\n  config.start_vim do\n    vim = Vimrunner.start_gvim\n    # vim = Vimrunner.start\n\n    vim.add_plugin(vim_flavor_path, 'bootstrap.vim')\n    vim.prepend_runtimepath(vim_plugin_path+'/after')\n    vim.prepend_runtimepath(vim_plugin_path)\n\n    # lh-UT\n    vim_UT_path      = File.expand_path('../../../vim-UT', __FILE__)\n    vim.prepend_runtimepath(vim_UT_path)\n    vim.runtime('plugin/UT.vim')\n\n    # pp vim_flavor_path\n    # lh-vim-lib\n    vim_lib_path      = File.expand_path('../../../lh-vim-lib', __FILE__)\n    vim.prepend_runtimepath(vim_lib_path)\n    vim.runtime('plugin/let.vim') # LetIfUndef\n    # vim.runtime('plugin/ui-functions.vim') # lh#ui#confirm\n    # vim.command(':messages')\n\n    # lh-tags\n    vim_tags_path = File.expand_path('../../../lh-tags', __FILE__)\n    vim.prepend_runtimepath(vim_tags_path)\n    vim.runtime('plugin/lh-tags.vim') # AddStyle\n\n    # lh-style\n    vim_style_path = File.expand_path('../../../lh-style', __FILE__)\n    vim.prepend_runtimepath(vim_style_path)\n    vim.runtime('plugin/lh-style.vim') # AddStyle\n\n    # lh-dev\n    vim_dev_path = File.expand_path('../../../lh-dev', __FILE__)\n    vim.prepend_runtimepath(vim_dev_path)\n\n    # lh-brackets\n    vim_brackets_path = File.expand_path('../../../lh-brackets', __FILE__)\n    vim.prepend_runtimepath(vim_brackets_path)\n    vim.runtime('plugin/misc_map.vim') # Inoreab\n    vim.runtime('plugin/common_brackets.vim') # Brackets\n    vim.runtime('plugin/bracketing.base.vim') # !mark!\n    vim.command('set enc=utf-8')\n    #vim.command('SetMarker <+ +>')\n\n    # mu-template\n    mu_template_path = File.expand_path('../../../mu-template@lh', __FILE__)\n    vim.prepend_runtimepath(mu_template_path+'/after')\n    vim.prepend_runtimepath(mu_template_path)\n    vim.runtime('plugin/mu-template.vim') # !mark!\n\n    # pp vim.echo('&rtp')\n    vim.command('set shm=')\n\n    has_redo = vim.echo('has(\"patch-7.4.849\")')\n    if has_redo != \"1\"\n      puts \"WARNING: this flavor of vim won't permit to support redo\"\n    end\n    vim\n  end\nend\n\nRSpec.configure do |config|\n  config.include Support::Vim\n\n  def write_file(filename, contents)\n    dirname = File.dirname(filename)\n    FileUtils.mkdir_p dirname if not File.directory?(dirname)\n\n    File.open(filename, 'w') { |f| f.write(contents) }\n  end\nend\n\n# vim:set sw=2:\n"
  },
  {
    "path": "spec/value-class-with-attributes_spec.rb",
    "content": "# encoding: UTF-8\nrequire 'spec_helper'\nrequire 'pp'\n\n\n# ======[ Value class w/ attributes {{{1\nRSpec.describe \"C++ Value class w/ attributes wizard\", :cpp, :class, :value, :with_attributes, :value_attributes do\n  let (:filename) { \"test.cpp\" }\n\n  # ====[ Executed once before all test {{{2\n  before :all do\n    if !defined? vim.runtime\n        vim.define_singleton_method(:runtime) do |path|\n            self.command(\"runtime #{path}\")\n        end\n    end\n    vim.runtime('spec/support/input-mock.vim')\n    expect(vim.command('verbose function lh#ui#input')).to match(/input-mock.vim/)\n    expect(vim.echo('lh#style#clear()')).to eq '0'\n    vim.command('UseStyle breakbeforebraces=stroustrup -ft=c')\n    vim.command('UseStyle spacesbeforeparens=control-statements -ft=c')\n    vim.command('UseStyle empty_braces=nl -ft=c')\n  end\n\n  # ====[ Always executed before each test {{{2\n  before :each do\n    vim.command('filetype plugin on')\n    vim.command(\"file #{filename}\")\n    vim.set('ft=cpp')\n    vim.set('expandtab')\n    vim.set('sw=4')\n    vim.command('silent! unlet g:cpp_explicit_default')\n    vim.command('silent! unlet g:cpp_std_flavour')\n    vim.command('silent! unlet g:mocked_input')\n    vim.command('silent! unlet g:mocked_confirm')\n    vim.command('silent! unlet g:cpp_use_copy_and_swap')\n    clear_buffer\n    set_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    EOF\n    vim.command(%Q{call append(1, ['', ''])})\n    expect(vim.echo('line(\"$\")')).to eq '3'\n    expect(vim.echo('setpos(\".\", [1,3,1,0])')).to eq '0'\n    expect(vim.echo('line(\".\")')).to eq '3'\n  end\n\n  # ====[ implictly copyable, explicit definitions, C++98 {{{2\n  specify \"value-attribute-class copyable\", :cpp98, :cpp11, :copyable do\n    expect(vim.echo('lh#mut#dirs#get_templates_for(\"cpp/value-class\")')).to match(/value-class.template/)\n    expect(vim.command('call lh#mut#expand_and_jump(0, \"cpp/value-class\", {\"attributes\": [{\"name\": \"foo\", \"type\": \"int\"}, {\"name\": \"bar\", \"type\": \"string\", \"functions\": [\"set\", \"get\"]}]})')).to match(/^$|#include <string> added/)\n    vim.feedkeys('\\<c-\\>\\<c-n>:silent! $call append(\"$\", [\"\",\"\"])\\<cr>G')\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <string>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Value object\n     * - «Regular object»\n     * - «Comparable»\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n        /**\n         * Init constructor.\n         * @param[in] foo «foo-explanations»\n         * @param[in] bar «bar-explanations»\n         * «@throw »\n         */\n        «Test»(int foo, std::string const& bar)\n            : m_foo(foo)\n            , m_bar(bar)\n            {\n            }\n        void setBar(std::string const& bar)\n        {\n            m_bar = bar;\n        }\n        std::string const& getBar() const\n        {\n            return m_bar;\n        }\n\n    private:\n\n        int         m_foo;\n        std::string m_bar;\n    };\n    EOF\n  end\n\n  # ====[ implictly copyable, NO explicit definitions, C++11 {{{2\n  specify \"value-attribute-class copyable, no explicit definition, C++11\", :cpp11, :copyable, :defaulted do\n    expect(vim.echo('lh#mut#dirs#get_templates_for(\"cpp/value-class\")')).to match(/value-class.template/)\n    vim.command('let g:cpp_std_flavour=11')\n    vim.command(\"let g:cpp_explicit_default = 1\")\n    expect(vim.command('call lh#mut#expand_and_jump(0, \"cpp/value-class\", {\"attributes\": [{\"name\": \"foo\", \"type\": \"int\"}, {\"name\": \"bar\", \"type\": \"string\", \"functions\": [\"set\", \"get\"]}]})')).to match(/^$|#include <string> added/)\n    vim.feedkeys('\\<c-\\>\\<c-n>:silent! $call append(\"$\", [\"\",\"\"])\\<cr>G')\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <string>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Value object\n     * - «Regular object»\n     * - «Comparable»\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n        «Test»(«Test» const&) = default;\n        «Test»& operator=(«Test» const&) = default;\n        /**\n         * Destructor.\n         * @throw Nothing\n         * @warning this class is not meant to be publicly inherited\n         */\n        ~«Test»() = default;\n        /**\n         * Init constructor.\n         * @param[in] foo «foo-explanations»\n         * @param[in] bar «bar-explanations»\n         * «@throw »\n         */\n        «Test»(int foo, std::string const& bar)\n            : m_foo(foo)\n            , m_bar(bar)\n            {\n            }\n        void setBar(std::string const& bar)\n        {\n            m_bar = bar;\n        }\n        std::string const& getBar() const\n        {\n            return m_bar;\n        }\n\n    private:\n\n        int         m_foo;\n        std::string m_bar;\n    };\n    EOF\n  end\n\n  # ====[ explicit copy, implicit definitions, no-swap, C++98 {{{2\n  #======================================================================\n  # The same with pointer attributes that imply ... copy operations to be\n  # explicited\n\n  specify \"value-attribute-class copyable, with ptr attributes\", :cpp98, :cpp11, :copyable do\n    expect(vim.echo('lh#mut#dirs#get_templates_for(\"cpp/value-class\")')).to match(/value-class.template/)\n    expect(vim.command('call lh#mut#expand_and_jump(0, \"cpp/value-class\", {\"use_copy_and_swap\": 0, \"attributes\": [{\"name\": \"foo\", \"type\": \"int\"}, {\"name\": \"bar\", \"type\": \"std::auto_ptr<std::string>\", \"includes\":[\"<memory>\", \"<string>\"], \"functions\": [\"ref_set\", \"set\", \"get\"]}]})')).to match(/^$|#include <string> added/)\n    vim.feedkeys('\\<c-\\>\\<c-n>:silent! $call append(\"$\", [\"\",\"\"])\\<cr>G')\n    # T* will require a destructor in current class\n    # auto_ptr<> will require a destructor in current class, even empty\n    # unique_ptr<>, doesn't require anything\n    # Let's suppose other types to follow RAII\n    #\n    # Regarding getters:\n    # - pointers are best avoided, IMO => references,\n    # - or may be non_null<>.\n    # - Only shared_ptr<> would deserved to be returned.  I don't know...\n    # Regarding setters:\n    # 1- one that takes a pointer that'll change the current one\n    # 2- one that takes a value to assign in the pointer (if we're in a value\n    # class, somehow this means that the value behind the pointer could be\n    # duplicated)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <memory>\n    #include <string>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Value object\n     * - «Regular object»\n     * - «Comparable»\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n        /**\n         * Copy constructor.\n         * @param[in] rhs source data to be copied.\n         * «@throw »\n         */\n        «Test»(«Test» const& rhs)\n            : m_foo(rhs.m_foo)\n            , m_bar(«duplicate(rhs.m_bar)»)\n            {\n            }\n        /**\n         * Assignment operator.\n         * @param[in] rhs source data to be copied.\n         * «@throw »\n         */\n        «Test»& operator=(«Test» const& rhs)\n        {\n            m_foo = rhs.m_foo;\n            m_bar = «duplicate(rhs.m_bar)»;\n        }\n        /**\n         * Destructor.\n         * @throw Nothing\n         * @warning this class is not meant to be publicly inherited\n         */\n        ~«Test»();\n        /**\n         * Init constructor.\n         * @param[in] foo «foo-explanations»\n         * @param«[in]» bar «bar-explanations»\n         * «@throw »\n         * @pre `bar != NULL`«»\n         */\n        «Test»(int foo, std::auto_ptr<std::string> bar)\n            : m_foo(foo)\n            , m_bar(bar)\n            {\n            }\n        void setBar(std::string const& bar)\n        {\n            *m_bar = bar;\n        }\n        void setBar(std::auto_ptr<std::string> bar)\n        {\n            m_bar = bar;\n        }\n        std::string const& getBar() const\n        {\n            return *m_bar;\n        }\n\n    private:\n\n        int                        m_foo;\n        std::auto_ptr<std::string> m_bar;\n    };\n    EOF\n  end\n\n  # ====[ explicit copy, implicit definitions, copy-n-swap, C++98 {{{2\n  specify \"value-attribute-class copyable, with ptr attributes\", :cpp98, :cpp11, :copyable, :copy_n_swap do\n    expect(vim.echo('lh#mut#dirs#get_templates_for(\"cpp/value-class\")')).to match(/value-class.template/)\n    expect(vim.command('call lh#mut#expand_and_jump(0, \"cpp/value-class\", {\"use_copy_and_swap\": 1, \"attributes\": [{\"name\": \"foo\", \"type\": \"int\"}, {\"name\": \"bar\", \"type\": \"std::auto_ptr<std::string>\", \"includes\":[\"<memory>\", \"<string>\"], \"functions\": [\"ref_set\", \"set\", \"get\"]}]})')).to match(/^$|#include <string> added/)\n    vim.feedkeys('\\<c-\\>\\<c-n>:silent! $call append(\"$\", [\"\",\"\"])\\<cr>G')\n    # T* will require a destructor in current class\n    # auto_ptr<> will require a destructor in current class, even empty\n    # unique_ptr<>, doesn't require anything\n    # Let's suppose other types to follow RAII\n    #\n    # Regarding getters:\n    # - pointers are best avoided, IMO => references,\n    # - or may be non_null<>.\n    # - Only shared_ptr<> would deserved to be returned.  I don't know...\n    # Regarding setters:\n    # 1- one that takes a pointer that'll change the current one\n    # 2- one that takes a value to assign in the pointer (if we're in a value\n    # class, somehow this means that the value behind the pointer could be\n    # duplicated)\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    #include <memory>\n    #include <string>\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Value object\n     * - «Regular object»\n     * - «Comparable»\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n        /**\n         * Copy constructor.\n         * @param[in] rhs source data to be copied.\n         * «@throw »\n         */\n        «Test»(«Test» const& rhs)\n            : m_foo(rhs.m_foo)\n            , m_bar(«duplicate(rhs.m_bar)»)\n            {\n            }\n        /**\n         * Assignment operator.\n         * @param[in] rhs source data to be copied.\n         * «@throw »\n         *\n         * @note based on copy-and-swap idiom, with copy-elision exploited\n         * @note exception-safe\n         */\n        «Test»& operator=(«Test» rhs)\n        {\n            this->swap(rhs);\n            return *this;\n        }\n        /**\n         * Swap operation.\n         * @param[in,out] other data with which content is swapped\n         * @throw None\n         */\n        void swap(«Test» & other) throw()\n        {\n            using std::swap;\n            swap(m_foo, other.m_foo);\n            swap(m_bar, other.m_bar);\n        }\n        /**\n         * Destructor.\n         * @throw Nothing\n         * @warning this class is not meant to be publicly inherited\n         */\n        ~«Test»();\n        /**\n         * Init constructor.\n         * @param[in] foo «foo-explanations»\n         * @param«[in]» bar «bar-explanations»\n         * «@throw »\n         * @pre `bar != NULL`«»\n         */\n        «Test»(int foo, std::auto_ptr<std::string> bar)\n            : m_foo(foo)\n            , m_bar(bar)\n            {\n            }\n        void setBar(std::string const& bar)\n        {\n            *m_bar = bar;\n        }\n        void setBar(std::auto_ptr<std::string> bar)\n        {\n            m_bar = bar;\n        }\n        std::string const& getBar() const\n        {\n            return *m_bar;\n        }\n\n    private:\n\n        int                        m_foo;\n        std::auto_ptr<std::string> m_bar;\n    };\n    EOF\n  end\n\n# }}}2\nend\n\n# }}}1\n# vim:set sw=2:\n"
  },
  {
    "path": "spec/value-class_spec.rb",
    "content": "# encoding: UTF-8\nrequire 'spec_helper'\nrequire 'pp'\n\n\nRSpec.describe \"C++ Value class wizard\", :cpp, :class, :value do\n  let (:filename) { \"test.cpp\" }\n\n  # ====[ Executed once before all test {{{2\n  before :all do\n    if !defined? vim.runtime\n        vim.define_singleton_method(:runtime) do |path|\n            self.command(\"runtime #{path}\")\n        end\n    end\n    vim.runtime('spec/support/input-mock.vim')\n    expect(vim.command('verbose function lh#ui#input')).to match(/input-mock.vim/)\n    expect(vim.echo('lh#mut#dirs#get_templates_for(\"cpp/value-class\")')).to match(/value-class.template/)\n  end\n\n  # ====[ Always executed before each test {{{2\n  before :each do\n    vim.command('filetype plugin on')\n    vim.command(\"file #{filename}\")\n    vim.set('ft=cpp')\n    vim.set('expandtab')\n    vim.set('sw=4')\n    vim.command('silent! unlet g:cpp_explicit_default')\n    vim.command('silent! unlet g:cpp_std_flavour')\n    clear_buffer\n    set_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n    EOF\n    vim.command(%Q{call append(1, ['', ''])})\n    expect(vim.echo('line(\"$\")')).to eq '3'\n    expect(vim.echo('setpos(\".\", [1,3,1,0])')).to eq '0'\n    expect(vim.echo('line(\".\")')).to eq '3'\n  end\n\n  specify \"value-class copyable\", :cpp98, :cpp11, :copyable do\n    expect(vim.command('MuTemplate cpp/value-class')).to eq \"\"\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Value object\n     * - «Regular object»\n     * - «Comparable»\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n    };\n    EOF\n  end\n\n  specify \"value-class copyable, no implicit definition\", :cpp11, :copyable, :defaulted do\n    vim.command(\"let g:cpp_std_flavour = 11\")\n    vim.command(\"let g:cpp_explicit_default = 1\")\n    expect(vim.command('MuTemplate cpp/value-class')).to eq \"\"\n    assert_buffer_contents <<-EOF\n    /** File Header line to trick auto-inclusion */\n\n    /**\n     * «Test».\n     * @invariant «»\n     * <p><b>Semantics</b><br>\n     * - Value object\n     * - «Regular object»\n     * - «Comparable»\n     * @author «author-name», creation\n     * @since Version «1.0»\n     */\n    class «Test»\n    {\n    public:\n\n        «Test»() = default;\n        «Test»(«Test» const&) = default;\n        «Test»& operator=(«Test» const&) = default;\n        /**\n         * Destructor.\n         * @throw Nothing\n         * @warning this class is not meant to be publicly inherited\n         */\n        ~«Test»() = default;\n    };\n    EOF\n  end\n\n\nend\n\n# vim:set sw=2:\n"
  },
  {
    "path": "syntax/c-assign-in-condition.vim",
    "content": "\"=============================================================================\n\" File:\t\tsyntax/c-assign-in-condition.vim                         {{{1\n\" Author:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:\t2.2.0\n\" Created:\t08th Oct 2007\n\" Last Update:\t16th Dec 2015\n\"------------------------------------------------------------------------\n\" Purpose:\tC syntax enhancements\n\"  (*) Hightlights assignements in if(), while(), ..., conditions\n\"\n\"------------------------------------------------------------------------\n\" Requirements:\n\" \tNone\n\"\n\" Option:\n\" - |c_no_assign_in_condition| to disable the check that assignments are\n\"   done in conditions.\n\" }}}1\n\" ========================================================================\n\" {{{1 Syntax definitions\n\"\n\" {{{2 Don't assign in conditions\nif !get(g:, \"c_no_assign_in_condition\", 0)\n\n  syn match cAssignInConditionBad  '\\(\\<if\\_s*([^=!<>]*\\)\\@<==[^=][^,)]*'\n  syn match cAssignInConditionRare '\\(\\<while\\_s*([^=!<>]*\\)\\@<==[^=][^,)]*'\n\n  hi def link cAssignInConditionBad    SpellBad\n  hi def link cAssignInConditionRare   SpellRare\nendif\n\n\n\" ========================================================================\n\" {{{1 Some mappings\n\n\" }}}1\n\" ========================================================================\n\" vim: set foldmethod=marker:\n"
  },
  {
    "path": "syntax/c-fallthrough-case.vim",
    "content": "\"=============================================================================\n\" File:         syntax/c-fallthrough-case.vim                     {{{1\n\" Author:       Luc Hermitte <EMAIL:luc {dot} hermitte {at} gmail {dot} com>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      2.2.0.\nlet s:k_version = '217'\n\" Created:      16th Dec 2015\n\" Last Update:  16th Dec 2015\n\"------------------------------------------------------------------------\n\" Description:  C syntax enhancements\n\" (*) Hightlights cases that fall through other cases\n\"\n\" Option:\n\" - |c_no_hl_fallthrough_case| to disable the check\n\"   Disabled by default\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\nif !get(g:, 'c_no_hl_fallthrough_case', 1)\n  silent! syn clear cFallthroughCase\n\n  \" These are usually defined as keywords, but we don't want their\n  \" |:syn-priority| to be higher => we redefine them as |:syn-match|\n  syn clear\tcLabel\n  silent! syn clear\tcBadLabel\n  syn match\tcBadLabel\t/\\v<default>/ containedin=cFallthroughCase\n  syn match\tcBadLabel\t/\\v<case>/ containedin=cFallthroughCase\n  syn match\tcLabel\t/\\v<default>/\n  syn match\tcLabel\t/\\v<case>/\n\n  \" FIXME: \"break;} case\" is incorrectly recognized\n  \" FIXME: \"default:\" is not recognized\n  syn match\tcFallthroughCase\t/\\v(((<break>|<continue>|<goto>\\_s+\\w+|return.*)\\_s*;(\\_s*})*|\\{|\\[\\[fallthrough]])\\_s*)@<!(<case>\\_s+\\w+|<default>)\\s*:/  contains=cBadLabel\n\n  hi def link\tcFallthroughCase\tspellBad\n  hi def link\tcBadLabel\tbadLabel\n  hi badLabel term=reverse,bold ctermfg=3 ctermbg=9 gui=undercurl,bold guisp=Red guifg=Brown\nendif\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "syntax/c.vim",
    "content": "\" ========================================================================\n\" File:\t\tsyntax/c.vim\n\" Author:\tLuc Hermitte <MAIL:hermitte {at} free {dot} fr>\n\" \t\t<URL:http://code.google.com/p/lh-vim/>\n\" Version:\t1.1.0\n\" Last Update:\t$Date$\n\"\n\" Purpose:\tC syntax enhancements\n\" Option:\n\" ========================================================================\n\n\" This is the only valid way to load the C++ and C default syntax file.\nso $VIMRUNTIME/syntax/c.vim\n\n\" Source syntax hooks for C\nruntime! syntax/c-*.vim syntax/c_*.vim\n\n"
  },
  {
    "path": "syntax/cpp-badcatch.vim",
    "content": "\"=============================================================================\n\" File:\t\tsyntax/cpp-badcatch.vim                                    {{{1\n\" Author:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:\t2.2.0\n\" Created:\t29th Jun 2006\n\" Last Update:\t16th Dec 2015\n\"------------------------------------------------------------------------\n\" Purpose:\tC++ syntax enhancements\n\" (*) Hightlights catches made by-value instead of by-reference.\n\" (*) Defines the two mappings [b (/resp. ]b) to jump to the previous\n\"     (/resp. next) catch made by value.\n\"\n\"------------------------------------------------------------------------\n\" Requirements:\n\" \tword_tools.vim::GetCurrentKeyword()\t-- unchecked\n\"\n\" Option:\n\" \t- |cpp_no_bad_by_reference| to disable the check that catches are done\n\" \tby reference.\n\" TODO:\n\"\t- \"typename\" should be supported like \"const\"\n\" \t- bug fix: do not highlight \"catch ([[:space:]] const foo<cursor>)\"\n\" }}}1\n\" ========================================================================\n\" {{{1 Syntax definitions\n\"\n\" {{{2 Enforce catch by reference\nif !get(g:, \"cpp_no_catch_by_reference\", 0)\n\n  \" In C++, we should always catch by reference (and throw by value)\n  \"\n  \" - \"constains=cStorageClass\" is used to accept and highlight \"const\"\n  \" - \"\\(regex\\)\\@<=\" is used to exclude a (required) leading context, optional\n  \"   closing spaces are better outside the context\n  \"   \"\\(regex\\)\\@=\" is used to exclude a (required) closing context\n  \" - The complex BadCatch regex tells to match an expression without \"&\" except \"...\".\n  \"\n  \" @todo\n  \" - catch ([[:space:]]const foo <+cursor+>) is not recognized as a\n  \"   cppEditedCatch, but a cppBadCatch\n  \" syn match cppBadCatch    /\\(catch\\s*(\\s*\\(const\\)\\=\\)\\@<=\\(\\s*\\.\\.\\.\\s*\\)\\@![^&)]*\\()\\)\\@=/ contains=cStorageClass\n  syn match cppBadCatch    /\\(catch\\s*(\\)\\@<=\\(\\s*\\.\\.\\.\\s*\\)\\@![^&)]*\\()\\)\\@=/ contains=cStorageClass\n  \" syn match cppBadCatch    /\\(catch\\s*(\\s*const\\)\\@<=\\(\\s*\\.\\.\\.\\s*\\)\\@![^&)]*\\()\\)\\@=/ contains=cStorageClass\n\n  \" Accept what is currently typed\n  \" catch(foo^) catch(foobar  ^) catch(foobar con^) catch(foobar const ^) ...\n  syn match cppEditedCatch /\\(catch\\s*(\\)\\@<=\\s*[a-zA-Z:_]\\+\\s*\\(\\%[const]\\|const\\s*\\)\\=\\%#\\(\\s*)\\)\\@=/ contains=cStorageClass\n\n  \" syn match cppEditedCatch /\\(catch\\s*(\\)\\@<=\\s*[a-zA-Z:_]*\\s*\\%#\\(\\s*)\\)\\@=/\n  syn match cppEditedCatch /\\(catch\\s*(\\s*const\\)\\@<=\\s*[a-zA-Z:_]*\\s*\\%#\\(\\s*)\\)\\@=/ contains=cStorageClass\n  \" syn match cppEditedCatch /\\(catch\\s*(\\s*\\(const\\s*\\)\\=\\)\\@<=\\(\\%[const]\\s*\\|const\\s*[a-zA-Z:_]\\+\\s*\\)\\%#\\(\\s*)\\)\\@=/\n\n  \" syn match cppEditedCatch /\\(catch\\s*(\\s*\\(const\\s*\\)\\=\\)\\@<=[a-zA-Z:_]\\+\\s*\\(\\%[const]\\|const\\s*\\)\\=\\%#\\(\\s*)\\)\\@=/\n\n  hi def link cppBadCatch    SpellBad\n  hi def link cppEditedCatch SpellRare\nendif\n\n\n\" ========================================================================\n\" {{{1 Some mappings\nif exists('b:cpp_bad_catch_loaded') && !exists('g:force_reload_cpp_bad_catch')\n  finish\nendif\nlet b:cpp_bad_catch_loaded = 1\n\nnnoremap <silent> <buffer> ]b :call <sid>NextBadCatch()<cr>\nnnoremap <silent> <buffer> [b :call <sid>PrevBadCatch()<cr>\n\n\" ========================================================================\n\" {{{1 Some functions\nif exists('g:cpp_bad_catch_loaded') && !exists('g:force_reload_cpp_bad_catch')\n  finish\nendif\nlet g:cpp_bad_catch_loaded = 1\n\n\" {{{2 Constants\nlet s:k_badCatch    = \"cppBadCatch\"\nlet s:k_badCatchGID = hlID(s:k_badCatch)\nlet s:k_trans       = 1\n\n\" {{{2 Tells if the cursor in on a bad catch\nfunction! s:IsInBadCatch()\n  let res = synID(line(\".\"),col(\".\"),s:k_trans) == s:k_badCatchGID\n  return res\nendfunction\n\n\" {{{2 Find next or previous bad catch\n\" @param {direction} = \"\"  => next\n\"                    = \"b\" => previous\nfunction! s:FindNextOrPrev(direction)\n  let r = 0\n  while r != 1\n    let r = search('\\<catch\\_s*(\\zs', 'W'.a:direction)\n    \" No more catch => fail!\n    if r == 0 | return 0 | endif\n\n    let r = s:IsInBadCatch()\n  endwhile\n  \" assert r == 1\n  return 1\nendfunction\n\n\" {{{2 Next bad catch\nfunction! s:NextPrevBadCatchImpl(moveWhenOnBadCatch, moveWhenNotOnBadCatch, searchDirection)\n  \" Remember where the search started\n  let pos = line('.').'normal! '.virtcol('.').'|'\n\n  \" if the cursor is on a bad catch, go out of the catch declaration\n  \" or if the current keyword is \"const\" (as s:IsInBadCatch() won't work\n  \" correctly on \"const\" ; expand('<cword>') doesn't return anything useful\n  if s:IsInBadCatch() || GetCurrentKeyword() == \"const\"\n    \" goto end of line if the cursor is on a badcatch\n    silent! exe \"normal! \".a:moveWhenOnBadCatch\n  else\n    \" else goto next word\n    silent! exe \"normal! \".a:moveWhenNotOnBadCatch\n  endif\n\n  if !s:FindNextOrPrev(a:searchDirection)\n    exe pos\n    call s:ErrorMsg ('No other catch() by value found')\n    return 0\n  else\n    call s:GotoWhereAmpersandIsMissing()\n    return 1\n  endif\nendfunction\n\nfunction! s:NextBadCatch()\n  return s:NextPrevBadCatchImpl('$', 'w', '')\nendfunction\n\nfunction! s:PrevBadCatch()\n  return s:NextPrevBadCatchImpl('0', 'b', 'b')\nendfunction\n\n\n\" {{{2 Error Message\nfunction! s:ErrorMsg(msg)\n  if has('gui')\n    call confirm(a:msg, '&Ok', 1, 'Error')\n  else\n    echohl ErrorMsg\n    echo a:msg\n    echohl None\n  endif\nendfunction\n\n\" {{{2 GotoWhereAmpersandIsMissing\nfunction! s:GotoWhereAmpersandIsMissing()\n  \" Move the cursor where the ampersand (\"&\") should be inserted\n  let last_line = line('.')\n  let pos = last_line.'normal! '.virtcol('.').'|'\n  \" move to start of line\n  normal! 0\n  \" if const, move after the const\n  if     search('(\\s*[A-Za-z_:]\\+\\s*const\\zs') == last_line \" found!\n    \" do nothing, it ok\n  else\n    \" reset position\n    exe last_line\n    normal! 0\n    if search('(\\s*\\(const\\s*\\)\\=[A-Za-z_:]\\+\\zs') == last_line \" found!\n      \" do nothing, it ok\n    else\n    \" reset position\n      exe pos\n    endif\n  endif\nendfunction\n\n\" {{{2 Old implementations\n\" {{{3 Next bad catch\nfunction! s:NextBadCatch0()\n  \" if the cursor is on a bad catch, go out of the catch declaration\n  if synID(line(\".\"),col(\".\"),1) == s:k_badCatchGID\n    \" goto next line if the cursor is on a badcatch\n    silent normal! j\n  else\n    \" else goto next word\n    silent! norm! w\n  endif\n\n  if LHNextHighlight(s:k_badCatch, 1) == 0\n    call s:ErrorMsg ('No other catch() by value found')\n    return 0\n  else\n    call s:GotoWhereAmpersandIsMissing()\n    return 1\n  endif\nendfunction\n\n\" {{{3 Previous bad catch\nfunction! s:PrevBadCatch0()\n  \" if the cursor is on a bad catch, go out of the catch declaration\n  if synID(line(\".\"),col(\".\"),1) == hlID(s:k_badCatch)\n    \" goto start of line if the cursor is on a badcatch\n    silent normal! 0\n  else\n    \" else goto prev word\n    silent! norm! b\n  endif\n\n  if LHPrevHighlight(s:k_badCatch, 1) == 0\n    call s:ErrorMsg ('No other catch() by value found')\n    return 0\n  else\n    call s:GotoWhereAmpersandIsMissing()\n    return 1\n  endif\nendfunction\n\n\" ========================================================================\n\" vim: set foldmethod=marker:\n"
  },
  {
    "path": "syntax/cpp-c-cast.vim",
    "content": "\"=============================================================================\n\" File:         syntax/cpp-c-cast.vim                             {{{1\n\" Author:       Luc Hermitte <EMAIL:luc {dot} hermitte {at} gmail {dot} com>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      2.2.0\nlet s:k_version = '220'\n\" Created:      16th Dec 2015\n\" Last Update:  20th Apr 2016\n\"------------------------------------------------------------------------\n\" Description:\tC++ syntax enhancements\n\" (*) detect C casts in C++\n\"\n\" Options:\n\" - |cpp_no_hl_c_cast| to disable the check\n\"\n\" Known bugs:\n\" - `decltype(auto) foo;`\n\" - `f(12)(13)(14)`\n\" }}}1\n\"=============================================================================\n\" {{{1 Syntax definitions\nif get(g:, 'cpp_no_hl_c_cast', 0)\n  finish\nendif\n\nsilent! syn clear       cCast\n\n\" (int*)v\n\"   but exclude some operators like \"and\", \"or\", \"xor\", \"not\" with \"@!\"\n\"   and function specifiers: \"const\", \"volatile\", \"final\", \"override\", \"throw\", \"noexcept\"\nsyn match       cCast '\\v\\(.{-}\\)\\s*(<and>|<or>|<xor>|<not>|<const>|<volatile>|<throw>|<noexcept>|<final>|<override>)@!\\w+'\n\" (int*)(expr)\n\"   \"\\w@!\" is used to ignore double chained calls to operator()\n\"   -> f(12)(13) and f (12)(13) are ignored\n\"   -> (int*)(expr) is matched\nsyn match       cCast '\\v(\\w\\s*)@<!\\(.{-}\\)\\s*\\(.{-}\\)'\n\nhi def link     cCast       SpellBad\n\n\" ========================================================================\n\" {{{1 Some mappings\n\n\" }}}1\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "syntax/cpp-cxxtest.vim",
    "content": "\"=============================================================================\n\" File:\t\tsyntax/cpp-cxxtest.vim                            {{{1\n\" Author:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      2.2.0.\n\" Created:\t23rd Apr 2009\n\" Last Update:\t16th Dec 2015\n\"------------------------------------------------------------------------\n\" Description:\tC++ syntax enhancements for CxxTest <http://cxxtest.sf.net/>\n\" assertions.\n\"\n\"------------------------------------------------------------------------\n\" Option:\n\" History:\t«history»\n\" TODO:\t\t«missing features»\n\" }}}1\n\"=============================================================================\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\"------------------------------------------------------------------------\n\nsyn keyword cppCxxTest TS_FAIL\nsyn keyword cppCxxTest TS_ASSERT\nsyn keyword cppCxxTest TS_ASSERT_EQUALS\nsyn keyword cppCxxTest TS_ASSERT_SAME_DELTA\nsyn keyword cppCxxTest TS_ASSERT_DIFFERS\nsyn keyword cppCxxTest TS_ASSERT_LESS_THAN\nsyn keyword cppCxxTest TS_ASSERT_LESS_THAN_EQUALS\nsyn keyword cppCxxTest TS_ASSERT_PREDICATE\nsyn keyword cppCxxTest TS_ASSERT_RELATION\nsyn keyword cppCxxTest TS_ASSERT_THROWS\nsyn keyword cppCxxTest TS_ASSERT_THROWS_EQUALS\nsyn keyword cppCxxTest TS_ASSERT_THROWS_ASSERT\nsyn keyword cppCxxTest TS_ASSERT_THROWS_ANYTHING\nsyn keyword cppCxxTest TS_ASSERT_THROWS_NOTHING\nsyn keyword cppCxxTest TS_WARN\nsyn keyword cppCxxTest TS_TRACE\n\nsyn keyword cppCxxTest TSM_FAIL\nsyn keyword cppCxxTest TSM_ASSERT\nsyn keyword cppCxxTest TSM_ASSERT_EQUALS\nsyn keyword cppCxxTest TSM_ASSERT_SAME_DELTA\nsyn keyword cppCxxTest TSM_ASSERT_DIFFERS\nsyn keyword cppCxxTest TSM_ASSERT_LESS_THAN\nsyn keyword cppCxxTest TSM_ASSERT_LESS_THAN_EQUALS\nsyn keyword cppCxxTest TSM_ASSERT_PREDICATE\nsyn keyword cppCxxTest TSM_ASSERT_RELATION\nsyn keyword cppCxxTest TSM_ASSERT_THROWS\nsyn keyword cppCxxTest TSM_ASSERT_THROWS_EQUALS\nsyn keyword cppCxxTest TSM_ASSERT_THROWS_ASSERT\nsyn keyword cppCxxTest TSM_ASSERT_THROWS_ANYTHING\nsyn keyword cppCxxTest TSM_ASSERT_THROWS_NOTHING\nsyn keyword cppCxxTest TSM_WARN\nsyn keyword cppCxxTest TSM_TRACE\n\nhi def link cppCxxTest Special\n\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "syntax/cpp-funcdef.vim",
    "content": "\"=============================================================================\n\" File:\t\tsyntax/cpp-funcdef.vim                                    {{{1\n\" Author:\tOlivier Teuliere\n\" \t\t<URL:http://vim.wikia.com/wiki/Highlighting_of_method_names_in_the_definition>\n\" Maintainer:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      2.2.0.\n\" Created:\t23rd Jul 2007\n\" Last Update:\t16th Dec 2015\n\"------------------------------------------------------------------------\n\" Purpose:\tC++ syntax enhancements\n\" (*) Hightlights member-function definitions\n\"\n\"------------------------------------------------------------------------\n\" Option:\n\" - |cpp_no_hl_funcdef| to disable the highlight\n\" }}}1\n\" ========================================================================\n\" {{{1 Syntax definitions\n\"\n\" {{{2 Enforce catch by reference\nif !get(g:, \"cpp_no_hl_funcdef\", 0)\n  syn match cppFuncDef \"::\\~\\?\\zs\\h\\w*\\ze([^)]*\\()\\s*\\(const\\)\\?\\)\\?$\"\n\n  hi def link cppFuncDef Special\nendif\n\n\" ========================================================================\n\n\" ========================================================================\n\" vim: set foldmethod=marker:\n"
  },
  {
    "path": "syntax/cpp-throw-spec.vim",
    "content": "\"=============================================================================\n\" File:\t\tsyntax/cpp-throw-spec.vim                                 {{{1\n\" Author:\tLuc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      2.2.0.\n\" Created:\t06th Sep 2007\n\" Last Update:\t18th May 2016\n\"------------------------------------------------------------------------\n\" Purpose:\tC++ syntax enhancements\n\" (*) Hightlights throw specifications\n\" (*) Defines the two mappings [t (/resp. ]t) to jump to the previous\n\"     (/resp. next) throw specification.\n\"\n\"------------------------------------------------------------------------\n\" Requirements:\n\" \tword_tools.vim::GetCurrentKeyword()\t-- unchecked\n\"\n\" Option:\n\" - |cpp_no_bad_by_reference| to disable the check that catches are done\n\"   by reference.\n\" TODO:\n\" }}}1\n\"=============================================================================\n\n\" ========================================================================\n\" {{{1 Syntax definitions\n\"\n\" {{{2 Enforce no throw specifications\nif !get(g:, \"cpp_no_hl_throw_spec\", 0)\n\n  \" In C++, throw specifications does not do what most C++ developpers think\n  \" they do. Instead of enforcing a static verification on exceptions flows,\n  \" they embed in the result binary some code that checks that the exceptions\n  \" thrown from a function match the authorized exceptions. If not, the\n  \" application will crash (if the exception handler has not been overriden).\n  \" In all cases the application can't do anything but halt very soon. They can\n  \" be seen as some kind of assertions, except they are always active, even in\n  \" \"release\" binaries.\n\n  \" Considered this is a tricky feature of C++, and considered they are hardly\n  \" useful, here is this script that highlight them as \"misspellings\".\n\n  \" As nevetheless some framework require them, it will be possible to\n  \" configure a list of authorized familly of exception specifications.\n  if ! exists('g:cpp_throw_spec_ignore')\n    let g:cpp_throw_spec_ignore = [ 'CORBA' ]\n  endif\n\n  silent! syn clear cppThrowSpec\n  silent! syn clear cppThrowSpecIgnored\n\n  \" Method 2, that has the same result... (throw is not underlined)\n  syn match cppThrowSpec /\\(\\<throw\\_s*\\)\\@<=(\\_.\\{-})/\n  exe 'syn match cppThrowSpecIgnored /\\(\\<throw\\_s*\\)\\@<=(\\_[^)]*\\('.join(g:cpp_throw_spec_ignore, '\\|').'\\)\\_[^)]*)/'\n\n  hi def link cppThrowSpec SpellBad\n  hi def link cppThrowSpecIgnored SpellRare\nendif\n\n\" ========================================================================\n\" {{{1 Some mappings\nif exists('b:cpp_throw_spec_loaded') && !exists('g:force_reload_cpp_throw_spec')\n  finish\nendif\nlet b:cpp_throw_spec_loaded = 1\n\nnnoremap <silent> <buffer> ]t :call <sid>NextThrowSpec()<cr>\nnnoremap <silent> <buffer> [t :call <sid>PrevThrowSpec()<cr>\n\n\" {{{1 Some functions\nif exists('g:cpp_throw_spec_loaded') && !exists('g:force_reload_cpp_throw_spec')\n  finish\nendif\nlet g:cpp_throw_spec_loaded = 1\n\n\" {{{2 Constants\nlet s:k_throwSpec    = \"cppThrowSpec\"\nlet s:k_throwSpecGID = hlID(s:k_throwSpec)\nlet s:k_trans       = 1\n\n\" {{{2 Tells if the cursor in on a bad catch\nfunction! s:IsInThrowSpec()\n  let res = synID(line(\".\"),col(\".\"),s:k_trans) == s:k_throwSpecGID\n  return res\nendfunction\n\n\" {{{2 Find next or previous bad catch\n\" @param {direction} = \"\"  => next\n\"                    = \"b\" => previous\nfunction! s:FindNextOrPrev(direction)\n  let r = 0\n  while r != 1\n    let r = search('\\<throw\\_s*(\\zs', 'W'.a:direction)\n    \" No more catch => fail!\n    if r == 0 | return 0 | endif\n\n    let r = s:IsInThrowSpec()\n    if r == 1\n      call search('\\<throw\\_s*(', 'Wb') \" beacause of \\zs + s:IsInThrowSpec() test\n    endif\n  endwhile\n  \" assert r == 1\n  return 1\nendfunction\n\n\" {{{2 Next bad catch\nfunction! s:NextPrevThrowSpecImpl(moveWhenOnThrowSpec, moveWhenNotOnThrowSpec, searchDirection)\n  \" Remember where the search started\n  let pos = line('.').'normal! '.virtcol('.').'|'\n\n  if 1\n  \" if the cursor is on a bad catch, go out of the catch declaration\n  \" or if the current keyword is \"const\" (as s:IsInThrowSpec() won't work\n  \" correctly on \"const\" ; expand('<cword>') doesn't return anything useful\n  \" if s:IsInThrowSpec() || GetCurrentKeyword() == \"throw\"\n  if s:IsInThrowSpec() || expand('<cword>') == \"throw\"\n    \" goto end of line if the cursor is on a throwspec\n    silent! exe \"normal! \".a:moveWhenOnThrowSpec\n  else\n    \" else goto next word\n    silent! exe \"normal! \".a:moveWhenNotOnThrowSpec\n  endif\n  endif\n\n  if !s:FindNextOrPrev(a:searchDirection)\n    exe pos\n    call s:ErrorMsg ('No other throw-specification found')\n    return 0\n  else\n    return 1\n  endif\nendfunction\n\nfunction! s:NextThrowSpec()\n  return s:NextPrevThrowSpecImpl(\"/)/\\<cr>\", 'w', '')\nendfunction\n\nfunction! s:PrevThrowSpec()\n  return s:NextPrevThrowSpecImpl('0', 'b', 'b')\nendfunction\n\n\n\" {{{2 Error Message\nfunction! s:ErrorMsg(msg)\n  if has('gui')\n    call confirm(a:msg, '&Ok', 1, 'Error')\n  else\n    echohl ErrorMsg\n    echo a:msg\n    echohl None\n  endif\nendfunction\n\n\n\"------------------------------------------------------------------------\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "syntax/cpp.vim",
    "content": "\" ========================================================================\n\" File:\t\tsyntax/cpp.vim\n\" Author:\tLuc Hermitte <MAIL:hermitte {at} free {dot} fr>\n\" \t\t<URL:http://code.google.com/p/lh-vim/>\n\" Version:\t1.1.0\n\" Last Update:\t$Date$\n\"\n\" Purpose:\tC++ syntax enhancements\n\"\n\" Option:\n\" ========================================================================\n\n\" This is the only valid way to load the C++ and C default syntax file.\nso      $VIMRUNTIME/syntax/cpp.vim\n\n\n\" Source syntax hooks for C++\nruntime! syntax/cpp-*.vim syntax/cpp_*.vim\n\n\" Load syntax enhancements for Doxygen, if installed\n\" runtime syntax/doxygen.vim\n\" see :h doxygen \n\" .vimrc => :let g:load_doxygen_syntax=1\n\n\" Load syntax enhancements for wxWindows, if installed\nruntime syntax/wxwin.vim\n"
  },
  {
    "path": "tests/VimFlavor",
    "content": "flavor 'LucHermitte/vim-UT', '>= 0.6.0'\n"
  },
  {
    "path": "tests/lh/analysis.vim",
    "content": "\"=============================================================================\n\" File:         tests/lh/analysis.vim                             {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>\n\"\t\t<URL:http://code.google.com/p/lh-vim/>\n\" Version:      2.0.0.b15\nlet s:k_version = '2.0.0b15'\n\" Created:      17th Feb 2015\n\" Last Update:  $Date$\n\"------------------------------------------------------------------------\n\" Description:\n\"       Unit Tests for AnalysisLic\n\" }}}1\n\"=============================================================================\n\nUTSuite [lh-cpp] Testing lh/cpp/AnalysisLib_Class\n\nruntime autoload/lh/cpp/AnalysisLib_Class.vim\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\n\"------------------------------------------------------------------------\nfunction! s:Test_simplify_id()\n  \" Partial Match up to last ns\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['',   'a', 'a::b']    ) == 'C'\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['::', 'a::', 'a::b::']) == 'C'\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['a',   'a::b']        ) == 'C'\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['a::', 'a::b::']      ) == 'C'\n\n  \" Partial Match (of first ns)\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['a', 'a::z']          ) == 'b::C'\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['a::', 'a::z::']      ) == 'b::C'\n\n  \" No Match\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['z', 'a::z']          ) == 'a::b::C'\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['z::', 'a::z::']      ) == 'a::b::C'\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['',   'z', 'a::z']    ) == 'a::b::C'\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['::', 'z::', 'a::z::']) == 'a::b::C'\n\n  \" Full Match\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['a', 'a::b::C']          ) == ''\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['a::', 'a::b::C::']      ) == ''\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['',   'b', 'a::b::C']    ) == ''\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['::', 'b::', 'a::b::C::']) == ''\nendfunction\n\nfunction! s:Test_simplify_id_and_show_ns()\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['',   'a', 'a::b']    , 1) == ['a::b::', 'C']\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['::', 'a::', 'a::b::'], 1) == ['a::b::', 'C']\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['a',   'a::b']        , 1) == ['a::b::', 'C']\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['a::', 'a::b::']      , 1) == ['a::b::', 'C']\n\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['a', 'a::z']          , 1) == ['a::', 'b::C']\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['a::', 'a::z::']      , 1) == ['a::', 'b::C']\n\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['z', 'a::z']          , 1) == ['', 'a::b::C']\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['z::', 'a::z::']      , 1) == ['', 'a::b::C']\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['',   'z', 'a::z']    , 1) == ['', 'a::b::C']\n  Assert lh#cpp#AnalysisLib_Class#simplify_id('a::b::C', ['::', 'z::', 'a::z::'], 1) == ['', 'a::b::C']\nendfunction\n\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "tests/lh/cpp-TU-override.cpp",
    "content": "// Vim: let b:tags_dirname = '.'\r\n//\r\nnamespace nZ { \r\n    class B {};\r\n} // nZ namespace \r\n\r\n\r\nnamespace foo { \r\n    class A0\r\n    {\r\n\tvirtual ~A0() = 0;\r\n\tvirtual void a0();\r\n    };\r\n\r\n    class A1\r\n    {\r\n\tvirtual ~A1();\r\n\tvirtual void f1(std::string const& s) = 0;\r\n\tvirtual void f2() { f1(\"foo\"); }\r\n\tvoid f2(int);\r\n\r\n[]\r\n    };\r\n\r\n    class A2 : virtual A0 \r\n    {\r\n\tvirtual ~A2() {}\r\n\tvirtual void g();\r\n\tvirtual void a0();\r\n\r\n['A0']\r\n    }\r\n\r\n    class A3 : virtual A0\r\n    {\r\n\tvoid a0();\r\n\r\n['A0']\r\n    }\r\n\r\n    class C1 : A1, A2\r\n    {\r\n\tvirtual ~C1();\r\n\tvoid f2(); \r\n\r\n['A0', 'A1', 'A2']\r\n    };\r\n\r\n    class D : C1, virtual A0\r\n    {\r\n\tvirtual void g();\r\n\r\n['A0', 'A1', 'A2', 'C1']\r\n    };\r\n    class B : A0{};\r\n} // foo namespace \r\n\r\nnamespace bar { \r\n    using namespace nZ;\r\n    struct V {};\r\n    struct Z {};\r\n    struct C1 : virtual V {};\r\n    struct C2 : virtual V, Z {};\r\n    struct C3 : C2{};\r\n    struct D : C1, C3, B {};\r\n// echo lh#cpp#AnalysisLib_Class#Ancestors('bar::D')\r\n} // bar namespace \r\n\r\n\r\n\r\n"
  },
  {
    "path": "tests/lh/cpp-TU.cpp",
    "content": "// nnoremap  :echo lh#cpp#AnalysisLib_Function#AnalysePrototype(lh#cpp#AnalysisLib_Function#GetFunctionPrototype(line('.'), 0))<cr>\n// nnoremap  :echo lh#cpp#AnalysisLib_Function#GetFunctionPrototype(line('.'), 0)<cr>\n\nenum Ee { E_a, E_b};\nenum class Ec {a, c};\n\n// test refactorinng\nvoid f(int z) {\n    int i = 42 + z;\n    printf(\"ttoto %d\\n\", i);\n    int j = i / 2 ;\n\n    Ee ee;\n}\nEc ec;\nint ec;\n\n\nstruct MyEnum {\n    enum type { E1, E2, MAX__};\n};\n\nvoid f(int)\n{\n    printf(toto);\n}\nclass Toto\n{\n    typedef tutu;\n\n    Toto(Toto const& rhs);\n    Toto(Ttiti const& rhs, int z=42, T t=T());\n    Toto(Ttiti const& rhs,\n\t    float z=42);\n    ~Toto();\n    virtual ~Toto();\n    Toto& operator=(Toto const& rhs);\n    Toto& operator*(Toto const& rhs);\n    Toto* operator*(Toto const& rhs);\n    void operator*(Toto const& rhs);\n    void operator+(Toto const& rhs);\n    std::ostream & operator<<(std::ostream &os, const Toto& toto);\n    operator int() const;\n    operator const T*() const;\n    Titi * f();\n    Titi & g();\n    virtual void f(Titi * titi) const;\n    static void f(Titi const* titi);\n    static s();\n    void foo(toto t=42, titi r, tutu z=f()) throw();\n    void foo(toto t=42, titi r, tutu z=f()) throw(foo);\n    void foo(toto t=42, titi r, tutu z=f()) throw(foo, bar);\n    void foo(toto t=42, std::string const& s, char * p, int[] i, titi r, tutu z=f()) const throw(foo, bar);\n    int foo(toto t=42, std::string const&, char * p, int[] i, std::vector<short>, titi r, tutu z=f()) const throw(foo, bar);\n\n    int bar(/*c1*/T/*c2*/ v/*c3*/); // c-eol\n};\n\nnamespace NS1 { namespace NS2 {\n    int foo; // -> echo lh#cpp#AnalysisLib_Class#CurrentScope(line('.'), '##')\n    class Bar {\n        \n    };\n} }\n\nvoid NS1::NS2::foo(toto t=42, int, std::string const& s, char * p, int[] i, titi r, tutu z=f()) const throw(foo, bar);\n\n/*===========================================================================*/\n/*===================================[ t ]===================================*/\n/*===========================================================================*/\n\nToto::~Toto()\n{\n    \n}\n\nvoid Toto::operator+(Toto const& rhs)\n{\n}\n\nToto* Toto::operator*(Toto const& rhs)\n{\n}\n\nTiti & Toto::g()\n{\n}\n\nTiti * Toto::f()\n{\n}\n\nToto& Toto::operator=(Toto const& rhs)\n{\n    while (toto = 42) {\n    if (toto = 42) \n\tfoo == 42;\n\t\n    }\n}\n\n\n/*===========================================================================*/\n/*===========================[ :Constructor test ]===========================*/\n/*===========================================================================*/\nclass Titi\n{\npublic:\nprivate:\n    int              m_int;\n    std::string      m_str;\n    Ptr*             m_ptr;\n    Ref&             m_ref;\n    Tab[N]           m_tab;\n    std::vector<int> m_vector;\n};\n\n\n"
  },
  {
    "path": "tests/lh/omap-param.vim",
    "content": "\" ======================================================================\n\" $Id$\n\" File:\t\ttests/lh/omap-param.vim\n\" Maintainer:\tLuc Hermitte <MAIL:hermitte {at} free {dot} fr>\n\" \t\t<URL:http://code.google.com/p/lh-vim/>\n\" Last Update:\t$Date$\n\" Version:\t1.1.0\n\"\n\"\n\" Author: Luc Hermitte\n\" Notes:\n\" * \"i,\" can't be used to select several parameters with several uses of\n\" \"i,\" ; use \"a,\" instead (-> \"va,a,a,\"). This is because of simple letter\n\" parameters.\n\" However, \"v2i,\" works perfectly.\n\" * Requires Vim 7+\n\" * The following should be resistant to &magic, and other mappings\n\" * select-mode is not parasited by this plugin\n\" ======================================================================\n\nonoremap <silent> i, :<c-u>call <sid>SelectParam(1,0)<cr>\nxnoremap <silent> i, :<c-u>call <sid>SelectParam(1,1)<cr><esc>gv\nonoremap <silent> a, :<c-u>call <sid>SelectParam(0,0)<cr>\nxnoremap <silent> a, :<c-u>call <sid>SelectParam(0,1)<cr><esc>gv\n\nif 0\n  call Un(Null,fun2(fun3(a,b,g(NULL))),t, titi, r  , zzz\n  call Un(Null,fun2(fun3(a,b,g(NULL))),t, titi, r  , zzz)\nendif\n\nfunction! s:SelectParam(inner, visual)\n  let saved_pos = getpos('.')\n  if a:visual ==1 && s:CharAtMark(\"'>\") =~ '[(,]'  \n\t\\ && !s:SkipAtMark(\"'>\")\n    normal! gv\n  elseif searchpair('(',',',')','bcW','s:Skip()') > 0 ||\n\t\\ searchpair('(',',',')','bW','s:Skip()') > 0\n    \" Test necessary because 'c' flag and Skip() don't always work well together\n    call search('.')\n    normal! v\n  else\n    throw \"Not on a parameter\"\n  endif\n\n  let cnt = v:count <= 0 ? 1 : v:count\n\n  while cnt > 0\n    let cnt -= 1\n    if 0 == searchpair('(', ',',')', 'W','s:Skip()')\n      if s:IsBefore(getpos('.'), saved_pos)\n\t\" no \"vi,\" when starting from the last parameter\n\texe \"normal! \\<esc>\"\n\tcall setpos('.', saved_pos)\n\tthrow (a:visual?'v':'').(a:inner?'i':'a').\",: Cursor not on a parameter\"\n      else\n\techomsg (a:visual?'v':'').(a:inner?'i':'a').\",: No more parameters\"\n\t\" 999di, silently deletes everything till the end\n\tbreak\n      endif\n    endif\n  endwhile\n  \" Don't include the last closing paren\n  if a:inner == 1 || searchpair('(',',',')','n','s:Skip()') <= 0\n    call search('.','b')\n  endif\nendfunction\n\nfunction! s:CharAtMark(char)\n  let c = getline(a:char)[col(a:char)-1]\n  return c\nendfunction\n\nfunc! s:SkipAt(l,c)\n  return synIDattr(synID(a:l, a:c, 0),'name') =~?\n\t\\ 'string\\|comment\\|character\\|doxygen'\nendfun\n\nfunc! s:Skip()\n  return s:SkipAt(line('.'), col('.'))\nendfun\n\nfunc! s:SkipAtMark(mark)\n  return s:SkipAt(line(a:mark), col(a:mark))\nendfun\n\nfunction! s:IsBefore(lhs_pos, rhs_pos)\n  if a:lhs_pos[0] != a:rhs_pos[0]\n    throw \"Postions from incompatible buffers can't be ordered\"\n  endif\n  \"1 test lines\n  \"2 test cols\n  let before \n\t\\ = (a:lhs_pos[1] == a:rhs_pos[1])\n\t\\ ? (a:lhs_pos[2] < a:rhs_pos[2])\n\t\\ : (a:lhs_pos[1] < a:rhs_pos[1])\n  return before\nendfunction\n\nfunction! SelectParam(i,v)\n  call s:SelectParam(a:i, a:v)\nendfunction\n\n\" by A.Politz\n\"assert(\"cursor at or in front of opening paren\")\nfunc! FargsPos()\n  let res = []\n  let p0 = getpos('.')\n  \"find first paren\n  if !search('(','Wc')\n    return []\n  endif\n  call add(res,getpos('.'))\n  \"goto closing paren\n  if searchpair('(','',')','W','Skip()') <= 0\n    call setpos('.',p0)\n    return []\n  endif\n  let end = getpos('.')\n  \"go back to opening paren\n  call setpos('.',res[0])\n  \"search for ',' , while not at the closing paren\n  while searchpair('(',',',')','W','Skip()') > 0 && getpos('.') != end\n    call add(res,getpos('.'))\n  endwhile\n  call add( res , end)\n  call setpos('.',p0)\n  return res \" = positions of '(' ',' ... ')'\nendfun\n\nfinish\n\nfunction! s:t(a, b, c, d e,, f  )\n  \nendfunction\n\nfun(Null,fun2(fun3(a,b,g(NULL))), zzz)\n"
  },
  {
    "path": "tests/lh/snippets.vim",
    "content": "\"=============================================================================\n\" File:         tests/lh/snippets.vim                             {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} gmail {dot} com>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      2.2.0.\nlet s:k_version = '220'\n\" Created:      25th Nov 2015\n\" Last Update:  15th Dec 2015\n\"------------------------------------------------------------------------\n\" Description:\n\"       Test autoload/lh/snippets.vim functions\n\" }}}1\n\"=============================================================================\n\nUTSuite [lh-cpp] Testing lh/cpp/snippets.vim\n\nruntime autoload/lh/cpp/on.vim\nruntime autoload/lh/cpp/snippets.vim\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\n\" ## Tests {{{1\n\"------------------------------------------------------------------------\nfunction! s:Test_noexcept() \" {{{2\n  let cleanup = lh#on#exit()\n        \\.restore_option('cpp_noexcept')\n        \\.restore_option('cpp_std_flavour')\n        \\.restore('$CXXFLAGS')\n  silent! unlet g:cpp_std_flavour\n  silent! unlet b:cpp_std_flavour\n  silent! unlet g:cpp_noexcept\n  silent! unlet b:cpp_noexcept\n  let $CXXFLAGS = ''\n  try\n    AssertEquals(lh#cpp#snippets#noexcept(), 'throw()')\n    AssertEquals(lh#cpp#snippets#noexcept('false'), 'throw()')\n\n    let b:cpp_std_flavour = 11\n    AssertEquals(lh#cpp#snippets#noexcept(), 'noexcept')\n    AssertEquals(lh#cpp#snippets#noexcept('false'), 'noexcept(false)')\n\n    let g:cpp_noexcept = 'ITK_NOEXCEPT%1'\n    AssertEquals(lh#cpp#snippets#noexcept(), 'ITK_NOEXCEPT')\n    AssertEquals(lh#cpp#snippets#noexcept('false'), 'ITK_NOEXCEPT(false)')\n\n    unlet b:cpp_std_flavour\n    AssertEquals(lh#cpp#snippets#noexcept(), 'ITK_NOEXCEPT')\n    AssertEquals(lh#cpp#snippets#noexcept('false'), 'ITK_NOEXCEPT(false)')\n  finally\n    call cleanup.finalize()\n  endtry\nendfunction\n\n\"------------------------------------------------------------------------\nfunction! s:Test_deleted() \" {{{2\n  let cleanup = lh#on#exit()\n        \\.restore_option('cpp_deleted')\n        \\.restore_option('cpp_std_flavour')\n        \\.restore('$CXXFLAGS')\n  silent! unlet g:cpp_std_flavour\n  silent! unlet b:cpp_std_flavour\n  silent! unlet g:cpp_deleted\n  silent! unlet b:cpp_deleted\n  let $CXXFLAGS = ''\n  try\n    AssertEquals(lh#cpp#snippets#deleted(), '/* = delete */')\n\n    let b:cpp_std_flavour = 11\n    AssertEquals(lh#cpp#snippets#deleted(), '= delete')\n\n    let g:cpp_deleted = 'ITK_DELETE'\n    AssertEquals(lh#cpp#snippets#deleted(), 'ITK_DELETE')\n\n    unlet b:cpp_std_flavour\n    AssertEquals(lh#cpp#snippets#deleted(), 'ITK_DELETE')\n  finally\n    call cleanup.finalize()\n  endtry\nendfunction\n\n\"------------------------------------------------------------------------\nfunction! s:Test_defaulted() \" {{{2\n  let cleanup = lh#on#exit()\n        \\.restore_option('cpp_defaulted')\n        \\.restore_option('cpp_std_flavour')\n        \\.restore('$CXXFLAGS')\n  silent! unlet g:cpp_std_flavour\n  silent! unlet b:cpp_std_flavour\n  silent! unlet g:cpp_defaulted\n  silent! unlet b:cpp_defaulted\n  let $CXXFLAGS = ''\n  try\n    AssertEquals(lh#cpp#snippets#defaulted(), '/* = default */')\n\n    let b:cpp_std_flavour = 11\n    AssertEquals(lh#cpp#snippets#defaulted(), '= default')\n\n    let g:cpp_defaulted = 'ITK_DEFAULT'\n    AssertEquals(lh#cpp#snippets#defaulted(), 'ITK_DEFAULT')\n\n    unlet b:cpp_std_flavour\n    AssertEquals(lh#cpp#snippets#defaulted(), 'ITK_DEFAULT')\n  finally\n    call cleanup.finalize()\n  endtry\nendfunction\n\n\"------------------------------------------------------------------------\n\" Function: s:Test_parents() {{{2\nfunction! s:Test_parents() abort\n  let parents = []\n  AssertEquals(lh#cpp#snippets#parents(parents), ['', []])\n\n  let parents += [ {\"boost::noncopyable\" : {\"how\": \"include\", \"visibility\": \"private\"}}]\n  AssertEquals(lh#cpp#snippets#parents(parents), [\" : private boost::noncopyable\", []])\n\n  let parents += [ {\"SomeBase\" : {}}]\n  AssertEquals(lh#cpp#snippets#parents(parents), [\"\\n: private boost::noncopyable\\n, public SomeBase\", []])\n\n  let parents += [ {\"Base2\" : {\"virtual\": 1}}]\n  AssertEquals(lh#cpp#snippets#parents(parents), [\"\\n: private boost::noncopyable\\n, public SomeBase\\n, public virtual Base2\", []])\n\n  \" Start from new, uses lh#cpp#types\n  let parents = [ {\"noncopyable\" : {\"how\": \"include\", \"visibility\": \"private\"}}]\n  AssertEquals(lh#cpp#snippets#parents(parents), [\" : private boost::noncopyable\", ['<boost/noncopyable.hpp>']])\n\nendfunction\n\n\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "tests/lh/test-flavours.vim",
    "content": "\"=============================================================================\n\" File:         tests/lh/test-flavours.vim                        {{{1\n\" Author:       Luc Hermitte <EMAIL:hermitte {at} gmail {dot} com>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" License:      GPLv3 with exceptions\n\"               <URL:http://github.com/LucHermitte/lh-cpp/License.md>\n\" Version:      2.1.7.\nlet s:k_version = '217'\n\" Created:      23rd Nov 2015\n\" Last Update:\n\"------------------------------------------------------------------------\n\" Description:\n\"       Test C++ flavour detection\n\"\n\" - Test all flavours\n\" - Test priorities\n\"------------------------------------------------------------------------\n\" Todo:\n\" - Test CMakeCache decoding\n\" }}}1\n\"=============================================================================\n\nUTSuite [lh-cpp] Testing lh#cpp#get_flavour()\n\nruntime autoload/lh/cpp.vim\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\n\"------------------------------------------------------------------------\nfunction! s:Setup()\n  let s:cleanup = lh#on#exit()\n        \\.restore_option('cpp_std_flavour')\n        \\.restore('$CXXFLAGS')\n  silent! let $CXXFLAGS=''\n  silent! unlet g:cpp_std_flavour\n  silent! unlet b:cpp_std_flavour\nendfunction\n\nfunction! s:Teardown()\n  call s:cleanup.finalize()\nendfunction\n\n\"------------------------------------------------------------------------\nfunction! s:Expect98()\n  AssertEquals!(lh#cpp#get_flavour(), 03)\n  Assert !lh#cpp#use_cpp11()\n  Assert !lh#cpp#use_cpp14()\n  Assert !lh#cpp#use_cpp17()\nendfunction\n\nfunction! s:Expect11()\n  AssertEquals(lh#cpp#get_flavour(), 11)\n  Assert  lh#cpp#use_cpp11()\n  Assert !lh#cpp#use_cpp14()\n  Assert !lh#cpp#use_cpp17()\nendfunction\n\nfunction! s:Expect14()\n  AssertEquals(lh#cpp#get_flavour(), 14)\n  Assert  lh#cpp#use_cpp11()\n  Assert  lh#cpp#use_cpp14()\n  Assert !lh#cpp#use_cpp17()\nendfunction\n\nfunction! s:Expect17()\n  AssertEquals(lh#cpp#get_flavour(), 17)\n  Assert  lh#cpp#use_cpp11()\n  Assert  lh#cpp#use_cpp14()\n  Assert  lh#cpp#use_cpp17()\nendfunction\n\n\"------------------------------------------------------------------------\n\"------------------------------------------------------------------------\nfunction! s:Test_cpp98()\n  call s:Expect98()\n\n  let $CXXFLAGS = '-Wall -O3 -DNDEBUG'\n  call s:Expect98()\nendfunction\n\n\"------------------------------------------------------------------------\nfunction! s:Test_cpp0x()\n  let $CXXFLAGS = '-O3 -std=c++0x -Wall'\n  call s:Expect11()\n\n  let $CXXFLAGS = '-Wall -O3 -DNDEBUG'\n  AssertEquals(lh#cpp#get_flavour(), 03)\n  call s:Expect98()\nendfunction\n\nfunction! s:Test_cpp11()\n  let b:cpp_std_flavour = '11'\n  call s:Expect11()\n  unlet b:cpp_std_flavour\n\n  let $CXXFLAGS = '-O3 -std=c++11 -Wall'\n  call s:Expect11()\n\n  let $CXXFLAGS = '-Wall -O3 -DNDEBUG'\n  AssertEquals(lh#cpp#get_flavour(), 03)\n  call s:Expect98()\nendfunction\n\n\"------------------------------------------------------------------------\nfunction! s:Test_cpp1y()\n  let $CXXFLAGS = '-O3 -std=c++1y -Wall'\n  call s:Expect14()\n\n  let $CXXFLAGS = '-Wall -O3 -DNDEBUG'\n  AssertEquals(lh#cpp#get_flavour(), 03)\n  call s:Expect98()\nendfunction\n\nfunction! s:Test_cpp14()\n  let b:cpp_std_flavour = '14'\n  call s:Expect14()\n  unlet b:cpp_std_flavour\n\n  let $CXXFLAGS = '-O3 -std=c++14 -Wall'\n  call s:Expect14()\n\n  let $CXXFLAGS = '-Wall -O3 -DNDEBUG'\n  AssertEquals(lh#cpp#get_flavour(), 03)\n  call s:Expect98()\nendfunction\n\n\"------------------------------------------------------------------------\nfunction! s:Test_cpp1z()\n  let $CXXFLAGS = '-O3 -std=c++1z -Wall'\n  call s:Expect17()\n\n  let $CXXFLAGS = '-Wall -O3 -DNDEBUG'\n  AssertEquals(lh#cpp#get_flavour(), 03)\n  call s:Expect98()\nendfunction\n\nfunction! s:Test_cpp17()\n  let b:cpp_std_flavour = '17'\n  call s:Expect17()\n  unlet b:cpp_std_flavour\n\n  let $CXXFLAGS = '-O3 -std=c++17 -Wall'\n  call s:Expect17()\n\n  let $CXXFLAGS = '-Wall -O3 -DNDEBUG'\n  AssertEquals(lh#cpp#get_flavour(), 03)\n  call s:Expect98()\nendfunction\n\n\"------------------------------------------------------------------------\n\"------------------------------------------------------------------------\nfunction! s:Test_prio()\n  call s:Expect98()\n  let $CXXFLAGS = '-O3 -std=c++17 -Wall'\n  call s:Expect17()\n  let g:cpp_std_flavour = '11'\n  call s:Expect11()\n  let b:cpp_std_flavour = '03'\n  call s:Expect98()\nendfunction\n\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  },
  {
    "path": "tests/lh/test-types.vim",
    "content": "\"=============================================================================\n\" File:         tests/lh/test-types.vim                           {{{1\n\" Author:       Luc Hermitte <EMAIL:luc {dot} hermitte {at} gmail {dot} com>\n\"\t\t<URL:http://github.com/LucHermitte/lh-cpp>\n\" Version:      2.2.0.\nlet s:k_version = '220'\n\" Created:      15th Dec 2015\n\" Last Update:  15th Dec 2015\n\"------------------------------------------------------------------------\n\" Description:\n\"       Test lh#cpp#types#...\n\"\n\"------------------------------------------------------------------------\n\" History:      «history»\n\" TODO:         «missing features»\n\" }}}1\n\"=============================================================================\n\nUTSuite [lh-cpp] Testing lh/cpp/types.vim\n\nruntime autoload/lh/cpp/types.vim\n\nlet s:cpo_save=&cpo\nset cpo&vim\n\n\n\" SetUp {{{1\n\" Function: s:Setup() {{{3\nfunction! s:Setup() abort\n  \" SetMarker <+ +>\n  \" it seems that playing with encodings messes vim execution through rspec\n  let b:marker_open = '<+'\n  let b:marker_close = '+>'\n  let b:last_encoding_used = &enc\n  AssertEquals( b:marker_open, '<+')\n  AssertRelation( lh#marker#version(), '>=' , 310)\n  AssertEquals(lh#marker#open(), '<+')\nendfunction\n\n\" Tests {{{1\n\"------------------------------------------------------------------------\nfunction! s:Test_none() \" {{{2\n  let info = lh#cpp#types#get_info('invalid_type')\n  Assert get(info, 'unknown', 0)\n\n  AssertEquals(lh#cpp#types#get_includes('<invalid_type>'), [])\nendfunction\n\n\"------------------------------------------------------------------------\nfunction! s:Test_vector() \" {{{2\n  let vector = lh#cpp#types#get_info('vector')\n  AssertEquals(vector.includes                 , ['<vector>'])\n  AssertEquals(vector.name                    , 'vector')\n  AssertEquals(vector.type                    , 'vector<%1>')\n  AssertEquals(vector.namespace               , 'std')\n  AssertEquals(vector.typename_for_header('T'), 'std::vector<T>')\n  AssertEquals(vector.typename_for_header()   , 'std::vector<<+T1+>>')\nendfunction\n\n\"------------------------------------------------------------------------\nfunction! s:Test_map() \" {{{2\n  let map = lh#cpp#types#get_info('map')\n  AssertEquals(map.includes                      , ['<map>'])\n  AssertEquals(map.name                         , 'map')\n  AssertEquals(map.type                         , 'map<%1,%2>')\n  AssertEquals(map.namespace                    , 'std')\n  AssertEquals(map.typename_for_header('T', 'V'), 'std::map<T,V>')\n  AssertEquals(map.typename_for_header('T')     , 'std::map<T,<+T2+>>')\n  AssertEquals(map.typename_for_header()        , 'std::map<<+T1+>,<+T2+>>')\nendfunction\n\n\"------------------------------------------------------------------------\nfunction! s:Test_string() \" {{{2\n  let string = lh#cpp#types#get_info('string')\n  AssertEquals(string.includes              , ['<string>'])\n  AssertEquals(string.name                 , 'string')\n  AssertEquals(string.type                 , 'string')\n  AssertEquals(string.namespace            , 'std')\n  AssertEquals(string.typename_for_header(), 'std::string')\nendfunction\n\n\"------------------------------------------------------------------------\nfunction! s:Test_chrono() \" {{{2\n  let chrono_time_point = lh#cpp#types#get_info('chrono::time_point')\n  AssertEquals(chrono_time_point.includes  , ['<chrono>'])\n  AssertEquals(chrono_time_point.name     , 'chrono::time_point')\n  AssertEquals(chrono_time_point.type     , 'chrono::time_point<%1>')\n  AssertEquals(chrono_time_point.namespace, 'std')\nendfunction\n\n\"------------------------------------------------------------------------\nfunction! s:Test_size_t() \" {{{2\n  let size_t = lh#cpp#types#get_info('size_t')\n  AssertEquals(size_t.includes  , ['<cstddef>', '<cstdio>', '<cstring>', '<ctime>', '<cstdlib>', '<cwchar>'])\n  AssertEquals(size_t.name     , 'size_t')\n  AssertEquals(size_t.type     , 'size_t')\n  AssertEquals(size_t.namespace, 'std')\nendfunction\n\n\"------------------------------------------------------------------------\nfunction! s:Test_noncopyable() \" {{{2\n  let noncopyable = lh#cpp#types#get_info('noncopyable')\n  AssertEquals(noncopyable.includes  , ['<boost/noncopyable.hpp>'])\n  AssertEquals(noncopyable.name     , 'noncopyable')\n  AssertEquals(noncopyable.type     , 'noncopyable')\n  AssertEquals(noncopyable.namespace, 'boost')\nendfunction\n\n\"------------------------------------------------------------------------\nfunction! s:Test_ptr_vector() \" {{{2\n  let ptr_vector = lh#cpp#types#get_info('ptr_vector')\n  AssertEquals(ptr_vector.includes  , ['<boost/ptr_container.hpp>', '<boost/ptr_container/ptr_vector.hpp>'])\n  AssertEquals(ptr_vector.name     , 'ptr_vector')\n  AssertEquals(ptr_vector.type     , 'ptr_vector<%1>')\n  AssertEquals(ptr_vector.namespace, 'boost')\nendfunction\n\n\"------------------------------------------------------------------------\n\" }}}1\n\"------------------------------------------------------------------------\nlet &cpo=s:cpo_save\n\"=============================================================================\n\" vim600: set fdm=marker:\n"
  }
]