pax_global_header00006660000000000000000000000064147564142470014530gustar00rootroot0000000000000052 comment=ea1f7537ae8d84a8d6612f9811596e0091291c90 breathe-doc-breathe-10a36f3/000077500000000000000000000000001475641424700156425ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/.github/000077500000000000000000000000001475641424700172025ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/.github/FUNDING.yml000066400000000000000000000012701475641424700210170ustar00rootroot00000000000000# These are supported funding model platforms github: breathe-doc patreon: # Replace with a single Patreon username open_collective: breathe ko_fi: # Replace with a single Ko-fi username tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] breathe-doc-breathe-10a36f3/.github/dependabot.yml000066400000000000000000000002731475641424700220340ustar00rootroot00000000000000version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "monthly" groups: github-actions: patterns: - "*" breathe-doc-breathe-10a36f3/.github/workflows/000077500000000000000000000000001475641424700212375ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/.github/workflows/create-release.yml000066400000000000000000000022551475641424700246470ustar00rootroot00000000000000name: Create release on: push: tags: - "v*" workflow_dispatch: permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true env: FORCE_COLOR: "1" UV_SYSTEM_PYTHON: "1" # make uv do global installs jobs: publish-pypi: runs-on: ubuntu-latest name: PyPI Release environment: release if: github.repository_owner == 'breathe-doc' permissions: id-token: write # for PyPI trusted publishing steps: - uses: actions/checkout@v4 with: persist-credentials: false - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3" - name: Install uv uses: astral-sh/setup-uv@v5 with: version: latest enable-cache: false - name: Install build dependencies (pypa/build, twine) run: uv pip install build "twine>=5.1" - name: Build distribution run: python -m build - name: Check distribution run: | twine check --strict dist/* - name: Upload to PyPI uses: pypa/gh-action-pypi-publish@release/v1 breathe-doc-breathe-10a36f3/.github/workflows/documentation.yml000066400000000000000000000025671475641424700246450ustar00rootroot00000000000000name: Build documentation on: push: pull_request: workflow_dispatch: permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true env: FORCE_COLOR: "1" jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3" - name: Install apt dependencies run: | sudo apt-get update sudo apt-get install graphviz - name: Install Doxygen from GitHub releases env: DOXYGEN_VERSION: 1.9.4 run: | mkdir doxygen-bin-arc && cd doxygen-bin-arc curl -LsSf https://github.com/doxygen/doxygen/releases/download/Release_${DOXYGEN_VERSION//./_}/doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz > doxygen.tar.gz gunzip doxygen.tar.gz tar xf doxygen.tar cd doxygen-$DOXYGEN_VERSION sudo make install - name: Install dependencies run: | python -m pip install --upgrade pip python -m pip install .[docs] - name: Build the documentation run: | make html rm documentation/build/html/.buildinfo - uses: actions/upload-artifact@v4 with: name: docs build artifacts path: | documentation/build/html examples/*/*/xml breathe-doc-breathe-10a36f3/.github/workflows/lint.yml000066400000000000000000000026021475641424700227300ustar00rootroot00000000000000name: Lint source code on: push: pull_request: workflow_dispatch: permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true env: FORCE_COLOR: "1" jobs: ruff: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: persist-credentials: false - name: Install Ruff uses: astral-sh/ruff-action@v3 with: args: --version version: 0.9.2 - name: Lint with Ruff run: ruff check --output-format=github - name: Format with Ruff run: ruff format --diff mypy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3" - name: Install dependencies run: | python -m pip install --upgrade pip python -m pip install ".[lint]" - name: Type check with mypy run: mypy twine: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3" - name: Install dependencies run: | python -m pip install --upgrade pip python -m pip install --upgrade twine build - name: Lint with twine run: | python -m build . twine check dist/* breathe-doc-breathe-10a36f3/.github/workflows/unit_tests.yml000066400000000000000000000043031475641424700241630ustar00rootroot00000000000000name: Tests on: push: paths: - ".github/workflows/unit_tests.yml" - "breathe/**" - "tests/**" pull_request: paths: - ".github/workflows/unit_tests.yml" - "breathe/**" - "tests/**" permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true env: FORCE_COLOR: "1" PYTHONDEVMODE: "1" # -X dev PYTHONWARNDEFAULTENCODING: "1" # -X warn_default_encoding jobs: test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: - '3.9' - '3.10' - '3.11' - '3.12' - '3.13' sphinx-version: - '7.2' # Ubuntu 24.04 - '7.4' # Ubuntu 24.10 - '8.1' # Ubuntu 25.04 exclude: - python-version: '3.9' sphinx-version: '8.0' - python-version: '3.9' sphinx-version: '8.1' - python-version: '3.12' sphinx-version: '6.2' - python-version: '3.13' sphinx-version: '6.2' steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip python -m pip install .[test] - name: Install Sphinx ${{ matrix.sphinx-version }} run: python -m pip install --upgrade "Sphinx~=${{ matrix.sphinx-version }}.0" - name: Test with pytest run: python -m pytest -vv env: PYTHONWARNINGS: "error" # treat all warnings as errors test-latest-sphinx: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v5 with: python-version: "3" - name: Install dependencies run: | python -m pip install --upgrade pip python -m pip install .[test] - name: Install Sphinx master run: python -m pip install "Sphinx @ git+https://github.com/sphinx-doc/sphinx" - name: Test with pytest run: python -m pytest -vv breathe-doc-breathe-10a36f3/.gitignore000066400000000000000000000017461475641424700176420ustar00rootroot00000000000000*.pyc /.project /.pydevproject build/ /dist /breathe.egg-info /.mypy_cache # Folder for placing stuff to be ignored /ignored # My virtual env folder /python-2.7.4 # Test folder for building simple examples of the documentation /simple # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm ## Directory-based project format .idea/ # if you remove the above rule, at least ignore user-specific stuff: # .idea/workspace.xml # .idea/tasks.xml # and these sensitive or high-churn files: # .idea/dataSources.ids # .idea/dataSources.xml # .idea/sqlDataSources.xml # .idea/dynamic.xml ## File-based project format *.ipr *.iws *.iml ## Additional for IntelliJ out/ # generated by mpeltonen/sbt-idea plugin .idea_modules/ # generated by JIRA plugin atlassian-ide-plugin.xml # generated by Crashlytics plugin (for Android Studio and Intellij) com_crashlytics_export_strings.xml # modified by build process examples/doxygen/example.tag examples/specific/dot_graphs/xml/dotfile.dot breathe-doc-breathe-10a36f3/.readthedocs.yaml000066400000000000000000000002671475641424700210760ustar00rootroot00000000000000version: 2 python: version: 3 sphinx: builder: html configuration: documentation/source/conf.py fail_on_warning: false conda: environment: documentation/environment.yaml breathe-doc-breathe-10a36f3/.ruff.toml000066400000000000000000000026211475641424700175600ustar00rootroot00000000000000target-version = "py39" # Pin Ruff to Python 3.9 line-length = 100 output-format = "full" [format] preview = true quote-style = "double" [lint] preview = true ignore = [ "UP031", # Use format specifiers instead of percent format ] select = [ "C4", # flake8-comprehensions # "B", # flake8-bugbear # "D", # pydocstyle "E", # pycodestyle "F", # pyflakes "FA", # flake8-future-annotations "FLY", # flynt "FURB", # refurb "G", # flake8-logging-format "I", # isort "LOG", # flake8-logging # "N", # pep8-naming "PERF", # perflint "PGH", # pygrep-hooks "PT", # flake8-pytest-style "TC", # flake8-type-checking "TID", # flake8-tidy-imports "UP", # pyupgrade "W", # pycodestyle ] [lint.per-file-ignores] "breathe/parser/{compound,index}super.py" = [ "E266", # Too many leading `#` before block comment ] "examples/doxygen/pyexample.py" = [ "E266", # Too many leading `#` before block comment ] [lint.flake8-quotes] inline-quotes = "double" [lint.flake8-type-checking] exempt-modules = [] strict = true [lint.flake8-tidy-imports] ban-relative-imports = "all" [lint.isort] forced-separate = [ "tests", ] required-imports = [ "from __future__ import annotations", ] [lint.pydocstyle] convention = "pep257" ignore-decorators = ["typing.overload"] ignore-var-parameters = true breathe-doc-breathe-10a36f3/CHANGELOG.rst000066400000000000000000000717001475641424700176700ustar00rootroot00000000000000Change Log ---------- Inspired by `Keepachangelog.com `__. - 2025-02-22 - **Breathe v4.36.0** - Update `test_renderer` so that tests pass with Sphinx 7.2. `#976 `__ - Fix PosixPath issue with Sphinx 7.2. `#964 `__ - Avoid `RemovedInSphinx80Warning` in path-manipulation code. `#977 `__ - Require Sphinx 7.2 or later, Python 3.9 or later, and Doxygen 1.9.2 or later. `#887 `__, `#946 `__ `#955 `__ - Begin to use pathlib. - Resolve full title for doxygenpage and doxygengroup and allow for omitting the title all together `#939 `__ - Insert signature name for use with Sphinx Table of Contents `#959 `__ - Fix test failure with latest Sphinx master. `#1010 `__ - Fix error in template specialization with qualified arguments `#1010 `__ - 2023-02-28 - **Breathe v4.35.0** - Pull lone literal blocks in paragraphs up to produce correct doctree. `#833 `__ - Fix tests for changes in Sphinx 5.3. `#865 `__ - Bump Python requirement to 3.7. `#866 `__ - Support Sphinx 6. `#885 `__ - Support ``:sort:`` option to sort sections by name. `#879 `__ - 2022-06-20 - **Breathe v4.34.0** - Treat .unparsed as plain text. `#806 `__ - Remove unneeded type: ignore annotations. `#813 `__ - Fix internal ``NodeFinder`` visitor for when non-Docutils nodes are present in the content of a directive. `#812 `__ - Rename lint workflow. `#814 `__ - Type check pygments and limit docutils stub version. `#819 `__ - Convert dot files' relative path to absolute. `#821 `__ - CI, update Sphinx versions to test. `#834 `__ - CI, update for Sphinx 5.0.1. `#846 `__ - Fix inconsistency in example. `#843 `__ - Fix C# enum rendering crash. `#849 `__ - Drop Sphinx 3 support, add Sphinx 5 support. `#850 `__ - CICD: Disable python 3.6 for Sphinx master tests. `#853 `__ - Populate default include text-node's data field instead of raw-source. `#828 `__ - 2022-02-14 - **Breathe v4.33.1** - Avoid warning about multiple graphviz directives. `#804 `__ - 2022-02-14 - **Breathe v4.33.0** - Fix duplicate ``static`` in variable declarations. `#794 `__ - Update CICD for Sphinx 4.4.0 series. `#795 `__ - Pin version of black in CICD and reformat files. `#792 `__ - Fix code block highlighting. `#760 `__ - Refactoring, cleanup and typing improvements. `#802 `__ - Doxygen dot graphs to Sphinx graphviz. `#757 `__ - Support externally hosted images. `#705 `__ - Address a peculiarity in Doxygen aliases in doc. `#770 `__ - Add flag to doxygengroup, doxygennamespace to display only the description. `#718 `__ - Add support for MD block quotes with attribution(s). `#759 `__ - 2022-01-30 - **Breathe v4.32.0** - Added ``breathe_doxygen_aliases`` config variable. `#729 `__ - Render ``\remark``/``\remarks`` and ``\see``/``\sa`` using Sphinx/Docutils admonition style nodes. `#756 `__ - Render C++ scoped enums differently than unscoped enums, and with their underlying type. `#753 `__ - Render ``\retval`` lists using dedicated field list when Sphinx >= 4.3 is used. `#749 `__ - Make ``.. doxygenfunction`` handle function template specializations. `#750 `__ - Properly handle field-lists and admonitions in the detailed description of classes and functions. `#764 `__ - Add ``:confval:`breathe_show_include``` to control whether ``#include`` lines are shown. Defaults to ``True``. `#725 `__ - Fix sys.path adjustment in doc config. `#734 `__ - Fix sphinx renderer variable and function visitors for C#. `#737 `__ - Fix sphinx renderer class visitor for C#. `#738 `__ - Auto-format python code with black. `#743 `__ - Extend flake8 and address some style issues. `#745 `__ - Fix black formatting warning. `#747 `__ - Update Sphinx and Python versions tested against. `#765 `__ - Fix friend functions for older Doxygen versions. `#769 `__ - Doxygen >= 1.9.2 supports C++20 concepts, add support for them. `#779 `__ - Change the way directives are added to adhere to the interface, e.g., avoiding myst-parser to crash. `#780 `__ - Improved list of included files (with cross-references for local includes). `#763 `__ - Update flake8 and mypy related stuff. `#781 `__ - Update readme with logo and sponsorship info. `#784 `__ - Store version number in both setup.py and __init__.py. `#789 `__ - CICD: lint: continue with other jobs if black fails. `#791 `__ - 2021-09-14 - **Breathe v4.31.0** - Collapse multiple retvals into a single bullet list. `#697 `__ - Fix mypy issues on CI. `#731 `__ - Print usage message from 'compare' doc script. `#727 `__ - Test against Sphinx 4.0.3, 4.1.2 and 4.1.x branch. `#721 `__ - Fix duplicate ``static`` in function declarations. `#717 `__ `#720 `__ - Directive refactoring. `#698 `__ - Handle parsing errors. `#711 `__ - Make doxygenfunction more robust when matching parameters. `#722 `__ `#723 `__ - Separate, link and style the changelog. `#735 `__ - Update changelog and readme ahead of release. `#739 `__ - CICD: Track Sphinx 4.2.x development series. `#741 `__ - 2021-05-06 - **Breathe v4.30.0** - Fix retval rendering. `#687 `__ - Correctly label example as C. `#690 `__ - apidoc: add -m, --members option flag. `#694 `__ - 2021-04-30 - **Breathe v4.29.2** - Remove stale six dep. `#682 `__ - Render fields with multiple names instead of crashing. `#685 `__ - Start pytest via module instead of exe. `#686 `__ - 2021-04-23 - **Breathe v4.29.1** - Splice out parameter direction in field lists. `#675 `__ - Fixes for Sphinx v4. `#676 `__ - Fix paragraph in paragraph rendering. `#678 `__ - Strip names before lookup in doxygenfunction. `#679 `__ - When rendering template params, insert name by parsing. `#681 `__ - 2021-04-09 - **Breathe v4.29.0** - Do not add inline modifier for C#. `#668 `__ - Use add_css_file instead of deprecated/removed add_stylesheet. `#669 `__ - Use native docutils for field lists, notes, and warnings. `#670 `__ - Handle directives returning no nodes on error. `#672 `__ - 2021-03-29 - **Breathe v4.28.0** - Code and documentation for membergroups and members-only options. `#637 `__ - Add example.tag to gitignore as it gets modified during build process. `#644 `__ - Add support for content-only flag when rendering pages. `#645 `__ - When rendering a section, add target after title. `#647 `__ - Render pages content in order. `#651 `__ - Adds an ID to the rubric created for each section of a group. `#658 `__ - Add missing getter and setter for C#. `#661 `__ - Add support for rowspan/colspan to tables. `#642 `__ - 2021-02-16 - **Breathe v4.27.0** - Add various specifiers to functions and variables. `#628 `__ - Add multiply inherited class for PHP objects. `#630 `__ - Initial support for table rendering. `#632 `__ - Add rendering of \section, \subsection and \subsubsection. `#635 `__ - Sphinx 3.5 compatibility. `#640 `__ - Fix linking to sections. `#639 `__ - Add table examples to documentation. `#638 `__ - 2021-01-21 - **Breathe v4.26.1** - Fix doxygenfile causing duplicate IDs for unspecified sections. `#622 `__ - Fixes for doxygenfunction (friend keyword, friend class, arg checks). `#623 `__ - 2021-01-08 - **Breathe v4.26.0** - Add test for ellipsis ('...') in args. `#610 `__ - Sphinx 3.4.x compatibility. `#617 `__ - Adapt friendclass to Doxygen 1.9. `#618 `__ - 2020-12-16 - **Breathe v4.25.1** - Addendum to #606, for functions with '...'. `#609 `__ - 2020-12-15 - **Breathe v4.25.0** - Add support for \parblock parsing and rendering. `#603 `__ - Allow lookup in doxygenfunction without writing param names. `#606 `__ - 2020-12-01 - **Breathe v4.24.1** - Fix anchors on pages generated by Doxygen >= 1.8.17. `#602 `__ - 2020-11-15 - **Breathe v4.24.0** - Update CI for Sphinx 3.3.x and fix test mock. `#597 `__ - Add support for xrefitem based page generation (doxygenpage). `#596 `__ - 2020-10-20 - **Breathe v4.23.0** - Add initial xrefsect support. `#589 `__ - 2020-09-26 - **Breathe v4.22.1** - Fix anonymous struct/union usage in C domain. `#585 `__ - 2020-09-19 - **Breathe v4.22.0** - Fix Read the Docs build (again). `#576 `__ - New boolean `breathe_show_enumvalue_initializer` option specifying whether value of enumvalue should be displayed. `#581 `__ - 2020-09-10 - **Breathe v4.21.0** - Fix Read the Docs build. `#567 `__ - Document doxygenclass template specialisation spacing. `#570 `__ - Update upper Sphinx release to <3.4. `#571 `__ - Reuse breathe.__version__ in setup.py. `#572 `__ - Document :inner: for the doxygengroup section. `#573 `__ - Add support for verbatim inline elements. `#560 `__ - Fix wrong refid when Doxygen SEPARATE_MEMBER_PAGES is YES. `#566 `__ - 2020-08-19 - **Breathe v4.20.0** - Allow Sphinx 3.2. `#561 `__ - Update CI scripts with new Sphinx versions. `#552 `__ - Add support for C# using sphinx-csharp. `#550 `__ - Doc, fix typo, :source: -> :project:. `#551 `__ - Add support for innergroup. `#556 `__ - Avoid duplicate doxygen targets when debug tracing. `#563 `__ - Remove Travis badge from README file. `#564 `__ - 2020-06-17 - **Breathe v4.19.2** - Fix crash when visiting typedef. `#547 `__ - 2020-06-08 - **Breathe v4.19.1** - Mark package as compatible with Sphinx 3.1. - 2020-06-07 - **Breathe v4.19.0** - Refactoring. `#528 `__ - Make debug config variables available in conf.py. `#533 `__ - Fix warning formatting for function lookup. `#535 `__ - Correctly reverse nested namespaces in get_qualification. `#540 `__ - 2020-05-10 - **Breathe v4.18.1** - Fix friend class rendering and allow friend struct. `#522 `__ - Add extern examples to doc and remove variable hack. `#526 `__ - Render function candidates without using Sphinx directives. `#524 `__ - 2020-05-02 - **Breathe v4.18.0** - Support tiles in verbatim blocks. `#517 `__ - 2020-05-01 - **Breathe v4.17.0** - Scoped rendering, better integration with Sphinx, misc fixes. `#512 `__ - 2020-04-19 - **Breathe v4.16.0** - Strictly depend on Sphinx's minor version. `#498 `__ - Simplifications and fixes, use more of modern Sphinx natively. `#503 `__ - Add section option to the doxygen(auto)file directive. `#501 `__ - Fix link generation when enum is inside a group (enum FQDN). `#508 `__ - Fix creation of LaTeX math formulas. `#506 `__ - Improve documentation for doxygen(auto)file section option. `#509 `__ - 2020-04-07 - **Breathe v4.15.0** - Add license file to distribution. `#492 `__ - Update for Sphinx 3. `#491 `__ - 2020-04-07 - **Breathe v4.14.2** - Add GitHub actions. `#474 `__ - Fixes to use Sphinx 2.4.4. `#486 `__ - Add nose to python development requirements. #484. - Switch to pytest from nose. `#487 `__ - 2020-02-02 - **Breathe v4.14.1** - Use sphinx core instead of mathbase ext. `#469 `__ - Fix test failure for Sphinx >= 2.2.2. `#472 `__ - Update travis to Sphinx 2.3.1. `#471 `__ - 2019-11-26 - **Breathe v4.14.0** - Add events attribute to MockApp. `#452 `__ - Add bit field support for C/C++. `#454 `__ - Add alias and variable template support. `#461 `__ - 2019-08-01 - **Breathe v4.13.1** - Fix for template method pointer parameter issue. `#449 `__ - 2019-04-23 - **Breathe v4.13.0**.post0 - Drop support for python 2, require Sphinx >= 2.0. `#432 `__ - 2019-04-21 - **Breathe v4.13.0** - Adapt to upcoming Sphinx 2.0. `#411 `__ - Add support for rendering parameter direction information. `#428 `__ - 2019-03-15 - **Breathe v4.12.0** - Adapt to Sphinx 1.8. `#410 `__ - Let Sphinx handle more things. `#412 `__ - Use standard windows EOL for batch file. `#417 `__ - Fix flake8 F632 warnings. `#418 `__ - Update dep versions in readme, setup, requirements. `#419 `__ - Add option to render function parameters after the description. `#421 `__ - Remove spurious "typedef" in type declaration when using "using". `#424 `__ - 2018-12-11 - **Breathe v4.11.1** - Sphinxrenderer: handle typeless parameters gracefully. `#404 `__ - 2018-10-31 - **Breathe v4.11.0** - Fix typo in quickstart. `#393 `__ - Add support for QtSignals. `#401 `__ - 2018-08-07 - **Breathe v4.10.0** - Explicitly use Sphinx 1.7.5 for CI and dev. `#385 `__ - Print filename when printing ParserException. `#390 `__ - 2018-06-03 - **Breathe v4.9.1** - Don't append separator for paragraph type. `#382 `__ - 2018-06-01 - **Breathe v4.9.0** - Render newlines as separate paragraphs. `#380 `__ - 2018-05-26 - **Breathe v4.8.0** - Add quiet option to apidoc. `#375 `__ - Add PHP domain. `#351 `__ - Keep templates on adjacent lines. `#300 `__ - Show reference qualification for methods. `#332 `__ - Adapt tests/CI to newest Sphinx version. `#377 `__ - More robust name regex in renderer. `#370 `__ - Show base classes using Sphinx's cpp domain. `#295 `__ - Fix domain detection when rendering groups. `#365 `__ - Return parallel_{read,write}_safe true for Sphinx's -j. `#376 `__ - 2017-10-09 - **Breathe v4.7.3** - Support for enums in the cpp domain. - Handle case where compoundref does not have a refid value associated. - 2017-08-15 - **Breathe v4.7.2** - Fix issue with packaging on Python 2.7 with wheels. - 2017-08-13 - **Breathe v4.7.1** - Fixed bug regarding code snippets inside Doxygen comments. - 2017-08-09 - **Breathe v4.7.0** - New `outtypes` option to prevent documenting namespace and files - New boolean `breathe_show_define_initializer` option specifying whether value of macros should be displayed. - New boolean `breathe_use_project_refids` option controlling whether the refids generated by breathe for doxygen elements contain the project name or not. - Fixed - Support for Sphinx 1.6 - 2017-02-25 - **Breathe v4.6.0** - Support for the Interface directive - Display the contents of defines - 2017-02-12 - **Breathe v4.5.0** - Improve handling of c typedefs - Support new `desc_signature_line` node - Add `--project` flag to breathe-apidoc helper - Dropped testing for Python 3.3 and added 3.6 - 2016-11-13 - **Breathe v4.4.0** - Improve single line parameter documentation rendering - 2016-11-05 - **Breathe v4.3.1** - Version bump package confusion with wheel release - 2016-11-05 - **Breathe v4.3.0** - Rewritten rendering approach to use the visitor pattern - Dropped support for 2.6 & added testing for 3.5 - Fixed - Issue with running breathe-apidoc for the first time. - Improved handling of qualifiers, eg. const & volatile. - Supports functions in structs - Supports auto-doxygen code path on Windows - 2016-03-19 - **Breathe v4.2.0** - Added - Output links to a class' parents & children. - Support for Sphinx's `needs_extensions` config option. - breathe-apidoc script for generating ReStructuredText stub files with Breathe directives from doxygen xml files. - Fixed - Handling default values in parameter declarations - Output order not being reproducible due to iteration over Set. - Handling of multiple pointers and references - `SEVERE: Duplicate ID` warnings when using function overloads. - Use project name for link references when using default project. So we use the project name instead of 'project0'. - 2015-08-27 - **Breathe v4.1.0** - Added - ``breathe_doxygen_config_options`` config variable which allows for adding more config lines to the doxygen file used for the auto-directives. - Fixed - Display of array & array reference parameters for functions. - Handling of links to classes with template arguments. - Handling of unnamed enums in C. - Naming of template parameter section. - Finding functions that are within groups. - Rendering of 'typename' and 'class' keywords for templates. - 2015-04-02 - **Breathe v4.0.0** - Significant work on the code base with miminal reStructureText interface changes. To be documented. - 2014-11-09 - **Breathe v3.2.0** - Nothing Added, Deprecated or Removed - Fixed - Changed docutils/Sphinx node usage to fix latex/pdf output. - When checking for path separators check for both ``/`` and ``\`` regardless of the platform. - ``KeyError`` when using ``auto`` directives without specifying the ``:project:`` option even though the default project config setting was set. - Use of ``doxygenfunction`` no longer inappropriately triggers the duplicate target check and fails to output link targets. - Support for inline urls in the doxygen comments. - Support for array notation in function parameters. - Reduced intention by changing ``section-defs`` to use ``container`` & ``rubric`` nodes rather than ``desc`` nodes with signatures & content. Now headings like 'Public Functions' appear inline with their subject matter. - 2014-09-07 - **Breathe v3.1.0** - Nothing Deprecated or Removed - Added - The ``doxygenclass`` directive can now reference template specialisations by specifying the specialisation in the argument name. - Fixed - Displaying function parameters for Qt slots output. Previously they were missing even though Qt Slots are essentially just functions. - Displaying headings from doxygen comments as emphasized text. - Crash when generating warning about being unable to find a define, variable, enum, typedef or union. - Only output the definition name for a function parameter if the declartion name is not available. Previously, where they were both available we were getting two names next to each other for no good reason. - 2014-08-04 - **Breathe v3.0.0** - Improve output of const, volatile, virtual and pure-virtual keywords. - Fix css class output for HTML so that object types rather than names are output as the css classes. eg. 'function' instead of 'myFunction'. - Fix issue with Breathe getting confused over functions appearing in header and implementation files. - Improve matching for overloaded functions when using ``doxygenfunction`` directive. Also, provide a list of potential matches when no match is found. - Improved ``:members:`` implementation to handle inner classes properly. - Updated ``doxygenstruct`` to share the ``doxygenclass`` implementation path which grants it the options from ``doxygenclass`` directive. - Added ``:outline:`` option support to ``doxygengroup`` & ``doxygennamespace`` directives. - Added ``doxygennamespace`` directive. - Added ``:undoc-members:`` option to ``doxygenclass`` & ``doxygengroup`` directives. - **Breaking change**: Removed ``:sections:`` option for ``doxygenclass`` & ``doxygengroup`` directives and replaced it with ``:members:``, ``:protected-members:`` and ``:private-members:``, and changed ``breathe_default_sections`` config variable to ``breathe_default_members``. This is designed to more closely match the Sphinx autodoc functionality and interface. - 2014-06-15 - **Breathe v2.0.0** - Add compare script for checking changes to documentation caused by changes in the implementation. - Switched to ``https`` reference for MathJax Javascript. - **Breaking change**: Change ``autodoxygen*`` directives to require explicitly declared source files in the ``conf.py`` rather than attempting to detect them from the directive arguments. - Switch documentation hosting to ReadTheDocs.org. - **Breaking change**: Switch to assuming all relative paths are relative to the directory holding the ``conf.py`` file. Previously, it would assume they were relative to the user's current working directory. This breaks projects which use separate build & source directories. - Add ``doxygenunion`` directive. - Add ``doxygengroup`` directive. - Add support for lists in the output. They were previously ignored. - Updated implementation to use the docutils nodes that Sphinx does where possible. - 2014-06-01 - **Breathe v1.2.0** - Change log not recorded. breathe-doc-breathe-10a36f3/CONTRIBUTING.rst000066400000000000000000000012321475641424700203010ustar00rootroot00000000000000 Contributing ============ Firstly, thank you for making it this far. We really appreciate anyone who even thinks about reporting an issue or helping out with the code or docs. It is kind of you to take the time. Please Provide an Example ------------------------- If you're having trouble with how the contents of a particular Doxygen comment or a particular set of code is being processed then please provide an example of the in question. Ideally as a pull-request with additions to the `examples/specific` folder but feel free to provide the comment content in your issue instead. It really helps to accelerate development if we have examples to work from. breathe-doc-breathe-10a36f3/CONTRIBUTORS.rst000066400000000000000000000026501475641424700203340ustar00rootroot00000000000000Contributors ============ Many thanks to everyone that has contributed to the project. - `Andne `_ - `arximboldi `_ - `D4N `_ - `dean0x7d `_ - `dg-dboehi `_ - `eric-wieser `_ - `fetzerch `_ - `gmarull `_ - `hidmic `_ - `ishitatsuyuki `_ - `jakobandersen `_ - `mattip `_ - `michaeljones `_ - `nijel `_ - `olitheolix `_ - `pczerkas `_ - `queezythegreat `_ - `remyleone `_ - `rhssk `_ - `rogerbarton `_ - `ropg `_ - `rscohn2 `_ - `rweickelt `_ - `SylvainCorlay `_ - `t-b `_ - `Tiwalun `_ - `utzig `_ - `vermeeren `_ - `vitaut `_ - `xuhongxu96 `_ And many more via issues and suggestions. breathe-doc-breathe-10a36f3/LICENSE000066400000000000000000000030021475641424700166420ustar00rootroot00000000000000// BSD license, modified to remove the organisation as there isn't one. Copyright (c) 2009, Michael Jones All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. breathe-doc-breathe-10a36f3/Makefile000066400000000000000000000012451475641424700173040ustar00rootroot00000000000000 .PHONY: all all: html pdf .PHONY: html html: data $(MAKE) -C documentation html .PHONY: pdf pdf: data $(MAKE) -C documentation latexpdf .PHONY: data data: $(MAKE) -C examples/doxygen all $(MAKE) -C examples/tinyxml all $(MAKE) -C examples/specific all .PHONY: distclean distclean: clean $(MAKE) -C documentation clean .PHONY: clean clean: $(MAKE) -C examples/doxygen $@ $(MAKE) -C examples/tinyxml $@ $(MAKE) -C examples/specific $@ .PHONY: test test: cd tests && python3 -m pytest -v .PHONY: dev-test dev-test: cd tests && PYTHONPATH=../:$(PYTHONPATH) python3 -m pytest -v .PHONY: ruff ruff: ruff check ruff format .PHONY: type-check type-check: mypy breathe-doc-breathe-10a36f3/README.rst000066400000000000000000000124011475641424700173270ustar00rootroot00000000000000.. image:: https://www.breathe-doc.org/img/logo.svg :align: center :alt: Breathe logo :width: 200 :height: 200 :target: https://www.breathe-doc.org Breathe ======= **Your technical docs, beautifully integrated** .. image:: https://github.com/breathe-doc/breathe/actions/workflows/unit_tests.yml/badge.svg :target: https://github.com/breathe-doc/breathe/actions/workflows/unit_tests.yml :alt: Build Status Website_ • Documentation_ • Sponsor_ **Sponsor**: If you benefit from using Breathe as a company or an individual, you can financially support the Breathe project with recurring or one off contributions via `Open Collective `_. .. _Website: https://www.breathe-doc.org/ .. _Documentation: https://breathe.readthedocs.io/en/latest/ .. _Sponsor: https://opencollective.com/breathe ---- Breathe is a Sphinx plugin providing beautifully integrated Doxygen output in your user-facing documentation. It allows you to combine Doxygen's excellent technical understanding of your code base with the superb long form documentation output of the Sphinx system. For Packagers ------------- - Breathe packages on PyPI are PGP signed for Breathe >= v4.28.0. - Breathe tarballs on GitHub are PGP signed for Breathe >= v4.29.0. Download -------- Breathe is available from github and `PyPI, the Python Package Index `_. It can be installed with:: pip install breathe Documentation ------------- The documentation is available `here `__. Thank you to the people running `Read the Docs `_ for such an excellent service. The source for the documentation is in the ``documentation`` folder if you want to built it and read it locally. Testing ------- The testsuite can be run with:: make dev-test The documentation also does a good effort of covering the available functionality with different examples. To build the documentation, run:: make This will run doxygen over the example code and then run the Breathe documentation. View the results at:: documentation/build/html/index.html Further to this if you want to compare the current documentation output against a previous state in order to check for regressions there is a ``compare`` script in the ``documentation`` folder. It takes two arguments which are two commit references that you'd like to compare. This means that all your changes have to be committed first. Also the script does not resolve state dependent references like ``HEAD`` so provide concrete commit references like sha1s or branch names. A typical example is to compare your current branch output to master:: # Make sure all your changes are committed first cd documentation ./compare master my-branch This will do a checkout and build at each commit and then run ``meld`` against the resulting directories so you can see the differences introduced by your branch. Requirements ------------ Breathe requires Python 3.9+, Sphinx 7.2+, and Doxygen 1.9.2+. Mailing List Archives --------------------- The archive for the Google groups list can be found `here `__. The previous mailing list was on `librelist.com `__ and the archives are available `here `__. Please post new questions as GitHub issues. Projects Using Breathe ---------------------- Examples of projects that use Breathe: - `PyTorch `_ - `OpenPilot `_ - `XGBoost `_ - `NumPy `_ - `Mozilla's DeepSpeech `_ - `Microsoft's LightGBM `_ - `PyBind11 `_ - `Ceph `_ - `Apache Arrow `_ - `LVGL `_ - `Espressif IoT Development Framework `_ - `Zephyr Project `_ - `Plaid ML `_ - `Sony's Neural Network Libraries `_ - `fmt `_ Release ------- 1. Update `CHANGELOG.rst` and create the git tag (`vX.Y.Z`). 2. Push the tag to GitHub. 3. The `create-release.yml` workflow will publish the release to PyPI. 4. Go to https://github.com/breathe-doc/breathe/tags, select the new tag, and click the "Create release from tag" button to publish a GitHub release. Maintainers ----------- Breathe is currently maintained by `vermeeren `_ & `jakobandersen `_ and was formerly maintained by `michaeljones `_ & `vitaut `_. See `CONTRIBUTORS `_ for the full list. Acknowledgements ---------------- - Dimitri van Heesch for `Doxygen `_. - Georg Brandl for `Sphinx `_. - David Goodger for `Docutils `_ and reStructuredText. Changelog --------- See the `CHANGELOG.rst `_ breathe-doc-breathe-10a36f3/breathe-apidoc.py000077500000000000000000000002331475641424700210640ustar00rootroot00000000000000#!/usr/bin/env python from __future__ import annotations import sys if __name__ == "__main__": from breathe.apidoc import main sys.exit(main()) breathe-doc-breathe-10a36f3/breathe/000077500000000000000000000000001475641424700172545ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/breathe/README.rst000066400000000000000000000027471475641424700207550ustar00rootroot00000000000000 breathe ======= - **Subpackages** - **directive** - Contains some rst directive definitions. These were split out of `directives.py` when it started to become too large. - **parser** - Contains code for parsing the doxygen xml into a tree of Python objects. The vast majority of the code is autogenerated but there are now small but significant tweaks which means we don't regenerate it. - **finder** - Provides classes for finding nodes within the set of xml files generated by doxygen. Finders are generally used in the `run` methods of the directives to find the xml node which is then passed to the renderer to create the output. - **renderer** - Provides classes for rendering an xml node from the doxygen xml into docutils rst nodes which can be used by Sphinx. Breathe should ideally only produce rst nodes and not concern itself with the final output (html, latex, etc.) - **Submodules** - **directives** - Contains the definitions of some of the directives. The rest are in the files in the `directive` folder. It also contains all the set up code which registers with Sphinx and wires together all the various factories. - **process** - Contains the code responsible for running the `doxygen` process when using the `autodoxygen` directives. - **project** - Handles the concept of a `Project` which is the breathe term for a folder full of doxygen xml files. - **exception** - Contains the base class for all custom exceptions. breathe-doc-breathe-10a36f3/breathe/__init__.py000066400000000000000000000010531475641424700213640ustar00rootroot00000000000000from __future__ import annotations from typing import TYPE_CHECKING from breathe.directives.setup import setup as directive_setup from breathe.file_state_cache import setup as file_state_cache_setup from breathe.renderer.sphinxrenderer import setup as renderer_setup if TYPE_CHECKING: from sphinx.application import Sphinx __version__ = "4.36.0" def setup(app: Sphinx): directive_setup(app) file_state_cache_setup(app) renderer_setup(app) return {"version": __version__, "parallel_read_safe": True, "parallel_write_safe": True} breathe-doc-breathe-10a36f3/breathe/apidoc.py000066400000000000000000000156431475641424700210760ustar00rootroot00000000000000""" breathe.apidoc ~~~~~~~~~~~~~~ Parses doxygen XML tree looking for C/C++ modules and creates ReST files appropriately to create code documentation with Sphinx. It also creates a modules index (See TYPEDICT below.). This is derived from the "sphinx-autopackage" script, which is: Copyright 2008 Société des arts technologiques (SAT), http://www.sat.qc.ca/ :copyright: Originally by Sphinx Team, C++ modifications by Tatsuyuki Ishi :license: BSD, see LICENSE for details. """ from __future__ import annotations import argparse import os import sys import xml.etree.ElementTree from pathlib import Path from breathe import __version__ # Reference: Doxygen XSD schema file, CompoundKind only # Only what breathe supports are included # Translates identifier to English TYPEDICT = { "class": "Class", "interface": "Interface", "struct": "Struct", "union": "Union", "file": "File", "namespace": "Namespace", "group": "Group", } # Types that accept the :members: option. MEMBERS_TYPES = ["class", "group", "interface", "namespace", "struct"] def print_info(msg, args): if not args.quiet: print(msg) def write_file(name, text, args): """Write the output file for module/package .""" fname = Path(args.destdir, f"{name}.{args.suffix}") if args.dryrun: print_info("Would create file %s." % fname, args) return if not args.force and fname.is_file(): print_info("File %s already exists, skipping." % fname, args) else: print_info("Creating file %s." % fname, args) fname.parent.mkdir(parents=True, exist_ok=True) try: orig = fname.read_text() if orig == text: print_info("File %s up to date, skipping." % fname, args) return except FileNotFoundError: # Don't mind if it isn't there pass fname.write_text(text) def format_heading(level, text): """Create a heading of [1, 2 or 3 supported].""" underlining = ["=", "-", "~"][level - 1] * len(text) return "%s\n%s\n\n" % (text, underlining) def format_directive(package_type, package, args): """Create the breathe directive and add the options.""" directive = ".. doxygen%s:: %s\n" % (package_type, package) if args.project: directive += " :project: %s\n" % args.project if args.members and package_type in MEMBERS_TYPES: directive += " :members:\n" return directive def create_package_file(package, package_type, package_id, args): """Build the text of the file and write the file.""" # Skip over types that weren't requested if package_type not in args.outtypes: return text = format_heading(1, "%s %s" % (TYPEDICT[package_type], package)) text += format_directive(package_type, package, args) write_file(Path(package_type, package_id), text, args) def create_modules_toc_file(key, value, args): """Create the module's index.""" if not Path(args.destdir, key).is_dir(): return text = format_heading(1, "%s list" % value) text += ".. toctree::\n" text += " :glob:\n\n" text += " %s/*\n" % key write_file("%slist" % key, text, args) def recurse_tree(args): """ Look for every file in the directory tree and create the corresponding ReST files. """ index = xml.etree.ElementTree.parse(Path(args.rootpath, "index.xml")) # Assuming this is a valid Doxygen XML for compound in index.getroot(): create_package_file( compound.findtext("name"), compound.get("kind"), compound.get("refid"), args ) class TypeAction(argparse.Action): def __init__(self, option_strings, dest, **kwargs): super().__init__(option_strings, dest, **kwargs) self.default = TYPEDICT.keys() self.metavar = ",".join(TYPEDICT.keys()) def __call__(self, parser, namespace, values, option_string=None): value_list = values.split(",") for value in value_list: if value not in TYPEDICT: raise ValueError("%s not a valid option" % value) setattr(namespace, self.dest, value_list) def main(): """Parse and check the command line arguments.""" parser = argparse.ArgumentParser( description="""\ Parse XML created by Doxygen in and create one reST file with breathe generation directives per definition in the . Note: By default this script will not overwrite already created files.""", formatter_class=argparse.RawDescriptionHelpFormatter, ) parser.add_argument( "-o", "--output-dir", action="store", dest="destdir", help="Directory to place all output", required=True, ) parser.add_argument( "-f", "--force", action="store_true", dest="force", help="Overwrite existing files" ) parser.add_argument( "-m", "--members", action="store_true", dest="members", help="Include members for types: %s" % MEMBERS_TYPES, ) parser.add_argument( "-n", "--dry-run", action="store_true", dest="dryrun", help="Run the script without creating files", ) parser.add_argument( "-T", "--no-toc", action="store_true", dest="notoc", help="Don't create a table of contents file", ) parser.add_argument( "-s", "--suffix", action="store", dest="suffix", help="file suffix (default: rst)", default="rst", ) parser.add_argument( "-p", "--project", action="store", dest="project", help="project to add to generated directives", ) parser.add_argument( "-g", "--generate", action=TypeAction, dest="outtypes", help="types of output to generate, comma-separated list", ) parser.add_argument( "-q", "--quiet", action="store_true", dest="quiet", help="suppress informational messages" ) parser.add_argument( "--version", action="version", version="Breathe (breathe-apidoc) %s" % __version__ ) parser.add_argument("rootpath", type=str, help="The directory contains index.xml") args = parser.parse_args() args.suffix = args.suffix.removeprefix(".") if not os.path.isdir(args.rootpath): print("%s is not a directory." % args.rootpath, file=sys.stderr) sys.exit(1) if "index.xml" not in os.listdir(args.rootpath): print("%s does not contain a index.xml" % args.rootpath, file=sys.stderr) sys.exit(1) if not os.path.isdir(args.destdir): if not args.dryrun: os.makedirs(args.destdir) args.rootpath = os.path.abspath(args.rootpath) recurse_tree(args) if not args.notoc: for key in args.outtypes: create_modules_toc_file(key, TYPEDICT[key], args) # So program can be started with "python -m breathe.apidoc ..." if __name__ == "__main__": main() breathe-doc-breathe-10a36f3/breathe/directives/000077500000000000000000000000001475641424700214155ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/breathe/directives/__init__.py000066400000000000000000000101021475641424700235200ustar00rootroot00000000000000from __future__ import annotations from typing import TYPE_CHECKING from docutils import nodes from sphinx.directives import SphinxDirective from breathe.finder.factory import FinderFactory from breathe.parser import FileIOError, ParserError from breathe.renderer import RenderContext, format_parser_error from breathe.renderer.filter import FilterFactory from breathe.renderer.sphinxrenderer import SphinxRenderer if TYPE_CHECKING: from collections.abc import Sequence from typing import Any from breathe.parser import DoxygenParserFactory from breathe.project import ProjectInfo, ProjectInfoFactory from breathe.renderer.filter import Filter from breathe.renderer.mask import MaskFactoryBase from breathe.renderer.target import TargetHandler class _WarningHandler: def __init__(self, state, context: dict[str, Any]) -> None: self.state = state self.context = context def warn( self, raw_text: str, *, rendered_nodes: Sequence[nodes.Node] | None = None, unformatted_suffix: str = "", ) -> list[nodes.Node]: raw_text = self.format(raw_text) + unformatted_suffix if rendered_nodes is None: rendered_nodes = [nodes.paragraph("", "", nodes.Text(raw_text))] return [ nodes.warning("", *rendered_nodes), self.state.document.reporter.warning(raw_text, line=self.context["lineno"]), ] def format(self, text: str) -> str: return text.format(**self.context) class BaseDirective(SphinxDirective): @property def directive_args(self) -> list: # the order must be the same as in docutils.parsers.rst.Directive.__init__ return [ self.name, self.arguments, self.options, self.content, self.lineno, self.content_offset, self.block_text, self.state, self.state_machine, ] @property def project_info_factory(self) -> ProjectInfoFactory: return self.env.temp_data["breathe_project_info_factory"] @property def parser_factory(self) -> DoxygenParserFactory: return self.env.temp_data["breathe_parser_factory"] @property def finder_factory(self) -> FinderFactory: return FinderFactory(self.env.app, self.parser_factory) @property def filter_factory(self) -> FilterFactory: return FilterFactory(self.env.app) @property def kind(self) -> str: raise NotImplementedError def create_warning(self, project_info: ProjectInfo | None, **kwargs) -> _WarningHandler: if project_info: proj_name = project_info.name() proj_path = project_info.project_path() tail = f'in doxygen xml output for project "{proj_name}" from directory: {proj_path}' else: tail = "" context = dict(lineno=self.lineno, tail=tail, **kwargs) return _WarningHandler(self.state, context) def render( self, node_stack, project_info: ProjectInfo, filter_: Filter, target_handler: TargetHandler, mask_factory: MaskFactoryBase, directive_args, ) -> list[nodes.Node]: "Standard render process used by subclasses" try: object_renderer = SphinxRenderer( self.parser_factory.app, project_info, node_stack, self.state, self.state.document, target_handler, self.parser_factory.create_compound_parser(project_info), filter_, ) except ParserError as e: return format_parser_error( "doxygenclass", e.error, e.filename, self.state, self.lineno, True ) except FileIOError as e: return format_parser_error( "doxygenclass", e.error, e.filename, self.state, self.lineno, True ) context = RenderContext(node_stack, mask_factory, directive_args) return object_renderer.render(node_stack[0], context) breathe-doc-breathe-10a36f3/breathe/directives/class_like.py000066400000000000000000000051371475641424700241060ustar00rootroot00000000000000from __future__ import annotations from typing import TYPE_CHECKING from docutils.parsers.rst.directives import flag, unchanged, unchanged_required from breathe.directives import BaseDirective from breathe.file_state_cache import MTimeError from breathe.project import ProjectError from breathe.renderer.mask import NullMaskFactory from breathe.renderer.target import create_target_handler if TYPE_CHECKING: from typing import Any from docutils.nodes import Node class _DoxygenClassLikeDirective(BaseDirective): required_arguments = 1 optional_arguments = 0 final_argument_whitespace = True option_spec = { "path": unchanged_required, "project": unchanged_required, "members": unchanged, "membergroups": unchanged_required, "members-only": flag, "protected-members": flag, "private-members": flag, "undoc-members": flag, "show": unchanged_required, "outline": flag, "no-link": flag, "allow-dot-graphs": flag, } has_content = False def run(self) -> list[Node]: name = self.arguments[0] try: project_info = self.project_info_factory.create_project_info(self.options) except ProjectError as e: warning = self.create_warning(None, kind=self.kind) return warning.warn("doxygen{kind}: %s" % e) try: finder = self.finder_factory.create_finder(project_info) except MTimeError as e: warning = self.create_warning(None, kind=self.kind) return warning.warn("doxygen{kind}: %s" % e) finder_filter = self.filter_factory.create_compound_finder_filter(name, self.kind) # TODO: find a more specific type for the Doxygen nodes matches: list[Any] = [] finder.filter_(finder_filter, matches) if len(matches) == 0: warning = self.create_warning(project_info, name=name, kind=self.kind) return warning.warn('doxygen{kind}: Cannot find class "{name}" {tail}') target_handler = create_target_handler(self.options, project_info, self.state.document) filter_ = self.filter_factory.create_class_filter(name, self.options) mask_factory = NullMaskFactory() return self.render( matches[0], project_info, filter_, target_handler, mask_factory, self.directive_args ) class DoxygenClassDirective(_DoxygenClassLikeDirective): kind = "class" class DoxygenStructDirective(_DoxygenClassLikeDirective): kind = "struct" class DoxygenInterfaceDirective(_DoxygenClassLikeDirective): kind = "interface" breathe-doc-breathe-10a36f3/breathe/directives/content_block.py000066400000000000000000000106441475641424700246200ustar00rootroot00000000000000from __future__ import annotations from typing import TYPE_CHECKING from docutils.parsers.rst.directives import flag, unchanged_required from breathe.directives import BaseDirective from breathe.file_state_cache import MTimeError from breathe.project import ProjectError from breathe.renderer import RenderContext from breathe.renderer.mask import NullMaskFactory from breathe.renderer.sphinxrenderer import SphinxRenderer from breathe.renderer.target import create_target_handler if TYPE_CHECKING: from typing import Any from docutils.nodes import Node class _DoxygenContentBlockDirective(BaseDirective): """Base class for namespace and group directives which have very similar behaviours""" required_arguments = 1 optional_arguments = 1 option_spec = { "path": unchanged_required, "project": unchanged_required, "content-only": flag, "outline": flag, "members": flag, "protected-members": flag, "private-members": flag, "undoc-members": flag, "no-link": flag, "desc-only": flag, "sort": flag, } has_content = False def run(self) -> list[Node]: name = self.arguments[0] try: project_info = self.project_info_factory.create_project_info(self.options) except ProjectError as e: warning = self.create_warning(None, kind=self.kind) return warning.warn("doxygen{kind}: %s" % e) try: finder = self.finder_factory.create_finder(project_info) except MTimeError as e: warning = self.create_warning(None, kind=self.kind) return warning.warn("doxygen{kind}: %s" % e) finder_filter = self.filter_factory.create_finder_filter(self.kind, name) # TODO: find a more specific type for the Doxygen nodes matches: list[Any] = [] finder.filter_(finder_filter, matches) # It shouldn't be possible to have too many matches as namespaces & groups in their nature # are merged together if there are multiple declarations, so we only check for no matches if not matches: warning = self.create_warning(project_info, name=name, kind=self.kind) return warning.warn('doxygen{kind}: Cannot find {kind} "{name}" {tail}') if "content-only" in self.options and self.kind != "page": # Unpack the single entry in the matches list (node_stack,) = matches filter_ = self.filter_factory.create_content_filter(self.kind, self.options) # Having found the compound node for the namespace or group in the index we want to grab # the contents of it which match the filter contents_finder = self.finder_factory.create_finder_from_root( node_stack[0], project_info ) # TODO: find a more specific type for the Doxygen nodes contents: list[Any] = [] contents_finder.filter_(filter_, contents) # Replaces matches with our new starting points matches = contents target_handler = create_target_handler(self.options, project_info, self.state.document) filter_ = self.filter_factory.create_render_filter(self.kind, self.options) node_list: list[Node] = [] for node_stack in matches: object_renderer = SphinxRenderer( self.parser_factory.app, project_info, node_stack, self.state, self.state.document, target_handler, self.parser_factory.create_compound_parser(project_info), filter_, ) mask_factory = NullMaskFactory() context = RenderContext(node_stack, mask_factory, self.directive_args) node_list.extend(object_renderer.render(context.node_stack[0], context)) return node_list class DoxygenNamespaceDirective(_DoxygenContentBlockDirective): kind = "namespace" class DoxygenGroupDirective(_DoxygenContentBlockDirective): kind = "group" option_spec = _DoxygenContentBlockDirective.option_spec.copy() option_spec.update({ "inner": flag, "no-title": flag, }) class DoxygenPageDirective(_DoxygenContentBlockDirective): kind = "page" option_spec = { "path": unchanged_required, "project": unchanged_required, "content-only": flag, "no-title": flag, } breathe-doc-breathe-10a36f3/breathe/directives/file.py000066400000000000000000000076541475641424700227220ustar00rootroot00000000000000from __future__ import annotations from docutils.parsers.rst.directives import flag, unchanged_required from breathe.directives import BaseDirective from breathe.project import ProjectError from breathe.renderer import RenderContext from breathe.renderer.mask import NullMaskFactory from breathe.renderer.sphinxrenderer import SphinxRenderer from breathe.renderer.target import create_target_handler class _BaseFileDirective(BaseDirective): """Base class handle the main work when given the appropriate file and project info to work from. """ # We use inheritance here rather than a separate object and composition, because so much # information is present in the Directive class from the docutils framework that we'd have to # pass way too much stuff to a helper object to be reasonable. def handle_contents(self, file_, project_info): finder = self.finder_factory.create_finder(project_info) finder_filter = self.filter_factory.create_file_finder_filter(file_) matches = [] finder.filter_(finder_filter, matches) if len(matches) > 1: warning = self.create_warning(None, file=file_, directivename=self.directive_name) return warning.warn('{directivename}: Found multiple matches for file "{file} {tail}') elif not matches: warning = self.create_warning(None, file=file_, directivename=self.directive_name) return warning.warn('{directivename}: Cannot find file "{file} {tail}') target_handler = create_target_handler(self.options, project_info, self.state.document) filter_ = self.filter_factory.create_file_filter(file_, self.options) node_list = [] for node_stack in matches: object_renderer = SphinxRenderer( self.parser_factory.app, project_info, node_stack, self.state, self.state.document, target_handler, self.parser_factory.create_compound_parser(project_info), filter_, ) mask_factory = NullMaskFactory() context = RenderContext(node_stack, mask_factory, self.directive_args) node_list.extend(object_renderer.render(node_stack[0], context)) return node_list class DoxygenFileDirective(_BaseFileDirective): directive_name = "doxygenfile" required_arguments = 0 optional_arguments = 3 option_spec = { "path": unchanged_required, "project": unchanged_required, "outline": flag, "no-link": flag, "allow-dot-graphs": flag, "sections": unchanged_required, } has_content = False def run(self): """Get the file from the argument and the project info from the factory.""" file_ = self.arguments[0] try: project_info = self.project_info_factory.create_project_info(self.options) except ProjectError as e: warning = self.create_warning(None) return warning.warn("doxygenfile: %s" % e) return self.handle_contents(file_, project_info) class AutoDoxygenFileDirective(_BaseFileDirective): directive_name = "autodoxygenfile" required_arguments = 1 option_spec = { "project": unchanged_required, "outline": flag, "no-link": flag, "allow-dot-graphs": flag, "sections": unchanged_required, } has_content = False def run(self): """Get the file from the argument and extract the associated project info for the named project given that it is an auto-project. """ file_ = self.arguments[0] try: project_info = self.project_info_factory.retrieve_project_info_for_auto(self.options) except ProjectError as e: warning = self.create_warning(None) return warning.warn("autodoxygenfile: %s" % e) return self.handle_contents(file_, project_info) breathe-doc-breathe-10a36f3/breathe/directives/function.py000066400000000000000000000265111475641424700236210ustar00rootroot00000000000000from __future__ import annotations import re from typing import TYPE_CHECKING from docutils import nodes from docutils.parsers.rst.directives import flag, unchanged_required from sphinx.domains import cpp from breathe.directives import BaseDirective from breathe.exception import BreatheError from breathe.file_state_cache import MTimeError from breathe.parser import FileIOError, ParserError from breathe.project import ProjectError from breathe.renderer import RenderContext, format_parser_error from breathe.renderer.mask import MaskFactory, NoParameterNamesMask, NullMaskFactory from breathe.renderer.sphinxrenderer import SphinxRenderer, WithContext from breathe.renderer.target import create_target_handler if TYPE_CHECKING: from typing import Any from docutils.nodes import Node class _NoMatchingFunctionError(BreatheError): pass class _UnableToResolveFunctionError(BreatheError): def __init__(self, signatures: list[str]) -> None: self.signatures = signatures class DoxygenFunctionDirective(BaseDirective): required_arguments = 1 option_spec = { "path": unchanged_required, "project": unchanged_required, "outline": flag, "no-link": flag, } has_content = False final_argument_whitespace = True def run(self) -> list[Node]: # Extract namespace, function name, and parameters # Regex explanation: # 1. (?:::)? # Optional namespace prefix, including template arguments if a specialization. # The is group 1: # 1. [^:(<]+, basically an identifier # definitely not a scope operator, ::, or template argument list, < # 2. (?:::[^:(<]+)*, (?:) for anon match group, # so a namespace delimiter and then another identifier # 3. ::, another namespace delimiter before the function name # 2. ([^(]+), group 2, the function name, whatever remains after the optional prefix, # until a (. # 3. (.*), group 3, the parameters. # Note: for template argument lists, the spacing is important for the Doxygen lookup. # TODO: we should really do this parsing differently, e.g., using the Sphinx C++ domain. # TODO: the Doxygen lookup should not be whitespace sensitive. match = re.match(r"(?:([^:(<]+(?:::[^:(<]+)*)::)?([^(]+)(.*)", self.arguments[0]) assert match is not None # TODO: this is probably not appropriate, for now it fixes typing namespace = (match.group(1) or "").strip() function_name = match.group(2).strip() argsStr = match.group(3) try: project_info = self.project_info_factory.create_project_info(self.options) except ProjectError as e: warning = self.create_warning(None) return warning.warn("doxygenfunction: %s" % e) try: finder = self.finder_factory.create_finder(project_info) except MTimeError as e: warning = self.create_warning(None) return warning.warn("doxygenfunction: %s" % e) # Extract arguments from the function name. try: args = self._parse_args(argsStr) except cpp.DefinitionError as e: return self.create_warning( project_info, namespace="%s::" % namespace if namespace else "", function=function_name, args=argsStr, cpperror=str(e), ).warn( "doxygenfunction: Unable to resolve function " '"{namespace}{function}" with arguments "{args}".\n' "Could not parse arguments. Parsing error is\n{cpperror}" ) finder_filter = self.filter_factory.create_function_and_all_friend_finder_filter( namespace, function_name ) # TODO: find a more specific type for the Doxygen nodes matchesAll: list[Any] = [] finder.filter_(finder_filter, matchesAll) matches = [] for m in matchesAll: # only take functions and friend functions # ignore friend classes node = m[0] if node.kind == "friend" and not node.argsstring: continue matches.append(m) # Create it ahead of time as it is cheap and it is ugly to declare it for both exception # clauses below warning = self.create_warning( project_info, namespace="%s::" % namespace if namespace else "", function=function_name, args=str(args), ) try: node_stack = self._resolve_function(matches, args, project_info) except _NoMatchingFunctionError: return warning.warn( 'doxygenfunction: Cannot find function "{namespace}{function}" {tail}' ) except _UnableToResolveFunctionError as error: message = ( "doxygenfunction: Unable to resolve function " '"{namespace}{function}" with arguments {args} {tail}.\n' "Potential matches:\n" ) text = "" for i, entry in enumerate(sorted(error.signatures)): text += "- %s\n" % entry block = nodes.literal_block("", "", nodes.Text(text)) formatted_message = warning.format(message) warning_nodes = [nodes.paragraph("", "", nodes.Text(formatted_message)), block] result = warning.warn(message, rendered_nodes=warning_nodes, unformatted_suffix=text) return result except cpp.DefinitionError as error: warning.context["cpperror"] = str(error) return warning.warn( "doxygenfunction: Unable to resolve function " '"{namespace}{function}" with arguments "{args}".\n' "Candidate function could not be parsed. Parsing error is\n{cpperror}" ) target_handler = create_target_handler(self.options, project_info, self.state.document) filter_ = self.filter_factory.create_outline_filter(self.options) return self.render( node_stack, project_info, filter_, target_handler, NullMaskFactory(), self.directive_args, ) def _parse_args(self, function_description: str) -> cpp.ASTParametersQualifiers | None: # Note: the caller must catch cpp.DefinitionError if function_description == "": return None parser = cpp.DefinitionParser( function_description, location=self.get_source_info(), config=self.config ) paramQual = parser._parse_parameters_and_qualifiers("function") # strip everything that doesn't contribute to overloading def stripParamQual(paramQual): paramQual.exceptionSpec = None paramQual.final = None paramQual.override = None # TODO: strip attrs when Doxygen handles them paramQual.initializer = None paramQual.trailingReturn = None for p in paramQual.args: if p.arg is None: assert p.ellipsis continue p.arg.init = None declarator = p.arg.type.decl def stripDeclarator(declarator): if hasattr(declarator, "next"): stripDeclarator(declarator.next) if isinstance(declarator, cpp.ASTDeclaratorParen): assert hasattr(declarator, "inner") stripDeclarator(declarator.inner) else: assert isinstance(declarator, cpp.ASTDeclaratorNameParamQual) assert hasattr(declarator, "declId") declarator.declId = None if declarator.paramQual is not None: stripParamQual(declarator.paramQual) stripDeclarator(declarator) stripParamQual(paramQual) return paramQual def _create_function_signature( self, node_stack, project_info, filter_, target_handler, mask_factory, directive_args ) -> str: "Standard render process used by subclasses" try: object_renderer = SphinxRenderer( self.parser_factory.app, project_info, node_stack, self.state, self.state.document, target_handler, self.parser_factory.create_compound_parser(project_info), filter_, ) except ParserError as e: return format_parser_error( "doxygenclass", e.error, e.filename, self.state, self.lineno, True ) except FileIOError as e: return format_parser_error( "doxygenclass", e.error, e.filename, self.state, self.lineno, False ) context = RenderContext(node_stack, mask_factory, directive_args) node = node_stack[0] with WithContext(object_renderer, context): # this part should be kept in sync with visit_function in sphinxrenderer name = node.get_name() # assume we are only doing this for C++ declarations declaration = " ".join([ object_renderer.create_template_prefix(node), "".join(n.astext() for n in object_renderer.render(node.get_type())), name, node.get_argsstring(), ]) parser = cpp.DefinitionParser( declaration, location=self.get_source_info(), config=self.config ) ast = parser.parse_declaration("function", "function") return str(ast) def _resolve_function(self, matches, args: cpp.ASTParametersQualifiers | None, project_info): if not matches: raise _NoMatchingFunctionError() res = [] candSignatures = [] for entry in matches: text_options = {"no-link": "", "outline": ""} # Render the matches to docutils nodes target_handler = create_target_handler( {"no-link": ""}, project_info, self.state.document ) filter_ = self.filter_factory.create_outline_filter(text_options) mask_factory = MaskFactory({"param": NoParameterNamesMask}) # Override the directive args for this render directive_args = self.directive_args[:] directive_args[2] = text_options signature = self._create_function_signature( entry, project_info, filter_, target_handler, mask_factory, directive_args ) candSignatures.append(signature) if args is not None: match = re.match(r"([^(]*)(.*)", signature) assert match _match_args = match.group(2) # Parse the text to find the arguments # This one should succeed as it came from _create_function_signature match_args = self._parse_args(_match_args) # Match them against the arg spec if args != match_args: continue res.append((entry, signature)) if len(res) == 1: return res[0][0] else: raise _UnableToResolveFunctionError(candSignatures) breathe-doc-breathe-10a36f3/breathe/directives/index.py000066400000000000000000000075741475641424700231130ustar00rootroot00000000000000from __future__ import annotations from typing import TYPE_CHECKING from docutils.parsers.rst.directives import flag, unchanged_required from breathe.directives import BaseDirective from breathe.parser import FileIOError, ParserError from breathe.project import ProjectError from breathe.renderer import RenderContext, format_parser_error from breathe.renderer.mask import NullMaskFactory from breathe.renderer.sphinxrenderer import SphinxRenderer from breathe.renderer.target import create_target_handler if TYPE_CHECKING: from docutils.nodes import Node class RootDataObject: node_type = "root" class _BaseIndexDirective(BaseDirective): """Base class handle the main work when given the appropriate project info to work from.""" # We use inheritance here rather than a separate object and composition, because so much # information is present in the Directive class from the docutils framework that we'd have to # pass way too much stuff to a helper object to be reasonable. def handle_contents(self, project_info): try: finder = self.finder_factory.create_finder(project_info) except ParserError as e: return format_parser_error( self.name, e.error, e.filename, self.state, self.lineno, True ) except FileIOError as e: return format_parser_error(self.name, e.error, e.filename, self.state, self.lineno) data_object = finder.root() target_handler = create_target_handler(self.options, project_info, self.state.document) filter_ = self.filter_factory.create_index_filter(self.options) object_renderer = SphinxRenderer( self.parser_factory.app, project_info, [data_object], self.state, self.state.document, target_handler, self.parser_factory.create_compound_parser(project_info), filter_, ) mask_factory = NullMaskFactory() context = RenderContext([data_object, RootDataObject()], mask_factory, self.directive_args) try: node_list = object_renderer.render(context.node_stack[0], context) except ParserError as e: return format_parser_error( self.name, e.error, e.filename, self.state, self.lineno, True ) except FileIOError as e: return format_parser_error(self.name, e.error, e.filename, self.state, self.lineno) return node_list class DoxygenIndexDirective(_BaseIndexDirective): required_arguments = 0 optional_arguments = 2 option_spec = { "path": unchanged_required, "project": unchanged_required, "outline": flag, "no-link": flag, "allow-dot-graphs": flag, } has_content = False def run(self): """Extract the project info and pass it to the helper method""" try: project_info = self.project_info_factory.create_project_info(self.options) except ProjectError as e: warning = self.create_warning(None) return warning.warn("doxygenindex: %s" % e) return self.handle_contents(project_info) class AutoDoxygenIndexDirective(_BaseIndexDirective): required_arguments = 0 final_argument_whitespace = True option_spec = { "project": unchanged_required, "outline": flag, "no-link": flag, "allow-dot-graphs": flag, } has_content = False def run(self) -> list[Node]: """Extract the project info from the auto project info store and pass it to the helper method. """ try: project_info = self.project_info_factory.retrieve_project_info_for_auto(self.options) except ProjectError as e: warning = self.create_warning(None) return warning.warn("autodoxygenindex: %s" % e) return self.handle_contents(project_info) breathe-doc-breathe-10a36f3/breathe/directives/item.py000066400000000000000000000100751475641424700227300ustar00rootroot00000000000000from __future__ import annotations from typing import TYPE_CHECKING from docutils.parsers.rst.directives import flag, unchanged_required from breathe.directives import BaseDirective from breathe.file_state_cache import MTimeError from breathe.project import ProjectError from breathe.renderer.mask import NullMaskFactory from breathe.renderer.target import create_target_handler if TYPE_CHECKING: from typing import Any from docutils.nodes import Node from breathe.renderer.filter import Filter class _DoxygenBaseItemDirective(BaseDirective): required_arguments = 1 optional_arguments = 1 option_spec = { "path": unchanged_required, "project": unchanged_required, "outline": flag, "no-link": flag, } has_content = False def create_finder_filter(self, namespace: str, name: str) -> Filter: """Creates a filter to find the node corresponding to this item.""" return self.filter_factory.create_member_finder_filter(namespace, name, self.kind) def run(self) -> list[Node]: try: namespace, name = self.arguments[0].rsplit("::", 1) except ValueError: namespace, name = "", self.arguments[0] try: project_info = self.project_info_factory.create_project_info(self.options) except ProjectError as e: warning = self.create_warning(None, kind=self.kind) return warning.warn("doxygen{kind}: %s" % e) try: finder = self.finder_factory.create_finder(project_info) except MTimeError as e: warning = self.create_warning(None, kind=self.kind) return warning.warn("doxygen{kind}: %s" % e) finder_filter = self.create_finder_filter(namespace, name) # TODO: find a more specific type for the Doxygen nodes matches: list[Any] = [] finder.filter_(finder_filter, matches) if len(matches) == 0: display_name = "%s::%s" % (namespace, name) if namespace else name warning = self.create_warning(project_info, kind=self.kind, display_name=display_name) return warning.warn('doxygen{kind}: Cannot find {kind} "{display_name}" {tail}') target_handler = create_target_handler(self.options, project_info, self.state.document) filter_ = self.filter_factory.create_outline_filter(self.options) node_stack = matches[0] mask_factory = NullMaskFactory() return self.render( node_stack, project_info, filter_, target_handler, mask_factory, self.directive_args ) class DoxygenVariableDirective(_DoxygenBaseItemDirective): kind = "variable" class DoxygenDefineDirective(_DoxygenBaseItemDirective): kind = "define" class DoxygenConceptDirective(_DoxygenBaseItemDirective): kind = "concept" def create_finder_filter(self, namespace: str, name: str) -> Filter: # Unions are stored in the xml file with their fully namespaced name # We're using C++ namespaces here, it might be best to make this file # type dependent # xml_name = "%s::%s" % (namespace, name) if namespace else name return self.filter_factory.create_compound_finder_filter(xml_name, "concept") class DoxygenEnumDirective(_DoxygenBaseItemDirective): kind = "enum" class DoxygenEnumValueDirective(_DoxygenBaseItemDirective): kind = "enumvalue" def create_finder_filter(self, namespace: str, name: str) -> Filter: return self.filter_factory.create_enumvalue_finder_filter(name) class DoxygenTypedefDirective(_DoxygenBaseItemDirective): kind = "typedef" class DoxygenUnionDirective(_DoxygenBaseItemDirective): kind = "union" def create_finder_filter(self, namespace: str, name: str) -> Filter: # Unions are stored in the xml file with their fully namespaced name # We're using C++ namespaces here, it might be best to make this file # type dependent # xml_name = "%s::%s" % (namespace, name) if namespace else name return self.filter_factory.create_compound_finder_filter(xml_name, "union") breathe-doc-breathe-10a36f3/breathe/directives/setup.py000066400000000000000000000120111475641424700231220ustar00rootroot00000000000000from __future__ import annotations import subprocess from pathlib import Path from typing import TYPE_CHECKING from breathe.directives.class_like import ( DoxygenClassDirective, DoxygenInterfaceDirective, DoxygenStructDirective, ) from breathe.directives.content_block import ( DoxygenGroupDirective, DoxygenNamespaceDirective, DoxygenPageDirective, ) from breathe.directives.file import AutoDoxygenFileDirective, DoxygenFileDirective from breathe.directives.function import DoxygenFunctionDirective from breathe.directives.index import AutoDoxygenIndexDirective, DoxygenIndexDirective from breathe.directives.item import ( DoxygenConceptDirective, DoxygenDefineDirective, DoxygenEnumDirective, DoxygenEnumValueDirective, DoxygenTypedefDirective, DoxygenUnionDirective, DoxygenVariableDirective, ) from breathe.parser import DoxygenParserFactory from breathe.process import AutoDoxygenProcessHandle from breathe.project import ProjectInfoFactory if TYPE_CHECKING: from sphinx.application import Sphinx def setup(app: Sphinx) -> None: directives = { "doxygenindex": DoxygenIndexDirective, "autodoxygenindex": AutoDoxygenIndexDirective, "doxygenfunction": DoxygenFunctionDirective, "doxygenstruct": DoxygenStructDirective, "doxygenclass": DoxygenClassDirective, "doxygeninterface": DoxygenInterfaceDirective, "doxygenvariable": DoxygenVariableDirective, "doxygendefine": DoxygenDefineDirective, "doxygenconcept": DoxygenConceptDirective, "doxygenenum": DoxygenEnumDirective, "doxygenenumvalue": DoxygenEnumValueDirective, "doxygentypedef": DoxygenTypedefDirective, "doxygenunion": DoxygenUnionDirective, "doxygennamespace": DoxygenNamespaceDirective, "doxygengroup": DoxygenGroupDirective, "doxygenfile": DoxygenFileDirective, "autodoxygenfile": AutoDoxygenFileDirective, "doxygenpage": DoxygenPageDirective, } # The directives need these global objects, so in order to smuggle # them in, we use env.temp_data. But it is cleared after each document # has been read, we use the source-read event to set them. # note: the parser factory contains a cache of the parsed XML # note: the project_info_factory also contains some caching stuff # TODO: is that actually safe for when reading in parallel? project_info_factory = ProjectInfoFactory(app) parser_factory = DoxygenParserFactory(app) def set_temp_data( app: Sphinx, project_info_factory=project_info_factory, parser_factory=parser_factory ): assert app.env is not None app.env.temp_data["breathe_project_info_factory"] = project_info_factory app.env.temp_data["breathe_parser_factory"] = parser_factory app.connect("source-read", lambda app, docname, source: set_temp_data(app)) for name, directive in directives.items(): app.add_directive(name, directive) app.add_config_value("breathe_projects", {}, "env") # Dict[str, str] app.add_config_value("breathe_default_project", "", "env") # str # Provide reasonable defaults for domain_by_extension mapping. Can be overridden by users. app.add_config_value( "breathe_domain_by_extension", {"py": "py", "cs": "cs"}, "env" ) # Dict[str, str] app.add_config_value("breathe_domain_by_file_pattern", {}, "env") # Dict[str, str] app.add_config_value("breathe_projects_source", {}, "env") app.add_config_value("breathe_build_directory", "", "env") app.add_config_value("breathe_default_members", (), "env") app.add_config_value("breathe_show_define_initializer", False, "env") app.add_config_value("breathe_show_enumvalue_initializer", False, "env") app.add_config_value("breathe_show_include", True, "env") app.add_config_value("breathe_implementation_filename_extensions", [".c", ".cc", ".cpp"], "env") app.add_config_value("breathe_doxygen_config_options", {}, "env") app.add_config_value("breathe_doxygen_aliases", {}, "env") app.add_config_value("breathe_use_project_refids", False, "env") app.add_config_value("breathe_order_parameters_first", False, "env") app.add_config_value("breathe_separate_member_pages", False, "env") breathe_css = "breathe.css" if Path(app.confdir, "_static", breathe_css).exists(): app.add_css_file(breathe_css) def write_file(directory, filename, content): # Ensure that the directory exists directory = Path(directory) directory.mkdir(parents=True, exist_ok=True) # Write the file with the provided contents (directory / filename).write_text(content) doxygen_handle = AutoDoxygenProcessHandle( subprocess.check_call, write_file, project_info_factory ) def doxygen_hook(app: Sphinx): doxygen_handle.generate_xml( app.config.breathe_projects_source, app.config.breathe_doxygen_config_options, app.config.breathe_doxygen_aliases, ) app.connect("builder-inited", doxygen_hook) breathe-doc-breathe-10a36f3/breathe/exception.py000066400000000000000000000001151475641424700216210ustar00rootroot00000000000000from __future__ import annotations class BreatheError(Exception): pass breathe-doc-breathe-10a36f3/breathe/file_state_cache.py000066400000000000000000000047121475641424700230740ustar00rootroot00000000000000from __future__ import annotations import os from pathlib import Path from typing import TYPE_CHECKING if TYPE_CHECKING: from sphinx.application import Sphinx from sphinx.environment import BuildEnvironment """ Store the modified time of the various doxygen xml files against the reStructuredText file that they are referenced from so that we know which reStructuredText files to rebuild if the doxygen xml is modified. We store the information in the environment object as 'breathe_file_state' so that it is pickled down and stored between builds as Sphinx is designed to do. (mypy doesn't like dynamically added attributes, hence all references to it are ignored) """ class MTimeError(Exception): pass def _getmtime(filename: str): try: return os.path.getmtime(filename) except OSError: raise MTimeError("Cannot find file: %s" % os.path.realpath(filename)) def update(app: Sphinx, source_file: str | os.PathLike[str]) -> None: if not hasattr(app.env, "breathe_file_state"): app.env.breathe_file_state = {} # type: ignore[attr-defined] norm_source_file = Path(source_file).resolve().as_posix() new_mtime = _getmtime(norm_source_file) _mtime, docnames = app.env.breathe_file_state.setdefault( # type: ignore[attr-defined] norm_source_file, (new_mtime, set()) ) assert app.env is not None docnames.add(app.env.docname) app.env.breathe_file_state[norm_source_file] = (new_mtime, docnames) # type: ignore[attr-defined] def _get_outdated( app: Sphinx, env: BuildEnvironment, added: set[str], changed: set[str], removed: set[str] ) -> list[str]: if not hasattr(app.env, "breathe_file_state"): return [] stale = [] for filename, info in app.env.breathe_file_state.items(): old_mtime, docnames = info if _getmtime(filename) > old_mtime: stale.extend(docnames) return list(set(stale).difference(removed)) def _purge_doc(app: Sphinx, env: BuildEnvironment, docname: str) -> None: if not hasattr(app.env, "breathe_file_state"): return toremove = [] for filename, info in app.env.breathe_file_state.items(): _, docnames = info docnames.discard(docname) if not docnames: toremove.append(filename) for filename in toremove: del app.env.breathe_file_state[filename] def setup(app: Sphinx): app.connect("env-get-outdated", _get_outdated) app.connect("env-purge-doc", _purge_doc) breathe-doc-breathe-10a36f3/breathe/filetypes.py000066400000000000000000000017711475641424700216400ustar00rootroot00000000000000""" A module to house the methods for resolving a code-blocks language based on filename (and extension). """ from __future__ import annotations import os.path from pygments.lexers import get_lexer_for_filename from pygments.util import ClassNotFound def get_pygments_alias(filename: str) -> str | None: "Find first pygments alias from filename" try: lexer_cls = get_lexer_for_filename(filename) return lexer_cls.aliases[0] # type: ignore[attr-defined] except ClassNotFound: return None def get_extension(filename: str) -> str: "Get extension from filename" # If the filename is just '.ext' then we get ('.ext', '') so we fall back to first part if # the second isn't there (first, second) = os.path.splitext(filename) # Doxygen allows users to specify the file extension ".unparsed" to disable syntax highlighting. # We translate it into the pygments un-highlighted 'text' type return (second or first).lstrip(".").replace("unparsed", "text") breathe-doc-breathe-10a36f3/breathe/finder/000077500000000000000000000000001475641424700205235ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/breathe/finder/__init__.py000066400000000000000000000015221475641424700226340ustar00rootroot00000000000000from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from breathe.project import ProjectInfo from breathe.renderer.filter import Filter def stack(element, list_): """Stack an element on to the start of a list and return as a new list""" # Copy list first so we have a new list to insert into output = list_[:] output.insert(0, element) return output class ItemFinder: def __init__(self, project_info: ProjectInfo, data_object, item_finder_factory): self.data_object = data_object # DoxygenItemFinderFactory, but actually typing it would introduce an import cycle self.item_finder_factory = item_finder_factory self.project_info = project_info def filter_(self, ancestors, filter_: Filter, matches) -> None: raise NotImplementedError breathe-doc-breathe-10a36f3/breathe/finder/compound.py000066400000000000000000000050411475641424700227210ustar00rootroot00000000000000from __future__ import annotations from typing import TYPE_CHECKING from breathe.finder import ItemFinder, stack if TYPE_CHECKING: from breathe.renderer.filter import Filter class DoxygenTypeSubItemFinder(ItemFinder): def filter_(self, ancestors, filter_: Filter, matches) -> None: """Find nodes which match the filter. Doesn't test this node, only its children""" node_stack = stack(self.data_object, ancestors) compound_finder = self.item_finder_factory.create_finder(self.data_object.compounddef) compound_finder.filter_(node_stack, filter_, matches) class CompoundDefTypeSubItemFinder(ItemFinder): def filter_(self, ancestors, filter_: Filter, matches) -> None: """Finds nodes which match the filter and continues checks to children""" node_stack = stack(self.data_object, ancestors) if filter_.allow(node_stack): matches.append(node_stack) for sectiondef in self.data_object.sectiondef: finder = self.item_finder_factory.create_finder(sectiondef) finder.filter_(node_stack, filter_, matches) for innerclass in self.data_object.innerclass: finder = self.item_finder_factory.create_finder(innerclass) finder.filter_(node_stack, filter_, matches) class SectionDefTypeSubItemFinder(ItemFinder): def filter_(self, ancestors, filter_: Filter, matches) -> None: """Find nodes which match the filter. Doesn't test this node, only its children""" node_stack = stack(self.data_object, ancestors) if filter_.allow(node_stack): matches.append(node_stack) for memberdef in self.data_object.memberdef: finder = self.item_finder_factory.create_finder(memberdef) finder.filter_(node_stack, filter_, matches) class MemberDefTypeSubItemFinder(ItemFinder): def filter_(self, ancestors, filter_: Filter, matches) -> None: data_object = self.data_object node_stack = stack(data_object, ancestors) if filter_.allow(node_stack): matches.append(node_stack) if data_object.kind == "enum": for value in data_object.enumvalue: value_stack = stack(value, node_stack) if filter_.allow(value_stack): matches.append(value_stack) class RefTypeSubItemFinder(ItemFinder): def filter_(self, ancestors, filter_: Filter, matches) -> None: node_stack = stack(self.data_object, ancestors) if filter_.allow(node_stack): matches.append(node_stack) breathe-doc-breathe-10a36f3/breathe/finder/factory.py000066400000000000000000000056411475641424700225520ustar00rootroot00000000000000from __future__ import annotations from typing import TYPE_CHECKING from breathe.finder import compound as compoundfinder from breathe.finder import index as indexfinder if TYPE_CHECKING: from sphinx.application import Sphinx from breathe.finder import ItemFinder from breathe.parser import DoxygenParserFactory from breathe.project import ProjectInfo from breathe.renderer.filter import Filter class _CreateCompoundTypeSubFinder: def __init__(self, app: Sphinx, parser_factory: DoxygenParserFactory): self.app = app self.parser_factory = parser_factory def __call__(self, project_info: ProjectInfo, *args): compound_parser = self.parser_factory.create_compound_parser(project_info) return indexfinder.CompoundTypeSubItemFinder(self.app, compound_parser, project_info, *args) class DoxygenItemFinderFactory: def __init__(self, finders: dict[str, type[ItemFinder]], project_info: ProjectInfo): self.finders = finders self.project_info = project_info def create_finder(self, data_object) -> ItemFinder: return self.finders[data_object.node_type](self.project_info, data_object, self) class _FakeParentNode: node_type = "fakeparent" class Finder: def __init__(self, root, item_finder_factory: DoxygenItemFinderFactory) -> None: self._root = root self.item_finder_factory = item_finder_factory def filter_(self, filter_: Filter, matches) -> None: """Adds all nodes which match the filter into the matches list""" item_finder = self.item_finder_factory.create_finder(self._root) item_finder.filter_([_FakeParentNode()], filter_, matches) def root(self): return self._root class FinderFactory: def __init__(self, app: Sphinx, parser_factory: DoxygenParserFactory): self.app = app self.parser_factory = parser_factory self.parser = parser_factory.create_index_parser() def create_finder(self, project_info: ProjectInfo) -> Finder: root = self.parser.parse(project_info) return self.create_finder_from_root(root, project_info) def create_finder_from_root(self, root, project_info: ProjectInfo) -> Finder: finders: dict[str, type[ItemFinder]] = { "doxygen": indexfinder.DoxygenTypeSubItemFinder, "compound": _CreateCompoundTypeSubFinder(self.app, self.parser_factory), # type: ignore[dict-item] "member": indexfinder.MemberTypeSubItemFinder, "doxygendef": compoundfinder.DoxygenTypeSubItemFinder, "compounddef": compoundfinder.CompoundDefTypeSubItemFinder, "sectiondef": compoundfinder.SectionDefTypeSubItemFinder, "memberdef": compoundfinder.MemberDefTypeSubItemFinder, "ref": compoundfinder.RefTypeSubItemFinder, } item_finder_factory = DoxygenItemFinderFactory(finders, project_info) return Finder(root, item_finder_factory) breathe-doc-breathe-10a36f3/breathe/finder/index.py000066400000000000000000000062321475641424700222070ustar00rootroot00000000000000from __future__ import annotations from typing import TYPE_CHECKING from breathe.finder import ItemFinder, stack from breathe.renderer.filter import FilterFactory if TYPE_CHECKING: from typing import Any from sphinx.application import Sphinx from breathe.parser import DoxygenCompoundParser from breathe.renderer.filter import Filter class DoxygenTypeSubItemFinder(ItemFinder): def filter_(self, ancestors, filter_: Filter, matches) -> None: """Find nodes which match the filter. Doesn't test this node, only its children""" compounds = self.data_object.get_compound() node_stack = stack(self.data_object, ancestors) for compound in compounds: compound_finder = self.item_finder_factory.create_finder(compound) compound_finder.filter_(node_stack, filter_, matches) class CompoundTypeSubItemFinder(ItemFinder): def __init__(self, app: Sphinx, compound_parser: DoxygenCompoundParser, *args): super().__init__(*args) self.filter_factory = FilterFactory(app) self.compound_parser = compound_parser def filter_(self, ancestors, filter_: Filter, matches) -> None: """Finds nodes which match the filter and continues checks to children Requires parsing the xml files referenced by the children for which we use the compound parser and continue at the top level of that pretending that this node is the parent of the top level node of the compound file. """ node_stack = stack(self.data_object, ancestors) # Match against compound object if filter_.allow(node_stack): matches.append(node_stack) # Descend to member children members = self.data_object.get_member() # TODO: find a more precise type for the Doxygen nodes member_matches: list[Any] = [] for member in members: member_finder = self.item_finder_factory.create_finder(member) member_finder.filter_(node_stack, filter_, member_matches) # If there are members in this compound that match the criteria # then load up the file for this compound and get the member data objects if member_matches: file_data = self.compound_parser.parse(self.data_object.refid) finder = self.item_finder_factory.create_finder(file_data) for member_stack in member_matches: ref_filter = self.filter_factory.create_id_filter( "memberdef", member_stack[0].refid ) finder.filter_(node_stack, ref_filter, matches) else: # Read in the xml file referenced by the compound and descend into that as well file_data = self.compound_parser.parse(self.data_object.refid) finder = self.item_finder_factory.create_finder(file_data) finder.filter_(node_stack, filter_, matches) class MemberTypeSubItemFinder(ItemFinder): def filter_(self, ancestors, filter_: Filter, matches) -> None: node_stack = stack(self.data_object, ancestors) # Match against member object if filter_.allow(node_stack): matches.append(node_stack) breathe-doc-breathe-10a36f3/breathe/parser/000077500000000000000000000000001475641424700205505ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/breathe/parser/__init__.py000066400000000000000000000056731475641424700226740ustar00rootroot00000000000000from __future__ import annotations from pathlib import Path from typing import TYPE_CHECKING from breathe import file_state_cache from breathe.parser import compound, index if TYPE_CHECKING: from sphinx.application import Sphinx from breathe.project import ProjectInfo class ParserError(Exception): def __init__(self, error: Exception, filename: Path): super().__init__(error) self.error = error self.filename = filename def __str__(self): return "file %s: %s" % (self.filename, self.error) class FileIOError(Exception): def __init__(self, error: Exception, filename: Path): super().__init__(error) self.error = error self.filename = filename class Parser: def __init__(self, app: Sphinx, cache): self.app = app self.cache = cache class DoxygenIndexParser(Parser): def parse(self, project_info: ProjectInfo): filename = Path(self.app.confdir, project_info.project_path(), "index.xml").resolve() file_state_cache.update(self.app, filename) try: # Try to get from our cache return self.cache[filename] except KeyError: # If that fails, parse it afresh try: result = index.parse(filename) self.cache[filename] = result return result except index.ParseError as e: raise ParserError(e, filename) except index.FileIOError as e: raise FileIOError(e, filename) class DoxygenCompoundParser(Parser): def __init__(self, app: Sphinx, cache, project_info: ProjectInfo) -> None: super().__init__(app, cache) self.project_info = project_info def parse(self, refid: str): filename = Path( self.app.confdir, self.project_info.project_path(), f"{refid}.xml" ).resolve() file_state_cache.update(self.app, filename) try: # Try to get from our cache return self.cache[filename] except KeyError: # If that fails, parse it afresh try: result = compound.parse(filename) self.cache[filename] = result return result except compound.ParseError as e: raise ParserError(e, filename) except compound.FileIOError as e: raise FileIOError(e, filename) class DoxygenParserFactory: def __init__(self, app: Sphinx) -> None: self.app = app # TODO: do we have a base class for all the Doxygen XML node types # that we can use for typing? self.cache = {} # type: ignore[var-annotated] def create_index_parser(self) -> DoxygenIndexParser: return DoxygenIndexParser(self.app, self.cache) def create_compound_parser(self, project_info: ProjectInfo) -> DoxygenCompoundParser: return DoxygenCompoundParser(self.app, self.cache, project_info) breathe-doc-breathe-10a36f3/breathe/parser/compound.py000066400000000000000000001146021475641424700227520ustar00rootroot00000000000000""" Generated Mon Feb 9 19:08:05 2009 by generateDS.py. This file contains manual modifications. """ from __future__ import annotations from xml.dom import Node, minidom from xml.parsers.expat import ExpatError from breathe.parser import compoundsuper as supermod from breathe.parser.compoundsuper import MixedContainer class DoxygenTypeSub(supermod.DoxygenType): node_type = "doxygendef" def __init__(self, version=None, compounddef=None): supermod.DoxygenType.__init__(self, version, compounddef) supermod.DoxygenType.subclass = DoxygenTypeSub # end class DoxygenTypeSub class compounddefTypeSub(supermod.compounddefType): node_type = "compounddef" def __init__( self, kind=None, prot=None, id=None, compoundname="", title="", basecompoundref=None, derivedcompoundref=None, includes=None, includedby=None, incdepgraph=None, invincdepgraph=None, innerdir=None, innerfile=None, innerclass=None, innernamespace=None, innerpage=None, innergroup=None, templateparamlist=None, sectiondef=None, briefdescription=None, detaileddescription=None, inheritancegraph=None, collaborationgraph=None, programlisting=None, location=None, listofallmembers=None, language=None, ): supermod.compounddefType.__init__( self, kind, prot, id, compoundname, title, basecompoundref, derivedcompoundref, includes, includedby, incdepgraph, invincdepgraph, innerdir, innerfile, innerclass, innernamespace, innerpage, innergroup, templateparamlist, sectiondef, briefdescription, detaileddescription, inheritancegraph, collaborationgraph, programlisting, location, listofallmembers, language, ) supermod.compounddefType.subclass = compounddefTypeSub # end class compounddefTypeSub class listofallmembersTypeSub(supermod.listofallmembersType): node_type = "listofallmembers" def __init__(self, member=None): supermod.listofallmembersType.__init__(self, member) supermod.listofallmembersType.subclass = listofallmembersTypeSub # end class listofallmembersTypeSub class memberRefTypeSub(supermod.memberRefType): node_type = "memberref" def __init__(self, virt=None, prot=None, refid=None, ambiguityscope=None, scope="", name=""): supermod.memberRefType.__init__(self, virt, prot, refid, ambiguityscope, scope, name) supermod.memberRefType.subclass = memberRefTypeSub # end class memberRefTypeSub class compoundRefTypeSub(supermod.compoundRefType): node_type = "compoundref" def __init__( self, virt=None, prot=None, refid=None, valueOf_="", mixedclass_=None, content_=None ): supermod.compoundRefType.__init__(self, mixedclass_, content_) supermod.compoundRefType.subclass = compoundRefTypeSub # end class compoundRefTypeSub class reimplementTypeSub(supermod.reimplementType): node_type = "reimplement" def __init__(self, refid=None, valueOf_="", mixedclass_=None, content_=None): supermod.reimplementType.__init__(self, mixedclass_, content_) supermod.reimplementType.subclass = reimplementTypeSub # end class reimplementTypeSub class incTypeSub(supermod.incType): node_type = "inc" def __init__(self, local=None, refid=None, valueOf_="", mixedclass_=None, content_=None): supermod.incType.__init__(self, mixedclass_, content_) supermod.incType.subclass = incTypeSub # end class incTypeSub class refTypeSub(supermod.refType): node_type = "ref" def __init__( self, node_name, prot=None, refid=None, valueOf_="", mixedclass_=None, content_=None ): supermod.refType.__init__(self, mixedclass_, content_) self.node_name = node_name supermod.refType.subclass = refTypeSub class refTextTypeSub(supermod.refTextType): node_type = "reftex" def __init__( self, refid=None, kindref=None, external=None, valueOf_="", mixedclass_=None, content_=None ): supermod.refTextType.__init__(self, mixedclass_, content_) supermod.refTextType.subclass = refTextTypeSub # end class refTextTypeSub class sectiondefTypeSub(supermod.sectiondefType): node_type = "sectiondef" def __init__(self, kind=None, header="", description=None, memberdef=None): supermod.sectiondefType.__init__(self, kind, header, description, memberdef) supermod.sectiondefType.subclass = sectiondefTypeSub # end class sectiondefTypeSub class memberdefTypeSub(supermod.memberdefType): node_type = "memberdef" def __init__( self, initonly=None, kind=None, volatile=None, const=None, raise_=None, virt=None, readable=None, prot=None, explicit=None, new=None, final=None, writable=None, add=None, static=None, strong=None, remove=None, sealed=None, mutable=None, gettable=None, inline=None, settable=None, id=None, templateparamlist=None, type_=None, definition="", argsstring="", name="", read="", write="", bitfield="", reimplements=None, reimplementedby=None, param=None, enumvalue=None, initializer=None, exceptions=None, briefdescription=None, detaileddescription=None, inbodydescription=None, location=None, references=None, referencedby=None, refqual=None, ): supermod.memberdefType.__init__( self, initonly, kind, volatile, const, raise_, virt, readable, prot, explicit, new, final, writable, add, static, strong, remove, sealed, mutable, gettable, inline, settable, id, templateparamlist, type_, definition, argsstring, name, read, write, bitfield, reimplements, reimplementedby, param, enumvalue, initializer, exceptions, briefdescription, detaileddescription, inbodydescription, location, references, referencedby, refqual, ) self.parameterlist = supermod.docParamListType.factory() self.parameterlist.kind = "param" def buildChildren(self, child_, nodeName_): supermod.memberdefType.buildChildren(self, child_, nodeName_) if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "param": # Get latest param param = self.param[-1] # If it doesn't have a description we're done if not param.briefdescription: return # Construct our own param list from the descriptions stored inline # with the parameters paramdescription = param.briefdescription paramname = supermod.docParamName.factory() # Add parameter name obj_ = paramname.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", param.declname ) paramname.content_.append(obj_) paramnamelist = supermod.docParamNameList.factory() paramnamelist.parametername.append(paramname) paramlistitem = supermod.docParamListItem.factory() paramlistitem.parameternamelist.append(paramnamelist) # Add parameter description paramlistitem.parameterdescription = paramdescription self.parameterlist.parameteritem.append(paramlistitem) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "detaileddescription": if not self.parameterlist.parameteritem: # No items in our list return # Assume supermod.memberdefType.buildChildren has already built the # description object, we just want to slot our parameterlist in at # a reasonable point if not self.detaileddescription: # Create one if it doesn't exist self.detaileddescription = supermod.descriptionType.factory() detaileddescription = self.detaileddescription para = supermod.docParaType.factory() para.parameterlist.append(self.parameterlist) obj_ = detaileddescription.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", para ) index = 0 detaileddescription.content_.insert(index, obj_) supermod.memberdefType.subclass = memberdefTypeSub # end class memberdefTypeSub class descriptionTypeSub(supermod.descriptionType): node_type = "description" def __init__( self, title="", para=None, sect1=None, internal=None, mixedclass_=None, content_=None ): supermod.descriptionType.__init__(self, mixedclass_, content_) supermod.descriptionType.subclass = descriptionTypeSub # end class descriptionTypeSub class enumvalueTypeSub(supermod.enumvalueType): node_type = "enumvalue" def __init__( self, prot=None, id=None, name="", initializer=None, briefdescription=None, detaileddescription=None, mixedclass_=None, content_=None, ): supermod.enumvalueType.__init__(self, mixedclass_, content_) self.initializer = None def buildChildren(self, child_, nodeName_): # Get text from child and put it in self.name if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "name": valuestr_ = "".join(text_.nodeValue for text_ in child_.childNodes) self.name = valuestr_ elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "briefdescription": obj_ = supermod.descriptionType.factory() obj_.build(child_) self.set_briefdescription(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "detaileddescription": obj_ = supermod.descriptionType.factory() obj_.build(child_) self.set_detaileddescription(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "initializer": childobj_ = supermod.linkedTextType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "initializer", childobj_ ) self.set_initializer(obj_) self.content_.append(obj_) supermod.enumvalueType.subclass = enumvalueTypeSub # end class enumvalueTypeSub class templateparamlistTypeSub(supermod.templateparamlistType): node_type = "templateparamlist" def __init__(self, param=None): supermod.templateparamlistType.__init__(self, param) supermod.templateparamlistType.subclass = templateparamlistTypeSub # end class templateparamlistTypeSub class paramTypeSub(supermod.paramType): node_type = "param" def __init__( self, type_=None, declname="", defname="", array="", defval=None, briefdescription=None ): supermod.paramType.__init__(self, type_, declname, defname, array, defval, briefdescription) supermod.paramType.subclass = paramTypeSub # end class paramTypeSub class linkedTextTypeSub(supermod.linkedTextType): node_type = "linkedtext" def __init__(self, ref=None, mixedclass_=None, content_=None): supermod.linkedTextType.__init__(self, mixedclass_, content_) supermod.linkedTextType.subclass = linkedTextTypeSub # end class linkedTextTypeSub class graphTypeSub(supermod.graphType): node_type = "graph" def __init__(self, node=None, direction="forward", caption=""): supermod.graphType.__init__(self, node, direction, caption) supermod.graphType.subclass = graphTypeSub # end class graphTypeSub class nodeTypeSub(supermod.nodeType): node_type = "node" def __init__(self, id=None, label="", link=None, childnode=None): supermod.nodeType.__init__(self, id, label, link, childnode) supermod.nodeType.subclass = nodeTypeSub # end class nodeTypeSub class childnodeTypeSub(supermod.childnodeType): node_type = "childnode" def __init__(self, relation=None, refid=None, edgelabel=None): supermod.childnodeType.__init__(self, relation, refid, edgelabel) supermod.childnodeType.subclass = childnodeTypeSub # end class childnodeTypeSub class linkTypeSub(supermod.linkType): node_type = "link" def __init__(self, refid=None, external=None, valueOf_=""): supermod.linkType.__init__(self, refid, external) supermod.linkType.subclass = linkTypeSub # end class linkTypeSub class listingTypeSub(supermod.listingType): node_type = "listing" def __init__(self, codeline=None, domain=None): supermod.listingType.__init__(self, codeline, domain) supermod.listingType.subclass = listingTypeSub # end class listingTypeSub class codelineTypeSub(supermod.codelineType): node_type = "codeline" def __init__(self, external=None, lineno=None, refkind=None, refid=None, highlight=None): supermod.codelineType.__init__(self, external, lineno, refkind, refid, highlight) supermod.codelineType.subclass = codelineTypeSub # end class codelineTypeSub class highlightTypeSub(supermod.highlightType): node_type = "highlight" def __init__(self, class_=None, sp=None, ref=None, mixedclass_=None, content_=None): supermod.highlightType.__init__(self, mixedclass_, content_) supermod.highlightType.subclass = highlightTypeSub # end class highlightTypeSub class referenceTypeSub(supermod.referenceType): node_type = "reference" def __init__( self, endline=None, startline=None, refid=None, compoundref=None, valueOf_="", mixedclass_=None, content_=None, ): supermod.referenceType.__init__(self, mixedclass_, content_) supermod.referenceType.subclass = referenceTypeSub # end class referenceTypeSub class locationTypeSub(supermod.locationType): node_type = "location" def __init__( self, bodystart=None, line=None, bodyend=None, bodyfile=None, file=None, valueOf_="" ): supermod.locationType.__init__(self, bodystart, line, bodyend, bodyfile, file) supermod.locationType.subclass = locationTypeSub # end class locationTypeSub class docSect1TypeSub(supermod.docSect1Type): node_type = "docsect1" def __init__( self, id=None, title="", para=None, sect2=None, internal=None, mixedclass_=None, content_=None, ): supermod.docSect1Type.__init__(self, mixedclass_, content_) supermod.docSect1Type.subclass = docSect1TypeSub # end class docSect1TypeSub class docSect2TypeSub(supermod.docSect2Type): node_type = "docsect2" def __init__( self, id=None, title="", para=None, sect3=None, internal=None, mixedclass_=None, content_=None, ): supermod.docSect2Type.__init__(self, mixedclass_, content_) supermod.docSect2Type.subclass = docSect2TypeSub # end class docSect2TypeSub class docSect3TypeSub(supermod.docSect3Type): node_type = "docsect3" def __init__( self, id=None, title="", para=None, sect4=None, internal=None, mixedclass_=None, content_=None, ): supermod.docSect3Type.__init__(self, mixedclass_, content_) supermod.docSect3Type.subclass = docSect3TypeSub # end class docSect3TypeSub class docSect4TypeSub(supermod.docSect4Type): node_type = "docsect4" def __init__( self, id=None, title="", para=None, internal=None, mixedclass_=None, content_=None ): supermod.docSect4Type.__init__(self, mixedclass_, content_) supermod.docSect4Type.subclass = docSect4TypeSub # end class docSect4TypeSub class docInternalTypeSub(supermod.docInternalType): node_type = "docinternal" def __init__(self, para=None, sect1=None, mixedclass_=None, content_=None): supermod.docInternalType.__init__(self, mixedclass_, content_) supermod.docInternalType.subclass = docInternalTypeSub # end class docInternalTypeSub class docInternalS1TypeSub(supermod.docInternalS1Type): node_type = "docinternals1" def __init__(self, para=None, sect2=None, mixedclass_=None, content_=None): supermod.docInternalS1Type.__init__(self, mixedclass_, content_) supermod.docInternalS1Type.subclass = docInternalS1TypeSub # end class docInternalS1TypeSub class docInternalS2TypeSub(supermod.docInternalS2Type): node_type = "docinternals2" def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None): supermod.docInternalS2Type.__init__(self, mixedclass_, content_) supermod.docInternalS2Type.subclass = docInternalS2TypeSub # end class docInternalS2TypeSub class docInternalS3TypeSub(supermod.docInternalS3Type): node_type = "docinternals3" def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None): supermod.docInternalS3Type.__init__(self, mixedclass_, content_) supermod.docInternalS3Type.subclass = docInternalS3TypeSub # end class docInternalS3TypeSub class docInternalS4TypeSub(supermod.docInternalS4Type): node_type = "docinternals4" def __init__(self, para=None, mixedclass_=None, content_=None): supermod.docInternalS4Type.__init__(self, mixedclass_, content_) supermod.docInternalS4Type.subclass = docInternalS4TypeSub # end class docInternalS4TypeSub class docURLLinkSub(supermod.docURLLink): node_type = "docurllink" def __init__(self, url=None, valueOf_="", mixedclass_=None, content_=None): supermod.docURLLink.__init__(self, mixedclass_, content_) supermod.docURLLink.subclass = docURLLinkSub # end class docURLLinkSub class docAnchorTypeSub(supermod.docAnchorType): node_type = "docanchor" def __init__(self, id=None, valueOf_="", mixedclass_=None, content_=None): supermod.docAnchorType.__init__(self, mixedclass_, content_) supermod.docAnchorType.subclass = docAnchorTypeSub # end class docAnchorTypeSub class docFormulaTypeSub(supermod.docFormulaType): node_type = "docformula" def __init__(self, id=None, valueOf_="", mixedclass_=None, content_=None): supermod.docFormulaType.__init__(self, mixedclass_, content_) supermod.docFormulaType.subclass = docFormulaTypeSub # end class docFormulaTypeSub class docIndexEntryTypeSub(supermod.docIndexEntryType): node_type = "docindexentry" def __init__(self, primaryie="", secondaryie=""): supermod.docIndexEntryType.__init__(self, primaryie, secondaryie) supermod.docIndexEntryType.subclass = docIndexEntryTypeSub # end class docIndexEntryTypeSub class docListTypeSub(supermod.docListType): node_type = "doclist" def __init__(self, listitem=None, subtype=""): self.node_subtype = "itemized" if subtype != "": self.node_subtype = subtype supermod.docListType.__init__(self, listitem) supermod.docListType.subclass = docListTypeSub # end class docListTypeSub class docListItemTypeSub(supermod.docListItemType): node_type = "doclistitem" def __init__(self, para=None): supermod.docListItemType.__init__(self, para) supermod.docListItemType.subclass = docListItemTypeSub # end class docListItemTypeSub class docSimpleSectTypeSub(supermod.docSimpleSectType): node_type = "docsimplesect" def __init__(self, kind=None, title=None, para=None): supermod.docSimpleSectType.__init__(self, kind, title, para) supermod.docSimpleSectType.subclass = docSimpleSectTypeSub # end class docSimpleSectTypeSub class docVarListEntryTypeSub(supermod.docVarListEntryType): node_type = "docvarlistentry" def __init__(self, term=None): supermod.docVarListEntryType.__init__(self, term) def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "term": obj_ = supermod.docTitleType.factory() obj_.build(child_) self.set_term(obj_) supermod.docVarListEntryType.subclass = docVarListEntryTypeSub # end class docVarListEntryTypeSub class docRefTextTypeSub(supermod.docRefTextType): node_type = "docreftext" def __init__( self, refid=None, kindref=None, external=None, valueOf_="", mixedclass_=None, content_=None ): supermod.docRefTextType.__init__(self, mixedclass_, content_) self.para = [] def buildChildren(self, child_, nodeName_): supermod.docRefTextType.buildChildren(self, child_, nodeName_) if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para": obj_ = supermod.docParaType.factory() obj_.build(child_) self.para.append(obj_) supermod.docRefTextType.subclass = docRefTextTypeSub # end class docRefTextTypeSub class docTableTypeSub(supermod.docTableType): node_type = "doctable" def __init__(self, rows=None, cols=None, row=None, caption=None): supermod.docTableType.__init__(self, rows, cols, row, caption) supermod.docTableType.subclass = docTableTypeSub # end class docTableTypeSub class docRowTypeSub(supermod.docRowType): node_type = "docrow" def __init__(self, entry=None): supermod.docRowType.__init__(self, entry) supermod.docRowType.subclass = docRowTypeSub # end class docRowTypeSub class docEntryTypeSub(supermod.docEntryType): node_type = "docentry" def __init__(self, thead=None, align=None, rowspan=None, colspan=None, para=None): supermod.docEntryType.__init__(self, thead, align, rowspan, colspan, para) supermod.docEntryType.subclass = docEntryTypeSub # end class docEntryTypeSub class docHeadingTypeSub(supermod.docHeadingType): node_type = "docheading" def __init__(self, level=None, valueOf_="", mixedclass_=None, content_=None): supermod.docHeadingType.__init__(self, mixedclass_, content_) def buildChildren(self, child_, nodeName_): supermod.docHeadingType.buildChildren(self, child_, nodeName_) # Account for styled content in the heading. This might need to be expanded to include other # nodes as it seems from the xsd that headings can have a lot of different children but we # really don't expect most of them to come up. if child_.nodeType == Node.ELEMENT_NODE and ( nodeName_ == "bold" or nodeName_ == "emphasis" or nodeName_ == "computeroutput" or nodeName_ == "subscript" or nodeName_ == "superscript" or nodeName_ == "center" or nodeName_ == "small" ): obj_ = supermod.docMarkupType.factory() obj_.build(child_) obj_.type_ = nodeName_ self.content_.append(obj_) supermod.docHeadingType.subclass = docHeadingTypeSub # end class docHeadingTypeSub class docImageTypeSub(supermod.docImageType): node_type = "docimage" def __init__( self, width=None, type_=None, name=None, height=None, valueOf_="", mixedclass_=None, content_=None, ): supermod.docImageType.__init__(self, mixedclass_, content_) supermod.docImageType.subclass = docImageTypeSub # end class docImageTypeSub class docDotFileTypeSub(supermod.docDotFileType): node_type = "docdotfile" def __init__(self, name=None, valueOf_="", mixedclass_=None, content_=None): supermod.docDotFileType.__init__(self, mixedclass_, content_) supermod.docDotFileType.subclass = docDotFileTypeSub # end class docDotFileTypeSub class docDotTypeSub(supermod.docDotType): node_type = "docdot" def __init__(self, name=None, valueOf_="", mixedclass_=None, content_=None): supermod.docDotType.__init__(self, mixedclass_, content_) supermod.docDotType.subclass = docDotTypeSub # end class docDotTypeSub class docTocItemTypeSub(supermod.docTocItemType): node_type = "doctocitem" def __init__(self, id=None, valueOf_="", mixedclass_=None, content_=None): supermod.docTocItemType.__init__(self, mixedclass_, content_) supermod.docTocItemType.subclass = docTocItemTypeSub # end class docTocItemTypeSub class docTocListTypeSub(supermod.docTocListType): node_type = "doctoclist" def __init__(self, tocitem=None): supermod.docTocListType.__init__(self, tocitem) supermod.docTocListType.subclass = docTocListTypeSub # end class docTocListTypeSub class docLanguageTypeSub(supermod.docLanguageType): node_type = "doclanguage" def __init__(self, langid=None, para=None): supermod.docLanguageType.__init__(self, langid, para) supermod.docLanguageType.subclass = docLanguageTypeSub # end class docLanguageTypeSub class docParamListTypeSub(supermod.docParamListType): node_type = "docparamlist" def __init__(self, kind=None, parameteritem=None): supermod.docParamListType.__init__(self, kind, parameteritem) supermod.docParamListType.subclass = docParamListTypeSub # end class docParamListTypeSub class docParamListItemSub(supermod.docParamListItem): node_type = "docparamlistitem" def __init__(self, parameternamelist=None, parameterdescription=None): supermod.docParamListItem.__init__(self, parameternamelist, parameterdescription) supermod.docParamListItem.subclass = docParamListItemSub # end class docParamListItemSub class docParamNameListSub(supermod.docParamNameList): node_type = "docparamnamelist" def __init__(self, parametername=None): supermod.docParamNameList.__init__(self, parametername) supermod.docParamNameList.subclass = docParamNameListSub # end class docParamNameListSub class docParamNameSub(supermod.docParamName): node_type = "docparamname" def __init__(self, direction=None, ref=None, mixedclass_=None, content_=None): supermod.docParamName.__init__(self, mixedclass_, content_) supermod.docParamName.subclass = docParamNameSub # end class docParamNameSub class docXRefSectTypeSub(supermod.docXRefSectType): node_type = "docxrefsect" def __init__(self, id=None, xreftitle=None, xrefdescription=None): supermod.docXRefSectType.__init__(self, id, xreftitle, xrefdescription) supermod.docXRefSectType.subclass = docXRefSectTypeSub # end class docXRefSectTypeSub class docVariableListTypeSub(supermod.docVariableListType): node_type = "docvariablelist" def __init__(self, valueOf_=""): supermod.docVariableListType.__init__(self, valueOf_) self.varlistentries = [] self.listitems = [] def buildChildren(self, child_, nodeName_): supermod.docVariableListType.buildChildren(self, child_, nodeName_) if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "varlistentry": obj_ = supermod.docVarListEntryType.factory() obj_.build(child_) self.varlistentries.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "listitem": obj_ = supermod.docListItemType.factory() obj_.build(child_) self.listitems.append(obj_) supermod.docVariableListType.subclass = docVariableListTypeSub # end class docVariableListTypeSub class docCopyTypeSub(supermod.docCopyType): node_type = "doccopy" def __init__(self, link=None, para=None, sect1=None, internal=None): supermod.docCopyType.__init__(self, link, para, sect1, internal) supermod.docCopyType.subclass = docCopyTypeSub # end class docCopyTypeSub class docCharTypeSub(supermod.docCharType): node_type = "docchar" def __init__(self, char=None, valueOf_=""): supermod.docCharType.__init__(self, char) supermod.docCharType.subclass = docCharTypeSub # end class docCharTypeSub class verbatimTypeSub: """ New node type. Structure is largely pillaged from other nodes in order to match the set. """ node_type = "verbatim" def __init__(self, valueOf_="", mixedclass_=None, content_=None): if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.text = "" def factory(*args, **kwargs): return verbatimTypeSub(*args, **kwargs) factory = staticmethod(factory) def buildAttributes(self, attrs): pass def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.text += child_.nodeValue class docBlockQuoteTypeSub(supermod.docBlockQuoteType): node_type = "docblockquote" def __init__(self, para=None): supermod.docBlockQuoteType.__init__(self, para) def buildChildren(self, child_, nodeName_): supermod.docBlockQuoteType.buildChildren(self, child_, nodeName_) supermod.docBlockQuoteType.subclass = docBlockQuoteTypeSub # end class docBlockQuoteTypeSub class docParaTypeSub(supermod.docParaType): node_type = "docpara" def __init__(self, char=None, valueOf_=""): supermod.docParaType.__init__(self, char) self.parameterlist = [] self.simplesects = [] self.content = [] self.programlisting = [] self.images = [] self.ordered_children = [] def buildChildren(self, child_, nodeName_): supermod.docParaType.buildChildren(self, child_, nodeName_) if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "ref": obj_ = supermod.docRefTextType.factory() obj_.build(child_) self.content.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "parameterlist": obj_ = supermod.docParamListType.factory() obj_.build(child_) self.parameterlist.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "simplesect": obj_ = supermod.docSimpleSectType.factory() obj_.build(child_) self.simplesects.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "programlisting": obj_ = supermod.listingType.factory() obj_.build(child_) # Add programlisting nodes to self.content rather than self.programlisting, # because programlisting and content nodes can interleave as shown in # https://www.stack.nl/~dimitri/doxygen/manual/examples/include/html/example.html. self.content.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "image": obj_ = supermod.docImageType.factory() obj_.build(child_) self.images.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and ( nodeName_ == "bold" or nodeName_ == "emphasis" or nodeName_ == "computeroutput" or nodeName_ == "subscript" or nodeName_ == "superscript" or nodeName_ == "center" or nodeName_ == "small" ): obj_ = supermod.docMarkupType.factory() obj_.build(child_) obj_.type_ = nodeName_ self.content.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "verbatim": childobj_ = verbatimTypeSub.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "verbatim", childobj_ ) self.content.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "formula": childobj_ = docFormulaTypeSub.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "formula", childobj_ ) self.content.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "itemizedlist": obj_ = supermod.docListType.factory(subtype="itemized") obj_.build(child_) self.content.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "orderedlist": obj_ = supermod.docListType.factory(subtype="ordered") obj_.build(child_) self.content.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "heading": obj_ = supermod.docHeadingType.factory() obj_.build(child_) self.content.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "ulink": obj_ = supermod.docURLLink.factory() obj_.build(child_) self.content.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "xrefsect": obj_ = supermod.docXRefSectType.factory() obj_.build(child_) self.content.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "variablelist": obj_ = supermod.docVariableListType.factory() obj_.build(child_) self.content.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "anchor": obj_ = supermod.docAnchorType.factory() obj_.build(child_) self.content.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "parblock": obj_ = supermod.docParBlockType.factory() obj_.build(child_) self.content.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "blockquote": obj_ = supermod.docBlockQuoteType.factory() obj_.build(child_) self.content.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "table": obj_ = supermod.docTableType.factory() obj_.build(child_) self.content.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "dotfile": obj_ = supermod.docDotFileType.factory() obj_.build(child_) self.content.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "dot": obj_ = supermod.docDotType.factory() obj_.build(child_) self.content.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and ( nodeName_ == "ndash" or nodeName_ == "mdash" ): # inject a emphasized dash unicode char as a placeholder/flag for rendering # later. See visit_docblockquote() obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeText, "", "—" ) self.content.append(obj_) else: obj_ = None if obj_: self.ordered_children.append(obj_) supermod.docParaType.subclass = docParaTypeSub # end class docParaTypeSub class docParBlockTypeSub(supermod.docParBlockType): node_type = "docparblock" def __init__(self, para=None): supermod.docParBlockType.__init__(self, para) def buildChildren(self, child_, nodeName_): supermod.docParBlockType.buildChildren(self, child_, nodeName_) supermod.docParBlockType.subclass = docParBlockTypeSub # end class docParBlockTypeSub class docMarkupTypeSub(supermod.docMarkupType): node_type = "docmarkup" def __init__(self, valueOf_="", mixedclass_=None, content_=None): supermod.docMarkupType.__init__(self, valueOf_, mixedclass_, content_) self.type_ = None def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "ref": childobj_ = supermod.docRefTextType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "ref", childobj_ ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" supermod.docMarkupType.subclass = docMarkupTypeSub # end class docMarkupTypeSub class docTitleTypeSub(supermod.docTitleType): node_type = "doctitle" def __init__(self, valueOf_="", mixedclass_=None, content_=None): supermod.docTitleType.__init__(self, valueOf_, mixedclass_, content_) self.type_ = None def buildChildren(self, child_, nodeName_): supermod.docTitleType.buildChildren(self, child_, nodeName_) if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "ref": obj_ = supermod.docRefTextType.factory() obj_.build(child_) self.content_.append(obj_) self.valueOf_ += obj_.valueOf_ elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "anchor": obj_ = supermod.docAnchorType.factory() obj_.build(child_) self.content_.append(obj_) supermod.docTitleType.subclass = docTitleTypeSub # end class docTitleTypeSub class ParseError(Exception): pass class FileIOError(Exception): pass def parse(inFilename): try: doc = minidom.parse(str(inFilename)) except OSError as e: raise FileIOError(e) except ExpatError as e: raise ParseError(e) rootNode = doc.documentElement rootObj = supermod.DoxygenType.factory() rootObj.build(rootNode) return rootObj breathe-doc-breathe-10a36f3/breathe/parser/compoundsuper.py000066400000000000000000010021031475641424700240220ustar00rootroot00000000000000# # Generated Thu Jun 11 18:44:25 2009 by generateDS.py. # from __future__ import annotations import sys from xml.dom import Node, minidom from breathe import filetypes # # User methods # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class # in a module named generatedssuper.py. try: from generatedssuper import GeneratedsSuper except ImportError: class GeneratedsSuper: def format_string(self, input_data, input_name=""): return input_data def format_integer(self, input_data, input_name=""): return "%d" % input_data def format_float(self, input_data, input_name=""): return "%f" % input_data def format_double(self, input_data, input_name=""): return "%e" % input_data def format_boolean(self, input_data, input_name=""): return "%s" % input_data # # If you have installed IPython you can uncomment and use the following. # IPython is available from https://ipython.org/. # ## from IPython.Shell import IPShellEmbed ## args = '' ## ipshell = IPShellEmbed(args, ## banner = 'Dropping into IPython', ## exit_msg = 'Leaving Interpreter, back to program.') # Then use the following line where and when you want to drop into the # IPython shell: # ipshell(' -- Entering ipshell.\nHit Ctrl-D to exit') # # Globals # ExternalEncoding = "ascii" # # Support/utility functions. # def showIndent(outfile, level): for idx in range(level): outfile.write(" ") def quote_xml(inStr): s1 = isinstance(inStr, str) and inStr or "%s" % inStr s1 = s1.replace("&", "&") s1 = s1.replace("<", "<") s1 = s1.replace(">", ">") return s1 def quote_attrib(inStr): s1 = isinstance(inStr, str) and inStr or "%s" % inStr s1 = s1.replace("&", "&") s1 = s1.replace("<", "<") s1 = s1.replace(">", ">") if '"' in s1: if "'" in s1: s1 = '"%s"' % s1.replace('"', """) else: s1 = "'%s'" % s1 else: s1 = '"%s"' % s1 return s1 def quote_python(inStr): s1 = inStr if s1.find("'") == -1: if s1.find("\n") == -1: return "'%s'" % s1 else: return "'''%s'''" % s1 else: if s1.find('"') != -1: s1 = s1.replace('"', '\\"') if s1.find("\n") == -1: return '"%s"' % s1 else: return '"""%s"""' % s1 class MixedContainer: node_type = "mixedcontainer" # Constants for category: CategoryNone = 0 CategoryText = 1 CategorySimple = 2 CategoryComplex = 3 # Constants for content_type: TypeNone = 0 TypeText = 1 TypeString = 2 TypeInteger = 3 TypeFloat = 4 TypeDecimal = 5 TypeDouble = 6 TypeBoolean = 7 def __init__(self, category, content_type, name, value): self.category = category self.content_type = content_type self.name = name self.value = value def getCategory(self): return self.category def getContenttype(self, content_type): return self.content_type def getValue(self): return self.value def getName(self): return self.name class _MemberSpec: def __init__(self, name="", data_type="", container=0): self.name = name self.data_type = data_type self.container = container def set_name(self, name): self.name = name def get_name(self): return self.name def set_data_type(self, data_type): self.data_type = data_type def get_data_type(self): return self.data_type def set_container(self, container): self.container = container def get_container(self): return self.container # # Data representation classes. # class DoxygenType(GeneratedsSuper): subclass = None superclass = None def __init__(self, version=None, compounddef=None): self.version = version self.compounddef = compounddef def factory(*args_, **kwargs_): if DoxygenType.subclass: return DoxygenType.subclass(*args_, **kwargs_) else: return DoxygenType(*args_, **kwargs_) factory = staticmethod(factory) def get_compounddef(self): return self.compounddef def set_compounddef(self, compounddef): self.compounddef = compounddef def get_version(self): return self.version def set_version(self, version): self.version = version def hasContent_(self): if self.compounddef is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("version"): self.version = attrs.get("version").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "compounddef": obj_ = compounddefType.factory() obj_.build(child_) self.set_compounddef(obj_) # end class DoxygenType class compounddefType(GeneratedsSuper): subclass = None superclass = None def __init__( self, kind=None, prot=None, id=None, compoundname=None, title=None, basecompoundref=None, derivedcompoundref=None, includes=None, includedby=None, incdepgraph=None, invincdepgraph=None, innerdir=None, innerfile=None, innerclass=None, innernamespace=None, innerpage=None, innergroup=None, templateparamlist=None, sectiondef=None, briefdescription=None, detaileddescription=None, inheritancegraph=None, collaborationgraph=None, programlisting=None, location=None, listofallmembers=None, language=None, ): self.kind = kind self.prot = prot self.id = id self.language = language self.compoundname = compoundname self.title = title if basecompoundref is None: self.basecompoundref = [] else: self.basecompoundref = basecompoundref if derivedcompoundref is None: self.derivedcompoundref = [] else: self.derivedcompoundref = derivedcompoundref if includes is None: self.includes = [] else: self.includes = includes if includedby is None: self.includedby = [] else: self.includedby = includedby self.incdepgraph = incdepgraph self.invincdepgraph = invincdepgraph if innerdir is None: self.innerdir = [] else: self.innerdir = innerdir if innerfile is None: self.innerfile = [] else: self.innerfile = innerfile if innerclass is None: self.innerclass = [] else: self.innerclass = innerclass if innernamespace is None: self.innernamespace = [] else: self.innernamespace = innernamespace if innerpage is None: self.innerpage = [] else: self.innerpage = innerpage if innergroup is None: self.innergroup = [] else: self.innergroup = innergroup self.templateparamlist = templateparamlist if sectiondef is None: self.sectiondef = [] else: self.sectiondef = sectiondef self.briefdescription = briefdescription self.detaileddescription = detaileddescription self.inheritancegraph = inheritancegraph self.collaborationgraph = collaborationgraph self.programlisting = programlisting self.location = location self.listofallmembers = listofallmembers self.namespaces = [] def factory(*args_, **kwargs_): if compounddefType.subclass: return compounddefType.subclass(*args_, **kwargs_) else: return compounddefType(*args_, **kwargs_) factory = staticmethod(factory) def get_compoundname(self): return self.compoundname def set_compoundname(self, compoundname): self.compoundname = compoundname def get_title(self): return self.title def set_title(self, title): self.title = title def get_basecompoundref(self): return self.basecompoundref def set_basecompoundref(self, basecompoundref): self.basecompoundref = basecompoundref def add_basecompoundref(self, value): self.basecompoundref.append(value) def insert_basecompoundref(self, index, value): self.basecompoundref[index] = value def get_derivedcompoundref(self): return self.derivedcompoundref def set_derivedcompoundref(self, derivedcompoundref): self.derivedcompoundref = derivedcompoundref def add_derivedcompoundref(self, value): self.derivedcompoundref.append(value) def insert_derivedcompoundref(self, index, value): self.derivedcompoundref[index] = value def get_includes(self): return self.includes def set_includes(self, includes): self.includes = includes def add_includes(self, value): self.includes.append(value) def insert_includes(self, index, value): self.includes[index] = value def get_includedby(self): return self.includedby def set_includedby(self, includedby): self.includedby = includedby def add_includedby(self, value): self.includedby.append(value) def insert_includedby(self, index, value): self.includedby[index] = value def get_incdepgraph(self): return self.incdepgraph def set_incdepgraph(self, incdepgraph): self.incdepgraph = incdepgraph def get_invincdepgraph(self): return self.invincdepgraph def set_invincdepgraph(self, invincdepgraph): self.invincdepgraph = invincdepgraph def get_innerdir(self): return self.innerdir def set_innerdir(self, innerdir): self.innerdir = innerdir def add_innerdir(self, value): self.innerdir.append(value) def insert_innerdir(self, index, value): self.innerdir[index] = value def get_innerfile(self): return self.innerfile def set_innerfile(self, innerfile): self.innerfile = innerfile def add_innerfile(self, value): self.innerfile.append(value) def insert_innerfile(self, index, value): self.innerfile[index] = value def get_innerclass(self): return self.innerclass def set_innerclass(self, innerclass): self.innerclass = innerclass def add_innerclass(self, value): self.innerclass.append(value) def insert_innerclass(self, index, value): self.innerclass[index] = value def get_innernamespace(self): return self.innernamespace def set_innernamespace(self, innernamespace): self.innernamespace = innernamespace def add_innernamespace(self, value): self.innernamespace.append(value) def insert_innernamespace(self, index, value): self.innernamespace[index] = value def get_innerpage(self): return self.innerpage def set_innerpage(self, innerpage): self.innerpage = innerpage def add_innerpage(self, value): self.innerpage.append(value) def insert_innerpage(self, index, value): self.innerpage[index] = value def get_innergroup(self): return self.innergroup def set_innergroup(self, innergroup): self.innergroup = innergroup def add_innergroup(self, value): self.innergroup.append(value) def insert_innergroup(self, index, value): self.innergroup[index] = value def get_templateparamlist(self): return self.templateparamlist def set_templateparamlist(self, templateparamlist): self.templateparamlist = templateparamlist def get_sectiondef(self): return self.sectiondef def set_sectiondef(self, sectiondef): self.sectiondef = sectiondef def add_sectiondef(self, value): self.sectiondef.append(value) def insert_sectiondef(self, index, value): self.sectiondef[index] = value def get_briefdescription(self): return self.briefdescription def set_briefdescription(self, briefdescription): self.briefdescription = briefdescription def get_detaileddescription(self): return self.detaileddescription def set_detaileddescription(self, detaileddescription): self.detaileddescription = detaileddescription def get_inheritancegraph(self): return self.inheritancegraph def set_inheritancegraph(self, inheritancegraph): self.inheritancegraph = inheritancegraph def get_collaborationgraph(self): return self.collaborationgraph def set_collaborationgraph(self, collaborationgraph): self.collaborationgraph = collaborationgraph def get_programlisting(self): return self.programlisting def set_programlisting(self, programlisting): self.programlisting = programlisting def get_location(self): return self.location def set_location(self, location): self.location = location def get_listofallmembers(self): return self.listofallmembers def set_listofallmembers(self, listofallmembers): self.listofallmembers = listofallmembers def get_kind(self): return self.kind def set_kind(self, kind): self.kind = kind def get_prot(self): return self.prot def set_prot(self, prot): self.prot = prot def get_id(self): return self.id def set_id(self, id): self.id = id def hasContent_(self): if ( self.compoundname is not None or self.title is not None or self.basecompoundref is not None or self.derivedcompoundref is not None or self.includes is not None or self.includedby is not None or self.incdepgraph is not None or self.invincdepgraph is not None or self.innerdir is not None or self.innerfile is not None or self.innerclass is not None or self.innernamespace is not None or self.innerpage is not None or self.innergroup is not None or self.templateparamlist is not None or self.sectiondef is not None or self.briefdescription is not None or self.detaileddescription is not None or self.inheritancegraph is not None or self.collaborationgraph is not None or self.programlisting is not None or self.location is not None or self.listofallmembers is not None ): return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("kind"): self.kind = attrs.get("kind").value if attrs.get("prot"): self.prot = attrs.get("prot").value if attrs.get("id"): self.id = attrs.get("id").value if attrs.get("language"): self.language = attrs.get("language").value.lower() def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "compoundname": compoundname_ = "" for text__content_ in child_.childNodes: compoundname_ += text__content_.nodeValue self.compoundname = compoundname_ elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "title": obj_ = docTitleType.factory() obj_.build(child_) self.set_title(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "basecompoundref": obj_ = compoundRefType.factory() obj_.build(child_) self.basecompoundref.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "derivedcompoundref": obj_ = compoundRefType.factory() obj_.build(child_) self.derivedcompoundref.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "includes": obj_ = incType.factory() obj_.build(child_) self.includes.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "includedby": obj_ = incType.factory() obj_.build(child_) self.includedby.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "incdepgraph": obj_ = graphType.factory( caption=f"Include dependency graph for {self.get_compoundname()}:" ) obj_.build(child_) self.set_incdepgraph(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "invincdepgraph": obj_ = graphType.factory( direction="back", caption=f"This graph shows which files directly " f"or indirectly include {self.get_compoundname()}:", ) obj_.build(child_) self.set_invincdepgraph(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "innerdir": obj_ = refType.factory(nodeName_) obj_.build(child_) self.innerdir.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "innerfile": obj_ = refType.factory(nodeName_) obj_.build(child_) self.innerfile.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "innerclass": obj_ = refType.factory(nodeName_) obj_.build(child_) self.innerclass.append(obj_) self.namespaces.append(obj_.content_[0].getValue()) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "innernamespace": obj_ = refType.factory(nodeName_) obj_.build(child_) self.innernamespace.append(obj_) self.namespaces.append(obj_.content_[0].getValue()) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "innerpage": obj_ = refType.factory(nodeName_) obj_.build(child_) self.innerpage.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "innergroup": obj_ = refType.factory(nodeName_) obj_.build(child_) self.innergroup.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "templateparamlist": obj_ = templateparamlistType.factory() obj_.build(child_) self.set_templateparamlist(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sectiondef": obj_ = sectiondefType.factory() obj_.build(child_) self.sectiondef.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "briefdescription": obj_ = descriptionType.factory() obj_.build(child_) self.set_briefdescription(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "detaileddescription": obj_ = descriptionType.factory() obj_.build(child_) self.set_detaileddescription(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "inheritancegraph": obj_ = graphType.factory(caption=f"Inheritance diagram for {self.get_compoundname()}:") obj_.build(child_) self.set_inheritancegraph(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "collaborationgraph": obj_ = graphType.factory( caption=f"Collaboration diagram for {self.get_compoundname()}:" ) obj_.build(child_) self.set_collaborationgraph(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "programlisting": obj_ = listingType.factory(domain=self.language) obj_.build(child_) self.set_programlisting(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "location": obj_ = locationType.factory() obj_.build(child_) self.set_location(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "listofallmembers": obj_ = listofallmembersType.factory() obj_.build(child_) self.set_listofallmembers(obj_) # end class compounddefType class listofallmembersType(GeneratedsSuper): subclass = None superclass = None def __init__(self, member=None): if member is None: self.member = [] else: self.member = member def factory(*args_, **kwargs_): if listofallmembersType.subclass: return listofallmembersType.subclass(*args_, **kwargs_) else: return listofallmembersType(*args_, **kwargs_) factory = staticmethod(factory) def get_member(self): return self.member def set_member(self, member): self.member = member def add_member(self, value): self.member.append(value) def insert_member(self, index, value): self.member[index] = value def hasContent_(self): if self.member is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "member": obj_ = memberRefType.factory() obj_.build(child_) self.member.append(obj_) # end class listofallmembersType class memberRefType(GeneratedsSuper): subclass = None superclass = None def __init__( self, virt=None, prot=None, refid=None, ambiguityscope=None, scope=None, name=None ): self.virt = virt self.prot = prot self.refid = refid self.ambiguityscope = ambiguityscope self.scope = scope self.name = name def factory(*args_, **kwargs_): if memberRefType.subclass: return memberRefType.subclass(*args_, **kwargs_) else: return memberRefType(*args_, **kwargs_) factory = staticmethod(factory) def get_scope(self): return self.scope def set_scope(self, scope): self.scope = scope def get_name(self): return self.name def set_name(self, name): self.name = name def get_virt(self): return self.virt def set_virt(self, virt): self.virt = virt def get_prot(self): return self.prot def set_prot(self, prot): self.prot = prot def get_refid(self): return self.refid def set_refid(self, refid): self.refid = refid def get_ambiguityscope(self): return self.ambiguityscope def set_ambiguityscope(self, ambiguityscope): self.ambiguityscope = ambiguityscope def hasContent_(self): if self.scope is not None or self.name is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("virt"): self.virt = attrs.get("virt").value if attrs.get("prot"): self.prot = attrs.get("prot").value if attrs.get("refid"): self.refid = attrs.get("refid").value if attrs.get("ambiguityscope"): self.ambiguityscope = attrs.get("ambiguityscope").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "scope": scope_ = "" for text__content_ in child_.childNodes: scope_ += text__content_.nodeValue self.scope = scope_ elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "name": name_ = "" for text__content_ in child_.childNodes: name_ += text__content_.nodeValue self.name = name_ # end class memberRefType class scope(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_=""): self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if scope.subclass: return scope.subclass(*args_, **kwargs_) else: return scope(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class scope class name(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_=""): self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if name.subclass: return name.subclass(*args_, **kwargs_) else: return name(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class name class compoundRefType(GeneratedsSuper): subclass = None superclass = None def __init__( self, virt=None, prot=None, refid=None, valueOf_="", mixedclass_=None, content_=None ): self.virt = virt self.prot = prot self.refid = refid if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if compoundRefType.subclass: return compoundRefType.subclass(*args_, **kwargs_) else: return compoundRefType(*args_, **kwargs_) factory = staticmethod(factory) def get_virt(self): return self.virt def set_virt(self, virt): self.virt = virt def get_prot(self): return self.prot def set_prot(self, prot): self.prot = prot def get_refid(self): return self.refid def set_refid(self, refid): self.refid = refid def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("virt"): self.virt = attrs.get("virt").value if attrs.get("prot"): self.prot = attrs.get("prot").value if attrs.get("refid"): self.refid = attrs.get("refid").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class compoundRefType class reimplementType(GeneratedsSuper): subclass = None superclass = None def __init__(self, refid=None, valueOf_="", mixedclass_=None, content_=None): self.refid = refid if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if reimplementType.subclass: return reimplementType.subclass(*args_, **kwargs_) else: return reimplementType(*args_, **kwargs_) factory = staticmethod(factory) def get_refid(self): return self.refid def set_refid(self, refid): self.refid = refid def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("refid"): self.refid = attrs.get("refid").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class reimplementType class incType(GeneratedsSuper): subclass = None superclass = None def __init__(self, local=None, refid=None, valueOf_="", mixedclass_=None, content_=None): self.local = local self.refid = refid if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if incType.subclass: return incType.subclass(*args_, **kwargs_) else: return incType(*args_, **kwargs_) factory = staticmethod(factory) def get_local(self): return self.local def set_local(self, local): self.local = local def get_refid(self): return self.refid def set_refid(self, refid): self.refid = refid def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("local"): self.local = attrs.get("local").value if attrs.get("refid"): self.refid = attrs.get("refid").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class incType class refType(GeneratedsSuper): subclass = None superclass = None def __init__(self, prot=None, refid=None, valueOf_="", mixedclass_=None, content_=None): self.prot = prot self.refid = refid if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if refType.subclass: return refType.subclass(*args_, **kwargs_) else: return refType(*args_, **kwargs_) factory = staticmethod(factory) def get_prot(self): return self.prot def set_prot(self, prot): self.prot = prot def get_refid(self): return self.refid def set_refid(self, refid): self.refid = refid def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("prot"): self.prot = attrs.get("prot").value if attrs.get("refid"): self.refid = attrs.get("refid").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class refType class refTextType(GeneratedsSuper): subclass = None superclass = None def __init__( self, refid=None, kindref=None, external=None, valueOf_="", mixedclass_=None, content_=None ): self.refid = refid self.kindref = kindref self.external = external if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if refTextType.subclass: return refTextType.subclass(*args_, **kwargs_) else: return refTextType(*args_, **kwargs_) factory = staticmethod(factory) def get_refid(self): return self.refid def set_refid(self, refid): self.refid = refid def get_kindref(self): return self.kindref def set_kindref(self, kindref): self.kindref = kindref def get_external(self): return self.external def set_external(self, external): self.external = external def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("refid"): self.refid = attrs.get("refid").value if attrs.get("kindref"): self.kindref = attrs.get("kindref").value if attrs.get("external"): self.external = attrs.get("external").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class refTextType class sectiondefType(GeneratedsSuper): subclass = None superclass = None def __init__(self, kind=None, header=None, description=None, memberdef=None): self.kind = kind self.header = header self.description = description if memberdef is None: self.memberdef = [] else: self.memberdef = memberdef def factory(*args_, **kwargs_): if sectiondefType.subclass: return sectiondefType.subclass(*args_, **kwargs_) else: return sectiondefType(*args_, **kwargs_) factory = staticmethod(factory) def get_header(self): return self.header def set_header(self, header): self.header = header def get_description(self): return self.description def set_description(self, description): self.description = description def get_memberdef(self): return self.memberdef def set_memberdef(self, memberdef): self.memberdef = memberdef def add_memberdef(self, value): self.memberdef.append(value) def insert_memberdef(self, index, value): self.memberdef[index] = value def get_kind(self): return self.kind def set_kind(self, kind): self.kind = kind def hasContent_(self): if self.header is not None or self.description is not None or self.memberdef is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("kind"): self.kind = attrs.get("kind").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "header": header_ = "" for text__content_ in child_.childNodes: header_ += text__content_.nodeValue self.header = header_ elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "description": obj_ = descriptionType.factory() obj_.build(child_) self.set_description(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "memberdef": obj_ = memberdefType.factory() obj_.build(child_) self.memberdef.append(obj_) # end class sectiondefType class memberdefType(GeneratedsSuper): subclass = None superclass = None def __init__( self, initonly=None, kind=None, volatile=None, const=None, raisexx=None, virt=None, readable=None, prot=None, explicit=None, new=None, final=None, writable=None, add=None, static=None, strong=None, remove=None, sealed=None, mutable=None, gettable=None, inline=None, settable=None, id=None, templateparamlist=None, type_=None, definition=None, argsstring=None, name=None, read=None, write=None, bitfield=None, reimplements=None, reimplementedby=None, param=None, enumvalue=None, initializer=None, exceptions=None, briefdescription=None, detaileddescription=None, inbodydescription=None, location=None, references=None, referencedby=None, refqual=None, ): self.initonly = initonly self.kind = kind self.volatile = volatile self.const = const self.raisexx = raisexx self.virt = virt self.readable = readable self.prot = prot self.explicit = explicit self.new = new self.final = final self.writable = writable self.add = add self.static = static self.strong = strong self.remove = remove self.sealed = sealed self.mutable = mutable self.gettable = gettable self.inline = inline self.settable = settable self.id = id self.templateparamlist = templateparamlist self.type_ = type_ self.definition = definition self.argsstring = argsstring self.name = name self.read = read self.write = write self.bitfield = bitfield if reimplements is None: self.reimplements = [] else: self.reimplements = reimplements if reimplementedby is None: self.reimplementedby = [] else: self.reimplementedby = reimplementedby if param is None: self.param = [] else: self.param = param if enumvalue is None: self.enumvalue = [] else: self.enumvalue = enumvalue self.initializer = initializer self.exceptions = exceptions self.briefdescription = briefdescription self.detaileddescription = detaileddescription self.inbodydescription = inbodydescription self.location = location if references is None: self.references = [] else: self.references = references if referencedby is None: self.referencedby = [] else: self.referencedby = referencedby self.refqual = refqual def factory(*args_, **kwargs_): if memberdefType.subclass: return memberdefType.subclass(*args_, **kwargs_) else: return memberdefType(*args_, **kwargs_) factory = staticmethod(factory) def get_templateparamlist(self): return self.templateparamlist def set_templateparamlist(self, templateparamlist): self.templateparamlist = templateparamlist def get_type(self): return self.type_ def set_type(self, type_): self.type_ = type_ def get_definition(self): return self.definition def set_definition(self, definition): self.definition = definition def get_argsstring(self): return self.argsstring def set_argsstring(self, argsstring): self.argsstring = argsstring def get_name(self): return self.name def set_name(self, name): self.name = name def get_read(self): return self.read def set_read(self, read): self.read = read def get_write(self): return self.write def set_write(self, write): self.write = write def get_bitfield(self): return self.bitfield def set_bitfield(self, bitfield): self.bitfield = bitfield def get_reimplements(self): return self.reimplements def set_reimplements(self, reimplements): self.reimplements = reimplements def add_reimplements(self, value): self.reimplements.append(value) def insert_reimplements(self, index, value): self.reimplements[index] = value def get_reimplementedby(self): return self.reimplementedby def set_reimplementedby(self, reimplementedby): self.reimplementedby = reimplementedby def add_reimplementedby(self, value): self.reimplementedby.append(value) def insert_reimplementedby(self, index, value): self.reimplementedby[index] = value def get_param(self): return self.param def set_param(self, param): self.param = param def add_param(self, value): self.param.append(value) def insert_param(self, index, value): self.param[index] = value def get_enumvalue(self): return self.enumvalue def set_enumvalue(self, enumvalue): self.enumvalue = enumvalue def add_enumvalue(self, value): self.enumvalue.append(value) def insert_enumvalue(self, index, value): self.enumvalue[index] = value def get_initializer(self): return self.initializer def set_initializer(self, initializer): self.initializer = initializer def get_exceptions(self): return self.exceptions def set_exceptions(self, exceptions): self.exceptions = exceptions def get_briefdescription(self): return self.briefdescription def set_briefdescription(self, briefdescription): self.briefdescription = briefdescription def get_detaileddescription(self): return self.detaileddescription def set_detaileddescription(self, detaileddescription): self.detaileddescription = detaileddescription def get_inbodydescription(self): return self.inbodydescription def set_inbodydescription(self, inbodydescription): self.inbodydescription = inbodydescription def get_location(self): return self.location def set_location(self, location): self.location = location def get_references(self): return self.references def set_references(self, references): self.references = references def add_references(self, value): self.references.append(value) def insert_references(self, index, value): self.references[index] = value def get_referencedby(self): return self.referencedby def set_referencedby(self, referencedby): self.referencedby = referencedby def add_referencedby(self, value): self.referencedby.append(value) def insert_referencedby(self, index, value): self.referencedby[index] = value def get_initonly(self): return self.initonly def set_initonly(self, initonly): self.initonly = initonly def get_kind(self): return self.kind def set_kind(self, kind): self.kind = kind def get_volatile(self): return self.volatile def set_volatile(self, volatile): self.volatile = volatile def get_const(self): return self.const def set_const(self, const): self.const = const def get_raise(self): return self.raisexx def set_raise(self, raisexx): self.raisexx = raisexx def get_virt(self): return self.virt def set_virt(self, virt): self.virt = virt def get_readable(self): return self.readable def set_readable(self, readable): self.readable = readable def get_prot(self): return self.prot def set_prot(self, prot): self.prot = prot def get_explicit(self): return self.explicit def set_explicit(self, explicit): self.explicit = explicit def get_new(self): return self.new def set_new(self, new): self.new = new def get_final(self): return self.final def set_final(self, final): self.final = final def get_writable(self): return self.writable def set_writable(self, writable): self.writable = writable def get_add(self): return self.add def set_add(self, add): self.add = add def get_static(self): return self.static def set_static(self, static): self.static = static def get_strong(self): return self.strong def set_strong(self, strong): self.strong = strong def get_remove(self): return self.remove def set_remove(self, remove): self.remove = remove def get_sealed(self): return self.sealed def set_sealed(self, sealed): self.sealed = sealed def get_mutable(self): return self.mutable def set_mutable(self, mutable): self.mutable = mutable def get_gettable(self): return self.gettable def set_gettable(self, gettable): self.gettable = gettable def get_inline(self): return self.inline def set_inline(self, inline): self.inline = inline def get_settable(self): return self.settable def set_settable(self, settable): self.settable = settable def get_id(self): return self.id def set_id(self, id): self.id = id def get_refqual(self): return self.refqual def set_refqual(self, refqual): self.refqual = refqual def hasContent_(self): if ( self.templateparamlist is not None or self.type_ is not None or self.definition is not None or self.argsstring is not None or self.name is not None or self.read is not None or self.write is not None or self.bitfield is not None or self.reimplements is not None or self.reimplementedby is not None or self.param is not None or self.enumvalue is not None or self.initializer is not None or self.exceptions is not None or self.briefdescription is not None or self.detaileddescription is not None or self.inbodydescription is not None or self.location is not None or self.references is not None or self.referencedby is not None ): return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("initonly"): self.initonly = attrs.get("initonly").value if attrs.get("kind"): self.kind = attrs.get("kind").value if attrs.get("volatile"): self.volatile = attrs.get("volatile").value if attrs.get("const"): self.const = attrs.get("const").value if attrs.get("raise"): self.raisexx = attrs.get("raise").value if attrs.get("virt"): self.virt = attrs.get("virt").value if attrs.get("readable"): self.readable = attrs.get("readable").value if attrs.get("prot"): self.prot = attrs.get("prot").value if attrs.get("explicit"): self.explicit = attrs.get("explicit").value if attrs.get("new"): self.new = attrs.get("new").value if attrs.get("final"): self.final = attrs.get("final").value if attrs.get("writable"): self.writable = attrs.get("writable").value if attrs.get("add"): self.add = attrs.get("add").value if attrs.get("static"): self.static = attrs.get("static").value if attrs.get("strong"): self.strong = attrs.get("strong").value if attrs.get("remove"): self.remove = attrs.get("remove").value if attrs.get("sealed"): self.sealed = attrs.get("sealed").value if attrs.get("mutable"): self.mutable = attrs.get("mutable").value if attrs.get("gettable"): self.gettable = attrs.get("gettable").value if attrs.get("inline"): self.inline = attrs.get("inline").value if attrs.get("settable"): self.settable = attrs.get("settable").value if attrs.get("id"): self.id = attrs.get("id").value if attrs.get("refqual"): self.refqual = attrs.get("refqual").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "templateparamlist": obj_ = templateparamlistType.factory() obj_.build(child_) self.set_templateparamlist(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "type": obj_ = linkedTextType.factory() obj_.build(child_) self.set_type(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "definition": definition_ = "" for text__content_ in child_.childNodes: definition_ += text__content_.nodeValue self.definition = definition_ elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "argsstring": argsstring_ = "" for text__content_ in child_.childNodes: argsstring_ += text__content_.nodeValue self.argsstring = argsstring_ elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "name": name_ = "" for text__content_ in child_.childNodes: name_ += text__content_.nodeValue self.name = name_ elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "read": read_ = "" for text__content_ in child_.childNodes: read_ += text__content_.nodeValue self.read = read_ elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "write": write_ = "" for text__content_ in child_.childNodes: write_ += text__content_.nodeValue self.write = write_ elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "bitfield": bitfield_ = "" for text__content_ in child_.childNodes: bitfield_ += text__content_.nodeValue self.bitfield = bitfield_ elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "reimplements": obj_ = reimplementType.factory() obj_.build(child_) self.reimplements.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "reimplementedby": obj_ = reimplementType.factory() obj_.build(child_) self.reimplementedby.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "param": obj_ = paramType.factory() obj_.build(child_) self.param.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "enumvalue": obj_ = enumvalueType.factory() obj_.build(child_) self.enumvalue.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "initializer": obj_ = linkedTextType.factory() obj_.build(child_) self.set_initializer(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "exceptions": obj_ = linkedTextType.factory() obj_.build(child_) self.set_exceptions(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "briefdescription": obj_ = descriptionType.factory() obj_.build(child_) self.set_briefdescription(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "detaileddescription": obj_ = descriptionType.factory() obj_.build(child_) self.set_detaileddescription(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "inbodydescription": obj_ = descriptionType.factory() obj_.build(child_) self.set_inbodydescription(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "location": obj_ = locationType.factory() obj_.build(child_) self.set_location(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "references": obj_ = referenceType.factory() obj_.build(child_) self.references.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "referencedby": obj_ = referenceType.factory() obj_.build(child_) self.referencedby.append(obj_) # end class memberdefType class definition(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_=""): self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if definition.subclass: return definition.subclass(*args_, **kwargs_) else: return definition(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class definition class argsstring(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_=""): self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if argsstring.subclass: return argsstring.subclass(*args_, **kwargs_) else: return argsstring(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="argsstring", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="argsstring") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class argsstring class read(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_=""): self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if read.subclass: return read.subclass(*args_, **kwargs_) else: return read(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class read class write(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_=""): self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if write.subclass: return write.subclass(*args_, **kwargs_) else: return write(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class write class bitfield(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_=""): self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if bitfield.subclass: return bitfield.subclass(*args_, **kwargs_) else: return bitfield(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class bitfield class descriptionType(GeneratedsSuper): subclass = None superclass = None def __init__( self, title=None, para=None, sect1=None, internal=None, mixedclass_=None, content_=None ): if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if descriptionType.subclass: return descriptionType.subclass(*args_, **kwargs_) else: return descriptionType(*args_, **kwargs_) factory = staticmethod(factory) def get_title(self): return self.title def set_title(self, title): self.title = title def get_para(self): return self.para def set_para(self, para): self.para = para def add_para(self, value): self.para.append(value) def insert_para(self, index, value): self.para[index] = value def get_sect1(self): return self.sect1 def set_sect1(self, sect1): self.sect1 = sect1 def add_sect1(self, value): self.sect1.append(value) def insert_sect1(self, index, value): self.sect1[index] = value def get_internal(self): return self.internal def set_internal(self, internal): self.internal = internal def hasContent_(self): if ( self.title is not None or self.para is not None or self.sect1 is not None or self.internal is not None ): return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "title": childobj_ = docTitleType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "title", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para": childobj_ = docParaType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sect1": childobj_ = docSect1Type.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "sect1", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "internal": childobj_ = docInternalType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "internal", childobj_ ) self.content_.append(obj_) # end class descriptionType class enumvalueType(GeneratedsSuper): subclass = None superclass = None def __init__( self, prot=None, id=None, name=None, initializer=None, briefdescription=None, detaileddescription=None, mixedclass_=None, content_=None, ): self.prot = prot self.id = id if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if enumvalueType.subclass: return enumvalueType.subclass(*args_, **kwargs_) else: return enumvalueType(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def get_initializer(self): return self.initializer def set_initializer(self, initializer): self.initializer = initializer def get_briefdescription(self): return self.briefdescription def set_briefdescription(self, briefdescription): self.briefdescription = briefdescription def get_detaileddescription(self): return self.detaileddescription def set_detaileddescription(self, detaileddescription): self.detaileddescription = detaileddescription def get_prot(self): return self.prot def set_prot(self, prot): self.prot = prot def get_id(self): return self.id def set_id(self, id): self.id = id def hasContent_(self): if ( self.name is not None or self.initializer is not None or self.briefdescription is not None or self.detaileddescription is not None ): return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("prot"): self.prot = attrs.get("prot").value if attrs.get("id"): self.id = attrs.get("id").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "name": valuestr_ = "".join(text_.nodeValue for text_ in child_.childNodes) obj_ = self.mixedclass_( MixedContainer.CategorySimple, MixedContainer.TypeString, "name", valuestr_ ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "initializer": childobj_ = linkedTextType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "initializer", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "briefdescription": childobj_ = descriptionType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "briefdescription", childobj_, ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "detaileddescription": childobj_ = descriptionType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "detaileddescription", childobj_, ) self.content_.append(obj_) elif child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) # end class enumvalueType class templateparamlistType(GeneratedsSuper): subclass = None superclass = None def __init__(self, param=None): if param is None: self.param = [] else: self.param = param def factory(*args_, **kwargs_): if templateparamlistType.subclass: return templateparamlistType.subclass(*args_, **kwargs_) else: return templateparamlistType(*args_, **kwargs_) factory = staticmethod(factory) def get_param(self): return self.param def set_param(self, param): self.param = param def add_param(self, value): self.param.append(value) def insert_param(self, index, value): self.param[index] = value def hasContent_(self): if self.param is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "param": obj_ = paramType.factory() obj_.build(child_) self.param.append(obj_) # end class templateparamlistType class paramType(GeneratedsSuper): subclass = None superclass = None def __init__( self, type_=None, declname=None, defname=None, array=None, defval=None, briefdescription=None, ): self.type_ = type_ self.declname = declname self.defname = defname self.array = array self.defval = defval self.briefdescription = briefdescription def factory(*args_, **kwargs_): if paramType.subclass: return paramType.subclass(*args_, **kwargs_) else: return paramType(*args_, **kwargs_) factory = staticmethod(factory) def get_type(self): return self.type_ def set_type(self, type_): self.type_ = type_ def get_declname(self): return self.declname def set_declname(self, declname): self.declname = declname def get_defname(self): return self.defname def set_defname(self, defname): self.defname = defname def get_array(self): return self.array def set_array(self, array): self.array = array def get_defval(self): return self.defval def set_defval(self, defval): self.defval = defval def get_briefdescription(self): return self.briefdescription def set_briefdescription(self, briefdescription): self.briefdescription = briefdescription def hasContent_(self): if ( self.type_ is not None or self.declname is not None or self.defname is not None or self.array is not None or self.defval is not None or self.briefdescription is not None ): return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "type": obj_ = linkedTextType.factory() obj_.build(child_) self.set_type(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "declname": declname_ = "" for text__content_ in child_.childNodes: declname_ += text__content_.nodeValue self.declname = declname_ elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "defname": defname_ = "" for text__content_ in child_.childNodes: defname_ += text__content_.nodeValue self.defname = defname_ elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "array": array_ = "" for text__content_ in child_.childNodes: array_ += text__content_.nodeValue self.array = array_ elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "defval": obj_ = linkedTextType.factory() obj_.build(child_) self.set_defval(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "briefdescription": obj_ = descriptionType.factory() obj_.build(child_) self.set_briefdescription(obj_) # end class paramType class declname(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_=""): self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if declname.subclass: return declname.subclass(*args_, **kwargs_) else: return declname(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class declname class defname(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_=""): self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if defname.subclass: return defname.subclass(*args_, **kwargs_) else: return defname(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class defname class array(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_=""): self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if array.subclass: return array.subclass(*args_, **kwargs_) else: return array(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class array class linkedTextType(GeneratedsSuper): subclass = None superclass = None def __init__(self, ref=None, mixedclass_=None, content_=None): if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if linkedTextType.subclass: return linkedTextType.subclass(*args_, **kwargs_) else: return linkedTextType(*args_, **kwargs_) factory = staticmethod(factory) def get_ref(self): return self.ref def set_ref(self, ref): self.ref = ref def add_ref(self, value): self.ref.append(value) def insert_ref(self, index, value): self.ref[index] = value def hasContent_(self): if self.ref is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "ref": childobj_ = docRefTextType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "ref", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) # end class linkedTextType class graphType(GeneratedsSuper): subclass = None superclass = None def __init__(self, node=None, direction: str = "forward", caption: str = ""): if node is None: self.node = [] else: self.node = node self.direction = direction self.caption = caption def factory(*args_, **kwargs_): if graphType.subclass: return graphType.subclass(*args_, **kwargs_) else: return graphType(*args_, **kwargs_) factory = staticmethod(factory) def get_direction(self): return self.direction def set_direction(self, direction): self.direction = direction def get_caption(self): return self.caption def set_caption(self, caption): self.caption = caption def get_node(self): return self.node def set_node(self, node): self.node = node def add_node(self, value): self.node.append(value) def insert_node(self, index, value): self.node[index] = value def hasContent_(self): if self.node is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "node": obj_ = nodeType.factory() obj_.build(child_) self.node.append(obj_) # end class graphType class nodeType(GeneratedsSuper): subclass = None superclass = None def __init__(self, id=None, label=None, link=None, childnode=None): self.id = id self.label = label self.link = link if childnode is None: self.childnode = [] else: self.childnode = childnode def factory(*args_, **kwargs_): if nodeType.subclass: return nodeType.subclass(*args_, **kwargs_) else: return nodeType(*args_, **kwargs_) factory = staticmethod(factory) def get_label(self): return self.label def set_label(self, label): self.label = label def get_link(self): return self.link def set_link(self, link): self.link = link def get_childnode(self): return self.childnode def set_childnode(self, childnode): self.childnode = childnode def add_childnode(self, value): self.childnode.append(value) def insert_childnode(self, index, value): self.childnode[index] = value def get_id(self): return self.id def set_id(self, id): self.id = id def hasContent_(self): if self.label is not None or self.link is not None or self.childnode is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("id"): self.id = attrs.get("id").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "label": label_ = "" for text__content_ in child_.childNodes: label_ += text__content_.nodeValue self.label = label_ elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "link": obj_ = linkType.factory() obj_.build(child_) self.set_link(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "childnode": obj_ = childnodeType.factory() obj_.build(child_) self.childnode.append(obj_) # end class nodeType class label(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_=""): self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if label.subclass: return label.subclass(*args_, **kwargs_) else: return label(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class label class childnodeType(GeneratedsSuper): subclass = None superclass = None def __init__(self, relation=None, refid=None, edgelabel=None): self.relation = relation self.refid = refid if edgelabel is None: self.edgelabel = [] else: self.edgelabel = edgelabel def factory(*args_, **kwargs_): if childnodeType.subclass: return childnodeType.subclass(*args_, **kwargs_) else: return childnodeType(*args_, **kwargs_) factory = staticmethod(factory) def get_edgelabel(self): return self.edgelabel def set_edgelabel(self, edgelabel): self.edgelabel = edgelabel def add_edgelabel(self, value): self.edgelabel.append(value) def insert_edgelabel(self, index, value): self.edgelabel[index] = value def get_relation(self): return self.relation def set_relation(self, relation): self.relation = relation def get_refid(self): return self.refid def set_refid(self, refid): self.refid = refid def export(self, outfile, level, namespace_="", name_="childnodeType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="childnodeType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="childnodeType"): if self.relation is not None: outfile.write(" relation=%s" % (quote_attrib(self.relation),)) if self.refid is not None: outfile.write( " refid=%s" % ( self.format_string( quote_attrib(self.refid).encode(ExternalEncoding), input_name="refid" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="childnodeType"): for edgelabel_ in self.edgelabel: showIndent(outfile, level) outfile.write( "<%sedgelabel>%s\n" % ( namespace_, self.format_string( quote_xml(edgelabel_).encode(ExternalEncoding), input_name="edgelabel" ), namespace_, ) ) def hasContent_(self): if self.edgelabel is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("relation"): self.relation = attrs.get("relation").value if attrs.get("refid"): self.refid = attrs.get("refid").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "edgelabel": edgelabel_ = "" for text__content_ in child_.childNodes: edgelabel_ += text__content_.nodeValue self.edgelabel.append(edgelabel_) # end class childnodeType class edgelabel(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_=""): self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if edgelabel.subclass: return edgelabel.subclass(*args_, **kwargs_) else: return edgelabel(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="edgelabel", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="edgelabel") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="edgelabel"): pass def exportChildren(self, outfile, level, namespace_="", name_="edgelabel"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class edgelabel class linkType(GeneratedsSuper): subclass = None superclass = None def __init__(self, refid=None, external=None, valueOf_=""): self.refid = refid self.external = external self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if linkType.subclass: return linkType.subclass(*args_, **kwargs_) else: return linkType(*args_, **kwargs_) factory = staticmethod(factory) def get_refid(self): return self.refid def set_refid(self, refid): self.refid = refid def get_external(self): return self.external def set_external(self, external): self.external = external def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="linkType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="linkType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="linkType"): if self.refid is not None: outfile.write( " refid=%s" % ( self.format_string( quote_attrib(self.refid).encode(ExternalEncoding), input_name="refid" ), ) ) if self.external is not None: outfile.write( " external=%s" % ( self.format_string( quote_attrib(self.external).encode(ExternalEncoding), input_name="external" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="linkType"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("refid"): self.refid = attrs.get("refid").value if attrs.get("external"): self.external = attrs.get("external").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class linkType class listingType(GeneratedsSuper): subclass = None superclass = None def __init__(self, codeline=None, domain: str = None): self.domain = domain if codeline is None: self.codeline = [] else: self.codeline = codeline def factory(*args_, **kwargs_): if listingType.subclass: return listingType.subclass(*args_, **kwargs_) else: return listingType(*args_, **kwargs_) factory = staticmethod(factory) def get_codeline(self): return self.codeline def set_codeline(self, codeline): self.codeline = codeline def add_codeline(self, value): self.codeline.append(value) def insert_codeline(self, index, value): self.codeline[index] = value def export(self, outfile, level, namespace_="", name_="listingType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="listingType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="listingType"): pass def exportChildren(self, outfile, level, namespace_="", name_="listingType"): for codeline_ in self.codeline: codeline_.export(outfile, level, namespace_, name_="codeline") def hasContent_(self): if self.codeline is not None: return True else: return False def build(self, node_: minidom.Element): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs: minidom.NamedNodeMap): if "filename" in attrs: # extract the domain for this programlisting tag. filename = attrs["filename"].value self.domain = filetypes.get_pygments_alias(filename) or filetypes.get_extension( filename ) def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "codeline": obj_ = codelineType.factory() obj_.build(child_) self.codeline.append(obj_) # end class listingType class codelineType(GeneratedsSuper): subclass = None superclass = None def __init__(self, external=None, lineno=None, refkind=None, refid=None, highlight=None): self.external = external self.lineno = lineno self.refkind = refkind self.refid = refid if highlight is None: self.highlight = [] else: self.highlight = highlight def factory(*args_, **kwargs_): if codelineType.subclass: return codelineType.subclass(*args_, **kwargs_) else: return codelineType(*args_, **kwargs_) factory = staticmethod(factory) def get_highlight(self): return self.highlight def set_highlight(self, highlight): self.highlight = highlight def add_highlight(self, value): self.highlight.append(value) def insert_highlight(self, index, value): self.highlight[index] = value def get_external(self): return self.external def set_external(self, external): self.external = external def get_lineno(self): return self.lineno def set_lineno(self, lineno): self.lineno = lineno def get_refkind(self): return self.refkind def set_refkind(self, refkind): self.refkind = refkind def get_refid(self): return self.refid def set_refid(self, refid): self.refid = refid def export(self, outfile, level, namespace_="", name_="codelineType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="codelineType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="codelineType"): if self.external is not None: outfile.write(" external=%s" % (quote_attrib(self.external),)) if self.lineno is not None: outfile.write(' lineno="%s"' % self.format_integer(self.lineno, input_name="lineno")) if self.refkind is not None: outfile.write(" refkind=%s" % (quote_attrib(self.refkind),)) if self.refid is not None: outfile.write( " refid=%s" % ( self.format_string( quote_attrib(self.refid).encode(ExternalEncoding), input_name="refid" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="codelineType"): for highlight_ in self.highlight: highlight_.export(outfile, level, namespace_, name_="highlight") def hasContent_(self): if self.highlight is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("external"): self.external = attrs.get("external").value if attrs.get("lineno"): try: self.lineno = int(attrs.get("lineno").value) except ValueError as exp: raise ValueError("Bad integer attribute (lineno): %s" % exp) if attrs.get("refkind"): self.refkind = attrs.get("refkind").value if attrs.get("refid"): self.refid = attrs.get("refid").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "highlight": obj_ = highlightType.factory() obj_.build(child_) self.highlight.append(obj_) # end class codelineType class highlightType(GeneratedsSuper): subclass = None superclass = None def __init__(self, classxx=None, sp=None, ref=None, mixedclass_=None, content_=None): self.classxx = classxx if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if highlightType.subclass: return highlightType.subclass(*args_, **kwargs_) else: return highlightType(*args_, **kwargs_) factory = staticmethod(factory) def get_sp(self): return self.sp def set_sp(self, sp): self.sp = sp def add_sp(self, value): self.sp.append(value) def insert_sp(self, index, value): self.sp[index] = value def get_ref(self): return self.ref def set_ref(self, ref): self.ref = ref def add_ref(self, value): self.ref.append(value) def insert_ref(self, index, value): self.ref[index] = value def get_class(self): return self.classxx def set_class(self, classxx): self.classxx = classxx def export(self, outfile, level, namespace_="", name_="highlightType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="highlightType") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="highlightType"): if self.classxx is not None: outfile.write(" class=%s" % (quote_attrib(self.classxx),)) def exportChildren(self, outfile, level, namespace_="", name_="highlightType"): for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_) def hasContent_(self): if self.sp is not None or self.ref is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("class"): self.classxx = attrs.get("class").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sp": # value_ = [text_.nodeValue for text_ in child_.childNodes] # We make this unicode so that our unicode renderer catch-all picks it up # otherwise it would go through as 'str' and we'd have to pick it up too valuestr_ = " " obj_ = self.mixedclass_( MixedContainer.CategorySimple, MixedContainer.TypeString, "sp", valuestr_ ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "ref": childobj_ = docRefTextType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "ref", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) # end class highlightType class sp(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_=""): self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if sp.subclass: return sp.subclass(*args_, **kwargs_) else: return sp(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="sp", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="sp") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="sp"): pass def exportChildren(self, outfile, level, namespace_="", name_="sp"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class sp class referenceType(GeneratedsSuper): subclass = None superclass = None def __init__( self, endline=None, startline=None, refid=None, compoundref=None, valueOf_="", mixedclass_=None, content_=None, ): self.endline = endline self.startline = startline self.refid = refid self.compoundref = compoundref if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if referenceType.subclass: return referenceType.subclass(*args_, **kwargs_) else: return referenceType(*args_, **kwargs_) factory = staticmethod(factory) def get_endline(self): return self.endline def set_endline(self, endline): self.endline = endline def get_startline(self): return self.startline def set_startline(self, startline): self.startline = startline def get_refid(self): return self.refid def set_refid(self, refid): self.refid = refid def get_compoundref(self): return self.compoundref def set_compoundref(self, compoundref): self.compoundref = compoundref def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="referenceType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="referenceType") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="referenceType"): if self.endline is not None: outfile.write(' endline="%s"' % self.format_integer(self.endline, input_name="endline")) if self.startline is not None: outfile.write( ' startline="%s"' % self.format_integer(self.startline, input_name="startline") ) if self.refid is not None: outfile.write( " refid=%s" % ( self.format_string( quote_attrib(self.refid).encode(ExternalEncoding), input_name="refid" ), ) ) if self.compoundref is not None: outfile.write( " compoundref=%s" % ( self.format_string( quote_attrib(self.compoundref).encode(ExternalEncoding), input_name="compoundref", ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="referenceType"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("endline"): try: self.endline = int(attrs.get("endline").value) except ValueError as exp: raise ValueError("Bad integer attribute (endline): %s" % exp) if attrs.get("startline"): try: self.startline = int(attrs.get("startline").value) except ValueError as exp: raise ValueError("Bad integer attribute (startline): %s" % exp) if attrs.get("refid"): self.refid = attrs.get("refid").value if attrs.get("compoundref"): self.compoundref = attrs.get("compoundref").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class referenceType class locationType(GeneratedsSuper): subclass = None superclass = None def __init__( self, bodystart=None, line=None, bodyend=None, bodyfile=None, file=None, valueOf_="" ): self.bodystart = bodystart self.line = line self.bodyend = bodyend self.bodyfile = bodyfile self.file = file self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if locationType.subclass: return locationType.subclass(*args_, **kwargs_) else: return locationType(*args_, **kwargs_) factory = staticmethod(factory) def get_bodystart(self): return self.bodystart def set_bodystart(self, bodystart): self.bodystart = bodystart def get_line(self): return self.line def set_line(self, line): self.line = line def get_bodyend(self): return self.bodyend def set_bodyend(self, bodyend): self.bodyend = bodyend def get_bodyfile(self): return self.bodyfile def set_bodyfile(self, bodyfile): self.bodyfile = bodyfile def get_file(self): return self.file def set_file(self, file): self.file = file def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="locationType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="locationType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="locationType"): if self.bodystart is not None: outfile.write( ' bodystart="%s"' % self.format_integer(self.bodystart, input_name="bodystart") ) if self.line is not None: outfile.write(' line="%s"' % self.format_integer(self.line, input_name="line")) if self.bodyend is not None: outfile.write(' bodyend="%s"' % self.format_integer(self.bodyend, input_name="bodyend")) if self.bodyfile is not None: outfile.write( " bodyfile=%s" % ( self.format_string( quote_attrib(self.bodyfile).encode(ExternalEncoding), input_name="bodyfile" ), ) ) if self.file is not None: outfile.write( " file=%s" % ( self.format_string( quote_attrib(self.file).encode(ExternalEncoding), input_name="file" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="locationType"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("bodystart"): try: self.bodystart = int(attrs.get("bodystart").value) except ValueError as exp: raise ValueError("Bad integer attribute (bodystart): %s" % exp) if attrs.get("line"): try: self.line = int(attrs.get("line").value) except ValueError as exp: raise ValueError("Bad integer attribute (line): %s" % exp) if attrs.get("bodyend"): try: self.bodyend = int(attrs.get("bodyend").value) except ValueError as exp: raise ValueError("Bad integer attribute (bodyend): %s" % exp) if attrs.get("bodyfile"): self.bodyfile = attrs.get("bodyfile").value if attrs.get("file"): self.file = attrs.get("file").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class locationType class docSect1Type(GeneratedsSuper): subclass = None superclass = None def __init__( self, id=None, title=None, para=None, sect2=None, internal=None, mixedclass_=None, content_=None, ): self.id = id if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ if title is None: self.title = "" else: self.title = title def factory(*args_, **kwargs_): if docSect1Type.subclass: return docSect1Type.subclass(*args_, **kwargs_) else: return docSect1Type(*args_, **kwargs_) factory = staticmethod(factory) def get_title(self): return self.title def set_title(self, title): self.title = title def get_para(self): return self.para def set_para(self, para): self.para = para def add_para(self, value): self.para.append(value) def insert_para(self, index, value): self.para[index] = value def get_sect2(self): return self.sect2 def set_sect2(self, sect2): self.sect2 = sect2 def add_sect2(self, value): self.sect2.append(value) def insert_sect2(self, index, value): self.sect2[index] = value def get_internal(self): return self.internal def set_internal(self, internal): self.internal = internal def get_id(self): return self.id def set_id(self, id): self.id = id def export(self, outfile, level, namespace_="", name_="docSect1Type", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docSect1Type") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docSect1Type"): if self.id is not None: outfile.write( " id=%s" % ( self.format_string( quote_attrib(self.id).encode(ExternalEncoding), input_name="id" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="docSect1Type"): for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_) def hasContent_(self): if ( self.title is not None or self.para is not None or self.sect2 is not None or self.internal is not None ): return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("id"): self.id = attrs.get("id").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "title": self.title = child_.childNodes[0].nodeValue elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para": childobj_ = docParaType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sect2": childobj_ = docSect2Type.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "sect2", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "internal": childobj_ = docInternalS1Type.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "internal", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) # end class docSect1Type class docSect2Type(GeneratedsSuper): subclass = None superclass = None def __init__( self, id=None, title=None, para=None, sect3=None, internal=None, mixedclass_=None, content_=None, ): self.id = id if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ if title is None: title = "" else: title = title def factory(*args_, **kwargs_): if docSect2Type.subclass: return docSect2Type.subclass(*args_, **kwargs_) else: return docSect2Type(*args_, **kwargs_) factory = staticmethod(factory) def get_title(self): return self.title def set_title(self, title): self.title = title def get_para(self): return self.para def set_para(self, para): self.para = para def add_para(self, value): self.para.append(value) def insert_para(self, index, value): self.para[index] = value def get_sect3(self): return self.sect3 def set_sect3(self, sect3): self.sect3 = sect3 def add_sect3(self, value): self.sect3.append(value) def insert_sect3(self, index, value): self.sect3[index] = value def get_internal(self): return self.internal def set_internal(self, internal): self.internal = internal def get_id(self): return self.id def set_id(self, id): self.id = id def export(self, outfile, level, namespace_="", name_="docSect2Type", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docSect2Type") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docSect2Type"): if self.id is not None: outfile.write( " id=%s" % ( self.format_string( quote_attrib(self.id).encode(ExternalEncoding), input_name="id" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="docSect2Type"): for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_) def hasContent_(self): if ( self.title is not None or self.para is not None or self.sect3 is not None or self.internal is not None ): return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("id"): self.id = attrs.get("id").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "title": self.title = child_.childNodes[0].nodeValue elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para": childobj_ = docParaType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sect3": childobj_ = docSect3Type.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "sect3", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "internal": childobj_ = docInternalS2Type.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "internal", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) # end class docSect2Type class docSect3Type(GeneratedsSuper): subclass = None superclass = None def __init__( self, id=None, title=None, para=None, sect4=None, internal=None, mixedclass_=None, content_=None, ): self.id = id if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ if title is None: self.title = "" else: self.title = title def factory(*args_, **kwargs_): if docSect3Type.subclass: return docSect3Type.subclass(*args_, **kwargs_) else: return docSect3Type(*args_, **kwargs_) factory = staticmethod(factory) def get_title(self): return self.title def set_title(self, title): self.title = title def get_para(self): return self.para def set_para(self, para): self.para = para def add_para(self, value): self.para.append(value) def insert_para(self, index, value): self.para[index] = value def get_sect4(self): return self.sect4 def set_sect4(self, sect4): self.sect4 = sect4 def add_sect4(self, value): self.sect4.append(value) def insert_sect4(self, index, value): self.sect4[index] = value def get_internal(self): return self.internal def set_internal(self, internal): self.internal = internal def get_id(self): return self.id def set_id(self, id): self.id = id def export(self, outfile, level, namespace_="", name_="docSect3Type", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docSect3Type") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docSect3Type"): if self.id is not None: outfile.write( " id=%s" % ( self.format_string( quote_attrib(self.id).encode(ExternalEncoding), input_name="id" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="docSect3Type"): for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_) def hasContent_(self): if ( self.title is not None or self.para is not None or self.sect4 is not None or self.internal is not None ): return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("id"): self.id = attrs.get("id").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "title": self.title = child_.childNodes[0].nodeValue elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para": childobj_ = docParaType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sect4": childobj_ = docSect4Type.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "sect4", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "internal": childobj_ = docInternalS3Type.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "internal", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) # end class docSect3Type class docSect4Type(GeneratedsSuper): subclass = None superclass = None def __init__( self, id=None, title=None, para=None, internal=None, mixedclass_=None, content_=None ): self.id = id if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docSect4Type.subclass: return docSect4Type.subclass(*args_, **kwargs_) else: return docSect4Type(*args_, **kwargs_) factory = staticmethod(factory) def get_title(self): return self.title def set_title(self, title): self.title = title def get_para(self): return self.para def set_para(self, para): self.para = para def add_para(self, value): self.para.append(value) def insert_para(self, index, value): self.para[index] = value def get_internal(self): return self.internal def set_internal(self, internal): self.internal = internal def get_id(self): return self.id def set_id(self, id): self.id = id def export(self, outfile, level, namespace_="", name_="docSect4Type", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docSect4Type") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docSect4Type"): if self.id is not None: outfile.write( " id=%s" % ( self.format_string( quote_attrib(self.id).encode(ExternalEncoding), input_name="id" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="docSect4Type"): for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_) def hasContent_(self): if self.title is not None or self.para is not None or self.internal is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("id"): self.id = attrs.get("id").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "title": childobj_ = docTitleType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "title", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para": childobj_ = docParaType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "internal": childobj_ = docInternalS4Type.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "internal", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) # end class docSect4Type class docInternalType(GeneratedsSuper): subclass = None superclass = None def __init__(self, para=None, sect1=None, mixedclass_=None, content_=None): if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docInternalType.subclass: return docInternalType.subclass(*args_, **kwargs_) else: return docInternalType(*args_, **kwargs_) factory = staticmethod(factory) def get_para(self): return self.para def set_para(self, para): self.para = para def add_para(self, value): self.para.append(value) def insert_para(self, index, value): self.para[index] = value def get_sect1(self): return self.sect1 def set_sect1(self, sect1): self.sect1 = sect1 def add_sect1(self, value): self.sect1.append(value) def insert_sect1(self, index, value): self.sect1[index] = value def export(self, outfile, level, namespace_="", name_="docInternalType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docInternalType") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docInternalType"): pass def exportChildren(self, outfile, level, namespace_="", name_="docInternalType"): for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_) def hasContent_(self): if self.para is not None or self.sect1 is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para": childobj_ = docParaType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sect1": childobj_ = docSect1Type.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "sect1", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) # end class docInternalType class docInternalS1Type(GeneratedsSuper): subclass = None superclass = None def __init__(self, para=None, sect2=None, mixedclass_=None, content_=None): if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docInternalS1Type.subclass: return docInternalS1Type.subclass(*args_, **kwargs_) else: return docInternalS1Type(*args_, **kwargs_) factory = staticmethod(factory) def get_para(self): return self.para def set_para(self, para): self.para = para def add_para(self, value): self.para.append(value) def insert_para(self, index, value): self.para[index] = value def get_sect2(self): return self.sect2 def set_sect2(self, sect2): self.sect2 = sect2 def add_sect2(self, value): self.sect2.append(value) def insert_sect2(self, index, value): self.sect2[index] = value def export(self, outfile, level, namespace_="", name_="docInternalS1Type", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docInternalS1Type") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docInternalS1Type"): pass def exportChildren(self, outfile, level, namespace_="", name_="docInternalS1Type"): for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_) def hasContent_(self): if self.para is not None or self.sect2 is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para": childobj_ = docParaType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sect2": childobj_ = docSect2Type.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "sect2", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) # end class docInternalS1Type class docInternalS2Type(GeneratedsSuper): subclass = None superclass = None def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None): if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docInternalS2Type.subclass: return docInternalS2Type.subclass(*args_, **kwargs_) else: return docInternalS2Type(*args_, **kwargs_) factory = staticmethod(factory) def get_para(self): return self.para def set_para(self, para): self.para = para def add_para(self, value): self.para.append(value) def insert_para(self, index, value): self.para[index] = value def get_sect3(self): return self.sect3 def set_sect3(self, sect3): self.sect3 = sect3 def add_sect3(self, value): self.sect3.append(value) def insert_sect3(self, index, value): self.sect3[index] = value def export(self, outfile, level, namespace_="", name_="docInternalS2Type", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docInternalS2Type") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docInternalS2Type"): pass def exportChildren(self, outfile, level, namespace_="", name_="docInternalS2Type"): for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_) def hasContent_(self): if self.para is not None or self.sect3 is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para": childobj_ = docParaType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sect3": childobj_ = docSect3Type.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "sect3", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) # end class docInternalS2Type class docInternalS3Type(GeneratedsSuper): subclass = None superclass = None def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None): if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docInternalS3Type.subclass: return docInternalS3Type.subclass(*args_, **kwargs_) else: return docInternalS3Type(*args_, **kwargs_) factory = staticmethod(factory) def get_para(self): return self.para def set_para(self, para): self.para = para def add_para(self, value): self.para.append(value) def insert_para(self, index, value): self.para[index] = value def get_sect3(self): return self.sect3 def set_sect3(self, sect3): self.sect3 = sect3 def add_sect3(self, value): self.sect3.append(value) def insert_sect3(self, index, value): self.sect3[index] = value def export(self, outfile, level, namespace_="", name_="docInternalS3Type", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docInternalS3Type") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docInternalS3Type"): pass def exportChildren(self, outfile, level, namespace_="", name_="docInternalS3Type"): for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_) def hasContent_(self): if self.para is not None or self.sect3 is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para": childobj_ = docParaType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sect3": childobj_ = docSect4Type.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "sect3", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) # end class docInternalS3Type class docInternalS4Type(GeneratedsSuper): subclass = None superclass = None def __init__(self, para=None, mixedclass_=None, content_=None): if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docInternalS4Type.subclass: return docInternalS4Type.subclass(*args_, **kwargs_) else: return docInternalS4Type(*args_, **kwargs_) factory = staticmethod(factory) def get_para(self): return self.para def set_para(self, para): self.para = para def add_para(self, value): self.para.append(value) def insert_para(self, index, value): self.para[index] = value def export(self, outfile, level, namespace_="", name_="docInternalS4Type", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docInternalS4Type") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docInternalS4Type"): pass def exportChildren(self, outfile, level, namespace_="", name_="docInternalS4Type"): for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_) def hasContent_(self): if self.para is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para": childobj_ = docParaType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) # end class docInternalS4Type class docTitleType(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_="", mixedclass_=None, content_=None): if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docTitleType.subclass: return docTitleType.subclass(*args_, **kwargs_) else: return docTitleType(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="docTitleType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docTitleType") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docTitleType"): pass def exportChildren(self, outfile, level, namespace_="", name_="docTitleType"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class docTitleType class docParaType(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_="", mixedclass_=None, content_=None): if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docParaType.subclass: return docParaType.subclass(*args_, **kwargs_) else: return docParaType(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="docParaType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docParaType") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docParaType"): pass def exportChildren(self, outfile, level, namespace_="", name_="docParaType"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class docParaType class docMarkupType(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_="", mixedclass_=None, content_=None): if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docMarkupType.subclass: return docMarkupType.subclass(*args_, **kwargs_) else: return docMarkupType(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="docMarkupType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docMarkupType") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docMarkupType"): pass def exportChildren(self, outfile, level, namespace_="", name_="docMarkupType"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class docMarkupType class docURLLink(GeneratedsSuper): subclass = None superclass = None def __init__(self, url=None, valueOf_="", mixedclass_=None, content_=None): self.url = url if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docURLLink.subclass: return docURLLink.subclass(*args_, **kwargs_) else: return docURLLink(*args_, **kwargs_) factory = staticmethod(factory) def get_url(self): return self.url def set_url(self, url): self.url = url def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="docURLLink", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docURLLink") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docURLLink"): if self.url is not None: outfile.write( " url=%s" % ( self.format_string( quote_attrib(self.url).encode(ExternalEncoding), input_name="url" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="docURLLink"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("url"): self.url = attrs.get("url").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class docURLLink class docAnchorType(GeneratedsSuper): subclass = None superclass = None def __init__(self, id=None, valueOf_="", mixedclass_=None, content_=None): self.id = id if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docAnchorType.subclass: return docAnchorType.subclass(*args_, **kwargs_) else: return docAnchorType(*args_, **kwargs_) factory = staticmethod(factory) def get_id(self): return self.id def set_id(self, id): self.id = id def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="docAnchorType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docAnchorType") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docAnchorType"): if self.id is not None: outfile.write( " id=%s" % ( self.format_string( quote_attrib(self.id).encode(ExternalEncoding), input_name="id" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="docAnchorType"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("id"): self.id = attrs.get("id").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class docAnchorType class docFormulaType(GeneratedsSuper): subclass = None superclass = None def __init__(self, id=None, valueOf_="", mixedclass_=None, content_=None): self.id = id if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docFormulaType.subclass: return docFormulaType.subclass(*args_, **kwargs_) else: return docFormulaType(*args_, **kwargs_) factory = staticmethod(factory) def get_id(self): return self.id def set_id(self, id): self.id = id def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="docFormulaType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docFormulaType") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docFormulaType"): if self.id is not None: outfile.write( " id=%s" % ( self.format_string( quote_attrib(self.id).encode(ExternalEncoding), input_name="id" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="docFormulaType"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("id"): self.id = attrs.get("id").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class docFormulaType class docIndexEntryType(GeneratedsSuper): subclass = None superclass = None def __init__(self, primaryie=None, secondaryie=None): self.primaryie = primaryie self.secondaryie = secondaryie def factory(*args_, **kwargs_): if docIndexEntryType.subclass: return docIndexEntryType.subclass(*args_, **kwargs_) else: return docIndexEntryType(*args_, **kwargs_) factory = staticmethod(factory) def get_primaryie(self): return self.primaryie def set_primaryie(self, primaryie): self.primaryie = primaryie def get_secondaryie(self): return self.secondaryie def set_secondaryie(self, secondaryie): self.secondaryie = secondaryie def export(self, outfile, level, namespace_="", name_="docIndexEntryType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docIndexEntryType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="docIndexEntryType"): pass def exportChildren(self, outfile, level, namespace_="", name_="docIndexEntryType"): if self.primaryie is not None: showIndent(outfile, level) outfile.write( "<%sprimaryie>%s\n" % ( namespace_, self.format_string( quote_xml(self.primaryie).encode(ExternalEncoding), input_name="primaryie" ), namespace_, ) ) if self.secondaryie is not None: showIndent(outfile, level) outfile.write( "<%ssecondaryie>%s\n" % ( namespace_, self.format_string( quote_xml(self.secondaryie).encode(ExternalEncoding), input_name="secondaryie", ), namespace_, ) ) def hasContent_(self): if self.primaryie is not None or self.secondaryie is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "primaryie": primaryie_ = "" for text__content_ in child_.childNodes: primaryie_ += text__content_.nodeValue self.primaryie = primaryie_ elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "secondaryie": secondaryie_ = "" for text__content_ in child_.childNodes: secondaryie_ += text__content_.nodeValue self.secondaryie = secondaryie_ # end class docIndexEntryType class docListType(GeneratedsSuper): subclass = None superclass = None def __init__(self, listitem=None): if listitem is None: self.listitem = [] else: self.listitem = listitem def factory(*args_, **kwargs_): if docListType.subclass: return docListType.subclass(*args_, **kwargs_) else: return docListType(*args_, **kwargs_) factory = staticmethod(factory) def get_listitem(self): return self.listitem def set_listitem(self, listitem): self.listitem = listitem def add_listitem(self, value): self.listitem.append(value) def insert_listitem(self, index, value): self.listitem[index] = value def export(self, outfile, level, namespace_="", name_="docListType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docListType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="docListType"): pass def exportChildren(self, outfile, level, namespace_="", name_="docListType"): for listitem_ in self.listitem: listitem_.export(outfile, level, namespace_, name_="listitem") def hasContent_(self): if self.listitem is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "listitem": obj_ = docListItemType.factory() obj_.build(child_) self.listitem.append(obj_) # end class docListType class docListItemType(GeneratedsSuper): subclass = None superclass = None def __init__(self, para=None): if para is None: self.para = [] else: self.para = para def factory(*args_, **kwargs_): if docListItemType.subclass: return docListItemType.subclass(*args_, **kwargs_) else: return docListItemType(*args_, **kwargs_) factory = staticmethod(factory) def get_para(self): return self.para def set_para(self, para): self.para = para def add_para(self, value): self.para.append(value) def insert_para(self, index, value): self.para[index] = value def export(self, outfile, level, namespace_="", name_="docListItemType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docListItemType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="docListItemType"): pass def exportChildren(self, outfile, level, namespace_="", name_="docListItemType"): for para_ in self.para: para_.export(outfile, level, namespace_, name_="para") def hasContent_(self): if self.para is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para": obj_ = docParaType.factory() obj_.build(child_) self.para.append(obj_) # end class docListItemType class docSimpleSectType(GeneratedsSuper): subclass = None superclass = None def __init__(self, kind=None, title=None, para=None): self.kind = kind self.title = title if para is None: self.para = [] else: self.para = para def factory(*args_, **kwargs_): if docSimpleSectType.subclass: return docSimpleSectType.subclass(*args_, **kwargs_) else: return docSimpleSectType(*args_, **kwargs_) factory = staticmethod(factory) def get_title(self): return self.title def set_title(self, title): self.title = title def get_para(self): return self.para def set_para(self, para): self.para = para def add_para(self, value): self.para.append(value) def insert_para(self, index, value): self.para[index] = value def get_kind(self): return self.kind def set_kind(self, kind): self.kind = kind def export(self, outfile, level, namespace_="", name_="docSimpleSectType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docSimpleSectType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="docSimpleSectType"): if self.kind is not None: outfile.write(" kind=%s" % (quote_attrib(self.kind),)) def exportChildren(self, outfile, level, namespace_="", name_="docSimpleSectType"): if self.title: self.title.export(outfile, level, namespace_, name_="title") for para_ in self.para: para_.export(outfile, level, namespace_, name_="para") def hasContent_(self): if self.title is not None or self.para is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("kind"): self.kind = attrs.get("kind").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "title": obj_ = docTitleType.factory() obj_.build(child_) self.set_title(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para": obj_ = docParaType.factory() obj_.build(child_) self.para.append(obj_) # end class docSimpleSectType class docVarListEntryType(GeneratedsSuper): subclass = None superclass = None def __init__(self, term=None): self.term = term def factory(*args_, **kwargs_): if docVarListEntryType.subclass: return docVarListEntryType.subclass(*args_, **kwargs_) else: return docVarListEntryType(*args_, **kwargs_) factory = staticmethod(factory) def get_term(self): return self.term def set_term(self, term): self.term = term def export(self, outfile, level, namespace_="", name_="docVarListEntryType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docVarListEntryType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="docVarListEntryType"): pass def exportChildren(self, outfile, level, namespace_="", name_="docVarListEntryType"): if self.term: self.term.export( outfile, level, namespace_, name_="term", ) def hasContent_(self): if self.term is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "term": obj_ = docTitleType.factory() obj_.build(child_) self.set_term(obj_) # end class docVarListEntryType class docVariableListType(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_=""): self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if docVariableListType.subclass: return docVariableListType.subclass(*args_, **kwargs_) else: return docVariableListType(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="docVariableListType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docVariableListType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="docVariableListType"): pass def exportChildren(self, outfile, level, namespace_="", name_="docVariableListType"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class docVariableListType class docRefTextType(GeneratedsSuper): subclass = None superclass = None def __init__( self, refid=None, kindref=None, external=None, valueOf_="", mixedclass_=None, content_=None ): self.refid = refid self.kindref = kindref self.external = external if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docRefTextType.subclass: return docRefTextType.subclass(*args_, **kwargs_) else: return docRefTextType(*args_, **kwargs_) factory = staticmethod(factory) def get_refid(self): return self.refid def set_refid(self, refid): self.refid = refid def get_kindref(self): return self.kindref def set_kindref(self, kindref): self.kindref = kindref def get_external(self): return self.external def set_external(self, external): self.external = external def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="docRefTextType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docRefTextType") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docRefTextType"): if self.refid is not None: outfile.write( " refid=%s" % ( self.format_string( quote_attrib(self.refid).encode(ExternalEncoding), input_name="refid" ), ) ) if self.kindref is not None: outfile.write(" kindref=%s" % (quote_attrib(self.kindref),)) if self.external is not None: outfile.write( " external=%s" % ( self.format_string( quote_attrib(self.external).encode(ExternalEncoding), input_name="external" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="docRefTextType"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("refid"): self.refid = attrs.get("refid").value if attrs.get("kindref"): self.kindref = attrs.get("kindref").value if attrs.get("external"): self.external = attrs.get("external").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class docRefTextType class docTableType(GeneratedsSuper): subclass = None superclass = None def __init__(self, rows=None, cols=None, row=None, caption=None): self.rows = rows self.cols = cols if row is None: self.row = [] else: self.row = row self.caption = caption def factory(*args_, **kwargs_): if docTableType.subclass: return docTableType.subclass(*args_, **kwargs_) else: return docTableType(*args_, **kwargs_) factory = staticmethod(factory) def get_row(self): return self.row def set_row(self, row): self.row = row def add_row(self, value): self.row.append(value) def insert_row(self, index, value): self.row[index] = value def get_caption(self): return self.caption def set_caption(self, caption): self.caption = caption def get_rows(self): return self.rows def set_rows(self, rows): self.rows = rows def get_cols(self): return self.cols def set_cols(self, cols): self.cols = cols def export(self, outfile, level, namespace_="", name_="docTableType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docTableType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="docTableType"): if self.rows is not None: outfile.write(' rows="%s"' % self.format_integer(self.rows, input_name="rows")) if self.cols is not None: outfile.write(' cols="%s"' % self.format_integer(self.cols, input_name="cols")) def exportChildren(self, outfile, level, namespace_="", name_="docTableType"): for row_ in self.row: row_.export(outfile, level, namespace_, name_="row") if self.caption: self.caption.export(outfile, level, namespace_, name_="caption") def hasContent_(self): if self.row is not None or self.caption is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("rows"): try: self.rows = int(attrs.get("rows").value) except ValueError as exp: raise ValueError("Bad integer attribute (rows): %s" % exp) if attrs.get("cols"): try: self.cols = int(attrs.get("cols").value) except ValueError as exp: raise ValueError("Bad integer attribute (cols): %s" % exp) def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "row": obj_ = docRowType.factory() obj_.build(child_) self.row.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "caption": obj_ = docCaptionType.factory() obj_.build(child_) self.set_caption(obj_) # end class docTableType class docRowType(GeneratedsSuper): subclass = None superclass = None def __init__(self, entry=None): if entry is None: self.entry = [] else: self.entry = entry def factory(*args_, **kwargs_): if docRowType.subclass: return docRowType.subclass(*args_, **kwargs_) else: return docRowType(*args_, **kwargs_) factory = staticmethod(factory) def get_entry(self): return self.entry def set_entry(self, entry): self.entry = entry def add_entry(self, value): self.entry.append(value) def insert_entry(self, index, value): self.entry[index] = value def export(self, outfile, level, namespace_="", name_="docRowType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docRowType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="docRowType"): pass def exportChildren(self, outfile, level, namespace_="", name_="docRowType"): for entry_ in self.entry: entry_.export(outfile, level, namespace_, name_="entry") def hasContent_(self): if self.entry is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "entry": obj_ = docEntryType.factory() obj_.build(child_) self.entry.append(obj_) # end class docRowType class docEntryType(GeneratedsSuper): subclass = None superclass = None def __init__(self, thead=None, align=None, rowspan=None, colspan=None, para=None): self.thead = thead self.align = align self.rowspan = rowspan self.colspan = colspan if para is None: self.para = [] else: self.para = para def factory(*args_, **kwargs_): if docEntryType.subclass: return docEntryType.subclass(*args_, **kwargs_) else: return docEntryType(*args_, **kwargs_) factory = staticmethod(factory) def get_para(self): return self.para def set_para(self, para): self.para = para def add_para(self, value): self.para.append(value) def insert_para(self, index, value): self.para[index] = value def get_thead(self): return self.thead def set_thead(self, thead): self.thead = thead def get_align(self): return self.align def set_align(self, align): self.align = align def get_rowspan(self): return self.rowspan def set_rowspan(self, rowspan): self.rowspan = rowspan def get_colspan(self): return self.colspan def set_colspan(self, colspan): self.colspan = colspan def export(self, outfile, level, namespace_="", name_="docEntryType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docEntryType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="docEntryType"): if self.thead is not None: outfile.write(" thead=%s" % (quote_attrib(self.thead),)) if self.align is not None: outfile.write(" align=%s" % (quote_attrib(self.align),)) if self.rowspan is not None: outfile.write(" rowspan=%s" % (quote_attrib(self.rowspan),)) if self.colspan is not None: outfile.write(" colspan=%s" % (quote_attrib(self.colspan),)) def exportChildren(self, outfile, level, namespace_="", name_="docEntryType"): for para_ in self.para: para_.export(outfile, level, namespace_, name_="para") def hasContent_(self): if self.para is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("thead"): self.thead = attrs.get("thead").value if attrs.get("align"): self.align = attrs.get("align").value if attrs.get("rowspan"): self.rowspan = attrs.get("rowspan").value if attrs.get("colspan"): self.colspan = attrs.get("colspan").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para": obj_ = docParaType.factory() obj_.build(child_) self.para.append(obj_) # end class docEntryType class docCaptionType(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_="", mixedclass_=None, content_=None): if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docCaptionType.subclass: return docCaptionType.subclass(*args_, **kwargs_) else: return docCaptionType(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="docCaptionType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docCaptionType") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docCaptionType"): pass def exportChildren(self, outfile, level, namespace_="", name_="docCaptionType"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class docCaptionType class docHeadingType(GeneratedsSuper): subclass = None superclass = None def __init__(self, level=None, valueOf_="", mixedclass_=None, content_=None): self.level = level if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docHeadingType.subclass: return docHeadingType.subclass(*args_, **kwargs_) else: return docHeadingType(*args_, **kwargs_) factory = staticmethod(factory) def get_level(self): return self.level def set_level(self, level): self.level = level def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="docHeadingType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docHeadingType") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docHeadingType"): if self.level is not None: outfile.write(' level="%s"' % self.format_integer(self.level, input_name="level")) def exportChildren(self, outfile, level, namespace_="", name_="docHeadingType"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("level"): try: self.level = int(attrs.get("level").value) except ValueError as exp: raise ValueError("Bad integer attribute (level): %s" % exp) def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class docHeadingType class docImageType(GeneratedsSuper): subclass = None superclass = None def __init__( self, width=None, type_=None, name=None, height=None, valueOf_="", mixedclass_=None, content_=None, ): self.width = width self.type_ = type_ self.name = name self.height = height if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docImageType.subclass: return docImageType.subclass(*args_, **kwargs_) else: return docImageType(*args_, **kwargs_) factory = staticmethod(factory) def get_width(self): return self.width def set_width(self, width): self.width = width def get_type(self): return self.type_ def set_type(self, type_): self.type_ = type_ def get_name(self): return self.name def set_name(self, name): self.name = name def get_height(self): return self.height def set_height(self, height): self.height = height def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="docImageType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docImageType") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docImageType"): if self.width is not None: outfile.write( " width=%s" % ( self.format_string( quote_attrib(self.width).encode(ExternalEncoding), input_name="width" ), ) ) if self.type_ is not None: outfile.write(" type=%s" % (quote_attrib(self.type_),)) if self.name is not None: outfile.write( " name=%s" % ( self.format_string( quote_attrib(self.name).encode(ExternalEncoding), input_name="name" ), ) ) if self.height is not None: outfile.write( " height=%s" % ( self.format_string( quote_attrib(self.height).encode(ExternalEncoding), input_name="height" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="docImageType"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("width"): self.width = attrs.get("width").value if attrs.get("type"): self.type_ = attrs.get("type").value if attrs.get("name"): self.name = attrs.get("name").value if attrs.get("height"): self.height = attrs.get("height").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class docImageType class docDotFileType(GeneratedsSuper): subclass = None superclass = None def __init__(self, name=None, valueOf_="", mixedclass_=None, content_=None): self.name = name if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docDotFileType.subclass: return docDotFileType.subclass(*args_, **kwargs_) else: return docDotFileType(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="docDotFileType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docDotFileType") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docDotFileType"): if self.name is not None: outfile.write( " name=%s" % ( self.format_string( quote_attrib(self.name).encode(ExternalEncoding), input_name="name" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="docDotFileType"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("name"): self.name = attrs.get("name").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class docDotFileType class docDotType(GeneratedsSuper): subclass = None superclass = None def __init__(self, caption=None, valueOf_="", mixedclass_=None, content_=None): self.caption = caption if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docDotType.subclass: return docDotType.subclass(*args_, **kwargs_) else: return docDotType(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.caption def set_name(self, caption): self.caption = caption def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="docDotType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docDotType") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docDotType"): if self.caption is not None: outfile.write( " caption=%s" % ( self.format_string( quote_attrib(self.caption).encode(ExternalEncoding), input_name="caption" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="docDotType"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("caption"): self.caption = attrs.get("caption").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class docDotType class docTocItemType(GeneratedsSuper): subclass = None superclass = None def __init__(self, id=None, valueOf_="", mixedclass_=None, content_=None): self.id = id if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docTocItemType.subclass: return docTocItemType.subclass(*args_, **kwargs_) else: return docTocItemType(*args_, **kwargs_) factory = staticmethod(factory) def get_id(self): return self.id def set_id(self, id): self.id = id def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="docTocItemType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docTocItemType") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docTocItemType"): if self.id is not None: outfile.write( " id=%s" % ( self.format_string( quote_attrib(self.id).encode(ExternalEncoding), input_name="id" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="docTocItemType"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("id"): self.id = attrs.get("id").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class docTocItemType class docTocListType(GeneratedsSuper): subclass = None superclass = None def __init__(self, tocitem=None): if tocitem is None: self.tocitem = [] else: self.tocitem = tocitem def factory(*args_, **kwargs_): if docTocListType.subclass: return docTocListType.subclass(*args_, **kwargs_) else: return docTocListType(*args_, **kwargs_) factory = staticmethod(factory) def get_tocitem(self): return self.tocitem def set_tocitem(self, tocitem): self.tocitem = tocitem def add_tocitem(self, value): self.tocitem.append(value) def insert_tocitem(self, index, value): self.tocitem[index] = value def export(self, outfile, level, namespace_="", name_="docTocListType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docTocListType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="docTocListType"): pass def exportChildren(self, outfile, level, namespace_="", name_="docTocListType"): for tocitem_ in self.tocitem: tocitem_.export(outfile, level, namespace_, name_="tocitem") def hasContent_(self): if self.tocitem is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "tocitem": obj_ = docTocItemType.factory() obj_.build(child_) self.tocitem.append(obj_) # end class docTocListType class docLanguageType(GeneratedsSuper): subclass = None superclass = None def __init__(self, langid=None, para=None): self.langid = langid if para is None: self.para = [] else: self.para = para def factory(*args_, **kwargs_): if docLanguageType.subclass: return docLanguageType.subclass(*args_, **kwargs_) else: return docLanguageType(*args_, **kwargs_) factory = staticmethod(factory) def get_para(self): return self.para def set_para(self, para): self.para = para def add_para(self, value): self.para.append(value) def insert_para(self, index, value): self.para[index] = value def get_langid(self): return self.langid def set_langid(self, langid): self.langid = langid def export(self, outfile, level, namespace_="", name_="docLanguageType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docLanguageType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="docLanguageType"): if self.langid is not None: outfile.write( " langid=%s" % ( self.format_string( quote_attrib(self.langid).encode(ExternalEncoding), input_name="langid" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="docLanguageType"): for para_ in self.para: para_.export(outfile, level, namespace_, name_="para") def hasContent_(self): if self.para is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("langid"): self.langid = attrs.get("langid").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para": obj_ = docParaType.factory() obj_.build(child_) self.para.append(obj_) # end class docLanguageType class docParamListType(GeneratedsSuper): subclass = None superclass = None def __init__(self, kind=None, parameteritem=None): self.kind = kind if parameteritem is None: self.parameteritem = [] else: self.parameteritem = parameteritem def factory(*args_, **kwargs_): if docParamListType.subclass: return docParamListType.subclass(*args_, **kwargs_) else: return docParamListType(*args_, **kwargs_) factory = staticmethod(factory) def get_parameteritem(self): return self.parameteritem def set_parameteritem(self, parameteritem): self.parameteritem = parameteritem def add_parameteritem(self, value): self.parameteritem.append(value) def insert_parameteritem(self, index, value): self.parameteritem[index] = value def get_kind(self): return self.kind def set_kind(self, kind): self.kind = kind def export(self, outfile, level, namespace_="", name_="docParamListType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docParamListType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="docParamListType"): if self.kind is not None: outfile.write(" kind=%s" % (quote_attrib(self.kind),)) def exportChildren(self, outfile, level, namespace_="", name_="docParamListType"): for parameteritem_ in self.parameteritem: parameteritem_.export(outfile, level, namespace_, name_="parameteritem") def hasContent_(self): if self.parameteritem is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("kind"): self.kind = attrs.get("kind").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "parameteritem": obj_ = docParamListItem.factory() obj_.build(child_) self.parameteritem.append(obj_) # end class docParamListType class docParamListItem(GeneratedsSuper): subclass = None superclass = None def __init__(self, parameternamelist=None, parameterdescription=None): if parameternamelist is None: self.parameternamelist = [] else: self.parameternamelist = parameternamelist self.parameterdescription = parameterdescription def factory(*args_, **kwargs_): if docParamListItem.subclass: return docParamListItem.subclass(*args_, **kwargs_) else: return docParamListItem(*args_, **kwargs_) factory = staticmethod(factory) def get_parameternamelist(self): return self.parameternamelist def set_parameternamelist(self, parameternamelist): self.parameternamelist = parameternamelist def add_parameternamelist(self, value): self.parameternamelist.append(value) def insert_parameternamelist(self, index, value): self.parameternamelist[index] = value def get_parameterdescription(self): return self.parameterdescription def set_parameterdescription(self, parameterdescription): self.parameterdescription = parameterdescription def export(self, outfile, level, namespace_="", name_="docParamListItem", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docParamListItem") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="docParamListItem"): pass def exportChildren(self, outfile, level, namespace_="", name_="docParamListItem"): for parameternamelist_ in self.parameternamelist: parameternamelist_.export(outfile, level, namespace_, name_="parameternamelist") if self.parameterdescription: self.parameterdescription.export( outfile, level, namespace_, name_="parameterdescription", ) def hasContent_(self): if self.parameternamelist is not None or self.parameterdescription is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "parameternamelist": obj_ = docParamNameList.factory() obj_.build(child_) self.parameternamelist.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "parameterdescription": obj_ = descriptionType.factory() obj_.build(child_) self.set_parameterdescription(obj_) # end class docParamListItem class docParamNameList(GeneratedsSuper): subclass = None superclass = None def __init__(self, parametername=None): if parametername is None: self.parametername = [] else: self.parametername = parametername def factory(*args_, **kwargs_): if docParamNameList.subclass: return docParamNameList.subclass(*args_, **kwargs_) else: return docParamNameList(*args_, **kwargs_) factory = staticmethod(factory) def get_parametername(self): return self.parametername def set_parametername(self, parametername): self.parametername = parametername def add_parametername(self, value): self.parametername.append(value) def insert_parametername(self, index, value): self.parametername[index] = value def export(self, outfile, level, namespace_="", name_="docParamNameList", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docParamNameList") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="docParamNameList"): pass def exportChildren(self, outfile, level, namespace_="", name_="docParamNameList"): for parametername_ in self.parametername: parametername_.export(outfile, level, namespace_, name_="parametername") def hasContent_(self): if self.parametername is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "parametername": obj_ = docParamName.factory() obj_.build(child_) self.parametername.append(obj_) # end class docParamNameList class docParamName(GeneratedsSuper): subclass = None superclass = None def __init__(self, direction=None, ref=None, mixedclass_=None, content_=None): self.direction = direction if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ def factory(*args_, **kwargs_): if docParamName.subclass: return docParamName.subclass(*args_, **kwargs_) else: return docParamName(*args_, **kwargs_) factory = staticmethod(factory) def get_ref(self): return self.ref def set_ref(self, ref): self.ref = ref def get_direction(self): return self.direction def set_direction(self, direction): self.direction = direction def export(self, outfile, level, namespace_="", name_="docParamName", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docParamName") outfile.write(">") self.exportChildren(outfile, level + 1, namespace_, name_) outfile.write("\n" % (namespace_, name_)) def exportAttributes(self, outfile, level, namespace_="", name_="docParamName"): if self.direction is not None: outfile.write(" direction=%s" % (quote_attrib(self.direction),)) def exportChildren(self, outfile, level, namespace_="", name_="docParamName"): for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_) def hasContent_(self): if self.ref is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("direction"): self.direction = attrs.get("direction").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "ref": childobj_ = docRefTextType.factory() childobj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "ref", childobj_ ) self.content_.append(obj_) elif child_.nodeType == Node.TEXT_NODE: obj_ = self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", child_.nodeValue ) self.content_.append(obj_) d = child_.parentNode.attributes.get("direction") if d is not None: self.content_.insert( 0, self.mixedclass_( MixedContainer.CategoryText, MixedContainer.TypeNone, "", f"[{d.value}] ", ), ) # end class docParamName class docXRefSectType(GeneratedsSuper): subclass = None superclass = None def __init__(self, id=None, xreftitle=None, xrefdescription=None): self.id = id if xreftitle is None: self.xreftitle = [] else: self.xreftitle = xreftitle self.xrefdescription = xrefdescription def factory(*args_, **kwargs_): if docXRefSectType.subclass: return docXRefSectType.subclass(*args_, **kwargs_) else: return docXRefSectType(*args_, **kwargs_) factory = staticmethod(factory) def get_xreftitle(self): return self.xreftitle def set_xreftitle(self, xreftitle): self.xreftitle = xreftitle def add_xreftitle(self, value): self.xreftitle.append(value) def insert_xreftitle(self, index, value): self.xreftitle[index] = value def get_xrefdescription(self): return self.xrefdescription def set_xrefdescription(self, xrefdescription): self.xrefdescription = xrefdescription def get_id(self): return self.id def set_id(self, id): self.id = id def export(self, outfile, level, namespace_="", name_="docXRefSectType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docXRefSectType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="docXRefSectType"): if self.id is not None: outfile.write( " id=%s" % ( self.format_string( quote_attrib(self.id).encode(ExternalEncoding), input_name="id" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="docXRefSectType"): for xreftitle_ in self.xreftitle: showIndent(outfile, level) outfile.write( "<%sxreftitle>%s\n" % ( namespace_, self.format_string( quote_xml(xreftitle_).encode(ExternalEncoding), input_name="xreftitle" ), namespace_, ) ) if self.xrefdescription: self.xrefdescription.export( outfile, level, namespace_, name_="xrefdescription", ) def hasContent_(self): if self.xreftitle is not None or self.xrefdescription is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("id"): self.id = attrs.get("id").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "xreftitle": xreftitle_ = "" for text__content_ in child_.childNodes: xreftitle_ += text__content_.nodeValue self.xreftitle.append(xreftitle_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "xrefdescription": obj_ = descriptionType.factory() obj_.build(child_) self.set_xrefdescription(obj_) # end class docXRefSectType class docCopyType(GeneratedsSuper): subclass = None superclass = None def __init__(self, link=None, para=None, sect1=None, internal=None): self.link = link if para is None: self.para = [] else: self.para = para if sect1 is None: self.sect1 = [] else: self.sect1 = sect1 self.internal = internal def factory(*args_, **kwargs_): if docCopyType.subclass: return docCopyType.subclass(*args_, **kwargs_) else: return docCopyType(*args_, **kwargs_) factory = staticmethod(factory) def get_para(self): return self.para def set_para(self, para): self.para = para def add_para(self, value): self.para.append(value) def insert_para(self, index, value): self.para[index] = value def get_sect1(self): return self.sect1 def set_sect1(self, sect1): self.sect1 = sect1 def add_sect1(self, value): self.sect1.append(value) def insert_sect1(self, index, value): self.sect1[index] = value def get_internal(self): return self.internal def set_internal(self, internal): self.internal = internal def get_link(self): return self.link def set_link(self, link): self.link = link def export(self, outfile, level, namespace_="", name_="docCopyType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docCopyType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="docCopyType"): if self.link is not None: outfile.write( " link=%s" % ( self.format_string( quote_attrib(self.link).encode(ExternalEncoding), input_name="link" ), ) ) def exportChildren(self, outfile, level, namespace_="", name_="docCopyType"): for para_ in self.para: para_.export(outfile, level, namespace_, name_="para") for sect1_ in self.sect1: sect1_.export(outfile, level, namespace_, name_="sect1") if self.internal: self.internal.export(outfile, level, namespace_, name_="internal") def hasContent_(self): if self.para is not None or self.sect1 is not None or self.internal is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("link"): self.link = attrs.get("link").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para": obj_ = docParaType.factory() obj_.build(child_) self.para.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "sect1": obj_ = docSect1Type.factory() obj_.build(child_) self.sect1.append(obj_) elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "internal": obj_ = docInternalType.factory() obj_.build(child_) self.set_internal(obj_) # end class docCopyType class docCharType(GeneratedsSuper): subclass = None superclass = None def __init__(self, char=None, valueOf_=""): self.char = char self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if docCharType.subclass: return docCharType.subclass(*args_, **kwargs_) else: return docCharType(*args_, **kwargs_) factory = staticmethod(factory) def get_char(self): return self.char def set_char(self, char): self.char = char def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="docCharType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docCharType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="docCharType"): if self.char is not None: outfile.write(" char=%s" % (quote_attrib(self.char),)) def exportChildren(self, outfile, level, namespace_="", name_="docCharType"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("char"): self.char = attrs.get("char").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class docCharType class docBlockQuoteType(GeneratedsSuper): subclass = None superclass = None def __init__(self, mixedclass_=None, para=None): if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if para is None: self.para = [] else: self.para = para def factory(*args_, **kwargs_): if docBlockQuoteType.subclass: return docBlockQuoteType.subclass(*args_, **kwargs_) else: return docBlockQuoteType(*args_, **kwargs_) factory = staticmethod(factory) def get_para(self): return self.para def set_para(self, para): self.para = para def add_para(self, value): self.para.append(value) def insert_para(self, index, value): self.para[index] = value def export(self, outfile, level, namespace_="", name_="docBlockQuoteType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s%s" % ( namespace_, name_, namespacedef_ and " " + namespacedef_ or "", ) ) self.exportAttributes(outfile, level, namespace_, name_="docBlockQuoteType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write("/>\n") def exportAttributes(self, outfile, level, namespace_="", name_="docBlockQuoteType"): pass def exportChildren(self, outfile, level, namespace_="", name_="docBlockQuoteType"): for para_ in self.para: para_.export(outfile, level, namespace_, name_="para") def hasContent_(self): if self.para: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para": obj_ = docParaType.factory() obj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", obj_ ) self.para.append(obj_) # end class docBlockQuoteType class docParBlockType(GeneratedsSuper): subclass = None superclass = None def __init__(self, mixedclass_=None, para=None): if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if para is None: self.para = [] else: self.para = para def factory(*args_, **kwargs_): if docParBlockType.subclass: return docParBlockType.subclass(*args_, **kwargs_) else: return docParBlockType(*args_, **kwargs_) factory = staticmethod(factory) def get_para(self): return self.para def set_para(self, para): self.para = para def add_para(self, value): self.para.append(value) def insert_para(self, index, value): self.para[index] = value def export(self, outfile, level, namespace_="", name_="docParBlockType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s%s" % ( namespace_, name_, namespacedef_ and " " + namespacedef_ or "", ) ) self.exportAttributes(outfile, level, namespace_, name_="docParBlockType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write("/>\n") def exportAttributes(self, outfile, level, namespace_="", name_="docParBlockType"): pass def exportChildren(self, outfile, level, namespace_="", name_="docParBlockType"): for para_ in self.para: para_.export(outfile, level, namespace_, name_="para") def hasContent_(self): if self.para: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "para": obj_ = docParaType.factory() obj_.build(child_) obj_ = self.mixedclass_( MixedContainer.CategoryComplex, MixedContainer.TypeNone, "para", obj_ ) self.para.append(obj_) # end class docParBlockType class docEmptyType(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_=""): self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if docEmptyType.subclass: return docEmptyType.subclass(*args_, **kwargs_) else: return docEmptyType(*args_, **kwargs_) factory = staticmethod(factory) def getValueOf_(self): return self.valueOf_ def setValueOf_(self, valueOf_): self.valueOf_ = valueOf_ def export(self, outfile, level, namespace_="", name_="docEmptyType", namespacedef_=""): showIndent(outfile, level) outfile.write( "<%s%s %s" % ( namespace_, name_, namespacedef_, ) ) self.exportAttributes(outfile, level, namespace_, name_="docEmptyType") if self.hasContent_(): outfile.write(">\n") self.exportChildren(outfile, level + 1, namespace_, name_) showIndent(outfile, level) outfile.write("\n" % (namespace_, name_)) else: outfile.write(" />\n") def exportAttributes(self, outfile, level, namespace_="", name_="docEmptyType"): pass def exportChildren(self, outfile, level, namespace_="", name_="docEmptyType"): if self.valueOf_.find("![CDATA") > -1: value = quote_xml("%s" % self.valueOf_) value = value.replace("![CDATA", "") outfile.write(value) else: outfile.write(quote_xml("%s" % self.valueOf_)) def hasContent_(self): if self.valueOf_ is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) self.valueOf_ = "" for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): pass def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.TEXT_NODE: self.valueOf_ += child_.nodeValue elif child_.nodeType == Node.CDATA_SECTION_NODE: self.valueOf_ += "![CDATA[" + child_.nodeValue + "]]" # end class docEmptyType USAGE_TEXT = """ Usage: python .py [ -s ] Options: -s Use the SAX parser, not the minidom parser. """ def usage(): print(USAGE_TEXT) sys.exit(1) def parse(inFileName): doc = minidom.parse(inFileName) rootNode = doc.documentElement rootObj = DoxygenType.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None sys.stdout.write('\n') rootObj.export(sys.stdout, 0, name_="doxygen", namespacedef_="") return rootObj def parseString(inString): doc = minidom.parseString(inString) rootNode = doc.documentElement rootObj = DoxygenType.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None sys.stdout.write('\n') rootObj.export(sys.stdout, 0, name_="doxygen", namespacedef_="") return rootObj def parseLiteral(inFileName): doc = minidom.parse(inFileName) rootNode = doc.documentElement rootObj = DoxygenType.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None sys.stdout.write("from compound import *\n\n") sys.stdout.write("rootObj = doxygen(\n") rootObj.exportLiteral(sys.stdout, 0, name_="doxygen") sys.stdout.write(")\n") return rootObj def main(): args = sys.argv[1:] if len(args) == 1: parse(args[0]) else: usage() if __name__ == "__main__": main() # import pdb # pdb.run('main()') breathe-doc-breathe-10a36f3/breathe/parser/index.py000066400000000000000000000026361475641424700222400ustar00rootroot00000000000000""" Generated Mon Feb 9 19:08:05 2009 by generateDS.py. """ from __future__ import annotations from xml.dom import minidom from xml.parsers.expat import ExpatError from breathe.parser import indexsuper as supermod class DoxygenTypeSub(supermod.DoxygenType): node_type = "doxygen" def __init__(self, version=None, compound=None): supermod.DoxygenType.__init__(self, version, compound) supermod.DoxygenType.subclass = DoxygenTypeSub # end class DoxygenTypeSub class CompoundTypeSub(supermod.CompoundType): node_type = "compound" def __init__(self, kind=None, refid=None, name="", member=None): supermod.CompoundType.__init__(self, kind, refid, name, member) supermod.CompoundType.subclass = CompoundTypeSub # end class CompoundTypeSub class MemberTypeSub(supermod.MemberType): node_type = "member" def __init__(self, kind=None, refid=None, name=""): supermod.MemberType.__init__(self, kind, refid, name) supermod.MemberType.subclass = MemberTypeSub # end class MemberTypeSub class ParseError(Exception): pass class FileIOError(Exception): pass def parse(inFilename): try: doc = minidom.parse(str(inFilename)) except OSError as e: raise FileIOError(e) except ExpatError as e: raise ParseError(e) rootNode = doc.documentElement rootObj = supermod.DoxygenType.factory() rootObj.build(rootNode) return rootObj breathe-doc-breathe-10a36f3/breathe/parser/indexsuper.py000066400000000000000000000251331475641424700233140ustar00rootroot00000000000000# # Generated Thu Jun 11 18:43:54 2009 by generateDS.py. # from __future__ import annotations import sys from xml.dom import Node, minidom # # User methods # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class # in a module named generatedssuper.py. try: from generatedssuper import GeneratedsSuper except ImportError: class GeneratedsSuper: def format_string(self, input_data, input_name=""): return input_data def format_integer(self, input_data, input_name=""): return "%d" % input_data def format_float(self, input_data, input_name=""): return "%f" % input_data def format_double(self, input_data, input_name=""): return "%e" % input_data def format_boolean(self, input_data, input_name=""): return "%s" % input_data # # If you have installed IPython you can uncomment and use the following. # IPython is available from https://ipython.org/. # ## from IPython.Shell import IPShellEmbed ## args = '' ## ipshell = IPShellEmbed(args, ## banner = 'Dropping into IPython', ## exit_msg = 'Leaving Interpreter, back to program.') # Then use the following line where and when you want to drop into the # IPython shell: # ipshell(' -- Entering ipshell.\nHit Ctrl-D to exit') # # Globals # ExternalEncoding = "ascii" # # Support/utility functions. # def showIndent(outfile, level): for idx in range(level): outfile.write(" ") def quote_xml(inStr): s1 = isinstance(inStr, str) and inStr or "%s" % inStr s1 = s1.replace("&", "&") s1 = s1.replace("<", "<") s1 = s1.replace(">", ">") return s1 def quote_attrib(inStr): s1 = isinstance(inStr, str) and inStr or "%s" % inStr s1 = s1.replace("&", "&") s1 = s1.replace("<", "<") s1 = s1.replace(">", ">") if '"' in s1: if "'" in s1: s1 = '"%s"' % s1.replace('"', """) else: s1 = "'%s'" % s1 else: s1 = '"%s"' % s1 return s1 def quote_python(inStr): s1 = inStr if s1.find("'") == -1: if s1.find("\n") == -1: return "'%s'" % s1 else: return "'''%s'''" % s1 else: if s1.find('"') != -1: s1 = s1.replace('"', '\\"') if s1.find("\n") == -1: return '"%s"' % s1 else: return '"""%s"""' % s1 class MixedContainer: # Constants for category: CategoryNone = 0 CategoryText = 1 CategorySimple = 2 CategoryComplex = 3 # Constants for content_type: TypeNone = 0 TypeText = 1 TypeString = 2 TypeInteger = 3 TypeFloat = 4 TypeDecimal = 5 TypeDouble = 6 TypeBoolean = 7 def __init__(self, category, content_type, name, value): self.category = category self.content_type = content_type self.name = name self.value = value def getCategory(self): return self.category def getContenttype(self, content_type): return self.content_type def getValue(self): return self.value def getName(self): return self.name class _MemberSpec: def __init__(self, name="", data_type="", container=0): self.name = name self.data_type = data_type self.container = container def set_name(self, name): self.name = name def get_name(self): return self.name def set_data_type(self, data_type): self.data_type = data_type def get_data_type(self): return self.data_type def set_container(self, container): self.container = container def get_container(self): return self.container # # Data representation classes. # class DoxygenType(GeneratedsSuper): subclass = None superclass = None def __init__(self, version=None, compound=None): self.version = version if compound is None: self.compound = [] else: self.compound = compound def factory(*args_, **kwargs_): if DoxygenType.subclass: return DoxygenType.subclass(*args_, **kwargs_) else: return DoxygenType(*args_, **kwargs_) factory = staticmethod(factory) def get_compound(self): return self.compound def set_compound(self, compound): self.compound = compound def add_compound(self, value): self.compound.append(value) def insert_compound(self, index, value): self.compound[index] = value def get_version(self): return self.version def set_version(self, version): self.version = version def hasContent_(self): if self.compound is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("version"): self.version = attrs.get("version").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "compound": obj_ = CompoundType.factory() obj_.build(child_) self.compound.append(obj_) # end class DoxygenType class CompoundType(GeneratedsSuper): subclass = None superclass = None def __init__(self, kind=None, refid=None, name=None, member=None): self.kind = kind self.refid = refid self.name = name if member is None: self.member = [] else: self.member = member def factory(*args_, **kwargs_): if CompoundType.subclass: return CompoundType.subclass(*args_, **kwargs_) else: return CompoundType(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def get_member(self): return self.member def set_member(self, member): self.member = member def add_member(self, value): self.member.append(value) def insert_member(self, index, value): self.member[index] = value def get_kind(self): return self.kind def set_kind(self, kind): self.kind = kind def get_refid(self): return self.refid def set_refid(self, refid): self.refid = refid def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("kind"): self.kind = attrs.get("kind").value if attrs.get("refid"): self.refid = attrs.get("refid").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "name": name_ = "" for text__content_ in child_.childNodes: name_ += text__content_.nodeValue self.name = name_ elif child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "member": obj_ = MemberType.factory() obj_.build(child_) self.member.append(obj_) # end class CompoundType class MemberType(GeneratedsSuper): subclass = None superclass = None def __init__(self, kind=None, refid=None, name=None): self.kind = kind self.refid = refid self.name = name def factory(*args_, **kwargs_): if MemberType.subclass: return MemberType.subclass(*args_, **kwargs_) else: return MemberType(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def get_kind(self): return self.kind def set_kind(self, kind): self.kind = kind def get_refid(self): return self.refid def set_refid(self, refid): self.refid = refid def hasContent_(self): if self.name is not None: return True else: return False def build(self, node_): attrs = node_.attributes self.buildAttributes(attrs) for child_ in node_.childNodes: nodeName_ = child_.nodeName.split(":")[-1] self.buildChildren(child_, nodeName_) def buildAttributes(self, attrs): if attrs.get("kind"): self.kind = attrs.get("kind").value if attrs.get("refid"): self.refid = attrs.get("refid").value def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and nodeName_ == "name": name_ = "" for text__content_ in child_.childNodes: name_ += text__content_.nodeValue self.name = name_ # end class MemberType USAGE_TEXT = """ Usage: python .py [ -s ] Options: -s Use the SAX parser, not the minidom parser. """ def usage(): print(USAGE_TEXT) sys.exit(1) def parse(inFileName): doc = minidom.parse(inFileName) rootNode = doc.documentElement rootObj = DoxygenType.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None sys.stdout.write('\n') rootObj.export(sys.stdout, 0, name_="doxygenindex", namespacedef_="") return rootObj def parseString(inString): doc = minidom.parseString(inString) rootNode = doc.documentElement rootObj = DoxygenType.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None sys.stdout.write('\n') rootObj.export(sys.stdout, 0, name_="doxygenindex", namespacedef_="") return rootObj def parseLiteral(inFileName): doc = minidom.parse(inFileName) rootNode = doc.documentElement rootObj = DoxygenType.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None sys.stdout.write("from index import *\n\n") sys.stdout.write("rootObj = doxygenindex(\n") rootObj.exportLiteral(sys.stdout, 0, name_="doxygenindex") sys.stdout.write(")\n") return rootObj def main(): args = sys.argv[1:] if len(args) == 1: parse(args[0]) else: usage() if __name__ == "__main__": main() # import pdb # pdb.run('main()') breathe-doc-breathe-10a36f3/breathe/path_handler.py000066400000000000000000000013401475641424700222550ustar00rootroot00000000000000from __future__ import annotations from pathlib import Path from typing import TYPE_CHECKING if TYPE_CHECKING: from sphinx.application import Sphinx def includes_directory(file_path: str): # Check for backslash or forward slash as we don't know what platform we're on and sometimes # the doxygen paths will have forward slash even on Windows. return bool(str(file_path).count("\\")) or bool(str(file_path).count("/")) def resolve_path(app: Sphinx, directory: str, filename: str): """Returns a full path to the filename in the given directory assuming that if the directory path is relative, then it is relative to the conf.py directory. """ return Path(app.confdir, directory, filename).resolve() breathe-doc-breathe-10a36f3/breathe/process.py000066400000000000000000000073311475641424700213100ustar00rootroot00000000000000from __future__ import annotations import os from pathlib import Path from shlex import quote from typing import TYPE_CHECKING if TYPE_CHECKING: from typing import Callable from breathe.project import AutoProjectInfo, ProjectInfoFactory AUTOCFG_TEMPLATE = r""" PROJECT_NAME = "{project_name}" OUTPUT_DIRECTORY = {output_dir} GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = {input} ENABLE_PREPROCESSING = YES QUIET = YES JAVADOC_AUTOBRIEF = YES JAVADOC_AUTOBRIEF = NO GENERATE_HTML = NO GENERATE_XML = YES ALIASES = rst="\verbatim embed:rst" ALIASES += endrst="\endverbatim" ALIASES += inlinerst="\verbatim embed:rst:inline" {extra} """.strip() class ProjectData: """Simple handler for the files and project_info for each project.""" def __init__(self, auto_project_info: AutoProjectInfo, files: list[str]) -> None: self.auto_project_info = auto_project_info self.files = files class AutoDoxygenProcessHandle: def __init__( self, run_process: Callable, write_file: Callable[[str | os.PathLike[str], str, str], None], project_info_factory: ProjectInfoFactory, ) -> None: self.run_process = run_process self.write_file = write_file self.project_info_factory = project_info_factory def generate_xml( self, projects_source: dict[str, tuple[str, list[str]]], doxygen_options: dict[str, str], doxygen_aliases: dict[str, str], ) -> None: project_files: dict[str, ProjectData] = {} # First collect together all the files which need to be doxygen processed for each project for project_name, file_structure in projects_source.items(): folder, contents = file_structure auto_project_info = self.project_info_factory.create_auto_project_info( project_name, folder ) project_files[project_name] = ProjectData(auto_project_info, contents) # Iterate over the projects and generate doxygen xml output for the files for each one into # a directory in the Sphinx build area for project_name, data in project_files.items(): project_path = self.process( data.auto_project_info, data.files, doxygen_options, doxygen_aliases ) project_info = data.auto_project_info.create_project_info(project_path) self.project_info_factory.store_project_info_for_auto(project_name, project_info) def process( self, auto_project_info: AutoProjectInfo, files: list[str], doxygen_options: dict[str, str], doxygen_aliases: dict[str, str], ) -> str: name = auto_project_info.name() full_paths = [str(auto_project_info.abs_path_to_source_file(f)) for f in files] options = "\n".join("%s=%s" % pair for pair in doxygen_options.items()) aliases = "\n".join( f'ALIASES += {name}="{value}"' for name, value in doxygen_aliases.items() ) cfg = AUTOCFG_TEMPLATE.format( project_name=name, output_dir=name, input=" ".join(full_paths), extra=f"{options}\n{aliases}", ) build_dir = Path(auto_project_info.build_dir(), "breathe", "doxygen") cfgfile = f"{name}.cfg" self.write_file(build_dir, cfgfile, cfg) # Shell-escape the cfg file name to try to avoid any issue where the name might include # malicious shell character - We have to use the shell=True option to make it work on # Windows. See issue #271 self.run_process(f"doxygen {quote(cfgfile)}", cwd=build_dir, shell=True) return os.path.join(build_dir, name, "xml") breathe-doc-breathe-10a36f3/breathe/project.py000066400000000000000000000167731475641424700213120ustar00rootroot00000000000000from __future__ import annotations import fnmatch import os from pathlib import Path from typing import TYPE_CHECKING from breathe.exception import BreatheError if TYPE_CHECKING: from sphinx.application import Sphinx class ProjectError(BreatheError): pass class NoDefaultProjectError(ProjectError): pass class AutoProjectInfo: """Created as a temporary step in the automatic xml generation process""" def __init__(self, app: Sphinx, name: str, source_path: str, build_dir: str, reference: str): self.app = app self._name = name self._source_path = source_path self._build_dir = build_dir self._reference = reference def name(self): return self._name def build_dir(self): return self._build_dir def abs_path_to_source_file(self, file_): """ Returns full path to the provide file assuming that the provided path is relative to the projects conf.py directory as specified in the breathe_projects_source config variable. """ return Path(self.app.confdir, self._source_path, file_).resolve() def create_project_info(self, project_path): """Creates a proper ProjectInfo object based on the information in this AutoProjectInfo""" return ProjectInfo(self.app, self._name, project_path, self._source_path, self._reference) class ProjectInfo: def __init__(self, app: Sphinx, name: str, path: str, source_path: str, reference: str): self.app = app self._name = name self._project_path = path self._source_path = source_path self._reference = reference def name(self) -> str: return self._name def project_path(self): return self._project_path def source_path(self): return self._source_path def relative_path_to_xml_file(self, file_): """ Returns relative path from Sphinx documentation top-level source directory to the specified file assuming that the specified file is a path relative to the doxygen xml output directory. """ # os.path.join does the appropriate handling if _project_path is an absolute path full_xml_project_path = os.path.join(self.app.confdir, self._project_path, file_) return os.path.relpath(full_xml_project_path, self.app.srcdir) def sphinx_abs_path_to_file(self, file_): """ Prepends os.path.sep to the value returned by relative_path_to_file. This is to match Sphinx's concept of an absolute path which starts from the top-level source directory of the project. """ return os.path.sep + self.relative_path_to_xml_file(file_) def reference(self): return self._reference def domain_for_file(self, file_: str) -> str: extension = file_.split(".")[-1] try: domain = self.app.config.breathe_domain_by_extension[extension] except KeyError: domain = "" domainFromFilePattern = self.app.config.breathe_domain_by_file_pattern for pattern, pattern_domain in domainFromFilePattern.items(): if fnmatch.fnmatch(file_, pattern): domain = pattern_domain return domain class ProjectInfoFactory: def __init__(self, app: Sphinx): self.app = app # note: don't access self.app.config now, as we are instantiated at setup-time. # Assume general build directory is the parent of the doctree directory. # This can be overridden with the breathe_build_directory config variable self._default_build_dir = os.path.dirname(os.path.normpath(app.doctreedir)) self.project_count = 0 self.project_info_store: dict[str, ProjectInfo] = {} self.project_info_for_auto_store: dict[str, AutoProjectInfo] = {} self.auto_project_info_store: dict[str, AutoProjectInfo] = {} @property def build_dir(self) -> str: config = self.app.config if config.breathe_build_directory: return config.breathe_build_directory else: return self._default_build_dir def default_path(self) -> str: config = self.app.config if not config.breathe_default_project: raise NoDefaultProjectError( "No breathe_default_project config setting to fall back on " "for directive with no 'project' or 'path' specified." ) try: return config.breathe_projects[config.breathe_default_project] except KeyError: raise ProjectError( ( "breathe_default_project value '%s' does not seem to be a valid key for the " "breathe_projects dictionary" ) % config.breathe_default_project ) def create_project_info(self, options) -> ProjectInfo: config = self.app.config name = config.breathe_default_project if "project" in options: try: path = config.breathe_projects[options["project"]] name = options["project"] except KeyError: raise ProjectError( "Unable to find project '%s' in breathe_projects dictionary" % options["project"] ) elif "path" in options: path = options["path"] else: path = self.default_path() try: return self.project_info_store[path] except KeyError: reference = name if not name: name = "project%s" % self.project_count reference = path self.project_count += 1 project_info = ProjectInfo(self.app, name, path, "NoSourcePath", reference) self.project_info_store[path] = project_info return project_info def store_project_info_for_auto(self, name: str, project_info: AutoProjectInfo) -> None: """Stores the project info by name for later extraction by the auto directives. Stored separately to the non-auto project info objects as they should never overlap. """ self.project_info_for_auto_store[name] = project_info def retrieve_project_info_for_auto(self, options) -> AutoProjectInfo: """Retrieves the project info by name for later extraction by the auto directives. Looks for the 'project' entry in the options dictionary. This is a less than ideal API but it is designed to match the use of 'create_project_info' above for which it makes much more sense. """ name = options.get("project", self.app.config.breathe_default_project) if name is None: raise NoDefaultProjectError( "No breathe_default_project config setting to fall back on " "for directive with no 'project' or 'path' specified." ) return self.project_info_for_auto_store[name] def create_auto_project_info(self, name: str, source_path) -> AutoProjectInfo: key = source_path try: return self.auto_project_info_store[key] except KeyError: reference = name if not name: name = "project%s" % self.project_count reference = source_path self.project_count += 1 auto_project_info = AutoProjectInfo( self.app, name, source_path, self.build_dir, reference ) self.auto_project_info_store[key] = auto_project_info return auto_project_info breathe-doc-breathe-10a36f3/breathe/renderer/000077500000000000000000000000001475641424700210625ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/breathe/renderer/__init__.py000066400000000000000000000034131475641424700231740ustar00rootroot00000000000000from __future__ import annotations import textwrap from docutils import nodes def format_parser_error(name, error, filename, state, lineno, do_unicode_warning): warning = '%s: Unable to parse xml file "%s". ' % (name, filename) explanation = "Reported error: %s. " % error unicode_explanation_text = "" unicode_explanation = [] if do_unicode_warning: unicode_explanation_text = ( textwrap.dedent( """ Parsing errors are often due to unicode errors associated with the encoding of the original source files. Doxygen propagates invalid characters from the input source files to the output xml.""" ) .strip() .replace("\n", " ") ) unicode_explanation = [nodes.paragraph("", "", nodes.Text(unicode_explanation_text))] return [ nodes.warning( "", nodes.paragraph("", "", nodes.Text(warning)), nodes.paragraph("", "", nodes.Text(explanation)), *unicode_explanation, ), state.document.reporter.warning( warning + explanation + unicode_explanation_text, line=lineno ), ] class RenderContext: def __init__( self, node_stack, mask_factory, directive_args, domain: str = "", child: bool = False ) -> None: self.node_stack = node_stack self.mask_factory = mask_factory self.directive_args = directive_args self.domain = domain self.child = child def create_child_context(self, data_object) -> RenderContext: node_stack = self.node_stack[:] node_stack.insert(0, self.mask_factory.mask(data_object)) return RenderContext(node_stack, self.mask_factory, self.directive_args, self.domain, True) breathe-doc-breathe-10a36f3/breathe/renderer/filter.py000066400000000000000000001160171475641424700227270ustar00rootroot00000000000000""" Filters ------- Filters are an interesting and somewhat challenging part of the code base. They are used for two different purposes: - To figure out which nodes in the xml hierarchy to start rendering from. These are called 'finder filters' or 'content filters'. This is done before rendering starts. - To figure out which nodes under a selected nodes in the xml hierarchy should be rendered. These are called 'render filters'. This is done during the render process with a test in the DoxygenToRstRendererFactory. General Implementation ~~~~~~~~~~~~~~~~~~~~~~ Filters are essential just tests to see if a node matches certain parameters that are needed to decide whether or not to include it in some output. As these filters are declared once and then used on multiple nodes, we model them as object hierarchies that encapsulate the required test and take a node (with its context) and return True or False. If you wanted a test which figures out if a node has the node_type 'memberdef' you might create the following object hierarchy: node_is_memberdef = InFilter(AttributeAccessor(Node(), 'node_type'), ['memberdef']) This reads from the inside out, as get the node, then get the node_type attribute from it, and see if the value of the attribute is in the list ['memberdef']. The Node() is called a 'Selector'. Parent() is also a selector. It means given the current context, work with the parent of the current node rather than the node itself. This allows you to frame tests in terms of a node's parent as well as the node which helps when we want nodes with particular parents and not others. The AttributeAccessor() is called an 'Accessor'. It wraps up an attempt to access a particular attribute on the selected node. There are quite a few different specific accessors but they can mostly be generalised with the AttributeAccessor. This code has evolved over time and initially the implementation involved specific accessor classes (which are still used in large parts of it.) The InFilter() is unsurprisingly called a 'Filter'. There are lots of different filters. Filters either act on the results of Accessors or on the results of other Filters and they always return True or False. The AndFilter and the OrFilter can be used to combine the outputs of other Filters with logical 'and' and 'or' operations. You can build up some pretty complex expressions with this level of freedom as you might imagine. The complexity is unfortunate but necessary as the nature of filtering the xml is quite complex. Finder Filters ~~~~~~~~~~~~~~ The implementation of the filters can change a little depending on how they are called. Finder filters are called from the breathe.finder.doxygen.index and breathe.finder.doxygen.compound files. They are called like this: # Descend down the hierarchy # ... if filter_.allow(node_stack): matches.append(self.data_object) # Keep on descending # ... This means that the result of the filter does not stop us descending down the hierarchy and testing more nodes. This simplifies the filters as they only have to return true for the exact nodes they are interested in and they don't have to worry about allowing the iteration down the hierarchy to continue for nodes which don't match. An example of a finder filter is: AndFilter( InFilter(NodeTypeAccessor(Node()), ["compound"]), InFilter(KindAccessor(Node()), ["group"]), InFilter(NameAccessor(Node()), ["mygroup"]) ) This says, return True for all the nodes of node_type 'compound' with 'kind' set to 'group' which have the name 'mygroup'. It returns false for everything else, but when a node matching this is found then it is added to the matches list by the code above. It is therefore relatively easy to write finder filters. If you have two separate node filters like the one above and you want to match on both of them then you can do: OrFilter( node_filter_1, node_filter_2 ) To combine them. Content Filters ~~~~~~~~~~~~~~~ Content filters are harder than the finder filters as they are responsible for halting the iteration down the hierarchy if they return false. This means that if you're interested in memberdef nodes with a particular attribute then you have to check for that but also include a clause which allows all other non-memberdef nodes to pass through as you don't want to interrupt them. This means you end up with filters like this: OrFilter( AndFilter( InFilter(NodeTypeAccessor(Node()), ["compound"]), InFilter(KindAccessor(Node()), ["group"]), InFilter(NameAccessor(Node()), ["mygroup"]) ), NotFilter( AndFilter( InFilter(NodeTypeAccessor(Node()), ["compound"]), InFilter(KindAccessor(Node()), ["group"]), ) ) ) Which is to say that we want to let through a compound, with kind group, with name 'mygroup' but we're also happy if the node is **not** a compound with kind group. Really we just don't want to let through any compounds with kind group with name other than 'mygroup'. As such, we can rephrase this as: NotFilter( AndFilter( InFilter(NodeTypeAccessor(Node()), ["compound"]), InFilter(KindAccessor(Node()), ["group"]), NotFilter(InFilter(NameAccessor(Node()), ["mygroup"])) ) ) Using logical manipulation we can rewrite this as: OrFilter( NotFilter(InFilter(NodeTypeAccessor(Node()), ["compound"])), NotFilter(InFilter(KindAccessor(Node()), ["group"])), InFilter(NameAccessor(Node()), ["mygroup"]) ) We reads: allow if it isn't a compound, or if it is a compound but doesn't have a 'kind' of 'group', but if it is a compound and has a 'kind' of 'group then only allow it if it is named 'mygroup'. Helper Syntax ~~~~~~~~~~~~~ Some of these filter declarations get a little awkward to read and write. They are not laid out in manner which reads smoothly. Additional helper methods and operator overloads have been introduced to help with this. AttributeAccessor objects are created in property methods on the Selector classes so: node.kind Where node has been declared as a Node() instance. Results in: AttributeAccessor(Node(), 'kind') The '==' and '!=' operators on the Accessors have been overloaded to return the appropriate filters so that: node.kind == 'group' Results in: InFilter(AttributeAccessor(Node(), 'kind'), ['kind']) We also override the binary 'and' (&), 'or' (|) and 'not' (~) operators in Python to apply AndFilters, OrFilters and NotFilters respectively. We have to override the binary operators as they actual 'and', 'or' and 'not' operators cannot be overridden. So: (node.node_type == 'compound') & (node.name == 'mygroup') Translates to: AndFilter( InFilter(NodeTypeAccessor(Node()), ["compound"])), InFilter(NameAccessor(Node()), ["mygroup"]) ) Where the former is hopefully more readable without sacrificing too much to the abstract magic of operator overloads. Operator Precedences & Extra Parenthesis '''''''''''''''''''''''''''''''''''''''' As the binary operators have a lower operator precedence than '==' and '!=' and some other operators we have to include additional parenthesis in the expressions to group them as we want. So instead of writing: node.node_type == 'compound' & node.name == 'mygroup' We have to write: (node.node_type == 'compound') & (node.name == 'mygroup') """ from __future__ import annotations import os from typing import TYPE_CHECKING from breathe import path_handler if TYPE_CHECKING: from typing import Any, Callable from sphinx.application import Sphinx class UnrecognisedKindError(Exception): pass ############################################################################### # Selectors ############################################################################### class Selector: def __call__(self, node_stack): raise NotImplementedError @property def node_type(self): return NodeTypeAccessor(self) @property def kind(self): return AttributeAccessor(self, "kind") @property def node_name(self): return AttributeAccessor(self, "node_name") @property def name(self): return AttributeAccessor(self, "name") @property def briefdescription(self): return AttributeAccessor(self, "briefdescription") @property def detaileddescription(self): return AttributeAccessor(self, "detaileddescription") @property def prot(self): return AttributeAccessor(self, "prot") @property def valueOf(self): return AttributeAccessor(self, "valueOf_") @property def id(self): return AttributeAccessor(self, "id") class Ancestor(Selector): def __init__(self, generations): self.generations = generations def __call__(self, node_stack): return node_stack[self.generations] class Parent(Selector): def __call__(self, node_stack): return node_stack[1] class Node(Selector): def __call__(self, node_stack): return node_stack[0] ############################################################################### # Accessors ############################################################################### class Accessor: def __init__(self, selector: Selector) -> None: self.selector = selector def __call__(self, node_stack): raise NotImplementedError def __eq__(self, value: str) -> InFilter: # type: ignore[override] return InFilter(self, [value]) def __ne__(self, value: str) -> NotFilter: # type: ignore[override] return NotFilter(InFilter(self, [value])) def is_one_of(self, collection: list[str]) -> InFilter: return InFilter(self, collection) def has_content(self) -> HasContentFilter: return HasContentFilter(self) def endswith(self, options: list[str]) -> EndsWithFilter: return EndsWithFilter(self, options) class NameAccessor(Accessor): def __call__(self, node_stack) -> str: return self.selector(node_stack).name class NodeNameAccessor(Accessor): """Check the .node_name member which is declared on refTypeSub nodes It distinguishes between innerclass, innernamespace, etc. """ def __call__(self, node_stack) -> str: return self.selector(node_stack).node_name class NodeTypeAccessor(Accessor): def __call__(self, node_stack) -> str: data_object = self.selector(node_stack) try: return data_object.node_type except AttributeError as e: # Horrible hack to silence errors on filtering unicode objects # until we fix the parsing if type(data_object) is str: return "unicode" else: raise e class KindAccessor(Accessor): def __call__(self, node_stack) -> str: return self.selector(node_stack).kind class AttributeAccessor(Accessor): """Returns the value of a particular attribute on the selected node. AttributeAccessor(Node(), 'name') returns the value of ``node.name``. """ def __init__(self, selector: Selector, attribute_name: str) -> None: super().__init__(selector) self.attribute_name = attribute_name def __call__(self, node_stack) -> Any: return getattr(self.selector(node_stack), self.attribute_name) class LambdaAccessor(Accessor): def __init__(self, selector: Selector, func: Callable[[Any], str]): super().__init__(selector) self.func = func def __call__(self, node_stack): return self.func(self.selector(node_stack)) class NamespaceAccessor(Accessor): def __call__(self, node_stack): return self.selector(node_stack).namespaces ############################################################################### # Filters ############################################################################### class Filter: def allow(self, node_stack) -> bool: raise NotImplementedError def __and__(self, other: Filter) -> AndFilter: return AndFilter(self, other) def __or__(self, other: Filter) -> OrFilter: return OrFilter(self, other) def __invert__(self) -> NotFilter: return NotFilter(self) class HasAncestorFilter(Filter): def __init__(self, generations: int) -> None: self.generations = generations def allow(self, node_stack) -> bool: return len(node_stack) > self.generations class HasContentFilter(Filter): def __init__(self, accessor: Accessor): self.accessor = accessor def allow(self, node_stack) -> bool: """Detects if the node in questions has an empty .content_ property.""" return bool(self.accessor(node_stack).content_) class EndsWithFilter(Filter): """Detects if the string result of the accessor ends with any of the strings in the ``options`` iterable parameter. """ def __init__(self, accessor: Accessor, options: list[str]): self.accessor = accessor self.options = options def allow(self, node_stack) -> bool: string = self.accessor(node_stack) for entry in self.options: if string.endswith(entry): return True return False class InFilter(Filter): """Checks if what is returned from the accessor is 'in' in the members""" def __init__(self, accessor: Accessor, members: list[str]) -> None: self.accessor = accessor self.members = members def allow(self, node_stack) -> bool: name = self.accessor(node_stack) return name in self.members class GlobFilter(Filter): def __init__(self, accessor: Accessor, glob): self.accessor = accessor self.glob = glob def allow(self, node_stack) -> bool: text = self.accessor(node_stack) return self.glob.match(text) class FilePathFilter(Filter): def __init__(self, accessor: Accessor, target_file: str): self.accessor = accessor self.target_file = target_file def allow(self, node_stack) -> bool: location = self.accessor(node_stack).file if path_handler.includes_directory(self.target_file): # If the target_file contains directory separators then # match against the same length at the end of the location # location_match = location[-len(self.target_file) :] return location_match == self.target_file else: # If there are no separators, match against the whole filename # at the end of the location # # This is to prevent "Util.cpp" matching "PathUtil.cpp" # location_basename = os.path.basename(location) return location_basename == self.target_file class NamespaceFilter(Filter): def __init__(self, namespace_accessor: Accessor, name_accessor: Accessor): self.namespace_accessor = namespace_accessor self.name_accessor = name_accessor def allow(self, node_stack) -> bool: namespaces = self.namespace_accessor(node_stack) name = self.name_accessor(node_stack) try: # strip out any template arguments before splitting on '::', to # avoid errors if a template specialization has qualified arguments # (see examples/specific/cpp_ns_template_specialization) cleaned_name, sep, rest = name.partition("<") namespace, name = cleaned_name.rsplit("::", 1) name += sep + rest except ValueError: namespace, name = "", name return namespace in namespaces class OpenFilter(Filter): def allow(self, node_stack) -> bool: return True class ClosedFilter(Filter): def allow(self, node_stack) -> bool: return False class NotFilter(Filter): def __init__(self, child_filter: Filter): self.child_filter = child_filter def allow(self, node_stack) -> bool: return not self.child_filter.allow(node_stack) class AndFilter(Filter): def __init__(self, *filters: Filter): self.filters = filters def allow(self, node_stack) -> bool: # If any filter returns False then return False for filter_ in self.filters: if not filter_.allow(node_stack): return False return True class OrFilter(Filter): """Provides a short-cutted 'or' operation between two filters""" def __init__(self, *filters: Filter): self.filters = filters def allow(self, node_stack) -> bool: # If any filter returns True then return True for filter_ in self.filters: if filter_.allow(node_stack): return True return False class IfFilter(Filter): def __init__(self, condition, if_true, if_false): self.condition = condition self.if_true = if_true self.if_false = if_false def allow(self, node_stack) -> bool: if self.condition.allow(node_stack): return self.if_true.allow(node_stack) else: return self.if_false.allow(node_stack) class Gather(Filter): def __init__(self, accessor: Accessor, names: list[str]): self.accessor = accessor self.names = names def allow(self, node_stack) -> bool: self.names.extend(self.accessor(node_stack)) return False ############################################################################### # Other stuff ############################################################################### class Glob: def __init__(self, method, pattern): self.method = method self.pattern = pattern def match(self, name): return self.method(name, self.pattern) class FilterFactory: # C++ style public entries public_kinds = { "public-type", "public-func", "public-attrib", "public-slot", "public-static-func", "public-static-attrib", } def __init__(self, app: Sphinx) -> None: self.app = app def create_render_filter(self, kind: str, options: dict[str, Any]) -> Filter: """Render filter for group & namespace blocks""" if kind not in ["group", "page", "namespace"]: raise UnrecognisedKindError(kind) # Generate new dictionary from defaults filter_options = dict.fromkeys(self.app.config.breathe_default_members, "") # Update from the actual options filter_options.update(options) # Convert the doxygengroup members flag (which just stores None as the value) to an empty # string to allow the create_class_member_filter to process it properly if "members" in filter_options: filter_options["members"] = "" if "desc-only" in filter_options: return self._create_description_filter(True, "compounddef", options) node = Node() grandparent = Ancestor(2) has_grandparent = HasAncestorFilter(2) non_class_memberdef = ( has_grandparent & (grandparent.node_type == "compounddef") & (grandparent.kind != "class") & (grandparent.kind != "struct") & (grandparent.kind != "interface") & (node.node_type == "memberdef") ) return ( (self.create_class_member_filter(filter_options) | non_class_memberdef) & self.create_innerclass_filter(filter_options) & self.create_outline_filter(filter_options) ) def create_class_filter(self, target: str, options: dict[str, Any]) -> Filter: """Content filter for classes based on various directive options""" # Generate new dictionary from defaults filter_options = dict.fromkeys(self.app.config.breathe_default_members, "") # Update from the actual options filter_options.update(options) return AndFilter( self.create_class_member_filter(filter_options), self.create_innerclass_filter(filter_options, outerclass=target), self.create_outline_filter(filter_options), self.create_show_filter(filter_options), ) def create_innerclass_filter(self, options: dict[str, Any], outerclass: str = "") -> Filter: """ :param outerclass: Should be the class/struct being target by the directive calling this code. If it is a group or namespace directive then it should be left blank. It is used when looking for names listed in the :members: option. The name should include any additional namespaces that the target class is in. """ node = Node() node_is_innerclass = (node.node_type == "ref") & (node.node_name == "innerclass") parent = Parent() parent_is_compounddef = parent.node_type == "compounddef" parent_is_class = parent.kind.is_one_of(["class", "struct", "interface"]) allowed = set() all_options = { "protected-members": "protected", "private-members": "private", } for option, scope in all_options.items(): if option in options: allowed.add(scope) node_is_innerclass_in_class = parent_is_compounddef & parent_is_class & node_is_innerclass public_innerclass_filter = ClosedFilter() if "members" in options: if options["members"].strip(): text = options["members"] prefix = ("%s::" % outerclass) if outerclass else "" # Matches sphinx-autodoc behaviour of comma separated values members = {f"{prefix}{x.strip()}" for x in text.split(",")} node_valueOf_is_in_members = node.valueOf.is_one_of(members) # Accept any nodes which don't have a "sectiondef" as a parent or, if they do, only # accept them if their names are in the members list public_innerclass_filter = ~node_is_innerclass_in_class | node_valueOf_is_in_members else: allowed.add("public") node_is_in_allowed_scope = node.prot.is_one_of(allowed) innerclass = ~node_is_innerclass_in_class | node_is_in_allowed_scope description = self._create_description_filter(True, "compounddef", options) # Put parent check last as we only want to check parents of innerclass's otherwise we have # to check the parent's type as well return innerclass | public_innerclass_filter | description def create_show_filter(self, options: dict[str, Any]) -> Filter: """Currently only handles the header-file entry""" try: text = options["show"] except KeyError: # Allow through everything except the header-file includes nodes return OrFilter( NotFilter(InFilter(NodeTypeAccessor(Parent()), ["compounddef"])), NotFilter(InFilter(NodeTypeAccessor(Node()), ["inc"])), ) if text == "header-file": # Allow through everything, including header-file includes return OpenFilter() # Allow through everything except the header-file includes nodes return OrFilter( NotFilter(InFilter(NodeTypeAccessor(Parent()), ["compounddef"])), NotFilter(InFilter(NodeTypeAccessor(Node()), ["inc"])), ) def _create_description_filter( self, allow: bool, level: str, options: dict[str, Any] ) -> Filter: """Whether or not we allow descriptions is determined by the calling function and we just do whatever the 'allow' function parameter tells us. """ node = Node() node_is_description = node.node_type == "description" parent = Parent() parent_is_level = parent.node_type == level # Nothing with a parent that's a sectiondef description_filter = ~parent_is_level # Let through any description children of sectiondefs if we output any kind members if allow: description_filter = (parent_is_level & node_is_description) | ~parent_is_level return description_filter def _create_public_members_filter(self, options: dict[str, Any]) -> Filter: node = Node() node_is_memberdef = node.node_type == "memberdef" node_is_public = node.prot == "public" parent = Parent() parent_is_sectiondef = parent.node_type == "sectiondef" # Nothing with a parent that's a sectiondef is_memberdef = parent_is_sectiondef & node_is_memberdef public_members_filter = ~is_memberdef # If the user has specified the 'members' option with arguments then we only pay attention # to that and not to any other member settings if "members" in options: if options["members"].strip(): text = options["members"] # Matches sphinx-autodoc behaviour of comma separated values members = {x.strip() for x in text.split(",")} node_name_is_in_members = node.name.is_one_of(members) # Accept any nodes which don't have a "sectiondef" as a parent or, if they do, only # accept them if their names are in the members list public_members_filter = ( parent_is_sectiondef & node_name_is_in_members ) | ~parent_is_sectiondef else: # Select anything that doesn't have a parent which is a sectiondef, or, if it does, # only select the public ones public_members_filter = (is_memberdef & node_is_public) | ~is_memberdef return public_members_filter def _create_non_public_members_filter( self, prot: str, option_name: str, options: dict[str, Any] ) -> Filter: """'prot' is the doxygen xml term for 'public', 'protected' and 'private' categories.""" node = Node() node_is_memberdef = node.node_type == "memberdef" node_is_public = node.prot == prot parent = Parent() parent_is_sectiondef = parent.node_type == "sectiondef" # Nothing with a parent that's a sectiondef is_memberdef = parent_is_sectiondef & node_is_memberdef filter_ = ~is_memberdef if option_name in options: # Allow anything that isn't a memberdef, or if it is only allow the public ones filter_ = ~is_memberdef | node_is_public return filter_ def _create_undoc_members_filter(self, options: dict[str, Any]) -> Filter: node = Node() node_is_memberdef = node.node_type == "memberdef" node_has_description = ( node.briefdescription.has_content() | node.detaileddescription.has_content() ) # Allow anything that isn't a memberdef, or if it is only allow the ones with a description undoc_members_filter = ~node_is_memberdef | node_has_description if "undoc-members" in options: undoc_members_filter = OpenFilter() return undoc_members_filter def create_class_member_filter(self, options: dict[str, Any]) -> Filter: """Content filter based on :members: and :private-members: classes""" # I can't fully explain the filtering of descriptions here. More testing needed to figure # out when it is needed. This approach reflects the old code that was here but it wasn't # commented (my fault.) I wonder if maybe the public and private declarations themselves can # be documented and we need to let them through. Not sure. allow = ( "members" in options or "protected-members" in options or "private-members" in options ) description = self._create_description_filter(allow, "sectiondef", options) # Create all necessary filters and combine them public_members = self._create_public_members_filter(options) protected_members = self._create_non_public_members_filter( "protected", "protected-members", options ) private_members = self._create_non_public_members_filter( "private", "private-members", options ) undoc_members = self._create_undoc_members_filter(options) # Allow any public/private members which also fit the undoc filter and all the descriptions allowed_members = (public_members | protected_members | private_members) & undoc_members return allowed_members | description def create_outline_filter(self, options: dict[str, Any]) -> Filter: if "outline" in options: node = Node() return ~node.node_type.is_one_of(["description", "inc"]) else: return OpenFilter() def create_file_filter(self, filename: str, options: dict[str, Any]) -> Filter: valid_names: list[str] = [] filter_ = AndFilter( NotFilter( # Gather the "namespaces" attribute from the # compounddef for the file we're rendering and # store the information in the "valid_names" list # # Gather always returns false, so, combined with # the NotFilter this chunk always returns true and # so does not affect the result of the filtering AndFilter( InFilter(NodeTypeAccessor(Node()), ["compounddef"]), InFilter(KindAccessor(Node()), ["file"]), FilePathFilter(LambdaAccessor(Node(), lambda x: x.location), filename), Gather(LambdaAccessor(Node(), lambda x: x.namespaces), valid_names), ) ), NotFilter( # Take the valid_names and everytime we handle an # innerclass or innernamespace, check that its name # was one of those initial valid names so that we # never end up rendering a namespace or class that # wasn't in the initial file. Notably this is # required as the location attribute for the # namespace in the xml is unreliable. AndFilter( InFilter(NodeTypeAccessor(Parent()), ["compounddef"]), InFilter(NodeTypeAccessor(Node()), ["ref"]), InFilter(NodeNameAccessor(Node()), ["innerclass", "innernamespace"]), NotFilter( InFilter( LambdaAccessor(Node(), lambda x: x.content_[0].getValue()), valid_names ) ), ) ), NotFilter( # Ignore innerclasses and innernamespaces that are inside a # namespace that is going to be rendered as they will be # rendered with that namespace and we don't want them twice AndFilter( InFilter(NodeTypeAccessor(Parent()), ["compounddef"]), InFilter(NodeTypeAccessor(Node()), ["ref"]), InFilter(NodeNameAccessor(Node()), ["innerclass", "innernamespace"]), NamespaceFilter( NamespaceAccessor(Parent()), LambdaAccessor(Node(), lambda x: x.content_[0].getValue()), ), ) ), NotFilter( # Ignore memberdefs from files which are different to # the one we're rendering. This happens when we have to # cross into a namespace xml file which has entries # from multiple files in it AndFilter( InFilter(NodeTypeAccessor(Node()), ["memberdef"]), NotFilter( FilePathFilter(LambdaAccessor(Node(), lambda x: x.location), filename) ), ) ), NotFilter( # Ignore compounddefs which are from another file # (normally means classes and structs which are in a # namespace that we have other interests in) but only # check it if the compounddef is not a namespace # itself, as for some reason compounddefs for # namespaces are registered with just a single file # location even if they namespace is spread over # multiple files AndFilter( InFilter(NodeTypeAccessor(Node()), ["compounddef"]), NotFilter(InFilter(KindAccessor(Node()), ["namespace"])), NotFilter( FilePathFilter(LambdaAccessor(Node(), lambda x: x.location), filename) ), ) ), ) return AndFilter(self.create_outline_filter(options), filter_) def create_content_filter(self, kind: str, options: dict[str, Any]) -> Filter: """Returns a filter which matches the contents of the or namespace but not the group or namespace name or description. This allows the groups to be used to structure sections of the documentation rather than to structure and further document groups of documentation As a finder/content filter we only need to match exactly what we're interested in. """ if kind not in ["group", "page", "namespace"]: raise UnrecognisedKindError(kind) node = Node() # Filter for public memberdefs node_is_memberdef = node.node_type == "memberdef" node_is_public = node.prot == "public" public_members = node_is_memberdef & node_is_public # Filter for public innerclasses parent = Parent() parent_is_compounddef = parent.node_type == "compounddef" parent_is_class = parent.kind == kind node_is_innerclass = (node.node_type == "ref") & (node.node_name == "innerclass") node_is_public = node.prot == "public" public_innerclass = ( parent_is_compounddef & parent_is_class & node_is_innerclass & node_is_public ) return public_members | public_innerclass def create_index_filter(self, options: dict[str, Any]) -> Filter: filter_ = AndFilter( NotFilter( AndFilter( InFilter(NodeTypeAccessor(Parent()), ["compounddef"]), InFilter(NodeTypeAccessor(Node()), ["ref"]), InFilter(NodeNameAccessor(Node()), ["innerclass", "innernamespace"]), ) ), NotFilter( AndFilter( InFilter(NodeTypeAccessor(Parent()), ["compounddef"]), InFilter(KindAccessor(Parent()), ["group"]), InFilter(NodeTypeAccessor(Node()), ["sectiondef"]), InFilter(KindAccessor(Node()), ["func"]), ) ), ) return AndFilter(self.create_outline_filter(options), filter_) def create_open_filter(self) -> Filter: """Returns a completely open filter which matches everything""" return OpenFilter() def create_id_filter(self, node_type: str, refid: str) -> Filter: node = Node() return (node.node_type == node_type) & (node.id == refid) def create_file_finder_filter(self, filename: str) -> Filter: filter_ = AndFilter( InFilter(NodeTypeAccessor(Node()), ["compounddef"]), InFilter(KindAccessor(Node()), ["file"]), FilePathFilter(LambdaAccessor(Node(), lambda x: x.location), filename), ) return filter_ def create_member_finder_filter(self, namespace: str, name: str, kind: str) -> Filter: """Returns a filter which looks for a member with the specified name and kind.""" node = Node() parent = Parent() node_matches = (node.node_type == "member") & (node.kind == kind) & (node.name == name) if namespace: parent_matches = ( (parent.node_type == "compound") & ( (parent.kind == "namespace") | (parent.kind == "class") | (parent.kind == "struct") | (parent.kind == "interface") ) & (parent.name == namespace) ) return parent_matches & node_matches else: is_implementation_file = parent.name.endswith( self.app.config.breathe_implementation_filename_extensions ) parent_is_compound = parent.node_type == "compound" parent_is_file = (parent.kind == "file") & (~is_implementation_file) parent_is_not_file = parent.kind != "file" return (parent_is_compound & parent_is_file & node_matches) | ( parent_is_compound & parent_is_not_file & node_matches ) def create_function_and_all_friend_finder_filter(self, namespace: str, name: str) -> Filter: parent = Parent() parent_is_compound = parent.node_type == "compound" parent_is_group = parent.kind == "group" function_filter = self.create_member_finder_filter(namespace, name, "function") friend_filter = self.create_member_finder_filter(namespace, name, "friend") # Get matching functions but only ones where the parent is not a group. We want to skip # function entries in groups as we'll find the same functions in a file's xml output # elsewhere and having more than one match is confusing for our logic later on. return (function_filter | friend_filter) & ~(parent_is_compound & parent_is_group) def create_enumvalue_finder_filter(self, name: str) -> Filter: """Returns a filter which looks for an enumvalue with the specified name.""" node = Node() return (node.node_type == "enumvalue") & (node.name == name) def create_compound_finder_filter(self, name: str, kind: str) -> Filter: """Returns a filter which looks for a compound with the specified name and kind.""" node = Node() return (node.node_type == "compound") & (node.kind == kind) & (node.name == name) def create_finder_filter(self, kind: str, name: str) -> Filter: """Returns a filter which looks for the compound node from the index which is a group node (kind=group) and has the appropriate name The compound node should reference the group file which we can parse for the group contents. """ if kind == "group": filter_ = AndFilter( InFilter(NodeTypeAccessor(Node()), ["compound"]), InFilter(KindAccessor(Node()), ["group"]), InFilter(NameAccessor(Node()), [name]), ) elif kind == "page": filter_ = AndFilter( InFilter(NodeTypeAccessor(Node()), ["compound"]), InFilter(KindAccessor(Node()), ["page"]), InFilter(NameAccessor(Node()), [name]), ) else: # Assume kind == 'namespace' filter_ = AndFilter( InFilter(NodeTypeAccessor(Node()), ["compound"]), InFilter(KindAccessor(Node()), ["namespace"]), InFilter(NameAccessor(Node()), [name]), ) return filter_ breathe-doc-breathe-10a36f3/breathe/renderer/mask.py000066400000000000000000000040001475641424700223610ustar00rootroot00000000000000""" Masks ===== Masks are related to filters. Filters can block the processing of particular parts of the xml hierarchy but they can only work on node level. If the part of the xml hierarchy that you want to filter out is read in as an instance of one of the classes in parser/doxygen/*.py then you can use the filters. However, if you want to filter out an attribute from one of the nodes (and some of the xml child nodes are read in as attributes on their parents) then you can't use a filter. We introduce the Mask's to fulfil this need. The masks are designed to be applied to a particular node type and to limit the access to particular attributes on the node. For example, then NoParameterNamesMask wraps a node a returns all its standard attributes but returns None for the 'declname' and 'defname' attributes. Currently the Mask functionality is only used for the text signature rendering for doing function matching. """ from __future__ import annotations class NoParameterNamesMask: def __init__(self, data_object) -> None: self.data_object = data_object def __getattr__(self, attr): if attr in ["declname", "defname", "defval"]: return None return getattr(self.data_object, attr) class MaskFactoryBase: def mask(self, data_object): raise NotImplementedError class MaskFactory(MaskFactoryBase): def __init__(self, lookup): self.lookup = lookup def mask(self, data_object): try: node_type = data_object.node_type except AttributeError as e: # Horrible hack to silence errors on filtering unicode objects # until we fix the parsing if isinstance(data_object, str): node_type = "unicode" else: raise e if node_type in self.lookup: Mask = self.lookup[node_type] return Mask(data_object) return data_object class NullMaskFactory(MaskFactoryBase): def mask(self, data_object): return data_object breathe-doc-breathe-10a36f3/breathe/renderer/sphinxrenderer.py000066400000000000000000003174131475641424700245050ustar00rootroot00000000000000from __future__ import annotations from pathlib import Path from docutils import nodes from docutils.parsers.rst.states import Text from docutils.statemachine import StringList, UnexpectedIndentationError from sphinx import addnodes from sphinx.domains import c, cpp, python from sphinx.ext.graphviz import graphviz from sphinx.util import url_re from sphinx.util.nodes import nested_parse_with_titles try: from sphinxcontrib import phpdomain as php # type: ignore[import-untyped] except ImportError: php = None try: from sphinx_csharp import csharp as cs # type: ignore[import-untyped] except ImportError: cs = None import re import textwrap from typing import TYPE_CHECKING, Callable, Union, cast if TYPE_CHECKING: from typing import Any from docutils.nodes import Node, TextElement from sphinx.application import Sphinx from sphinx.directives import ObjectDescription from breathe.parser import DoxygenCompoundParser, compound, compoundsuper from breathe.project import ProjectInfo from breathe.renderer import RenderContext from breathe.renderer.filter import Filter from breathe.renderer.target import TargetHandler ContentCallback = Callable[[addnodes.desc_content], None] Declarator = Union[addnodes.desc_signature, addnodes.desc_signature_line] DeclaratorCallback = Callable[[Declarator], None] _debug_indent = 0 class WithContext: def __init__(self, parent: SphinxRenderer, context: RenderContext): self.context = context self.parent = parent self.previous = None def __enter__(self): assert self.previous is None self.previous = self.parent.context self.parent.set_context(self.context) return self def __exit__(self, et, ev, bt): self.parent.context = self.previous self.previous = None class BaseObject: # Use this class as the first base class to make sure the overrides are used. # Set the content_callback attribute to a function taking a docutils node. def transform_content(self, contentnode: addnodes.desc_content) -> None: super().transform_content(contentnode) # type: ignore[misc] callback = getattr(self, "breathe_content_callback", None) if callback is None: return callback(contentnode) # ---------------------------------------------------------------------------- class CPPClassObject(BaseObject, cpp.CPPClassObject): pass class CPPUnionObject(BaseObject, cpp.CPPUnionObject): pass class CPPFunctionObject(BaseObject, cpp.CPPFunctionObject): pass class CPPMemberObject(BaseObject, cpp.CPPMemberObject): pass class CPPTypeObject(BaseObject, cpp.CPPTypeObject): pass class CPPConceptObject(BaseObject, cpp.CPPConceptObject): pass class CPPEnumObject(BaseObject, cpp.CPPEnumObject): pass class CPPEnumeratorObject(BaseObject, cpp.CPPEnumeratorObject): pass # ---------------------------------------------------------------------------- class CStructObject(BaseObject, c.CStructObject): pass class CUnionObject(BaseObject, c.CUnionObject): pass class CFunctionObject(BaseObject, c.CFunctionObject): pass class CMemberObject(BaseObject, c.CMemberObject): pass class CTypeObject(BaseObject, c.CTypeObject): pass class CEnumObject(BaseObject, c.CEnumObject): pass class CEnumeratorObject(BaseObject, c.CEnumeratorObject): pass class CMacroObject(BaseObject, c.CMacroObject): pass # ---------------------------------------------------------------------------- class PyFunction(BaseObject, python.PyFunction): pass class PyAttribute(BaseObject, python.PyAttribute): pass class PyClasslike(BaseObject, python.PyClasslike): pass # ---------------------------------------------------------------------------- # Create multi-inheritance classes to merge BaseObject from Breathe with # classes from phpdomain. # We use capitalization (and the namespace) to differentiate between the two if php is not None: class PHPNamespaceLevel(BaseObject, php.PhpNamespacelevel): """Description of a PHP item *in* a namespace (not the space itself).""" pass class PHPClassLike(BaseObject, php.PhpClasslike): pass class PHPClassMember(BaseObject, php.PhpClassmember): pass class PHPGlobalLevel(BaseObject, php.PhpGloballevel): pass # ---------------------------------------------------------------------------- if cs is not None: class CSharpCurrentNamespace(BaseObject, cs.CSharpCurrentNamespace): pass class CSharpNamespacePlain(BaseObject, cs.CSharpNamespacePlain): pass class CSharpClass(BaseObject, cs.CSharpClass): pass class CSharpStruct(BaseObject, cs.CSharpStruct): pass class CSharpInterface(BaseObject, cs.CSharpInterface): pass class CSharpInherits(BaseObject, cs.CSharpInherits): pass class CSharpMethod(BaseObject, cs.CSharpMethod): pass class CSharpVariable(BaseObject, cs.CSharpVariable): pass class CSharpProperty(BaseObject, cs.CSharpProperty): pass class CSharpEvent(BaseObject, cs.CSharpEvent): pass class CSharpEnum(BaseObject, cs.CSharpEnum): pass class CSharpEnumValue(BaseObject, cs.CSharpEnumValue): pass class CSharpAttribute(BaseObject, cs.CSharpAttribute): pass class CSharpIndexer(BaseObject, cs.CSharpIndexer): pass class CSharpXRefRole(BaseObject, cs.CSharpXRefRole): pass # ---------------------------------------------------------------------------- class DomainDirectiveFactory: # A mapping from node kinds to domain directives and their names. cpp_classes = { "variable": (CPPMemberObject, "var"), "class": (CPPClassObject, "class"), "struct": (CPPClassObject, "struct"), "interface": (CPPClassObject, "class"), "function": (CPPFunctionObject, "function"), "friend": (CPPFunctionObject, "function"), "signal": (CPPFunctionObject, "function"), "slot": (CPPFunctionObject, "function"), "concept": (CPPConceptObject, "concept"), "enum": (CPPEnumObject, "enum"), "enum-class": (CPPEnumObject, "enum-class"), "typedef": (CPPTypeObject, "type"), "using": (CPPTypeObject, "type"), "union": (CPPUnionObject, "union"), "namespace": (CPPTypeObject, "type"), "enumvalue": (CPPEnumeratorObject, "enumerator"), "define": (CMacroObject, "macro"), } c_classes = { "variable": (CMemberObject, "var"), "function": (CFunctionObject, "function"), "define": (CMacroObject, "macro"), "struct": (CStructObject, "struct"), "union": (CUnionObject, "union"), "enum": (CEnumObject, "enum"), "enumvalue": (CEnumeratorObject, "enumerator"), "typedef": (CTypeObject, "type"), } python_classes = { # TODO: PyFunction is meant for module-level functions # and PyAttribute is meant for class attributes, not module-level variables. # Somehow there should be made a distinction at some point to get the correct # index-text and whatever other things are different. "function": (PyFunction, "function"), "variable": (PyAttribute, "attribute"), "class": (PyClasslike, "class"), "namespace": (PyClasslike, "class"), } if php is not None: php_classes = { "function": (PHPNamespaceLevel, "function"), "class": (PHPClassLike, "class"), "attr": (PHPClassMember, "attr"), "method": (PHPClassMember, "method"), "global": (PHPGlobalLevel, "global"), } php_classes_default = php_classes["class"] # Directive when no matching ones were found if cs is not None: cs_classes = { # 'doxygen-name': (CSharp class, key in CSharpDomain.object_types) "namespace": (CSharpNamespacePlain, "namespace"), "class": (CSharpClass, "class"), "struct": (CSharpStruct, "struct"), "interface": (CSharpInterface, "interface"), "function": (CSharpMethod, "function"), "method": (CSharpMethod, "method"), "variable": (CSharpVariable, "var"), "property": (CSharpProperty, "property"), "event": (CSharpEvent, "event"), "enum": (CSharpEnum, "enum"), "enumvalue": (CSharpEnumValue, "enumerator"), "attribute": (CSharpAttribute, "attr"), # Fallback to cpp domain "typedef": (CPPTypeObject, "type"), } @staticmethod def create(domain: str, args) -> ObjectDescription: cls = cast("type[ObjectDescription]", None) name = cast("str", None) if domain == "c": cls, name = DomainDirectiveFactory.c_classes[args[0]] elif domain == "py": cls, name = DomainDirectiveFactory.python_classes[args[0]] elif php is not None and domain == "php": separators = php.separators arg_0 = args[0] if any(separators["method"] in n for n in args[1]): if any(separators["attr"] in n for n in args[1]): arg_0 = "attr" else: arg_0 = "method" else: if arg_0 == "variable": arg_0 = "global" if arg_0 in DomainDirectiveFactory.php_classes: cls, name = DomainDirectiveFactory.php_classes[arg_0] # type: ignore[assignment] else: cls, name = DomainDirectiveFactory.php_classes_default # type: ignore[assignment] elif cs is not None and domain == "cs": cls, name = DomainDirectiveFactory.cs_classes[args[0]] else: domain = "cpp" cls, name = DomainDirectiveFactory.cpp_classes[args[0]] # type: ignore[assignment] # Replace the directive name because domain directives don't know how to handle # Breathe's "doxygen" directives. assert ":" not in name args = [domain + ":" + name] + args[1:] return cls(*args) class NodeFinder(nodes.SparseNodeVisitor): """Find the Docutils desc_signature declarator and desc_content nodes.""" def __init__(self, document): super().__init__(document) self.declarator = None self.content = None def visit_desc_signature(self, node): # Find the last signature node because it contains the actual declarator # rather than "template <...>". In Sphinx 1.4.1 we'll be able to use sphinx_cpp_tagname: # https://github.com/breathe-doc/breathe/issues/242 self.declarator = node def visit_desc_signature_line(self, node): # In sphinx 1.5, there is now a desc_signature_line node within the desc_signature # This should be used instead self.declarator = node def visit_desc_content(self, node): self.content = node # The SparseNodeVisitor seems to not actually be universally Sparse, # but only for nodes known to Docutils. # So if there are extensions with new node types in the content, # then the visitation will fail. # We anyway don't need to visit the actual content, so skip it. raise nodes.SkipChildren def intersperse(iterable, delimiter): it = iter(iterable) yield next(it) for x in it: yield delimiter yield x def get_param_decl(param): def to_string(node): """Convert Doxygen node content to a string.""" result = [] if node is not None: for p in node.content_: value = p.value if not isinstance(value, str): value = value.valueOf_ result.append(value) return " ".join(result) param_type = to_string(param.type_) param_name = param.declname or param.defname if not param_name: param_decl = param_type else: param_decl, number_of_subs = re.subn( r"(\((?:\w+::)*[*&]+)(\))", r"\g<1>" + param_name + r"\g<2>", param_type ) if number_of_subs == 0: param_decl = param_type + " " + param_name if param.array: param_decl += param.array if param.defval: param_decl += " = " + to_string(param.defval) return param_decl def get_definition_without_template_args(data_object): """ Return data_object.definition removing any template arguments from the class name in the member function. Otherwise links to classes defined in the same template are not generated correctly. For example in 'Result A< B >::f' we want to remove the '< B >' part. """ definition = data_object.definition if len(data_object.bitfield) > 0: definition += " : " + data_object.bitfield qual_name = "::" + data_object.name if definition.endswith(qual_name): qual_name_start = len(definition) - len(qual_name) pos = qual_name_start - 1 if definition[pos] == ">": bracket_count = 0 # Iterate back through the characters of the definition counting matching braces and # then remove all braces and everything between while pos > 0: if definition[pos] == ">": bracket_count += 1 elif definition[pos] == "<": bracket_count -= 1 if bracket_count == 0: definition = definition[:pos] + definition[qual_name_start:] break pos -= 1 return definition class InlineText(Text): """ Add a custom docutils class to allow parsing inline text. This is to be used inside a @verbatim/@endverbatim block but only the first line is consumed and a inline element is generated as the parent, instead of the paragraph used by Text. """ patterns = {"inlinetext": r""} initial_transitions = [("inlinetext",)] def indent(self, match, context, next_state): """ Avoid Text's indent from detecting space prefixed text and doing "funny" stuff; always rely on inlinetext for parsing. """ return self.inlinetext(match, context, next_state) def eof(self, context): """ Text.eof() inserts a paragraph, so override it to skip adding elements. """ return [] def inlinetext(self, match, context, next_state): """ Called by the StateMachine when an inline element is found (which is any text when this class is added as the single transition. """ startline = self.state_machine.abs_line_number() - 1 msg = None try: block = self.state_machine.get_text_block() except UnexpectedIndentationError as err: block, src, srcline = err.args msg = self.reporter.error("Unexpected indentation.", source=src, line=srcline) lines = context + list(block) text, _ = self.inline_text(lines[0], startline) self.parent += text self.parent += msg return [], next_state, [] class SphinxRenderer: """ Doxygen node visitor that converts input into Sphinx/RST representation. Each visit method takes a Doxygen node as an argument and returns a list of RST nodes. """ def __init__( self, app: Sphinx, project_info: ProjectInfo, node_stack, state, document: nodes.document, target_handler: TargetHandler, compound_parser: DoxygenCompoundParser, filter_: Filter, ): self.app = app self.project_info = project_info self.qualification_stack = node_stack self.nesting_level = 0 self.state = state self.document = document self.target_handler = target_handler self.compound_parser = compound_parser self.filter_ = filter_ self.context: RenderContext | None = None self.output_defname = True # Nesting level for lists. self.nesting_level = 0 def set_context(self, context: RenderContext) -> None: self.context = context if self.context.domain == "": self.context.domain = self.get_domain() # XXX: fix broken links in XML generated by Doxygen when Doxygen's # SEPARATE_MEMBER_PAGES is set to YES; this function should be harmless # when SEPARATE_MEMBER_PAGES is NO! # # The issue was discussed here: https://github.com/doxygen/doxygen/pull/7971 # # A Doxygen anchor consists of a 32-byte string version of the results of # passing in the stringified identifier or prototype that is being "hashed". # An "a" character is then prefixed to mark it as an anchor. Depending on how # the identifier is linked, it can also get a "g" prefix to mean it is part # of a Doxygen group. This results in an id having either 33 or 34 bytes # (containing a "g" or not). Some identifiers, eg enumerators, get twice that # length to have both a unique enum + unique enumerator, and sometimes they # get two "g" characters as prefix instead of one. def _fixup_separate_member_pages(self, refid: str) -> str: if refid: parts = refid.rsplit("_", 1) if len(parts) == 2 and parts[1].startswith("1"): anchorid = parts[1][1:] if len(anchorid) in {33, 34} and parts[0].endswith(anchorid): return parts[0][: -len(anchorid)] + parts[1] elif len(anchorid) > 34: index = 0 if anchorid.startswith("gg"): index = 1 _len = 35 elif anchorid.startswith("g"): _len = 34 else: _len = 33 if parts[0].endswith(anchorid[index:_len]): return parts[0][: -(_len - index)] + parts[1] return refid def get_refid(self, refid: str) -> str: if self.app.config.breathe_separate_member_pages: refid = self._fixup_separate_member_pages(refid) if self.app.config.breathe_use_project_refids: return "%s%s" % (self.project_info.name(), refid) else: return refid def get_domain(self) -> str: """Returns the domain for the current node.""" def get_filename(node) -> str | None: """Returns the name of a file where the declaration represented by node is located.""" try: return node.location.file except AttributeError: return None self.context = cast("RenderContext", self.context) node_stack = self.context.node_stack node = node_stack[0] # An enumvalue node doesn't have location, so use its parent node for detecting # the domain instead. if isinstance(node, str) or node.node_type == "enumvalue": node = node_stack[1] filename = get_filename(node) if not filename and node.node_type == "compound": file_data = self.compound_parser.parse(node.refid) filename = get_filename(file_data.compounddef) return self.project_info.domain_for_file(filename) if filename else "" def join_nested_name(self, names: list[str]) -> str: dom = self.get_domain() sep = "::" if not dom or dom == "cpp" else "." return sep.join(names) def run_directive( self, obj_type: str, declaration: str, contentCallback: ContentCallback, options={} ) -> list[Node]: self.context = cast("RenderContext", self.context) args = [obj_type, [declaration]] + self.context.directive_args[2:] directive = DomainDirectiveFactory.create(self.context.domain, args) assert issubclass(type(directive), BaseObject) directive.breathe_content_callback = contentCallback # type: ignore[attr-defined] # Translate Breathe's no-link option into the standard noindex option. if "no-link" in self.context.directive_args[2]: directive.options["noindex"] = True for k, v in options.items(): directive.options[k] = v assert self.app.env is not None config = self.app.env.config if config.breathe_debug_trace_directives: global _debug_indent print( "{}Running directive: .. {}:: {}".format( " " * _debug_indent, directive.name, declaration ) ) _debug_indent += 1 self.nesting_level += 1 nodes_ = directive.run() self.nesting_level -= 1 # TODO: the directive_args seems to be reused between different run_directives # so for now, reset the options. # Remove this once the args are given in a different manner. for k, v in options.items(): del directive.options[k] if config.breathe_debug_trace_directives: _debug_indent -= 1 # Filter out outer class names if we are rendering a member as a part of a class content. # In some cases of errors with a declaration there are no nodes # (e.g., variable in function), so perhaps skip (see #671). # If there are nodes, there should be at least 2. if len(nodes_) != 0: assert len(nodes_) >= 2, nodes_ rst_node = nodes_[1] finder = NodeFinder(rst_node.document) rst_node.walk(finder) signode = finder.declarator if self.context.child: signode.children = [n for n in signode.children if not n.tagname == "desc_addname"] return nodes_ def handle_declaration( self, node, declaration: str, *, obj_type: str | None = None, content_callback: ContentCallback | None = None, display_obj_type: str | None = None, declarator_callback: DeclaratorCallback | None = None, options={}, ) -> list[Node]: if obj_type is None: obj_type = node.kind if content_callback is None: def content(contentnode): contentnode.extend(self.description(node)) content_callback = content declaration = declaration.replace("\n", " ") nodes_ = self.run_directive(obj_type, declaration, content_callback, options) assert self.app.env is not None if self.app.env.config.breathe_debug_trace_doxygen_ids: target = self.create_doxygen_target(node) if len(target) == 0: print("{}Doxygen target: (none)".format(" " * _debug_indent)) else: print("{}Doxygen target: {}".format(" " * _debug_indent, target[0]["ids"])) # and then one or more # each has a sphinx_line_type which hints what is present in that line # In some cases of errors with a declaration there are no nodes # (e.g., variable in function), so perhaps skip (see #671). if len(nodes_) == 0: return [] assert len(nodes_) >= 2, nodes_ desc = nodes_[1] assert isinstance(desc, addnodes.desc) assert len(desc) >= 1 sig = desc[0] assert isinstance(sig, addnodes.desc_signature) # Insert the member name for use in Sphinx-generated table of contents. if node.node_type == "compounddef": member_name = node.compoundname else: member_name = node.name if obj_type == "function": member_name += "()" sig.attributes["_toc_name"] = member_name sig.attributes["_toc_parts"] = member_name # if may or may not be a multiline signature isMultiline = sig.get("is_multiline", False) declarator: Declarator | None = None if isMultiline: for line in sig: assert isinstance(line, addnodes.desc_signature_line) if line.sphinx_line_type == "declarator": declarator = line else: declarator = sig assert declarator is not None if display_obj_type is not None: n = declarator[0] newStyle = True # the new style was introduced in Sphinx v4 # but only for the C and C++ domains if self.get_domain() and self.get_domain() not in ("c", "cpp"): newStyle = False if newStyle: assert isinstance(n, addnodes.desc_sig_keyword) declarator[0] = addnodes.desc_sig_keyword(display_obj_type, display_obj_type) else: assert isinstance(n, addnodes.desc_annotation) assert n.astext()[-1] == " " txt = display_obj_type + " " declarator[0] = addnodes.desc_annotation(txt, txt) if not self.app.env.config.breathe_debug_trace_doxygen_ids: target = self.create_doxygen_target(node) declarator.insert(0, target) if declarator_callback: declarator_callback(declarator) return nodes_ def get_qualification(self) -> list[str]: if self.nesting_level > 0: return [] assert self.app.env is not None config = self.app.env.config if config.breathe_debug_trace_qualification: def debug_print_node(n): return f"node_type={n.node_type}" global _debug_indent print( "{}{}".format(_debug_indent * " ", debug_print_node(self.qualification_stack[0])) ) _debug_indent += 1 names: list[str] = [] for node in self.qualification_stack[1:]: if config.breathe_debug_trace_qualification: print("{}{}".format(_debug_indent * " ", debug_print_node(node))) if node.node_type == "ref" and len(names) == 0: if config.breathe_debug_trace_qualification: print("{}{}".format(_debug_indent * " ", "res=")) return [] if ( node.node_type == "compound" and node.kind not in ["file", "namespace", "group"] ) or node.node_type == "memberdef": # We skip the 'file' entries because the file name doesn't form part of the # qualified name for the identifier. We skip the 'namespace' entries because if we # find an object through the namespace 'compound' entry in the index.xml then we'll # also have the 'compounddef' entry in our node stack and we'll get it from that. We # need the 'compounddef' entry because if we find the object through the 'file' # entry in the index.xml file then we need to get the namespace name from somewhere names.append(node.name) if node.node_type == "compounddef" and node.kind == "namespace": # Nested namespaces include their parent namespace(s) in compoundname. ie, # compoundname is 'foo::bar' instead of just 'bar' for namespace 'bar' nested in # namespace 'foo'. We need full compoundname because node_stack doesn't necessarily # include parent namespaces and we stop here in case it does. names.extend(reversed(node.compoundname.split("::"))) break names.reverse() if config.breathe_debug_trace_qualification: print("{}res={}".format(_debug_indent * " ", names)) _debug_indent -= 1 return names # =================================================================================== def get_fully_qualified_name(self): names = [] node_stack = self.context.node_stack node = node_stack[0] # If the node is a namespace, use its name because namespaces are skipped in the main loop. if node.node_type == "compound" and node.kind == "namespace": names.append(node.name) for node in node_stack: if node.node_type == "ref" and len(names) == 0: return node.valueOf_ if ( node.node_type == "compound" and node.kind not in ["file", "namespace", "group"] ) or node.node_type == "memberdef": # We skip the 'file' entries because the file name doesn't form part of the # qualified name for the identifier. We skip the 'namespace' entries because if we # find an object through the namespace 'compound' entry in the index.xml then we'll # also have the 'compounddef' entry in our node stack and we'll get it from that. We # need the 'compounddef' entry because if we find the object through the 'file' # entry in the index.xml file then we need to get the namespace name from somewhere names.insert(0, node.name) if node.node_type == "compounddef" and node.kind == "namespace": # Nested namespaces include their parent namespace(s) in compoundname. ie, # compoundname is 'foo::bar' instead of just 'bar' for namespace 'bar' nested in # namespace 'foo'. We need full compoundname because node_stack doesn't necessarily # include parent namespaces and we stop here in case it does. names.insert(0, node.compoundname) break return "::".join(names) def create_template_prefix(self, decl) -> str: if not decl.templateparamlist: return "" nodes_ = self.render(decl.templateparamlist) return "template<" + "".join(n.astext() for n in nodes_) + ">" def run_domain_directive(self, kind, names): domain_directive = DomainDirectiveFactory.create( self.context.domain, [kind, names] + self.context.directive_args[2:] ) # Translate Breathe's no-link option into the standard noindex option. if "no-link" in self.context.directive_args[2]: domain_directive.options["noindex"] = True config = self.app.env.config if config.breathe_debug_trace_directives: global _debug_indent print( "{}Running directive (old): .. {}:: {}".format( " " * _debug_indent, domain_directive.name, "".join(names) ) ) _debug_indent += 1 nodes_ = domain_directive.run() if config.breathe_debug_trace_directives: _debug_indent -= 1 # Filter out outer class names if we are rendering a member as a part of a class content. rst_node = nodes_[1] finder = NodeFinder(rst_node.document) rst_node.walk(finder) signode = finder.declarator if len(names) > 0 and self.context.child: signode.children = [n for n in signode.children if not n.tagname == "desc_addname"] return nodes_ def create_doxygen_target(self, node): """Can be overridden to create a target node which uses the doxygen refid information which can be used for creating links between internal doxygen elements. The default implementation should suffice most of the time. """ refid = self.get_refid(node.id) return self.target_handler.create_target(refid) def title(self, node) -> list[Node]: nodes_ = [] # Variable type or function return type nodes_.extend(self.render_optional(node.type_)) if nodes_: nodes_.append(nodes.Text(" ")) nodes_.append(addnodes.desc_name(text=node.name)) return nodes_ def description(self, node) -> list[Node]: brief = self.render_optional(node.briefdescription) detailed = self.detaileddescription(node) return brief + detailed def detaileddescription(self, node) -> list[Node]: detailedCand = self.render_optional(node.detaileddescription) # all field_lists must be at the top-level of the desc_content, so pull them up fieldLists: list[nodes.field_list] = [] admonitions: list[Node] = [] def pullup(node, typ, dest): for n in node.traverse(typ): del n.parent[n.parent.index(n)] dest.append(n) detailed = [] for candNode in detailedCand: pullup(candNode, nodes.field_list, fieldLists) pullup(candNode, nodes.note, admonitions) pullup(candNode, nodes.warning, admonitions) # and collapse paragraphs for para in candNode.traverse(nodes.paragraph): if ( para.parent and len(para.parent) == 1 and isinstance(para.parent, nodes.paragraph) ): para.replace_self(para.children) # and remove empty top-level paragraphs if isinstance(candNode, nodes.paragraph) and len(candNode) == 0: continue detailed.append(candNode) # make one big field list instead to the Sphinx transformer can make it pretty if len(fieldLists) > 1: fieldList = nodes.field_list() for fl in fieldLists: fieldList.extend(fl) fieldLists = [fieldList] if self.app.config.breathe_order_parameters_first: return detailed + fieldLists + admonitions else: return detailed + admonitions + fieldLists # type: ignore[operator] def update_signature(self, signature, obj_type): """Update the signature node if necessary, e.g. add qualifiers.""" prefix = obj_type + " " annotation = addnodes.desc_annotation(prefix, prefix) if signature[0].tagname != "desc_name": signature[0] = annotation else: signature.insert(0, annotation) def render_declaration(self, node, declaration=None, description=None, **kwargs): if declaration is None: declaration = self.get_fully_qualified_name() obj_type = kwargs.get("objtype", None) if obj_type is None: obj_type = node.kind nodes_ = self.run_domain_directive(obj_type, [declaration.replace("\n", " ")]) if self.app.env.config.breathe_debug_trace_doxygen_ids: target = self.create_doxygen_target(node) if len(target) == 0: print("{}Doxygen target (old): (none)".format(" " * _debug_indent)) else: print("{}Doxygen target (old): {}".format(" " * _debug_indent, target[0]["ids"])) rst_node = nodes_[1] finder = NodeFinder(rst_node.document) rst_node.walk(finder) signode = finder.declarator contentnode = finder.content update_signature = kwargs.get("update_signature", None) if update_signature is not None: update_signature(signode, obj_type) if description is None: description = self.description(node) if not self.app.env.config.breathe_debug_trace_doxygen_ids: target = self.create_doxygen_target(node) signode.insert(0, target) contentnode.extend(description) return nodes_ def visit_doxygen(self, node) -> list[Node]: nodelist: list[Node] = [] # Process all the compound children for n in node.get_compound(): nodelist.extend(self.render(n)) return nodelist def visit_doxygendef(self, node) -> list[Node]: return self.render(node.compounddef) def visit_union(self, node) -> list[Node]: # Read in the corresponding xml file and process file_data = self.compound_parser.parse(node.refid) nodeDef = file_data.compounddef self.context = cast("RenderContext", self.context) parent_context = self.context.create_child_context(file_data) new_context = parent_context.create_child_context(nodeDef) with WithContext(self, new_context): names = self.get_qualification() if self.nesting_level == 0: names.extend(nodeDef.compoundname.split("::")) else: names.append(nodeDef.compoundname.split("::")[-1]) declaration = self.join_nested_name(names) def content(contentnode): if nodeDef.includes: for include in nodeDef.includes: contentnode.extend( self.render(include, new_context.create_child_context(include)) ) rendered_data = self.render(file_data, parent_context) contentnode.extend(rendered_data) nodes_ = self.handle_declaration(nodeDef, declaration, content_callback=content) return nodes_ def visit_class(self, node) -> list[Node]: # Read in the corresponding xml file and process file_data = self.compound_parser.parse(node.refid) nodeDef = file_data.compounddef self.context = cast("RenderContext", self.context) parent_context = self.context.create_child_context(file_data) new_context = parent_context.create_child_context(nodeDef) domain = self.get_domain() with WithContext(self, new_context): # Pretend that the signature is being rendered in context of the # definition, for proper domain detection kind = nodeDef.kind # Defer to domains specific directive. names = self.get_qualification() # strip out any template arguments before splitting on '::', to # avoid errors if a template specialization has qualified arguments # (see examples/specific/cpp_ns_template_specialization) cleaned_name, sep, rest = nodeDef.compoundname.partition("<") if self.nesting_level == 0: names.extend(cleaned_name.split("::")) else: names.append(cleaned_name.split("::")[-1]) names[-1] += sep + rest decls = [ self.create_template_prefix(nodeDef), self.join_nested_name(names), ] # add base classes if len(nodeDef.basecompoundref) != 0: decls.append(":") first = True for base in nodeDef.basecompoundref: if not first: decls.append(",") else: first = False if base.prot is not None and domain != "cs": decls.append(base.prot) if base.virt == "virtual": decls.append("virtual") decls.append(base.content_[0].value) declaration = " ".join(decls) def content(contentnode) -> None: if nodeDef.includes: for include in nodeDef.includes: contentnode.extend( self.render(include, new_context.create_child_context(include)) ) rendered_data = self.render(file_data, parent_context) contentnode.extend(rendered_data) assert kind in ("class", "struct", "interface") display_obj_type = "interface" if kind == "interface" else None nodes_ = self.handle_declaration( nodeDef, declaration, content_callback=content, display_obj_type=display_obj_type ) if "members-only" in self.context.directive_args[2]: assert len(nodes_) >= 2 assert isinstance(nodes_[1], addnodes.desc) assert len(nodes_[1]) >= 2 assert isinstance(nodes_[1][1], addnodes.desc_content) return nodes_[1][1].children return nodes_ def visit_namespace(self, node) -> list[Node]: # Read in the corresponding xml file and process file_data = self.compound_parser.parse(node.refid) nodeDef = file_data.compounddef self.context = cast("RenderContext", self.context) parent_context = self.context.create_child_context(file_data) new_context = parent_context.create_child_context(file_data.compounddef) with WithContext(self, new_context): # Pretend that the signature is being rendered in context of the # definition, for proper domain detection names = self.get_qualification() if self.nesting_level == 0: names.extend(nodeDef.compoundname.split("::")) else: names.append(nodeDef.compoundname.split("::")[-1]) declaration = self.join_nested_name(names) def content(contentnode): if nodeDef.includes: for include in nodeDef.includes: contentnode.extend( self.render(include, new_context.create_child_context(include)) ) rendered_data = self.render(file_data, parent_context) contentnode.extend(rendered_data) display_obj_type = "namespace" if self.get_domain() != "py" else "module" nodes_ = self.handle_declaration( nodeDef, declaration, content_callback=content, display_obj_type=display_obj_type ) return nodes_ def visit_compound(self, node, render_empty_node=True, **kwargs) -> list[Node]: # Read in the corresponding xml file and process file_data = self.compound_parser.parse(node.refid) def get_node_info(file_data): return node.name, node.kind name, kind = kwargs.get("get_node_info", get_node_info)(file_data) if kind == "union": dom = self.get_domain() assert not dom or dom in ("c", "cpp") return self.visit_union(node) elif kind in ("struct", "class", "interface"): dom = self.get_domain() if not dom or dom in ("c", "cpp", "py", "cs"): return self.visit_class(node) elif kind == "namespace": dom = self.get_domain() if not dom or dom in ("c", "cpp", "py", "cs"): return self.visit_namespace(node) self.context = cast("RenderContext", self.context) parent_context = self.context.create_child_context(file_data) new_context = parent_context.create_child_context(file_data.compounddef) rendered_data = self.render(file_data, parent_context) if not rendered_data and not render_empty_node: return [] def render_signature(file_data, doxygen_target, name, kind): # Defer to domains specific directive. templatePrefix = self.create_template_prefix(file_data.compounddef) arg = "%s %s" % (templatePrefix, self.get_fully_qualified_name()) # add base classes if kind in ("class", "struct"): bs = [] for base in file_data.compounddef.basecompoundref: b = [] if base.prot is not None: b.append(base.prot) if base.virt == "virtual": b.append("virtual") b.append(base.content_[0].value) bs.append(" ".join(b)) if len(bs) != 0: arg += " : " arg += ", ".join(bs) self.context.directive_args[1] = [arg] nodes_ = self.run_domain_directive(kind, self.context.directive_args[1]) rst_node = nodes_[1] finder = NodeFinder(rst_node.document) rst_node.walk(finder) if kind in ("interface", "namespace"): # This is not a real C++ declaration type that Sphinx supports, # so we hax the replacement of it. finder.declarator[0] = addnodes.desc_annotation(kind + " ", kind + " ") rst_node.children[0].insert(0, doxygen_target) return nodes_, finder.content refid = self.get_refid(node.refid) render_sig = kwargs.get("render_signature", render_signature) with WithContext(self, new_context): # Pretend that the signature is being rendered in context of the # definition, for proper domain detection nodes_, contentnode = render_sig( file_data, self.target_handler.create_target(refid), name, kind ) if file_data.compounddef.includes: for include in file_data.compounddef.includes: contentnode.extend(self.render(include, new_context.create_child_context(include))) contentnode.extend(rendered_data) return nodes_ def visit_file(self, node) -> list[Node]: def render_signature(file_data, doxygen_target, name, kind): self.context = cast("RenderContext", self.context) options = self.context.directive_args[2] if "content-only" in options: rst_node = nodes.container() else: rst_node = addnodes.desc() # Build targets for linking targets = [] targets.extend(doxygen_target) title_signode = addnodes.desc_signature() title_signode.extend(targets) # Set up the title if ( kind in ["group", "page"] and file_data.compounddef and file_data.compounddef.title ): if "no-title" not in options: full_title = " ".join([ i.getValue() for i in file_data.compounddef.title.content_ ]) title_signode.append(nodes.emphasis(text=kind)) title_signode.append(nodes.Text(" ")) title_signode.append(addnodes.desc_name(text=full_title)) else: title_signode.append(nodes.emphasis(text=kind)) title_signode.append(nodes.Text(" ")) title_signode.append(addnodes.desc_name(text=name)) rst_node.append(title_signode) rst_node.document = self.state.document rst_node["objtype"] = kind rst_node["domain"] = self.get_domain() or "cpp" contentnode = addnodes.desc_content() rst_node.append(contentnode) return [rst_node], contentnode return self.visit_compound(node, render_signature=render_signature) # We store both the identified and appropriate title text here as we want to define the order # here and the titles for the SectionDefTypeSubRenderer but we don't want the repetition of # having two lists in case they fall out of sync # # If this list is edited, also change the sections option documentation for # the doxygen(auto)file directive in documentation/source/file.rst. sections = [ ("user-defined", "User Defined"), ("public-type", "Public Types"), ("public-func", "Public Functions"), ("public-attrib", "Public Members"), ("public-slot", "Public Slots"), ("signal", "Signals"), ("dcop-func", "DCOP Function"), ("property", "Properties"), ("event", "Events"), ("public-static-func", "Public Static Functions"), ("public-static-attrib", "Public Static Attributes"), ("protected-type", "Protected Types"), ("protected-func", "Protected Functions"), ("protected-attrib", "Protected Attributes"), ("protected-slot", "Protected Slots"), ("protected-static-func", "Protected Static Functions"), ("protected-static-attrib", "Protected Static Attributes"), ("package-type", "Package Types"), ("package-func", "Package Functions"), ("package-attrib", "Package Attributes"), ("package-static-func", "Package Static Functions"), ("package-static-attrib", "Package Static Attributes"), ("private-type", "Private Types"), ("private-func", "Private Functions"), ("private-attrib", "Private Members"), ("private-slot", "Private Slots"), ("private-static-func", "Private Static Functions"), ("private-static-attrib", "Private Static Attributes"), ("friend", "Friends"), ("related", "Related"), ("define", "Defines"), ("prototype", "Prototypes"), ("typedef", "Typedefs"), ("concept", "Concepts"), ("enum", "Enums"), ("func", "Functions"), ("var", "Variables"), ] def visit_compounddef(self, node) -> list[Node]: self.context = cast("RenderContext", self.context) options = self.context.directive_args[2] section_order = None if "sections" in options: section_order = {sec: i for i, sec in enumerate(options["sections"].split(" "))} membergroup_order = None if "membergroups" in options: membergroup_order = {sec: i for i, sec in enumerate(options["membergroups"].split(" "))} nodemap: dict[int, list[Node]] = {} def addnode(kind, lam): if section_order is None: nodemap[len(nodemap)] = lam() elif kind in section_order: nodemap.setdefault(section_order[kind], []).extend(lam()) if "members-only" not in options: if "allow-dot-graphs" in options: addnode("incdepgraph", lambda: self.render_optional(node.get_incdepgraph())) addnode("invincdepgraph", lambda: self.render_optional(node.get_invincdepgraph())) addnode( "inheritancegraph", lambda: self.render_optional(node.get_inheritancegraph()) ) addnode( "collaborationgraph", lambda: self.render_optional(node.get_collaborationgraph()), ) addnode("briefdescription", lambda: self.render_optional(node.briefdescription)) addnode("detaileddescription", lambda: self.detaileddescription(node)) def render_derivedcompoundref(node): if node is None: return [] output = self.render_iterable(node) if not output: return [] return [ nodes.paragraph( "", "", nodes.Text("Subclassed by "), *intersperse(output, nodes.Text(", ")) ) ] addnode( "derivedcompoundref", lambda: render_derivedcompoundref(node.derivedcompoundref) ) section_nodelists: dict[str, list[Node]] = {} # Get all sub sections for sectiondef in node.sectiondef: kind = sectiondef.kind if section_order is not None and kind not in section_order: continue header = sectiondef.header if membergroup_order is not None and header not in membergroup_order: continue child_nodes = self.render(sectiondef) if not child_nodes: # Skip empty section continue rst_node = nodes.container(classes=["breathe-sectiondef"]) rst_node.document = self.state.document rst_node["objtype"] = kind rst_node.extend(child_nodes) # We store the nodes as a list against the kind in a dictionary as the kind can be # 'user-edited' and that can repeat so this allows us to collect all the 'user-edited' # entries together section_nodelists.setdefault(kind, []).append(rst_node) # Order the results in an appropriate manner for kind, _ in self.sections: addnode(kind, lambda: section_nodelists.get(kind, [])) # Take care of innerclasses addnode("innerclass", lambda: self.render_iterable(node.innerclass)) addnode("innernamespace", lambda: self.render_iterable(node.innernamespace)) if "inner" in options: for node in node.innergroup: file_data = self.compound_parser.parse(node.refid) inner = file_data.compounddef addnode("innergroup", lambda: self.visit_compounddef(inner)) nodelist = [] for _, nodes_ in sorted(nodemap.items()): nodelist += nodes_ return nodelist section_titles = dict(sections) def visit_sectiondef(self, node) -> list[Node]: self.context = cast("RenderContext", self.context) options = self.context.directive_args[2] node_list = [] node_list.extend(self.render_optional(node.description)) # Get all the memberdef info if "sort" in options: member_def = sorted(node.memberdef, key=lambda x: x.name) else: member_def = node.memberdef node_list.extend(self.render_iterable(member_def)) if node_list: if "members-only" in options: return node_list text = self.section_titles[node.kind] # Override default name for user-defined sections. Use "Unnamed # Group" if the user didn't name the section # This is different to Doxygen which will track the groups and name # them Group1, Group2, Group3, etc. if node.kind == "user-defined": if node.header: text = node.header else: text = "Unnamed Group" # Use rubric for the title because, unlike the docutils element "section", # it doesn't interfere with the document structure. idtext = text.replace(" ", "-").lower() rubric = nodes.rubric( text=text, classes=["breathe-sectiondef-title"], ids=["breathe-section-title-" + idtext], ) res: list[Node] = [rubric] return res + node_list return [] def visit_docreftext(self, node) -> list[Node]: nodelist = self.render_iterable(node.content_) if hasattr(node, "para"): nodelist.extend(self.render_iterable(node.para)) refid = self.get_refid(node.refid) nodelist = [ addnodes.pending_xref( "", reftype="ref", refdomain="std", refexplicit=True, refid=refid, reftarget=refid, *nodelist, ) ] return nodelist def visit_docheading(self, node) -> list[Node]: """Heading renderer. Renders embedded headlines as emphasized text. Different heading levels are not supported. """ nodelist = self.render_iterable(node.content_) return [nodes.emphasis("", "", *nodelist)] def visit_docpara(self, node) -> list[Node]: """ tags in the Doxygen output tend to contain either text or a single other tag of interest. So whilst it looks like we're combined descriptions and program listings and other things, in the end we generally only deal with one per para tag. Multiple neighbouring instances of these things tend to each be in a separate neighbouring para tag. """ nodelist = [] if self.context and self.context.directive_args[0] == "doxygenpage": nodelist.extend(self.render_iterable(node.ordered_children)) else: contentNodeCands = self.render_iterable(node.content) # if there are consecutive nodes.Text we should collapse them # and rerender them to ensure the right paragraphifaction contentNodes: list[Node] = [] for n in contentNodeCands: if len(contentNodes) != 0 and isinstance(contentNodes[-1], nodes.Text): if isinstance(n, nodes.Text): prev = contentNodes.pop() contentNodes.extend(self.render_string(prev.astext() + n.astext())) continue # we have handled this node contentNodes.append(n) nodelist.extend(contentNodes) nodelist.extend(self.render_iterable(node.images)) paramList = self.render_iterable(node.parameterlist) defs = [] fields = [] for n in self.render_iterable(node.simplesects): if isinstance(n, nodes.definition_list_item): defs.append(n) elif isinstance(n, nodes.field_list): fields.append(n) else: nodelist.append(n) # note: all these gets pulled up and reordered in description() if len(defs) != 0: deflist = nodes.definition_list("", *defs) nodelist.append(deflist) nodelist.extend(paramList) nodelist.extend(fields) # And now all kinds of cleanup steps # ---------------------------------- # trim trailing whitespace while len(nodelist) != 0: last = nodelist[-1] if not isinstance(last, nodes.Text): break if last.astext().strip() != "": break nodelist.pop() # https://github.com/breathe-doc/breathe/issues/827 # verbatim nodes should not be in a paragraph: if len(nodelist) == 1 and isinstance(nodelist[0], nodes.literal_block): return nodelist return [nodes.paragraph("", "", *nodelist)] def visit_docparblock(self, node) -> list[Node]: return self.render_iterable(node.para) def visit_docblockquote(self, node) -> list[Node]: nodelist = self.render_iterable(node.para) # catch block quote attributions here; the tag is the only identifier, # and it is nested within a subsequent tag if nodelist and nodelist[-1].astext().startswith("—"): # nodes.attribution prepends the author with an emphasized dash. # replace the — placeholder and strip any leading whitespace. text = nodelist[-1].astext().replace("—", "").lstrip() nodelist[-1] = nodes.attribution("", text) return [nodes.block_quote("", classes=[], *nodelist)] def visit_docimage(self, node) -> list[Node]: """Output docutils image node using name attribute from xml as the uri""" path_to_image = node.name if not url_re.match(path_to_image): path_to_image = self.project_info.sphinx_abs_path_to_file(path_to_image) options = {"uri": path_to_image} return [nodes.image("", **options)] def visit_docurllink(self, node) -> list[Node]: """Url Link Renderer""" nodelist = self.render_iterable(node.content_) return [nodes.reference("", "", refuri=node.url, *nodelist)] def visit_docmarkup(self, node) -> list[Node]: nodelist = self.render_iterable(node.content_) creator: type[TextElement] = nodes.inline if node.type_ == "emphasis": creator = nodes.emphasis elif node.type_ == "computeroutput": creator = nodes.literal elif node.type_ == "bold": creator = nodes.strong elif node.type_ == "superscript": creator = nodes.superscript elif node.type_ == "subscript": creator = nodes.subscript elif node.type_ == "center": print("Warning: does not currently handle 'center' text display") elif node.type_ == "small": print("Warning: does not currently handle 'small' text display") return [creator("", "", *nodelist)] def visit_docsectN(self, node) -> list[Node]: """ Docutils titles are defined by their level inside the document so the proper structure is only guaranteed by the Doxygen XML. Doxygen command mapping to XML element name: @section == sect1, @subsection == sect2, @subsubsection == sect3 """ section = nodes.section() section["ids"].append(self.get_refid(node.id)) section += nodes.title(node.title, node.title) section += self.create_doxygen_target(node) section += self.render_iterable(node.content_) return [section] def visit_docsimplesect(self, node) -> list[Node]: """Other Type documentation such as Warning, Note, Returns, etc""" # for those that should go into a field list, just render them as that, # and it will be pulled up later nodelist = self.render_iterable(node.para) if node.kind in ("pre", "post", "return"): return [ nodes.field_list( "", nodes.field( "", nodes.field_name("", nodes.Text(node.kind)), nodes.field_body("", *nodelist), ), ) ] elif node.kind == "warning": return [nodes.warning("", *nodelist)] elif node.kind == "note": return [nodes.note("", *nodelist)] elif node.kind == "see": return [addnodes.seealso("", *nodelist)] elif node.kind == "remark": nodelist.insert(0, nodes.title("", nodes.Text(node.kind.capitalize()))) return [nodes.admonition("", classes=[node.kind], *nodelist)] if node.kind == "par": text = self.render(node.title) else: text = [nodes.Text(node.kind.capitalize())] # TODO: is this working as intended? there is something strange with the types title = nodes.strong("", "", *text) term = nodes.term("", "", title) definition = nodes.definition("", *nodelist) return [nodes.definition_list_item("", term, definition)] def visit_doctitle(self, node) -> list[Node]: return self.render_iterable(node.content_) def visit_docformula(self, node) -> list[Node]: nodelist: list[Node] = [] for item in node.content_: latex = item.getValue() docname = self.state.document.settings.env.docname # Strip out the doxygen markup that slips through # Either inline if latex.startswith("$") and latex.endswith("$"): latex = latex[1:-1] nodelist.append( nodes.math(text=latex, label=None, nowrap=False, docname=docname, number=None) ) # Else we're multiline else: if latex.startswith("\\[") and latex.endswith("\\]"): latex = latex[2:-2:] nodelist.append( nodes.math_block( text=latex, label=None, nowrap=False, docname=docname, number=None ) ) return nodelist def visit_listing(self, node) -> list[Node]: nodelist: list[Node] = [] for i, item in enumerate(node.codeline): # Put new lines between the lines if i: nodelist.append(nodes.Text("\n")) nodelist.extend(self.render(item)) # Add blank string at the start otherwise for some reason it renders # the pending_xref tags around the kind in plain text block = nodes.literal_block("", "", *nodelist) if node.domain: block["language"] = node.domain return [block] def visit_codeline(self, node) -> list[Node]: return self.render_iterable(node.highlight) def visit_highlight(self, node) -> list[Node]: return self.render_iterable(node.content_) def _nested_inline_parse_with_titles(self, content, node) -> str: """ This code is basically a customized nested_parse_with_titles from docutils, using the InlineText class on the statemachine. """ surrounding_title_styles = self.state.memo.title_styles surrounding_section_level = self.state.memo.section_level self.state.memo.title_styles = [] self.state.memo.section_level = 0 try: return self.state.nested_parse( content, 0, node, match_titles=1, state_machine_kwargs={ "state_classes": (InlineText,), "initial_state": "InlineText", }, ) finally: self.state.memo.title_styles = surrounding_title_styles self.state.memo.section_level = surrounding_section_level def visit_verbatim(self, node) -> list[Node]: if not node.text.strip().startswith("embed:rst"): # Remove trailing new lines. Purely subjective call from viewing results text = node.text.rstrip() # Handle has a preformatted text return [nodes.literal_block(text, text)] is_inline = False # do we need to strip leading asterisks? # NOTE: We could choose to guess this based on every line starting with '*'. # However This would have a side-effect for any users who have an rst-block # consisting of a simple bullet list. # For now we just look for an extended embed tag if node.text.strip().startswith("embed:rst:leading-asterisk"): lines = node.text.splitlines() # Replace the first * on each line with a blank space lines = (text.replace("*", " ", 1) for text in lines) node.text = "\n".join(lines) # do we need to strip leading ///? elif node.text.strip().startswith("embed:rst:leading-slashes"): lines = node.text.splitlines() # Replace the /// on each line with three blank spaces lines = (text.replace("///", " ", 1) for text in lines) node.text = "\n".join(lines) elif node.text.strip().startswith("embed:rst:inline"): # Inline all text inside the verbatim node.text = "".join(node.text.splitlines()) is_inline = True if is_inline: text = node.text.replace("embed:rst:inline", "", 1) else: # Remove the first line which is "embed:rst[:leading-asterisk]" text = "\n".join(node.text.split("\n")[1:]) # Remove starting whitespace text = textwrap.dedent(text) # Inspired by autodoc.py in Sphinx rst = StringList() for line in text.split("\n"): rst.append(line, "") # Parent node for the generated node subtree rst_node: Node if is_inline: rst_node = nodes.inline() else: rst_node = nodes.paragraph() rst_node.document = self.state.document # Generate node subtree if is_inline: self._nested_inline_parse_with_titles(rst, rst_node) else: nested_parse_with_titles(self.state, rst, rst_node) return [rst_node] def visit_inc(self, node: compoundsuper.incType) -> list[Node]: if not self.app.config.breathe_show_include: return [] compound_link: list[Node] = [nodes.Text(node.content_[0].getValue())] if node.get_refid(): compound_link = self.visit_docreftext(node) if node.local == "yes": text = [nodes.Text('#include "'), *compound_link, nodes.Text('"')] else: text = [nodes.Text("#include <"), *compound_link, nodes.Text(">")] return [nodes.container("", nodes.emphasis("", "", *text))] def visit_ref(self, node: compoundsuper.refType) -> list[Node]: def get_node_info(file_data): name = node.content_[0].getValue() name = name.rsplit("::", 1)[-1] return name, file_data.compounddef.kind return self.visit_compound(node, False, get_node_info=get_node_info) def visit_doclistitem(self, node) -> list[Node]: """List item renderer. Render all the children depth-first. Upon return expand the children node list into a docutils list-item. """ nodelist = self.render_iterable(node.para) return [nodes.list_item("", *nodelist)] numeral_kind = ["arabic", "loweralpha", "lowerroman", "upperalpha", "upperroman"] def render_unordered(self, children) -> list[Node]: nodelist_list = nodes.bullet_list("", *children) return [nodelist_list] def render_enumerated(self, children, nesting_level) -> list[Node]: nodelist_list = nodes.enumerated_list("", *children) idx = nesting_level % len(SphinxRenderer.numeral_kind) nodelist_list["enumtype"] = SphinxRenderer.numeral_kind[idx] nodelist_list["prefix"] = "" nodelist_list["suffix"] = "." return [nodelist_list] def visit_doclist(self, node) -> list[Node]: """List renderer The specifics of the actual list rendering are handled by the decorator around the generic render function. Render all the children depth-first.""" """ Call the wrapped render function. Update the nesting level for the enumerated lists. """ if node.node_subtype == "itemized": val = self.render_iterable(node.listitem) return self.render_unordered(children=val) elif node.node_subtype == "ordered": self.nesting_level += 1 val = self.render_iterable(node.listitem) self.nesting_level -= 1 return self.render_enumerated(children=val, nesting_level=self.nesting_level) return [] def visit_compoundref(self, node) -> list[Node]: nodelist = self.render_iterable(node.content_) refid = self.get_refid(node.refid) if refid is not None: nodelist = [ addnodes.pending_xref( "", reftype="ref", refdomain="std", refexplicit=True, refid=refid, reftarget=refid, *nodelist, ) ] return nodelist def visit_docxrefsect(self, node) -> list[Node]: assert self.app.env is not None signode = addnodes.desc_signature() title = node.xreftitle[0] + ":" titlenode = nodes.emphasis(text=title) ref = addnodes.pending_xref( "", reftype="ref", refdomain="std", refexplicit=True, reftarget=node.id, refdoc=self.app.env.docname, *[titlenode], ) signode += ref nodelist = self.render(node.xrefdescription) contentnode = addnodes.desc_content() contentnode += nodelist descnode = addnodes.desc() descnode["objtype"] = "xrefsect" descnode["domain"] = self.get_domain() or "cpp" descnode += signode descnode += contentnode return [descnode] def visit_docvariablelist(self, node) -> list[Node]: output: list[Node] = [] for varlistentry, listitem in zip(node.varlistentries, node.listitems): descnode = addnodes.desc() descnode["objtype"] = "varentry" descnode["domain"] = self.get_domain() or "cpp" signode = addnodes.desc_signature() signode += self.render_optional(varlistentry) descnode += signode contentnode = addnodes.desc_content() contentnode += self.render_iterable(listitem.para) descnode += contentnode output.append(descnode) return output def visit_docvarlistentry(self, node) -> list[Node]: content = node.term.content_ return self.render_iterable(content) def visit_docanchor(self, node) -> list[Node]: return list(self.create_doxygen_target(node)) def visit_docentry(self, node) -> list[Node]: col = nodes.entry() col += self.render_iterable(node.para) if node.thead == "yes": col["heading"] = True if node.rowspan: col["morerows"] = int(node.rowspan) - 1 if node.colspan: col["morecols"] = int(node.colspan) - 1 return [col] def visit_docrow(self, node) -> list[Node]: row = nodes.row() cols = self.render_iterable(node.entry) elem: nodes.thead | nodes.tbody if all(col.get("heading", False) for col in cols): # type: ignore[attr-defined] elem = nodes.thead() else: elem = nodes.tbody() row += cols elem.append(row) return [elem] def visit_doctable(self, node) -> list[Node]: table = nodes.table() table["classes"] += ["colwidths-auto"] tgroup = nodes.tgroup(cols=node.cols) for _ in range(node.cols): colspec = nodes.colspec() colspec.attributes["colwidth"] = "auto" tgroup += colspec table += tgroup rows = self.render_iterable(node.row) # this code depends on visit_docrow(), and expects the same elements used to # "envelop" rows there, namely thead and tbody (eg it will need to be updated # if Doxygen one day adds support for tfoot) tags: dict[str, list] = {row.starttag(): [] for row in rows} # type: ignore[attr-defined] for row in rows: tags[row.starttag()].append(row.next_node()) # type: ignore[attr-defined] def merge_row_types(root, elem, elems): for node in elems: elem += node root += elem for klass in [nodes.thead, nodes.tbody]: obj = klass() if obj.starttag() in tags: merge_row_types(tgroup, obj, tags[obj.starttag()]) return [table] def visit_mixedcontainer(self, node: compoundsuper.MixedContainer) -> list[Node]: return self.render_optional(node.getValue()) def visit_description(self, node) -> list[Node]: return self.render_iterable(node.content_) def visit_linkedtext(self, node) -> list[Node]: return self.render_iterable(node.content_) def visit_function(self, node) -> list[Node]: dom = self.get_domain() if not dom or dom in ("c", "cpp", "py", "cs"): names = self.get_qualification() names.append(node.get_name()) name = self.join_nested_name(names) if dom == "py": declaration = name + node.get_argsstring() elif dom == "cs": declaration = " ".join([ self.create_template_prefix(node), "".join(n.astext() for n in self.render(node.get_type())), name, node.get_argsstring(), ]) else: elements = [self.create_template_prefix(node)] if node.static == "yes": elements.append("static") if node.inline == "yes": elements.append("inline") if node.kind == "friend": elements.append("friend") if node.virt in ("virtual", "pure-virtual"): elements.append("virtual") if node.explicit == "yes": elements.append("explicit") # TODO: handle constexpr when parser has been updated # but Doxygen seems to leave it in the type anyway typ = "".join(n.astext() for n in self.render(node.get_type())) # Doxygen sometimes leaves 'static' in the type, # e.g., for "constexpr static auto f()" typ = typ.replace("static ", "") # In Doxygen up to somewhere between 1.8.17 to exclusive 1.9.1 # the 'friend' part is also left in the type. # See also #767. typ = typ.removeprefix("friend ") elements.extend((typ, name, node.get_argsstring())) declaration = " ".join(elements) nodes_ = self.handle_declaration(node, declaration) return nodes_ else: # Get full function signature for the domain directive. param_list = [] for param in node.param: self.context = cast("RenderContext", self.context) param = self.context.mask_factory.mask(param) param_decl = get_param_decl(param) param_list.append(param_decl) templatePrefix = self.create_template_prefix(node) sig_def = get_definition_without_template_args(node) signature = f"{templatePrefix}{sig_def}({', '.join(param_list)})" # Add CV-qualifiers. if node.const == "yes": signature += " const" # The doxygen xml output doesn't register 'volatile' as the xml attribute for functions # until version 1.8.8 so we also check argsstring: # https://bugzilla.gnome.org/show_bug.cgi?id=733451 if node.volatile == "yes" or node.argsstring.endswith("volatile"): signature += " volatile" if node.refqual == "lvalue": signature += "&" elif node.refqual == "rvalue": signature += "&&" # Add `= 0` for pure virtual members. if node.virt == "pure-virtual": signature += "= 0" self.context = cast("RenderContext", self.context) self.context.directive_args[1] = [signature] nodes_ = self.run_domain_directive(node.kind, self.context.directive_args[1]) assert self.app.env is not None if self.app.env.config.breathe_debug_trace_doxygen_ids: target = self.create_doxygen_target(node) if len(target) == 0: print("{}Doxygen target (old): (none)".format(" " * _debug_indent)) else: print( "{}Doxygen target (old): {}".format(" " * _debug_indent, target[0]["ids"]) ) rst_node = nodes_[1] finder = NodeFinder(rst_node.document) rst_node.walk(finder) # Templates have multiple signature nodes in recent versions of Sphinx. # Insert Doxygen target into the first signature node. if not self.app.env.config.breathe_debug_trace_doxygen_ids: target = self.create_doxygen_target(node) rst_node.children[0].insert(0, target) # type: ignore[attr-defined] finder.content.extend(self.description(node)) return nodes_ def visit_define(self, node) -> list[Node]: declaration = node.name if node.param: declaration += "(" for i, parameter in enumerate(node.param): if i: declaration += ", " declaration += parameter.defname declaration += ")" # TODO: remove this once Sphinx supports definitions for macros def add_definition(declarator: Declarator) -> None: if node.initializer and self.app.config.breathe_show_define_initializer: declarator.append(nodes.Text(" ")) declarator.extend(self.render(node.initializer)) return self.handle_declaration(node, declaration, declarator_callback=add_definition) def visit_enum(self, node) -> list[Node]: def content(contentnode): contentnode.extend(self.description(node)) values = nodes.emphasis("", nodes.Text("Values:")) title = nodes.paragraph("", "", values) contentnode += title enums = self.render_iterable(node.enumvalue) contentnode.extend(enums) names = self.get_qualification() names.append(node.name) declaration = self.join_nested_name(names) dom = self.get_domain() if (not dom or dom == "cpp") and node.strong == "yes": # It looks like Doxygen does not make a difference # between 'enum class' and 'enum struct', # so render them both as 'enum class'. obj_type = "enum-class" underlying_type = "".join(n.astext() for n in self.render(node.type_)) if len(underlying_type.strip()) != 0: declaration += " : " declaration += underlying_type else: obj_type = "enum" return self.handle_declaration( node, declaration, obj_type=obj_type, content_callback=content ) def visit_enumvalue(self, node) -> list[Node]: if self.app.config.breathe_show_enumvalue_initializer: declaration = node.name + self.make_initializer(node) else: declaration = node.name return self.handle_declaration(node, declaration, obj_type="enumvalue") def visit_typedef(self, node) -> list[Node]: type_ = "".join(n.astext() for n in self.render(node.get_type())) names = self.get_qualification() names.append(node.get_name()) name = self.join_nested_name(names) if node.definition.startswith("using "): # TODO: looks like Doxygen does not generate the proper XML # for the template parameter list declaration = self.create_template_prefix(node) declaration += " " + name + " = " + type_ else: # TODO: Both "using" and "typedef" keywords get into this function, # and if no @typedef comment was added, the definition should # contain the full text. If a @typedef was used instead, the # definition has only the typename, which makes it impossible to # distinguish between them so fallback to "typedef" behavior here. declaration = f"{type_} {name} {node.get_argsstring()}" return self.handle_declaration(node, declaration) def make_initializer(self, node) -> str: initializer = node.initializer signature: list[Node] = [] if initializer: render_nodes = self.render(initializer) # Do not append separators for paragraphs. if not isinstance(render_nodes[0], nodes.paragraph): separator = " " assert isinstance(render_nodes[0], nodes.Text) if not render_nodes[0].startswith("="): separator += "= " signature.append(nodes.Text(separator)) signature.extend(render_nodes) return "".join(n.astext() for n in signature) def visit_variable(self, node) -> list[Node]: names = self.get_qualification() names.append(node.name) name = self.join_nested_name(names) dom = self.get_domain() options = {} if dom == "py": declaration = name initializer = self.make_initializer(node).strip().lstrip("=").strip() if len(initializer) != 0: options["value"] = initializer elif dom == "cs": declaration = " ".join([ self.create_template_prefix(node), "".join(n.astext() for n in self.render(node.get_type())), name, node.get_argsstring(), ]) if node.get_gettable() or node.get_settable(): declaration += "{" if node.get_gettable(): declaration += "get;" if node.get_settable(): declaration += "set;" declaration += "}" declaration += self.make_initializer(node) else: elements = [self.create_template_prefix(node)] if node.static == "yes": elements.append("static") if node.mutable == "yes": elements.append("mutable") typename = "".join(n.astext() for n in self.render(node.get_type())) # Doxygen sometimes leaves 'static' in the type, # e.g., for "constexpr static int i" typename = typename.replace("static ", "") if dom == "c" and "::" in typename: typename = typename.replace("::", ".") elements.extend((typename, name, node.get_argsstring(), self.make_initializer(node))) declaration = " ".join(elements) if not dom or dom in ("c", "cpp", "py", "cs"): return self.handle_declaration(node, declaration, options=options) else: return self.render_declaration(node, declaration) def visit_friendclass(self, node) -> list[Node]: dom = self.get_domain() assert not dom or dom == "cpp" desc = addnodes.desc() desc["objtype"] = "friendclass" desc["domain"] = self.get_domain() or "cpp" signode = addnodes.desc_signature() desc += signode typ = "".join(n.astext() for n in self.render(node.get_type())) # in Doxygen < 1.9 the 'friend' part is there, but afterwards not # https://github.com/breathe-doc/breathe/issues/616 assert typ in ("friend class", "friend struct", "class", "struct") if not typ.startswith("friend "): typ = "friend " + typ signode += addnodes.desc_annotation(typ, typ) signode += nodes.Text(" ") # expr = cpp.CPPExprRole(asCode=False) # expr.text = node.name # TODO: set most of the things that SphinxRole.__call__ sets # signode.extend(expr.run()) signode += nodes.Text(node.name) return [desc] def visit_templateparam( self, node: compound.paramTypeSub, *, insertDeclNameByParsing: bool = False ) -> list[Node]: nodelist: list[Node] = [] # Parameter type if node.type_: type_nodes = self.render(node.type_) # Render keywords as annotations for consistency with the cpp domain. if len(type_nodes) > 0 and isinstance(type_nodes[0], str): first_node = type_nodes[0] for keyword in ["typename", "class"]: if first_node.startswith(keyword + " "): type_nodes[0] = nodes.Text(first_node.replace(keyword, "", 1)) type_nodes.insert(0, addnodes.desc_annotation(keyword, keyword)) break nodelist.extend(type_nodes) # Parameter name if node.declname: dom = self.get_domain() if not dom: dom = "cpp" appendDeclName = True if insertDeclNameByParsing: if dom == "cpp": parser = cpp.DefinitionParser( "".join(n.astext() for n in nodelist), location=self.state.state_machine.get_source_and_line(), config=self.app.config, ) try: # we really should use _parse_template_parameter() # but setting a name there is non-trivial, so we use type ast = parser._parse_type(named="single", outer="templateParam") assert ast.name is None nn = cpp.ASTNestedName( names=[ cpp.ASTNestedNameElement(cpp.ASTIdentifier(node.declname), None) ], templates=[False], rooted=False, ) ast.name = nn # the actual nodes don't matter, as it is astext()-ed later nodelist = [nodes.Text(str(ast))] appendDeclName = False except cpp.DefinitionError: # happens with "typename ...Args", so for now, just append pass if appendDeclName: if nodelist: nodelist.append(nodes.Text(" ")) nodelist.append(nodes.emphasis(text=node.declname)) elif self.output_defname and node.defname: # We only want to output the definition name (from the cpp file) if the declaration name # (from header file) isn't present if nodelist: nodelist.append(nodes.Text(" ")) nodelist.append(nodes.emphasis(text=node.defname)) # array information if node.array: nodelist.append(nodes.Text(node.array)) # Default value if node.defval: nodelist.append(nodes.Text(" = ")) nodelist.extend(self.render(node.defval)) return nodelist def visit_templateparamlist(self, node: compound.templateparamlistTypeSub) -> list[Node]: nodelist: list[Node] = [] self.output_defname = False for i, item in enumerate(node.param): if i: nodelist.append(nodes.Text(", ")) nodelist.extend(self.visit_templateparam(item, insertDeclNameByParsing=True)) self.output_defname = True return nodelist def visit_docparamlist(self, node) -> list[Node]: """Parameter/Exception/TemplateParameter documentation""" fieldListName = { "param": "param", "exception": "throws", "templateparam": "tparam", "retval": "retval", } # https://docutils.sourceforge.io/docs/ref/doctree.html#field-list fieldList = nodes.field_list() for item in node.parameteritem: # TODO: does item.parameternamelist really have more than 1 parametername? assert len(item.parameternamelist) <= 1, item.parameternamelist nameNodes: list[Node] = [] parameterDirectionNodes = [] if len(item.parameternamelist) != 0: paramNameNodes = item.parameternamelist[0].parametername if len(paramNameNodes) != 0: nameNodes = [] for paramName in paramNameNodes: content = paramName.content_ # this is really a list of MixedContainer objects, i.e., a generic object # we assume there is either 1 or 2 elements, if there is 2 the first is the # parameter direction assert len(content) == 1 or len(content) == 2, content thisName = self.render(content[-1]) if len(nameNodes) != 0: if node.kind == "exception": msg = "Doxygen \\exception commands with multiple names can not be" msg += " converted to a single :throws: field in Sphinx." msg += " Exception '{}' suppressed from output.".format( "".join(n.astext() for n in thisName) ) self.state.document.reporter.warning(msg) continue nameNodes.append(nodes.Text(", ")) nameNodes.extend(thisName) if len(content) == 2: # note, each paramName node seems to have the same direction, # so just use the last one dir = "".join(n.astext() for n in self.render(content[0])).strip() assert dir in ("[in]", "[out]", "[inout]"), ">" + dir + "<" parameterDirectionNodes = [nodes.strong(dir, dir), nodes.Text(" ")] # it seems that Sphinx expects the name to be a single node, # so let's make it that txt = fieldListName[node.kind] + " " for n in nameNodes: txt += n.astext() name = nodes.field_name("", nodes.Text(txt)) bodyNodes = self.render_optional(item.parameterdescription) # TODO: is it correct that bodyNodes is either empty or a single paragraph? assert len(bodyNodes) <= 1, bodyNodes if len(bodyNodes) == 1: assert isinstance(bodyNodes[0], nodes.paragraph) bodyNodes = [ nodes.paragraph("", "", *(parameterDirectionNodes + bodyNodes[0].children)) ] body = nodes.field_body("", *bodyNodes) field = nodes.field("", name, body) fieldList += field return [fieldList] def visit_docdot(self, node) -> list[Node]: """Translate node from doxygen's dot command to sphinx's graphviz directive.""" graph_node = graphviz() if node.content_ and node.content_[0].getValue().rstrip("\n"): graph_node["code"] = node.content_[0].getValue() else: graph_node["code"] = "" # triggers another warning from sphinx.ext.graphviz self.state.document.reporter.warning( # would be better if this output includes the parent node's # name/reference, but that would always be a element. "no content provided for generating DOT graph." ) graph_node["options"] = {} if node.caption: caption_node = nodes.caption(node.caption, "") caption_node += nodes.Text(node.caption) return [nodes.figure("", graph_node, caption_node)] return [graph_node] def visit_docdotfile(self, node) -> list[Node]: """Translate node from doxygen's dotfile command to sphinx's graphviz directive.""" dotcode = "" dot_file_path = Path(node.name) # Doxygen v1.9.3+ uses a relative path to specify the dot file. # Previously, Doxygen used an absolute path. # This relative path is with respect to the XML_OUTPUT path. # Furthermore, Doxygen v1.9.3+ will copy the dot file into the XML_OUTPUT if not dot_file_path.is_absolute(): # Use self.project_info.project_path as the XML_OUTPUT path, and # make it absolute with consideration to the conf.py path project_path = self.project_info.project_path() dot_file_path = Path(self.app.confdir, project_path, dot_file_path).resolve() try: dotcode = dot_file_path.read_text(encoding="utf-8") if not dotcode.rstrip("\n"): raise RuntimeError("%s found but without any content" % dot_file_path) except OSError as exc: # doxygen seems to prevent this from triggering as a non-existent file # generates no XML output for the corresponding `\dotfile` cmd self.state.document.reporter.warning(exc) # better safe than sorry except RuntimeError as exc: self.state.document.reporter.warning(exc) graph_node = graphviz() graph_node["code"] = dotcode graph_node["options"] = {"docname": dot_file_path} caption = "" if not node.content_ else node.content_[0].getValue() if caption: caption_node = nodes.caption(caption, "") caption_node += nodes.Text(caption) return [nodes.figure("", graph_node, caption_node)] return [graph_node] def visit_docgraph(self, node: compoundsuper.graphType) -> list[Node]: """Create a graph (generated by doxygen - not user-defined) from XML using dot syntax.""" # use graphs' legend from doxygen (v1.9.1) # most colors can be changed via `graphviz_dot_args` in conf.py edge_colors = { # blue (#1414CE) doesn't contrast well in dark mode. # "public-inheritance": "1414CE", # allow user to customize this one "private-inheritance": "8B1A1A", # hardcoded "protected-inheritance": "006400", # hardcoded # the following are demonstrated in the doxygen graphs' legend, but # these don't show in XML properly (bug?); these keys are fiction. "used-internal": "9C35CE", # should also be dashed "template-instantiated-inheritance": "FFA500", # should also be dashed } # assemble the dot syntax we'll pass to the graphviz directive dot = "digraph {\n" dot += ' graph [bgcolor="#00000000"]\n' # transparent color for graph's bg dot += ' node [shape=rectangle style=filled fillcolor="#FFFFFF"' dot += " font=Helvetica padding=2]\n" dot += ' edge [color="#1414CE"]\n' relations = [] for g_node in node.get_node(): dot += ' "%s" [label="%s"' % (g_node.get_id(), g_node.get_label()) dot += ' tooltip="%s"' % g_node.get_label() if g_node.get_id() == "1": # the disabled grey color is used in doxygen to indicate that the URL is # not set (for the compound in focus). Setting this here doesn't allow # further customization. Maybe remove this since URL is not used? # dot += ' fillcolor="#BFBFBF"' # hardcoded # URLs from a doxygen refid won't work in sphinx graphviz; we can't convert # the refid until all docs are built, and pending references are un-noticed # within graphviz directives. Maybe someone wiser will find a way to do it. # # dot += ' URL="%s"' % g_node.get_link().get_refid() dot += "]\n" for child_node in g_node.childnode: edge = f' "{g_node.get_id()}"' edge += f' -> "{child_node.get_refid()}" [' edge += f"dir={node.get_direction()} " # edge labels don't appear in XML (bug?); use tooltip in meantime edge += 'tooltip="%s"' % child_node.get_relation() if child_node.get_relation() in edge_colors.keys(): edge += ' color="#%s"' % edge_colors.get(child_node.get_relation()) edge += "]\n" relations.append(edge) for relation in relations: dot += relation dot += "}" # use generated dot syntax to create a graphviz node graph_node = graphviz() graph_node["code"] = dot graph_node["align"] = "center" graph_node["options"] = {} caption = node.get_caption() # if caption is first node in a figure, then everything that follows is # considered a caption. Use a paragraph followed by a figure to center the # graph. This may have illegible side effects for very large graphs. caption_node = nodes.paragraph("", nodes.Text(caption)) return [caption_node, nodes.figure("", graph_node)] def visit_unknown(self, node) -> list[Node]: """Visit a node of unknown type.""" return [] def dispatch_compound(self, node) -> list[Node]: """Dispatch handling of a compound node to a suitable visit method.""" if node.kind in ["file", "dir", "page", "example", "group"]: return self.visit_file(node) return self.visit_compound(node) def dispatch_memberdef(self, node) -> list[Node]: """Dispatch handling of a memberdef node to a suitable visit method.""" if node.kind in ("function", "signal", "slot") or ( node.kind == "friend" and node.argsstring ): return self.visit_function(node) if node.kind == "enum": return self.visit_enum(node) if node.kind == "typedef": return self.visit_typedef(node) if node.kind == "variable": return self.visit_variable(node) if node.kind == "property": # Note: visit like variable for now return self.visit_variable(node) if node.kind == "event": # Note: visit like variable for now return self.visit_variable(node) if node.kind == "define": return self.visit_define(node) if node.kind == "friend": # note, friend functions should be dispatched further up return self.visit_friendclass(node) return self.render_declaration(node, update_signature=self.update_signature) # A mapping from node types to corresponding dispatch and visit methods. # Dispatch methods, as the name suggest, dispatch nodes to appropriate visit # methods based on node attributes such as kind. methods: dict[str, Callable[[SphinxRenderer, Any], list[Node]]] = { "doxygen": visit_doxygen, "doxygendef": visit_doxygendef, "compound": dispatch_compound, "compounddef": visit_compounddef, "sectiondef": visit_sectiondef, "memberdef": dispatch_memberdef, "docreftext": visit_docreftext, "docheading": visit_docheading, "docpara": visit_docpara, "docparblock": visit_docparblock, "docimage": visit_docimage, "docurllink": visit_docurllink, "docmarkup": visit_docmarkup, "docsect1": visit_docsectN, "docsect2": visit_docsectN, "docsect3": visit_docsectN, "docsimplesect": visit_docsimplesect, "doctitle": visit_doctitle, "docformula": visit_docformula, "listing": visit_listing, "codeline": visit_codeline, "highlight": visit_highlight, "verbatim": visit_verbatim, "inc": visit_inc, "ref": visit_ref, "doclist": visit_doclist, "doclistitem": visit_doclistitem, "enumvalue": visit_enumvalue, "linkedtext": visit_linkedtext, "compoundref": visit_compoundref, "mixedcontainer": visit_mixedcontainer, "description": visit_description, "templateparamlist": visit_templateparamlist, "docparamlist": visit_docparamlist, "docxrefsect": visit_docxrefsect, "docvariablelist": visit_docvariablelist, "docvarlistentry": visit_docvarlistentry, "docanchor": visit_docanchor, "doctable": visit_doctable, "docrow": visit_docrow, "docentry": visit_docentry, "docdotfile": visit_docdotfile, "docdot": visit_docdot, "graph": visit_docgraph, "docblockquote": visit_docblockquote, } def render_string(self, node: str) -> list[Node]: # Skip any nodes that are pure whitespace # Probably need a better way to do this as currently we're only doing # it skip whitespace between higher-level nodes, but this will also # skip any pure whitespace entries in actual content nodes # # We counter that second issue slightly by allowing through single white spaces # stripped = node.strip() if stripped: delimiter = None if "" in stripped: delimiter = "" elif "\n" in stripped: delimiter = "\n" if delimiter: # Render lines as paragraphs because RST doesn't have line breaks. return [ nodes.paragraph("", "", nodes.Text(line.strip())) for line in node.split(delimiter) if line.strip() ] # importantly, don't strip whitespace as visit_docpara uses it to collapse # consecutive nodes.Text and rerender them with this function. return [nodes.Text(node)] if node == " ": return [nodes.Text(node)] return [] def render(self, node, context: RenderContext | None = None) -> list[Node]: if context is None: self.context = cast("RenderContext", self.context) context = self.context.create_child_context(node) with WithContext(self, context): result: list[Node] = [] self.context = cast("RenderContext", self.context) if not self.filter_.allow(self.context.node_stack): pass elif isinstance(node, str): result = self.render_string(node) else: method = SphinxRenderer.methods.get(node.node_type, SphinxRenderer.visit_unknown) result = method(self, node) return result def render_optional(self, node) -> list[Node]: """Render a node that can be None.""" return self.render(node) if node else [] def render_iterable(self, iterable: list) -> list[Node]: output: list[Node] = [] for entry in iterable: output.extend(self.render(entry)) return output def setup(app: Sphinx) -> None: app.add_config_value("breathe_debug_trace_directives", False, "") app.add_config_value("breathe_debug_trace_doxygen_ids", False, "") app.add_config_value("breathe_debug_trace_qualification", False, "") breathe-doc-breathe-10a36f3/breathe/renderer/target.py000066400000000000000000000026171475641424700227300ustar00rootroot00000000000000from __future__ import annotations from typing import TYPE_CHECKING from docutils import nodes if TYPE_CHECKING: from collections.abc import Sequence from typing import Any from docutils.nodes import Element from breathe.project import ProjectInfo class TargetHandler: def create_target(self, refid: str) -> Sequence[Element]: raise NotImplementedError class _RealTargetHandler(TargetHandler): def __init__(self, project_info: ProjectInfo, document: nodes.document): self.project_info = project_info self.document = document def create_target(self, refid: str) -> list[Element]: """Creates a target node and registers it with the document and returns it in a list""" target = nodes.target(ids=[refid], names=[refid]) try: self.document.note_explicit_target(target) except Exception: # TODO: We should really return a docutils warning node here print("Warning: Duplicate target detected: %s" % refid) return [target] class _NullTargetHandler(TargetHandler): def create_target(self, refid: str) -> list[Element]: return [] def create_target_handler( options: dict[str, Any], project_info: ProjectInfo, document: nodes.document ) -> TargetHandler: if "no-link" in options: return _NullTargetHandler() return _RealTargetHandler(project_info, document) breathe-doc-breathe-10a36f3/documentation/000077500000000000000000000000001475641424700205135ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/documentation/.gitignore000066400000000000000000000000311475641424700224750ustar00rootroot00000000000000/build /view /comparison breathe-doc-breathe-10a36f3/documentation/Makefile000066400000000000000000000157651475641424700221710ustar00rootroot00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS ?= -v -W -E # -n triggers an additional 100+ warnings (all about undefined references) that -W treats as errors. # these extraneous warnings are ignored because some doc pages have to avoid duplicate IDs SPHINXBUILD = sphinx-build PAPER = BUILDDIR ?= build DEBUG ?= -P # User-friendly check for sphinx-build ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from https://www.sphinx-doc.org/) endif # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = $(DEBUG) -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " xml to make Docutils-native XML files" @echo " pseudoxml to make pseudoxml-XML files for display purposes" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/test.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/test.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/test" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/test" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." latexpdfja: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through platex and dvipdfmx..." $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." xml: $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml @echo @echo "Build finished. The XML files are in $(BUILDDIR)/xml." pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." spelling: $(SPHINXBUILD) -b spelling -N $(ALLSPHINXOPTS) $(BUILDDIR)/spelling @echo @echo "Build finished. The spelling files are in $(BUILDDIR)/spelling." breathe-doc-breathe-10a36f3/documentation/assets/000077500000000000000000000000001475641424700220155ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/documentation/assets/BreatheFlowChart.svg000066400000000000000000000551111475641424700257250ustar00rootroot00000000000000
Doxygen
Doxygen
Code
Code
Breathe
Parser
Breathe...
XML
XML
Breathe
Filter
Breathe...
Hierarchy of nested Python objects
Hierarchy of ne...
Sphinx
Sphinx
RST nodes
RST nodes
Final Document (HTML, TeX, etc.)
Final Document...
Breath
Renderer
Breath...
Python objects that actually need to be rendered
Python objects...
Text is not SVG - cannot display
breathe-doc-breathe-10a36f3/documentation/assets/BreatheFlowChart_DarkMode.svg000066400000000000000000000374501475641424700275010ustar00rootroot00000000000000
Doxygen
Doxygen
Code
Code
Breathe
Parser
Breathe...
XML
XML
Breathe
Filter
Breathe...
Hierarchy of nested Python objects
Hierarchy of ne...
Sphinx
Sphinx
RST nodes
RST nodes
Final Document (HTML, TeX, etc.)
Final Document...
Breath
Renderer
Breath...
Python objects that actually need to be rendered
Python objects...
Text is not SVG - cannot display
breathe-doc-breathe-10a36f3/documentation/compare000077500000000000000000000031511475641424700220670ustar00rootroot00000000000000#!/bin/sh -e first=$1 second=$2 if [ -z "$first" ]; then echo "Usage: compare []" echo "" echo "The second argument defaults to the current branch if not specified" exit 1 fi # Remember the branch we're on currentbranch=`git symbolic-ref --short HEAD` if [ -z "$second" ]; then second=$currentbranch fi firstdir=comparison/first seconddir=comparison/second # Make sure the output directory exists mkdir -p comparison # Remove any previous builds rm -fr $firstdir rm -fr $seconddir export BREATHE_COMPARE=True # Checkout the first target echo git checkout $first git checkout $first # Run doxygen for this state (cd ../examples/specific; make) (cd ../examples/tinyxml; make) (cd ../examples/doxygen; make) # Clean current sphinx build directory make clean # Make sure the BUILDDIR variable can be overridden in the Makefile. Required for older commits sed -i 's/BUILDDIR = build/BUILDDIR ?= build/g' Makefile # Build into our first comparison directory make html BUILDDIR=$firstdir # Reset the Makefile to its state for this commit git checkout Makefile # Checkout the second target and repeat echo git checkout $second git checkout $second (cd ../examples/specific; make) (cd ../examples/tinyxml; make) (cd ../examples/doxygen; make) make clean sed -i 's/BUILDDIR = build/BUILDDIR ?= build/g' Makefile make html BUILDDIR=$seconddir git checkout Makefile # Return to our current branch echo git checkout $currentbranch git checkout $currentbranch # Launch meld to compare the two html directories echo meld $firstdir/html $seconddir/html meld $firstdir/html $seconddir/html breathe-doc-breathe-10a36f3/documentation/environment.yaml000066400000000000000000000005221475641424700237420ustar00rootroot00000000000000name: RTD channels: - conda-forge - defaults dependencies: # doxygen versions available from conda forge are listed at # https://anaconda.org/conda-forge/doxygen/files # # - doxygen=1.9.4 # to specify a specific version of doxygen # we'll be using the latest available - doxygen - pip - pip: - ".[docs,lint,test]" breathe-doc-breathe-10a36f3/documentation/make.bat000066400000000000000000000145341475641424700221270ustar00rootroot00000000000000@ECHO OFF REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set BUILDDIR=build set SRCDIR=source set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% %SRCDIR% set I18NSPHINXOPTS=%SPHINXOPTS% %SRCDIR% if NOT "%PAPER%" == "" ( set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% ) if "%1" == "" goto help if "%1" == "help" ( :help echo.Please use `make ^` where ^ is one of echo. html to make standalone HTML files echo. dirhtml to make HTML files named index.html in directories echo. singlehtml to make a single large HTML file echo. pickle to make pickle files echo. json to make JSON files echo. htmlhelp to make HTML files and a HTML help project echo. qthelp to make HTML files and a qthelp project echo. devhelp to make HTML files and a Devhelp project echo. epub to make an epub echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter echo. text to make text files echo. man to make manual pages echo. texinfo to make Texinfo files echo. gettext to make PO message catalogs echo. changes to make an overview over all changed/added/deprecated items echo. xml to make Docutils-native XML files echo. pseudoxml to make pseudoxml-XML files for display purposes echo. linkcheck to check all external links for integrity echo. doctest to run all doctests embedded in the documentation if enabled goto end ) if "%1" == "clean" ( for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i del /q /s %BUILDDIR%\* goto end ) %SPHINXBUILD% 2> nul if errorlevel 9009 ( echo. echo.The 'sphinx-build' command was not found. Make sure you have Sphinx echo.installed, then set the SPHINXBUILD environment variable to point echo.to the full path of the 'sphinx-build' executable. Alternatively you echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from echo.https://www.sphinx-doc.org/ exit /b 1 ) if "%1" == "html" ( %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/html. goto end ) if "%1" == "dirhtml" ( %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. goto end ) if "%1" == "singlehtml" ( %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. goto end ) if "%1" == "pickle" ( %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the pickle files. goto end ) if "%1" == "json" ( %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the JSON files. goto end ) if "%1" == "htmlhelp" ( %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run HTML Help Workshop with the ^ .hhp project file in %BUILDDIR%/htmlhelp. goto end ) if "%1" == "qthelp" ( %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: echo.^> qcollectiongenerator %BUILDDIR%\qthelp\libuv.qhcp echo.To view the help file: echo.^> assistant -collectionFile %BUILDDIR%\qthelp\libuv.ghc goto end ) if "%1" == "devhelp" ( %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp if errorlevel 1 exit /b 1 echo. echo.Build finished. goto end ) if "%1" == "epub" ( %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub if errorlevel 1 exit /b 1 echo. echo.Build finished. The epub file is in %BUILDDIR%/epub. goto end ) if "%1" == "latex" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex if errorlevel 1 exit /b 1 echo. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. goto end ) if "%1" == "latexpdf" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex cd %BUILDDIR%/latex make all-pdf cd %BUILDDIR%/.. echo. echo.Build finished; the PDF files are in %BUILDDIR%/latex. goto end ) if "%1" == "latexpdfja" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex cd %BUILDDIR%/latex make all-pdf-ja cd %BUILDDIR%/.. echo. echo.Build finished; the PDF files are in %BUILDDIR%/latex. goto end ) if "%1" == "text" ( %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text if errorlevel 1 exit /b 1 echo. echo.Build finished. The text files are in %BUILDDIR%/text. goto end ) if "%1" == "man" ( %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man if errorlevel 1 exit /b 1 echo. echo.Build finished. The manual pages are in %BUILDDIR%/man. goto end ) if "%1" == "texinfo" ( %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo if errorlevel 1 exit /b 1 echo. echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. goto end ) if "%1" == "gettext" ( %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale if errorlevel 1 exit /b 1 echo. echo.Build finished. The message catalogs are in %BUILDDIR%/locale. goto end ) if "%1" == "changes" ( %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes if errorlevel 1 exit /b 1 echo. echo.The overview file is in %BUILDDIR%/changes. goto end ) if "%1" == "linkcheck" ( %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck if errorlevel 1 exit /b 1 echo. echo.Link check complete; look for any errors in the above output ^ or in %BUILDDIR%/linkcheck/output.txt. goto end ) if "%1" == "doctest" ( %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest if errorlevel 1 exit /b 1 echo. echo.Testing of doctests in the sources finished, look at the ^ results in %BUILDDIR%/doctest/output.txt. goto end ) if "%1" == "xml" ( %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml if errorlevel 1 exit /b 1 echo. echo.Build finished. The XML files are in %BUILDDIR%/xml. goto end ) if "%1" == "pseudoxml" ( %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml if errorlevel 1 exit /b 1 echo. echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. goto end ) :endbreathe-doc-breathe-10a36f3/documentation/source/000077500000000000000000000000001475641424700220135ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/documentation/source/_static/000077500000000000000000000000001475641424700234415ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/documentation/source/_static/breathe.css000066400000000000000000000065101475641424700255670ustar00rootroot00000000000000/* -- breathe specific styles ----------------------------------------------- */ /* So enum value descriptions are displayed inline to the item */ .breatheenumvalues li tt + p { display: inline; } /* So parameter descriptions are displayed inline to the item */ .breatheparameterlist li tt + p { display: inline; } :root { --color-brand-primary-light: hsl(205deg, 52%, 39%); --color-brand-primary-dark: hsl(205deg, 65%, 65%); --breathe-str-char-color-dark: hsl(41, 85%, 46%); --breathe-str-char-color-light: hsl(41, 89%, 37%); --breathe-keyword-type-color-dark: hsl(256, 100%, 65%); --breathe-keyword-type-color-light: hsl(276, 85%, 29%); --breathe-number-color-dark: hsl(157, 81%, 50%); --breathe-number-color-light: hsl(157, 93%, 32%); --breathe-name-color-dark: hsl(88, 72%, 56%); --breathe-name-color-light: hsl(88, 100%, 28%); } /* ************************************************** */ /* rules to uniform color scheme with breathe-doc.org */ body { --color-brand-primary: var(--color-brand-primary-light); --color-brand-content: var(--color-brand-primary-light); --breathe-str-char-color: var(--breathe-str-char-color-light); --breathe-keyword-type-color: var(--breathe-keyword-type-color-light); --breathe-number-color: var(--breathe-number-color-light); --breathe-name-color: var(--breathe-name-color-light); } /* Enable dark-mode, if requested. */ body[data-theme="dark"] { --color-brand-primary: var(--color-brand-primary-dark); --color-brand-content: var(--color-brand-primary-dark); --breathe-str-char-color: var(--breathe-str-char-color-dark); --breathe-keyword-type-color: var(--breathe-keyword-type-color-dark); --breathe-number-color: var(--breathe-number-color-dark); --breathe-name-color: var(--breathe-name-color-dark); } /* Enable dark mode, unless explicitly told to avoid. */ @media (prefers-color-scheme: dark) { body:not([data-theme="light"]) { --color-brand-primary: var(--color-brand-primary-dark); --color-brand-content: var(--color-brand-primary-dark); --breathe-str-char-color: var(--breathe-str-char-color-dark); --breathe-keyword-type-color: var(--breathe-keyword-type-color-dark); --breathe-number-color: var(--breathe-number-color-dark); --breathe-name-color: var(--breathe-name-color-dark); } } .mobile-header { /* background-color: var(--color-header-background); */ background-color: #003c66; } .mobile-header .toc-overlay-icon .icon { /* color: var(--color-foreground-secondary); */ color: white; } .mobile-header .header-center a { /* color: var(--color-header-text); */ color: white; } .mobile-header .theme-toggle svg { /* color: var(--color-foreground-primary); */ color: white; } /* C++ specific styling */ .highlight { /* desaturate that ugly yellow color used by most other theme's code snippets */ background-color: var(--color-api-background); /* for light theme only */ } .sig.c .k, .sig.c .kt, .sig.cpp .k, .sig.cpp .kt { color: var(--breathe-keyword-type-color); } .sig.c .m, .sig.cpp .m { color: var(--breathe-number-color); } .sig.c .s, .sig.c .sc, .sig.cpp .s, .sig.cpp .sc { color: var(--breathe-str-char-color); } .sig > .n { color: var(--breathe-name-color); } /* bugfix for multi-lined signatures (see https://github.com/pradyunsg/furo/discussions/427 ) */ .sig { padding-left: 0.5em; text-indent: revert; } breathe-doc-breathe-10a36f3/documentation/source/_static/favicon.ico000066400000000000000000000102761475641424700255700ustar00rootroot00000000000000  ( @ ;|@T|?}|?|?|@|>cy@(@ |>g|?}?~@wCyDE~E}~Bw|@}?|?zC}>V|?~DqLMLLLLLLLMF{|>|>f3|>B}AzTRRRRRRRRRRRRS۪Fu}?UUYHZXXXXXXXXXXXXXXXY_V_^^^^^^^^^^^^^^^^^_f+Ƿ ƪ?,ҥ-ȿȪE+<1γξC>߿ ʻDϴU̙9 ߿>ˬb7Ů,425,2=68տ ʭ5ʹî/Ը 32122͵23 ͫ=ʰҴʬ"̭AҴԸ??????1breathe-doc-breathe-10a36f3/documentation/source/_static/logo.svg000066400000000000000000000054741475641424700251340ustar00rootroot00000000000000 breathe-doc-breathe-10a36f3/documentation/source/autofile.rst000066400000000000000000000011111475641424700243470ustar00rootroot00000000000000 .. _autodoxygenfile-example: autodoxygenfile Directive Example ================================= For more details and directive documentation please see :ref:`file-example`, which is very similar to this directive. Working Example --------------- This should work: .. code-block:: rst .. autodoxygenfile:: auto_class.h :project: auto With the following config value: .. code-block:: python breathe_projects_source = { "auto" : ( "../examples/specific", ["auto_class.h"] ) } It produces this output: .. autodoxygenfile:: auto_class.h :project: auto breathe-doc-breathe-10a36f3/documentation/source/autoindex.rst000066400000000000000000000007621475641424700245520ustar00rootroot00000000000000 .. _autodoxygenindex-example: autodoxygenindex Directive Example ================================== Working Example --------------- This should work: .. code-block:: rst .. autodoxygenindex:: :project: auto With the following config value: .. code-block:: python breathe_projects_source = { "auto" : ( "../examples/specific", ["auto_function.h", "auto_class.h"] ) } It produces this output: .. cpp:namespace:: @ex_autoindex .. autodoxygenindex:: :project: auto breathe-doc-breathe-10a36f3/documentation/source/class.rst000066400000000000000000000216601475641424700236570ustar00rootroot00000000000000 .. _class-example: doxygenclass Directive ====================== This directive generates the appropriate output for a single class. It takes the standard ``project``, ``path``, ``outline`` and ``no-link`` options and additionally the ``members``, ``protected-members``, ``private-members``, ``undoc-members``, ``membergroups`` and ``members-only`` options. ``members`` Designed to behavior in a similar manner to the ``members`` option for the ``autoclass`` directive that comes with the Sphinx ``autodoc`` extension. If you do not specify this option you will not get any information about the class members, just the general class documentation. If you provide it without arguments, then Breathe adds all the public members and their documentation. If you specify it with **comma separated** arguments, then Breathe will treat the arguments as names of members and provide documentation for only those members that have been named. ``protected-members`` If specified, the protected members of the class will be displayed. ``private-members`` If specified, the private members of the class will be displayed. ``undoc-members`` If specified, the undocumented members of the class will be displayed. ``membergroups`` If specified, only the groups in a space-delimited list following this directive will be displayed. ``members-only`` This will allow to show only the members, not the class information. Child classes and structs are also not shown. If you would like to always specify some combination of ``members``, ``protected-members``, ``private-members`` and ``undoc-members`` then you can use the :ref:`breathe_default_members ` configuration variable to set it in the ``conf.py``. The output includes references to any base classes and derived classes of the specified class. Basic Example ------------- .. cpp:namespace:: @ex_class_basic This displays the class documentation without any members: .. code-block:: rst .. doxygenclass:: Nutshell :project: nutshell It produces this output: .. doxygenclass:: Nutshell :project: nutshell Template Specialisation Example ------------------------------- .. cpp:namespace:: @ex_class_template_spec You can reference class template specialisations by include the specialisation in the name: .. code-block:: rst .. doxygenclass:: TemplateClass< T * > :project: template_specialisation Produces this output: .. doxygenclass:: TemplateClass< T * > :project: template_specialisation Where as without the specialisation, the directive references the generic declaration: .. code-block:: rst .. doxygenclass:: TemplateClass :project: template_specialisation Produces this output: .. doxygenclass:: TemplateClass :project: template_specialisation Note the spacing inside the ``<>``, it's important: there must be a space after the ``<`` and before the ``>``. Members Example --------------- .. cpp:namespace:: @ex_class_members This directive call will display the class documentation with all the public members: .. code-block:: rst .. doxygenclass:: Nutshell :project: nutshell :members: It produces this output: .. doxygenclass:: Nutshell :project: nutshell :members: :no-link: Specific Members Example ------------------------ .. cpp:namespace:: @ex_class_members_specific This displays the class documentation with only the members listed in the ``:members:`` option: .. code-block:: rst .. doxygenclass:: Nutshell :project: nutshell :members: Tool, crack, isCracked It produces this output: .. doxygenclass:: Nutshell :project: nutshell :members: Tool, crack, isCracked :no-link: Protected Members ----------------- .. cpp:namespace:: @ex_class_members_protected This displays only the protected members of the class. Normally this is combined with the ``:members:`` option to show the public members as well. .. code-block:: rst .. doxygenclass:: GroupedClassTest :project: group :protected-members: It produces this output: .. doxygenclass:: GroupedClassTest :project: group :protected-members: Private Members --------------- .. cpp:namespace:: @ex_class_members_private This displays only the private members of the class. Normally this is combined with the ``:members:`` option to show the public members as well. .. code-block:: rst .. doxygenclass:: Nutshell :project: nutshell :private-members: It produces this output: .. doxygenclass:: Nutshell :project: nutshell :private-members: :no-link: Undocumented Members -------------------- .. cpp:namespace:: @ex_class_members_undocumented This displays the undocumented members of the class which are suppressed by default. Undocumented public members are only shown if the ``:members:`` option is also used. The same goes for the undocumented private members and the ``private-members`` option. .. code-block:: rst .. doxygenclass:: ClassTest :project: class :members: :private-members: :undoc-members: It produces this output: .. doxygenclass:: ClassTest :project: classtest :members: :private-members: :undoc-members: :no-link: .. note:: Undocumented classes are still not shown in the output due to an implementation issue. Please post an issue on github if you would like this resolved. .. _class-example-membergroups: Membergroups ------------ .. cpp:namespace:: @ex_class_membergroups This will show only members in the specified member group(s). .. code-block:: rst .. doxygenclass:: GroupedMembers :project: membergroups :members: :membergroups: myGroup It produces this output: .. doxygenclass:: GroupedMembers :project: membergroups :members: :membergroups: myGroup :no-link: Without ``:membergroups: myGroup`` it would produce: .. cpp:namespace:: @ex_class_membergroups_all .. doxygenclass:: GroupedMembers :project: membergroups :members: .. _class-example-membersonly: Members-only ------------ .. cpp:namespace:: @ex_class_members_only This will only show the members of a class, and not the class name, child classes or structs, or any information about the class. .. code-block:: rst .. doxygenclass:: ClassTest :project: class :members: :members-only: It produces this output: .. doxygenclass:: ClassTest :project: classtest :members: :members-only: :no-link: Without ``:members-only:`` it would produce: .. cpp:namespace:: @ex_class_members_all .. doxygenclass:: ClassTest :project: classtest :members: :no-link: .. note:: The members will be shown at the indentation normally reserver for class definitions. To prevent this, you may want to indent the block by indenting the ``.. doxygenclass`` directive. .. note:: In the ``readthedocs`` theme, the members will show up in the color scheme of the class definitions. If you would like them rendered as the other members, indent like above, create a ``_static/css/custom.css`` file containing .. code-block:: css /* render as functions not classes when indented (for :members-only:) */ html.writer-html4 .rst-content blockquote dl:not(.field-list)>dt, html.writer-html5 .rst-content blockquote dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt { margin-bottom: 6px; border: none; border-left: 3px solid #ccc; background: #f0f0f0; color: #555; } and add the following to your ``conf.py`` .. code-block:: python html_static_path = ['_static'] html_css_files = ['css/custom.css'] Outline Example --------------- .. cpp:namespace:: @ex_class_outline This displays only the names of the class members and not their documentation. The ``:members:`` and ``:private-members:`` options determine which members are displayed. .. code-block:: rst .. doxygenclass:: Nutshell :project: nutshell :members: :outline: It produces this output: .. doxygenclass:: Nutshell :project: nutshell :members: :outline: :no-link: Qt Signals & Slots Example -------------------------- .. cpp:namespace:: @ex_class_qt Doxygen is aware of Qt Signals and Slots and so Breathe can pick them up and display them in the output. They are displayed in appropriate ``Signals``, ``Public Slots``, ``Protected Slots`` and ``Private Slots`` sections. .. code-block:: rst .. doxygenclass:: QtSignalSlotExample :project: qtsignalsandslots :members: Produces the following output: .. doxygenclass:: QtSignalSlotExample :project: qtsignalsandslots :members: Failing Example --------------- .. cpp:namespace:: @ex_class_failing This intentionally fails: .. code-block:: rst .. doxygenclass:: made_up_class :project: class :members: It produces the following warning message: .. warning:: doxygenclass: Cannot find class “made_up_class” in doxygen xml output for project “class” from directory: ../../examples/doxygen/class/xml/ breathe-doc-breathe-10a36f3/documentation/source/code/000077500000000000000000000000001475641424700227255ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/documentation/source/code/groups.h000066400000000000000000000013701475641424700244160ustar00rootroot00000000000000// Example from Doxygen documentation /** A class. More details about the Test class */ class UserDefinedGroupTest { public: //@{ /** Same documentation for both members. Details */ void func1InGroup1(); void func2InGroup1(); //@} /** Function without group. Details. */ void ungroupedFunction(); void func1InCustomGroup(); protected: void func2InCustomGroup(); }; void UserDefinedGroupTest::func1InGroup1() {} void UserDefinedGroupTest::func2InGroup1() {} /** @name Custom Group * Description of custom group */ //@{ /** Function 2 in custom group. Details. */ void UserDefinedGroupTest::func2InCustomGroup() {} /** Function 1 in custom group. Details. */ void UserDefinedGroupTest::func1InCustomGroup() {} //@} breathe-doc-breathe-10a36f3/documentation/source/code/namespaces.h000066400000000000000000000004031475641424700252120ustar00rootroot00000000000000 /*! A namespace for nothing. */ namespace test_namespace { /*! A very important class. */ class Sample1 { public: Sample1() {} }; /*! Even more important class */ class Sample2 { Sample2() {} }; /*! A function in the namespace */ void foo() {} } breathe-doc-breathe-10a36f3/documentation/source/code/nested_list_1.h000066400000000000000000000006441475641424700256370ustar00rootroot00000000000000/** * \file nested_list_1.h * Example of nested lists in documentation. */ /** * A list of events: * - mouse events * -# mouse move event * -# mouse click event\n * More info about the click event. * -# mouse double click event * - keyboard events * 1. key down event * 2. key up event * * More text here. */ class NestedLists_1 { }; breathe-doc-breathe-10a36f3/documentation/source/code/nested_list_2.h000066400000000000000000000010511475641424700256310ustar00rootroot00000000000000/** * \file nested_list_2.h * Example of nested list in documentation. */ /** * Text before the list * - list item 1 * - sub item 1 * - sub sub item 1 * - sub sub item 2 * . * The dot above ends the sub sub item list. * * More text for the first sub item * . * The dot above ends the first sub item. * * More text for the first list item * - sub item 2 * - sub item 3 * - list item 2 * . * More text in the same paragraph. * * More text in a new paragraph. */ class NestedLists_2 { }; breathe-doc-breathe-10a36f3/documentation/source/code/nested_list_3.h000066400000000000000000000007311475641424700256360ustar00rootroot00000000000000/** * \file nested_list_3.h * Example of nested lists in documentation. */ /*! * A list of events: *
    *
  • mouse events *
      *
    1. mouse move event *
    2. mouse click event
      * More info about the click event. *
    3. mouse double click event *
    *
  • keyboard events *
      *
    1. key down event *
    2. key up event *
    *
* More text here. */ class NestedLists_3 { }; breathe-doc-breathe-10a36f3/documentation/source/code/nested_list_4.h000066400000000000000000000010751475641424700256410ustar00rootroot00000000000000/** * \file nested_list_4.h * Example of nested lists in documentation. */ /** * A list of events: * 1. mouse events * -# mouse move event * 1. swipe event * 2. circle event * 3. wave event * -# mouse click event\n * More info about the click event. * -# mouse double click event * 2. keyboard events * -# key down event * -# key up event * 3. touch events * -# pinch event * -# swipe event * More text here. */ class NestedLists_4 { }; breathe-doc-breathe-10a36f3/documentation/source/code/nested_list_5.h000066400000000000000000000012071475641424700256370ustar00rootroot00000000000000/** * \file nested_list_4.h * Example of nested lists in documentation. */ /** * A deeply nested list of events: * 1. mouse events * -# mouse move event * 1. swipe event * -# swipe left * -# swipe right * 2. circle event * 3. wave event * -# mouse click event\n * More info about the click event. * -# mouse double click event * 2. keyboard events * -# key down event * -# key up event * 3. touch events * -# pinch event * -# swipe event * More text here. */ class NestedLists_5 { }; breathe-doc-breathe-10a36f3/documentation/source/code/nutshell.h000066400000000000000000000015031475641424700247330ustar00rootroot00000000000000/** \file nutshell.h An overly extended example of how to use breathe */ /*! With a little bit of a elaboration, should you feel it necessary. */ class Nutshell { public: //! Our tool set /*! The various tools we can opt to use to crack this particular nut */ enum Tool { kHammer = 0, //!< What? It does the job kNutCrackers, //!< Boring kNinjaThrowingStars //!< Stealthy }; //! Nutshell constructor Nutshell(); //! Nutshell destructor ~Nutshell(); /*! Crack that shell with specified tool \param tool - the tool with which to crack the nut */ void crack( Tool tool ); /*! \return Whether or not the nut is cracked */ bool isCracked(); private: //! Our cracked state bool m_isCracked; }; breathe-doc-breathe-10a36f3/documentation/source/codeblocks.rst000066400000000000000000000071101475641424700246540ustar00rootroot00000000000000 Code Blocks =========== Breathe supports rendering code blocks with syntax highlighting provided by the `Pygments `_ library. By default, Breathe will assume that code blocks match the language of the source file, but you can also specify the language of the code blocks using `Doxygen's code command `_ or `MarkDown's fenced code blocks `_. .. note:: Any hyperlinked text found within the code blocks rendered with Doxygen's HTML output will not be hyperlinked in any Sphinx output due to the use of the Pygments library. As a benefit, a code-block's syntax highlighting can be any syntax supported by Pygments (which is much more than only the languages supported by Doxygen's parsers). The Doxygen syntax for code blocks supports specifying the language as follows: .. code-block:: \code{.py} class Python: pass \endcode @code{.cpp} class Cpp {}; @endcode This technique can also be utilized from MarkDown syntax/files .. code-block:: markdown ```py class Python: pass ``` ```cpp class Cpp {}; ``` Breathe will pass the language specified to Pygments to get accurate highlighting. If no language is explicitly provided (either from ``\code`` command or via Doxygen's XML output about the language documented), then Pygments will try to guess what syntax the code block is using (based on the code block's contents). Examples -------- The following should render with standard C/C++ highlighting. Notice, the syntax is automatically highlighted as C++ because the documented function exists in a C++ source file. ---- .. code-block:: cpp /** A function with an unannotated code block with C/C++ code. * * @code * char *buffer = new char[42]; * int charsAdded = sprintf(buffer, "Tabs are normally %d spaces\n", 8); * @endcode */ void with_standard_code_block(); ---- .. doxygenfunction:: with_standard_code_block :path: ../../examples/specific/code_blocks/xml :no-link: ---- The following should render with no detected highlighting. Notice, there is no syntax highlighting because Pygments does not recognize the code block's contained syntax as a C++ snippet. ---- .. code-block:: cpp /** A function with an unannotated code block with non-C/C++ code. * * @code * set(user_list A B C) * foreach(element ${user_list}) * message(STATUS "Element is ${element}") * endforeach() * @endcode * * Another code-block that explicitly remains not highlighted. * @code{.unparsed} * Show this as is. * @endcode */ void with_unannotated_cmake_code_block(); ---- .. doxygenfunction:: with_unannotated_cmake_code_block :path: ../../examples/specific/code_blocks/xml :no-link: ---- The following should render with specified CMake highlighting. Here, the syntax highlighting is explicitly recognized as a CMake script snippet which overrides the inherent C++ context. ---- .. code-block:: cpp /** A function with an annotated cmake code block. * * @code{.cmake} * set(user_list A B C) * foreach(element ${user_list}) * message(STATUS "Element is ${element}") * endforeach() * @endcode */ void with_annotated_cmake_code_block(); ---- .. doxygenfunction:: with_annotated_cmake_code_block :path: ../../examples/specific/code_blocks/xml :no-link: .. warning:: Pygments will raise a warning in the Sphinx build logs if the specified syntax does conform the specified syntax's convention(s). breathe-doc-breathe-10a36f3/documentation/source/codeguide.rst000066400000000000000000000430051475641424700244770ustar00rootroot00000000000000 .. _codeguide: How It Works ============ There are three main sections to Breathe: parser, finders and renderers. Briefly: **parser** Responsible for reading the doxygen xml output and creating objects representing the data. Found in ``breathe.parser``. **finders** Responsible for finding reference objects within the output from the parser. Found in ``breathe.finder``. **renderers** Responsible for producing reStructuredText nodes to represent the objects that the finders have found. The renderers generally descend through the object hierarchies rendering the objects, their children, their children's children and so on. Found in ``breathe.renderer``. The following flow chart shows how the different components of Breathe transform data. The shaded region indicates which components are part of Breathe. .. image:: ../assets/BreatheFlowChart.svg :width: 500 :alt: A flow chart showing that the initial input format is code. Doxgyen converts code to XML. The Breathe parser converts XML to a hierarchy of python objects. The Breathe Filter identifies which of these objects need to be rendered. The Breathe Renderer converts these objects into reStructuredText (RST) nodes. Finally, the RST node objects are passed to Sphinx to be turned into actual HTML or LaTeX documents. :class: only-light :align: center .. image:: ../assets/BreatheFlowChart_DarkMode.svg :width: 500 :alt: A flow chart showing that the initial input format is code. Doxgyen converts code to XML. The Breathe parser converts XML to a hierarchy of python objects. The Breathe Filter identifies which of these objects need to be rendered. The Breathe Renderer converts these objects into reStructuredText (RST) nodes. Finally, the RST node objects are passed to Sphinx to be turned into actual HTML or LaTeX documents. :class: only-dark :align: center Parser ------ The parser's job is to parse the doxygen xml output and create a hierarchy of Python objects to represent the xml data. Doxygen XML Output ~~~~~~~~~~~~~~~~~~ The xml output from doxygen comes in multiple files. There is always an ``index.xml`` file which is a central reference point and contains a list of all the other files that have been generated by doxygen and an indication of what they contain. For example, in ``examples/doxygen/func/xml`` directory, the ``index.xml`` file contains: .. code-block:: xml Test member func.h This suggests there is additional information about a class called **Test** which has a function called **member**. Additionally there is some more information about a file called **func.h**. Now, the ``refid`` attribute on the ``compound`` xml nodes gives an indication of where the additional information can be found. So for the **Test** class, we should look in ``class_test.xml``, which we get by simply appending ``.xml`` to the ``refid`` value, and for the **func.h** file we should look in ``func_8h.xml``. So the ``index.xml`` file is unique in its role and has its own structure which is defined in the ``index.xsd`` file which you will also find in the same directory. All the other files, the ones referenced by the ``index.xml`` file, follow another structure. This is described in ``compound.xsd`` file so we call these other files **compound** files. These are generally longer than the ``index.xml`` file and contain all the specific information you might expect from doxygen, including any documentation you added to your code as doxygen markup. Have a look at ``examples/doxygen/func/xml/class_test.xml`` for a fairly short example. Doing the Parsing ~~~~~~~~~~~~~~~~~ To get things up and running quickly, I have used the `generateDS `_ project to help create classes to parse the doxygen xml output. The script automatically creates the ``compound.py``, ``compoundsuper.py``, ``index.py`` and ``indexsuper.py`` files that you can see inside ``breathe/parser/doxygen``. So what is the difference between ``index.py`` and ``indexsuper.py``, and ``compound.py`` and ``compoundsuper.py``? These files allow us to separate the bulk of the automatically generated code from the code changes we might want to make. There are a large number of classes in the ``...super.py`` files and each one has a basic derived class in the corresponding non-super files. It is designed so that all the hard work done by the generated code is done in the ``...super.py`` files and if we need to make changes we can do them in the derived classes in the non-super files and if we ever need to regenerate the code, we only regenerate the ``...super.py`` files and so we don't lose our changes in the process. The end result is that for the parsing, we have written relatively little code, but have a large amount automatically generated for us. This has only been done once and it seems relatively unlikely that we'll do it again. The entry points to the parsing code is the ``parse`` functions at the bottom of the ``breathe.parser.doxygen.compound`` and ``breathe.parser.doxygen.index``. I have never really examined the details of the parsing but you can see that there is a class for each node type you are likely to find in the xml files. I say "node type" instead of just "node" because different nodes can share the same type and there is one class per type. For example, there are **detaileddescription** nodes and **briefdescription** nodes which are both of type **descriptionType**. If we look in ``breathe.parser.doxygen.compoundsuper`` we see a **descriptionType** class and in ``breathe.parser.doxygen.compound`` we see a **descriptionTypeSub** class which is derived from **descriptionType**. Our Changes ~~~~~~~~~~~ You'll notice there are some classes in the non-super files that have some additional code in them. This tends to be adjusting the ``buildChildren`` member function in the derived class to extend or override the one in the automatically generated base class. We have to do this sometimes as it seems the original code we generated with ``generateDS`` fails to construct the children of some classes. The ``generateDS`` scripts uses the descriptions in the ``.xsd`` files to determine what classes to generate and what nodes can be the children of other nodes. It is possible that the doxygen ``.xsd`` files contain levels of abstraction that the ``generateDS`` project did not cope with at the time I used it. It is possible that newer versions would handle it better but for the moment I'm content updating the derived classes to handle the cases I see missing. Finders ------- The finder classes have a relatively small but important job of finding objects in the hierarchy generated by the parsers. For example, when a user specifies a particular class for the :ref:`doxygenclass directive `, we use the finder classes to go and find the object corresponding to that class. In fact, if you look closely, it is the finders that use the parser entry points to parse the xml and then find the objects. The finders also use ``Filter`` objects to actually figure out if they have found what they are looking for. The finder is given a hierarchy of filter objects which are designed to match at different levels of the XML hierarchy. Filters can also represent logical conditions such as 'and' and 'or'. More Details, Please ~~~~~~~~~~~~~~~~~~~~ So initially, we create a finder to look at the root of the hierarchy: the **doxygenTypeSub** node. That finder, handily called **DoxygenTypeSubItemFinder** (you'll notice a lot of that) looks through all the child compound nodes of the **doxygenTypeSub** node and tries a compound-level match against each of them and if something matches it creates a **CompoundTypeSubItemFinder** to look further. In turn, that checks each of its member child nodes with a member-level match and if it finds one it creates a **MemberTypeSubItemFinder** (see the pattern?) and that does another check. The interesting part is, if that is successful, the **CompoundTypeSubItemFinder** finds the corresponding xml file that has more information in it (remember ``refid + .xml``?) and parses that and creates another finder to start looking in there. This time it is a **DoxygenTypeSubItemFinder** from the ``breathe.finder.doxygen.compound`` module. And the search goes on until we find an object to return for rendering. If the **CompoundTypeSubItemFinder** fails to find any deeper levels to match against then it returns itself as it must be the target we're interested in. As stated, the job of the finder is to find a single node for the renderers to starting rendering to reStructuredText. That is all the finder does. Renderers --------- Finally, the bit that really does something we care about. Rendering is the art of turning whatever object we've found in the hierarchy into reStructuredText nodes. This almost invariably means most of its children as well. Much like with the finder classes, we start off creating a renderer for a particular parser object and then it looks at its children and uses the renderer factory to create appropriate renderers for those objects and tells them to render and they look at their object's children and create appropriate renderers for those and so on and so forth. The node we start at is determined by the finder and ultimately by the user. The whole process is kicked off by the ``Builder`` class, though it doesn't really do much. The aim of the renderers is to return a list of reStructuredText nodes which is passed back to Sphinx to render into whatever you're final output format is. There are two complicated bits here. All the different renderers and all the different reStructuredText nodes. Different Renderers ~~~~~~~~~~~~~~~~~~~ Just like with the parsers, there is one renderer per node type. In fact there is one renderer class per parser class and they are named almost the same and are designed to match up. The renderers look at the data on the instance of the corresponding parser class that they have been given and grab the interesting bits and return reStructuredText nodes. For reference on what there is to render, you can look at the parser class definitions or at the raw xml to see what attributes there are to render. Sometimes if something isn't appearing in the final output, it is because the renderer isn't returning an reStructuredText representation of it so the rendering code needs to be updated, and sometimes it is because the parser classes are not picking it up properly so both the parser and the renderer code needs to be updated. Given a little bit of time, you get used to chasing through the xml nodes, the parser classes and the corresponding renderers to figure out where all the information is ending up. reStructuredText Nodes ~~~~~~~~~~~~~~~~~~~~~~ We use the reStructuredText API as provided by the fabulous docutils project and extended by Sphinx itself. For the most part, they are fairly straight forward and they are certainly well named. Unfortunately there are a lot of nodes and only certain ways of combining them. It is also not always clear what arguments their constructs take. Whilst I'm sure it would be possible to figure it out with time and the appropriate source code, the use of them is not something I've found very well documented and my code largely operates on a basis of trial and error. One day I'm sure I'll be enlightened, until then expect fairly naive code. Testing ------- Tests for Breathe can be found in the ``tests`` directory. They can be run by running ``make test`` in your terminal (assuming that you have pytest installed). The bulk of Breathe's test suite is in ``tests/test_renderer.py``, and this is where any renderer-related tests should be added. This documentation will focus on how to write more renderer tests, as this is the most common region of the code to add new features to and perhaps the hardest to test. Creating Python Doxygen Nodes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ As indicated in the diagram at the top of this page, the renderer is expecting to be run after the parser has created a hierarchy of python objects. Thus, there is a lot of set-up that would usually happen before the renderer is invoked. For ease of testing, it is often expedient to skip straight to the step where you have a hierarchy of Python objects representing some hypothetical XML that doxygen could have produced. ``test_renderer.py`` contains a number of classes designed to assist with this process. For just about any node that could show up in the XML produced by doxygen, there is a class that quickly instantiates it in Python. For example, if you want to test the rendering of a member definition, you can use the ``WrappedMemebrDef`` class. Figuring out how nodes fit together can be challenging; until you're comfortable with the type of XML produced by doxygen, the easiest process is likely: #. Write C++ code containing the behavior you would like to test. #. Run Doxygen on it, which will produce an XML file (likely inside a directory called xml within your doxygen output directory) #. Re-build the relevant part of the xml file in Python using the ``Wrapped*`` classes. For example, lets say you have a struct representing a cat. Your C++ might look something like this (inspired by Sy Brand's `blog post `_): .. code-block:: cpp /** A fluffy feline */ struct cat { /** Make this cat look super cute */ void make_cute(); }; Running Doxygen on this might give you XML something like this: .. code-block:: xml cat test_cpp.hpp void void cat::make_cute () make_cute cat::make_cute Make this cat look super cute A fluffy feline catmake_cute There's a lot here. For now, let's just say we're testing something related to member function definitions, and we only need to test that part of the hierarchy. We can load the ``memberdef`` part of this XML into a ``WrappedMemberDef`` object as follows: .. code-block:: python member_def = WrappedMemberDef( kind="function", # From "kind" in open memberdef tag definition="void cat::make_cute", # From tag type="void", # From tag name="make_cute", # From tag argstring="()", # From tag virt="non-virtual", # From "virt" in open memberdef tag ) As you can see, all of the arguments to the constructor are pulled directly out of the XML, either from options on the original memberdef or tags nested under it. There are a lot more optional arguments that can be provided to specify additional details of the memberdef. More advanced hierarchies can be represented by nesting nodes inside each other. For example, if our function took arguments, it would have ```` tags nested within it. We could represent these as a list of ``WrappedParam`` objects passed into the ``param`` keyword argument. To test that the node renders correctly, you can use the ``render`` function provided in ``test_renderer.py``: .. code-block:: python # Render the node and grab its description signature = find_node(render(app, member_def), "desc_signature") # You can now examine the contents of signature.astext() and assert that # they are as expected Mocks ~~~~~ If you want to do more elaborate tests, it is useful to be aware of the various Mock objects provided in ``test_renderer.py``. Because the renderer is expecting to be executing in the context of a full Sphinx run, there are a lot of objects that it is expecting to have access to. For example, rendering some nodes requires making reference to a context object. The ``MockContext`` class can serve as a stand-in.breathe-doc-breathe-10a36f3/documentation/source/concept.rst000066400000000000000000000013341475641424700242010ustar00rootroot00000000000000 .. _concept-example: doxygenconcept Directive Example ================================ .. warning:: C++20 Concepts support was added in Doxygen v1.9.2. Please be sure to use Doxygen v1.9.2 or newer with :ref:`doxygenconcept`. Working Example --------------- This should work: .. code-block:: rst .. doxygenconcept:: Hashable :project: cpp_concept It produces this output: .. doxygenconcept:: Hashable :project: cpp_concept Failing Example --------------- This intentionally fails: .. code-block:: rst .. doxygenconcept:: MadeUpConcept :project: cpp_concept It produces the following warning message: .. warning:: doxygenconcept: Cannot find concept "MadeUpConcept" in doxygen xml output breathe-doc-breathe-10a36f3/documentation/source/conf.py000066400000000000000000000165571475641424700233300ustar00rootroot00000000000000from __future__ import annotations import os import re import subprocess import sys from pathlib import Path from typing import TYPE_CHECKING import sphinx if TYPE_CHECKING: from sphinx.application import Sphinx from sphinx.util.typing import ExtensionMetadata PROJECT_ROOT = Path(__file__).resolve().parent.parent.parent sys.path.append(str(PROJECT_ROOT)) # General configuration # --------------------- extensions = [ "breathe", "sphinx.ext.graphviz", "sphinx_copybutton", "sphinxcontrib.spelling", ] master_doc = "index" project = "Breathe" copyright = "2009-2025, Michael Jones" if os.getenv("BREATHE_COMPARE") == "True": # If we're doing a comparison then set the version & release to 'compare' # so that they are always the same otherwise they can come up as changes # when we really don't care if they are different. version = release = "compare" else: # Get a description of the current position. git_tag = subprocess.run(["git", "describe", "--tags"], capture_output=True, encoding="utf-8") if re.match(r"^v\d+\.\d+\.\d+$", git_tag.stdout): # Check if it matches a pure tag number vX.Y.Z, # rather than vX.Y.Z-91-g8676988, which is how non-tagged commits # are described (relative to the last tag). version = release = git_tag.stdout else: version = release = "latest" # Options for breathe extension # ----------------------------- breathe_projects = { "class": "../../examples/doxygen/class/xml/", "classtest": "../../examples/specific/class/xml/", "struct": "../../examples/specific/struct/xml/", "interface": "../../examples/specific/interface/xml/", "decl_impl": "../../examples/specific/decl_impl/xml/", "structcmd": "../../examples/doxygen/structcmd/xml/", "tinyxml": "../../examples/tinyxml/tinyxml/xml/", "restypedef": "../../examples/doxygen/restypedef/xml/", "nutshell": "../../examples/specific/nutshell/xml/", "rst": "../../examples/specific/rst/xml/", "c_file": "../../examples/specific/c_file/xml/", "namespace": "../../examples/specific/namespacefile/xml/", "userdefined": "../../examples/specific/userdefined/xml/", "template_function": "../../examples/specific/template_function/xml/", "template_class": "../../examples/specific/template_class/xml/", "template_class_non_type": "../../examples/specific/template_class_non_type/xml/", "template_specialisation": "../../examples/specific/template_specialisation/xml/", "latexmath": "../../examples/specific/latexmath/xml/", "functionOverload": "../../examples/specific/functionOverload/xml/", "programlisting": "../../examples/specific/programlisting/xml/", "image": "../../examples/specific/image/xml/", "lists": "../../examples/specific/lists/xml/", "tables": "../../examples/specific/tables/xml/", "group": "../../examples/specific/group/xml/", "union": "../../examples/specific/union/xml/", "qtsignalsandslots": "../../examples/specific/qtsignalsandslots/xml/", "array": "../../examples/specific/array/xml/", "c_struct": "../../examples/specific/c_struct/xml/", "c_enum": "../../examples/specific/c_enum/xml/", "c_typedef": "../../examples/specific/c_typedef/xml/", "c_macro": "../../examples/specific/c_macro/xml/", "c_union": "../../examples/specific/c_union/xml/", "define": "../../examples/specific/define/xml/", "multifile": "../../examples/specific/multifilexml/xml/", "cpp_anon": "../../examples/specific/cpp_anon/xml/", "cpp_concept": "../../examples/specific/cpp_concept/xml/", "cpp_enum": "../../examples/specific/cpp_enum/xml/", "cpp_union": "../../examples/specific/cpp_union/xml/", "cpp_function": "../../examples/specific/cpp_function/xml/", "cpp_function_lookup": "../../examples/specific/cpp_function_lookup/xml/", "cpp_friendclass": "../../examples/specific/cpp_friendclass/xml/", "cpp_inherited_members": "../../examples/specific/cpp_inherited_members/xml/", "cpp_ns_template_specialization": "../../examples/specific/cpp_ns_template_specialization/xml/", "cpp_trailing_return_type": "../../examples/specific/cpp_trailing_return_type/xml/", "cpp_constexpr_hax": "../../examples/specific/cpp_constexpr_hax/xml/", "xrefsect": "../../examples/specific/xrefsect/xml/", "membergroups": "../../examples/specific/membergroups/xml/", "simplesect": "../../examples/specific/simplesect/xml/", "dot_graphs": "../../examples/specific/dot_graphs/xml/", } breathe_projects_source = { "auto": ("../../examples/specific", ["auto_function.h", "auto_class.h"]), } breathe_default_project = "tinyxml" breathe_domain_by_extension = { "h": "cpp", "py": "py", } breathe_domain_by_file_pattern = { "class.h": "cpp", "alias.h": "c", "array.h": "c", "c_*.h": "c", } breathe_use_project_refids = True # Options for HTML output # ----------------------- html_theme = "furo" html_logo = "_static/logo.svg" html_favicon = "_static/favicon.ico" html_static_path = ["_static"] html_css_files = ["breathe.css"] # Options for the spelling extension # ---------------------------------- spelling_word_list_filename = "spelling_wordlist.txt" spelling_lang = "en_US" # Extension interface # ------------------- try: doxygen_test = subprocess.check_output(["doxygen", "--version"], encoding="utf-8") except subprocess.CalledProcessError as err: msg = f"doxygen --version reported an error: {err.stderr}" raise RuntimeError(msg) from err else: print(f"Using Doxygen v{doxygen_test}") del doxygen_test if os.getenv("READTHEDOCS") == "True": if version == "latest": tags.add("documentation_build_readthedocs_latest") # NoQA: F821 else: tags.add("documentation_build_readthedocs") # NoQA: F821 else: tags.add("documentation_build_development") # NoQA: F821 def run_doxygen(folder: Path) -> None: """Run the doxygen make command in the designated folder""" try: subprocess.run(["make", "DOXYGEN=doxygen"], check=True, cwd=folder) except subprocess.CalledProcessError as e: print(f"doxygen terminated by signal {-e.returncode}", file=sys.stderr) except OSError as e: print(f"doxygen execution failed: {e}", file=sys.stderr) def generate_doxygen_xml(app: Sphinx) -> None: """Run the doxygen make commands if we're on the ReadTheDocs server""" if os.getenv("READTHEDOCS") == "True": # Attempt to build the doxygen files on the RTD server. # Explicitly override the path/name used for executing doxygen # to simply be 'doxygen' to stop the makefiles looking for the executable. # This is because the `which doxygen` effort seemed to fail # when tested on the RTD server. run_doxygen(PROJECT_ROOT / "examples" / "doxygen") run_doxygen(PROJECT_ROOT / "examples" / "specific") run_doxygen(PROJECT_ROOT / "examples" / "tinyxml") def setup(app) -> ExtensionMetadata: if sphinx.version_info[:2] < (7, 4): # Approach borrowed from the Sphinx docs app.add_object_type( "confval", "confval", objname="configuration value", indextemplate="pair: %s; configuration value", ) # Add hook for building doxygen xml when needed app.connect("builder-inited", generate_doxygen_xml) return { "version": version, "parallel_read_safe": True, "parallel_write_safe": True, } breathe-doc-breathe-10a36f3/documentation/source/contributing.rst000066400000000000000000000034551475641424700252630ustar00rootroot00000000000000 Contributing to Breathe ======================= There are four main ways you might consider contributing to Breathe. Give It A Go ------------ **...and let me know!** Firstly, the more people using it the better, but more than that, hearing about the project being put to use is a great motivator for the developer, namely me. Report Bugs & Suggest Features ------------------------------ Embarrassingly I don't get to use Breathe that much in my general work, so it doesn't really get pushed beyond the test code we have here in the repository. If you use it and find issues with it, minor or major, please let me know and if possible provide some detail so I can reproduce it. With the help of those who have posted issues on the github issue tracker we've managed to track down and improve some of the less obvious (and some more obvious!) parts of Breathe that weren't working properly. Improve the Documentation ------------------------- I've made an effort to document Breathe so it is usable, but I have a twisted perspective on the whole thing as I made it. I've already had some help with the documentation, which was greatly appreciated, but if you managed to get it working and find that the documentation could have been clearer in parts, let me know or write up a paragraph or two that would have helped you when you were trying it. Fork It! And Improve the Code ----------------------------- If you find a bug, quite like Python and have some time, then grab a copy of the code and have a go at fixing it. Nothing motivates me quite like other people caring enough to put a bit of time into working on it. The contributions we've had this way have been great and much appreciated. If you want to help out, take a look at the :ref:`code guide` to see how it is all structured and works. breathe-doc-breathe-10a36f3/documentation/source/credits.rst000066400000000000000000000027661475641424700242150ustar00rootroot00000000000000 Credits ======= Thank you to: - `nijel `_ - `sebastianschaetz `_ - `mbolivar `_ - `queezythegreat `_ - `abingham `_ - `davidm `_ - `hobu `_ - `magro11 `_ - `scopatz `_ - `vitaut `_ - `vonj `_ - `jmnas `_ - `donkopotamus `_ - `jo3w4rd `_ - `Anthony Truchet `_ - `Daniel Matz `_ - `Andrew Hundt `_ - `sebastinas `_ - `robo9k `_ - `sieben `_ - `rweickelt `_ - `sam-roth `_ - `bnewbold `_ - `serge-sans-paille `_ For their contributions; reporting bugs, suggesting features, improving the code and working on the documentation. And thanks to: - Dimitri van Heesch for `Doxygen `_. - Georg Brandl for `Sphinx `_. - David Goodger for `Docutils `_ and reStructuredText. And thank you to whoever made the ``haiku`` theme for Sphinx. breathe-doc-breathe-10a36f3/documentation/source/customcss.rst000066400000000000000000000012101475641424700245620ustar00rootroot00000000000000 .. highlight:: css Custom CSS ========== In order to help with the output styling in HTML, Breathe attaches some custom classes to parts of the document. There are three such classes: **breatheparameterlist** Used to keep the description of a parameter displayed inline with the parameter name. The Breathe docs use: .. code-block:: css .breatheparameterlist li tt + p { display: inline; } **breatheenumvalues** Used to keep the description of an enum displayed inline with the enum name. The Breathe docs use: .. code-block:: css .breatheenumvalues li tt + p { display: inline; } breathe-doc-breathe-10a36f3/documentation/source/define.rst000066400000000000000000000012231475641424700237750ustar00rootroot00000000000000 .. _define-example: doxygendefine Directive Example =============================== Working Example --------------- This should work: .. code-block:: rst .. doxygendefine:: WRITE_TREE_MISSING_OK :project: c_file It produces this output: .. doxygendefine:: WRITE_TREE_MISSING_OK :project: c_file Failing Example --------------- This intentionally fails: .. code-block:: rst .. doxygendefine:: MADEUPDEFINE :project: define It produces the following warning message: .. warning:: doxygendefine: Cannot find define "MADEUPDEFINE" in doxygen xml output for project "define" in directory: ../../examples/specific/define/xml breathe-doc-breathe-10a36f3/documentation/source/differences.rst000066400000000000000000000017631475641424700250310ustar00rootroot00000000000000 Deviations from Doxygen & Autodoc ================================= As Breathe attempts to bridge the gap between Sphinx and Doxygen it is confined by both what Doxygen outputs in its XML and what Sphinx will accept through the Docutils document model. This leads to a few differences between Breathe output and the Doxygen HTML output and the Sphinx Autodoc output. These are incomplete lists but we're keen to expand them as issues are brought to our attention. Doxygen ------- - Doxygen allows both HTML and Markdown syntax for headings in comments. These are rendered as standard HTML headings in the output (h1, h2, h3, etc.) RestructuredText only allows headings at the start of document sections and you cannot put arbitrary sections into the output to gain the appearance of headings so any headings found in the doxygen comments are rendered as emphasized text in the Breathe HTML output. Sphinx Autodoc -------------- - No differences highlighted yet, though they certainly exist. breathe-doc-breathe-10a36f3/documentation/source/directives.rst000066400000000000000000000462131475641424700247140ustar00rootroot00000000000000Directives & Config Variables ============================= .. toctree:: :hidden: autoindex function struct class namespace concept enum enumvalue typedef union define variable file group autofile page Directives ---------- The available directives are shown below. In each case the ``project``, ``path``, ``no-link`` and ``outline`` options have the following meaning: ``project`` Specifies which project, as defined in the ``breathe_projects`` config value, should be used for this directive. This overrides the default project if one has been specified. This is not used by the `autodoxygenindex`_ directive. Use ``source`` instead to specify the entry in the :confval:`breathe_projects_source` config value to use. ``path`` Directly specifies the path to the folder with the doxygen output. This overrides the project and default project if they have been specified. This is not used by the `autodoxygenindex`_ directive. Use ``source-path`` instead to specify the root path to the sources files which are to be processed. ``no-link`` Instructs Breathe to not attempt to generate any document targets for the content generated by this particular directive. This allows you to have your main reference listings somewhere with targets, but then to be able to sneak in repeat directives into other parts of the documentation to illustrate particular points without Sphinx getting confused what should be linked to by other references. ``outline`` Results in Breathe only outputting the raw code definitions without any additional description information. If neither project nor path are provided on the directive then breathe will expect the :ref:`breathe_default_project ` config value to be set. .. _doxygenclass: doxygenclass ~~~~~~~~~~~~ This directive generates the appropriate output for a single class. It takes the standard ``project``, ``path``, ``outline`` and ``no-link`` options and additionally the ``members``, ``protected-members``, ``private-members``, ``undoc-members``, ``membergroups`` and ``members-only`` options .. code-block:: rst .. doxygenclass:: :project: ... :path: ... :members: [...] :protected-members: :private-members: :undoc-members: :membergroups: ... :members-only: :outline: :no-link: :allow-dot-graphs: Checkout the :ref:`doxygenclass documentation ` for more details and to see it in action. .. _doxygendefine: doxygendefine ~~~~~~~~~~~~~ This directive generates the appropriate output for a single preprocessor define. It behaves the same as the `doxygenstruct`_ directive. .. code-block:: rst .. doxygendefine:: :project: ... :path: ... :outline: :no-link: Checkout the :ref:`example ` to see it in action. .. _doxygenconcept: doxygenconcept ~~~~~~~~~~~~~~ This directive generates the appropriate output for a single concept. It behaves the same as the `doxygenstruct`_ directive. .. code-block:: rst .. doxygenconcept:: :project: ... :path: ... :outline: :no-link: Checkout the :ref:`example ` to see it in action. .. _doxygenenum: doxygenenum ~~~~~~~~~~~ This directive generates the appropriate output for a single enum. It behaves the same as the `doxygenstruct`_ directive. .. code-block:: rst .. doxygenenum:: :project: ... :path: ... :outline: :no-link: Checkout the :ref:`example ` to see it in action. .. _doxygenenumvalue: doxygenenumvalue ~~~~~~~~~~~~~~~~ This directive generates the appropriate output for a single enum value. .. code-block:: rst .. doxygenenumvalue:: :project: ... :path: ... :outline: :no-link: Checkout the :ref:`example ` to see it in action. .. _doxygenfile: doxygenfile ~~~~~~~~~~~ This directive generates the appropriate output for the contents of a source file. .. code-block:: rst .. doxygenfile:: :project: ... :path: ... :outline: :no-link: :sections: ... :allow-dot-graphs: Checkout the :ref:`example ` to see it in action. .. _autodoxygenfile: autodoxygenfile ~~~~~~~~~~~~~~~ This directive is this ``auto`` version of the `doxygenfile`_ directive above. It handles the doxygen xml generation for you like the other auto directives. .. code-block:: rst .. autodoxygenfile:: :project: ... :outline: :no-link: :sections: ... :allow-dot-graphs: Checkout the :ref:`example ` to see it in action. .. _doxygenfunction: doxygenfunction ~~~~~~~~~~~~~~~ This directive generates the appropriate output for a single function. The function name is required to be unique in the project. .. code-block:: rst .. doxygenfunction:: :project: ... :path: ... :outline: :no-link: Checkout the :ref:`example ` to see it in action. .. _doxygengroup: doxygengroup ~~~~~~~~~~~~ This directive generates the appropriate output for the contents of a doxygen group. A doxygen group can be declared with specific doxygen markup in the source comments as covered in the `doxygen grouping documentation`_. It takes the standard ``project``, ``path``, ``outline`` and ``no-link`` options and additionally the ``content-only``, ``desc-only``, ``members``, ``protected-members``, ``private-members`` and ``undoc-members`` options. .. code-block:: rst .. doxygengroup:: :project: ... :path: ... :content-only: :desc-only: :outline: :members: :protected-members: :private-members: :undoc-members: :no-link: :inner: Checkout the :ref:`doxygengroup documentation ` for more details and to see it in action. .. _doxygen grouping documentation: https://www.doxygen.nl/manual/grouping.html .. _doxygenindex: doxygenindex ~~~~~~~~~~~~ This directive processes and produces output for everything described by the Doxygen xml output. It reads the ``index.xml`` file and process everything referenced by it. .. code-block:: rst .. doxygenindex:: :project: ... :path: ... :outline: :no-link: :allow-dot-graphs: .. _autodoxygenindex: autodoxygenindex ~~~~~~~~~~~~~~~~ This directive performs a similar role to the `doxygenindex`_ directive except that it handles the doxygen xml generation for you. It uses the :confval:`breathe_projects_source` configuration dictionary to judge which code source files should have doxygen xml generated for them. The ``project`` directive option associates the directive with a particular project in the :confval:`breathe_projects_source` dictionary. All the files references by the entry in the :confval:`breathe_projects_source` will be included in the output. In addition, any options specified in :confval:`breathe_doxygen_config_options` will be added to the generated Doxygen config file and any custom aliases specified in :confval:`breathe_doxygen_aliases` will be added to the `doxygen aliases `_. Thank you to `Scopatz `_ for the idea and initial implementation. .. code-block:: rst .. autodoxygenindex:: :project: ... :outline: :no-link: :allow-dot-graphs: Checkout the :ref:`example ` to see it in action. .. _doxygennamespace: doxygennamespace ~~~~~~~~~~~~~~~~ This directive generates the appropriate output for the contents of a namespace. It takes the standard ``project``, ``path``, ``outline`` and ``no-link`` options and additionally the ``content-only``, ``desc-only``, ``members``, ``protected-members``, ``private-members`` and ``undoc-members`` options. To reference a nested namespace, the full namespaced path must be provided, e.g. ``foo::bar`` for the ``bar`` namespace inside the ``foo`` namespace. .. code-block:: rst .. doxygennamespace:: :project: ... :path: ... :content-only: :desc-only: :outline: :members: :protected-members: :private-members: :undoc-members: :no-link: Checkout the :ref:`doxygennamespace documentation ` for more details and to see it in action. .. _doxygenstruct: doxygenstruct ~~~~~~~~~~~~~ This directive generates the appropriate output for a single struct. The struct name is required to be unique in the project. It takes the standard ``project``, ``path``, ``outline`` and ``no-link`` options and additionally the ``members``, ``protected-members``, ``private-members``, ``membergroups``, ``members-only`` and ``undoc-members`` options. .. code-block:: rst .. doxygenstruct:: :project: ... :path: ... :members: :protected-members: :private-members: :undoc-members: :membergroups: ... :members-only: :outline: :no-link: :allow-dot-graphs: Checkout the :ref:`example ` to see it in action. .. _doxygeninterface: doxygeninterface ~~~~~~~~~~~~~~~~ This directive generates the appropriate output for a single interface (specially-used class). It behaves the same as the `doxygenclass`_ directive. .. code-block:: rst .. doxygeninterface:: :project: ... :path: ... :members: :protected-members: :private-members: :undoc-members: :membergroups: ... :members-only: :outline: :no-link: .. _doxygentypedef: doxygentypedef ~~~~~~~~~~~~~~ This directive generates the appropriate output for a single typedef. It behaves the same as the doxygenstruct directive. .. code-block:: rst .. doxygentypedef:: :project: ... :path: ... :outline: :no-link: Checkout the :ref:`example ` to see it in action. .. _doxygenunion: doxygenunion ~~~~~~~~~~~~ This directive generates the appropriate output for a single union. It behaves the same as the doxygenstruct directive. .. code-block:: rst .. doxygenunion:: :project: ... :path: ... :outline: :no-link: Checkout the :ref:`example ` to see it in action. .. _doxygenvariable: doxygenvariable ~~~~~~~~~~~~~~~ This directive generates the appropriate output for a single variable. It behaves the same as the doxygenstruct directive. .. code-block:: rst .. doxygenvariable:: :project: ... :path: ... :outline: :no-link: Checkout the :ref:`example ` to see it in action. .. _doxygenpage: doxygenpage ~~~~~~~~~~~ This directive generates the appropriate output for the contents of a doxygen page. A doxygen page is created for each "key" of every \\xrefitem command used for markup in the source comments. For more information check the `doxygen xrefitem documentation`_. It takes the standard ``project`` and ``path`` options and additionally the ``content-only`` option. .. code-block:: rst .. doxygenpage:: :project: ... :path: ... :content-only: Checkout the :ref:`doxygenpage documentation ` for more details and to see it in action. .. _doxygen xrefitem documentation: https://www.doxygen.nl/manual/commands.html#cmdxrefitem Config Values ------------- .. confval:: breathe_projects This should be a dictionary in which the keys are project names and the values are paths to the folder containing the doxygen output for that project. .. _default_project: .. confval:: breathe_default_project This should match one of the keys in the :confval:`breathe_projects` dictionary and indicates which project should be used when the project is not specified on the directive. .. confval:: breathe_domain_by_extension Allows you to specify domains for particular files according to their extension. For example: .. code-block:: python breathe_domain_by_extension = { "h" : "cpp", } You can also use this to enable support for Doxygen XML generated from PHP code: .. code-block:: python breathe_domain_by_extension = { "php" : "php", } .. confval:: breathe_domain_by_file_pattern Allows you to specify domains for particular files by wildcard syntax. This is checked after :confval:`breathe_domain_by_extension` and so will override it when necessary. For example: .. code-block:: python breathe_domain_by_file_pattern = { "\*/alias.h" : "c", } If you wanted all ``.h`` header files to be treated as being in the **cpp** domain you might use the :confval:`breathe_domain_by_extension` example above. But if you had one ``.h`` file that should be treated as being in the **c** domain then you can override as above. .. confval:: breathe_projects_source A dictionary in which the keys are project names and the values are a tuple of the directory and a list of file names of the source code for those projects that you would like to be automatically processed with doxygen. If you have some files in: .. code-block:: text /some/long/path/to/myproject/file.c /some/long/path/to/myproject/subfolder/otherfile.c Then you can set: .. code-block:: python breathe_projects_source = { "myprojectsource" : ( "/some/long/path/to/myproject", ["file.c", "subfolder/otherfile.c"] ) } Then your `autodoxygenfile`_ usage can look like this: .. code-block:: rst .. autodoxygenfile:: file.c :project: myprojectsource The directory entry in the tuple can be an empty string if the entries in the list are full paths. .. confval:: breathe_build_directory In order to process the `autodoxygenindex`_ Breathe has to run ``doxygen`` to create the xml files for processing. This config value specifies the root directory that these files should be created in. By default, this is set to the parent directory of the ``doctrees`` output folder which is the normal build directory. You can change it with this setting if you have a custom set up. Breathe will take the final value and append ``breathe/doxygen/`` to the path to minimize conflicts. .. _breathe-default-members: .. confval:: breathe_default_members Provides the directive flags that should be applied to all directives which take ``:members:``, ``:private-members:`` and ``:undoc-members:`` options. By default, this is set to an empty list, which means no members are displayed. If you'd like to always display the public and public, undocumented members then you could set it like this: .. code-block:: python breathe_default_members = ('members', 'undoc-members') .. _breathe-implementation-filename-extensions: .. confval:: breathe_implementation_filename_extensions Provides a list of the filename extensions which are considered to be implementation files. These files are ignored when the `doxygenfunction`_ directive looks for un-namespaced function names. This is to avoid the issue where the same function name appears in the doxygen XML output for a header file and implementation file because the declaration is in one and the definition is in the other. Doxygen appends the documentation from the definition to the XML for the declaration so we don't miss any documentation information from the implementation files. The default value for this variable is: .. code-block:: python breathe_implementation_filename_extensions = ['.c', '.cc', '.cpp'] .. _breathe-doxygen-config-options: .. confval:: breathe_doxygen_config_options A dictionary in which the keys and values are the names and values of config options to be placed in the Doxygen config file generated by `autodoxygenindex`_. For instance, this: .. code-block:: python breathe_doxygen_config_options = {'EXCLUDE_SYMBOLS': 'abc123'} would place ``EXCLUDE_SYMBOLS=abc123`` in the config file. The default value is the empty dictionary. .. confval:: breathe_doxygen_aliases A dictionary in which the keys and values are the names and values of aliases to be placed in the Doxygen config file generated by `autodoxygenindex`_. For instance, this: .. code-block:: python breathe_doxygen_aliases = { 'rstref{1}': r'\verbatim embed:rst:inline :ref:`\1` \endverbatim' } would place the line:: ALIASES += rstref{1}="\verbatim embed:rst:inline :ref:`\1` \endverbatim" in the config file. The default value is an empty dictionary. Note the use of a raw string to ensure that backslashes are interpreted as literal characters. (This example alias enables linking to rst targets inline in doxygen comments using ``\rstref{}``) .. confval:: breathe_show_define_initializer A boolean flag which can be set to ``True`` to display the initializer of a define in the output. For example a define ``MAX_LENGTH 100`` would be shown with the value 100 if this is set to ``True``, and without if it is set to ``False``. .. confval:: breathe_show_enumvalue_initializer A boolean flag which can be set to ``True`` to display the initializer of an enum value in the output. For example an enum value ``TWO = 2`` would be shown with the value 2 if this is set to ``True``, and without if it is set to ``False``. .. confval:: breathe_show_include A boolean flag which can be set to ``False`` to hide the header in which each entity (struct, function, macro, etc.) is defined. For example, when set to ``True`` (the default) a ``struct Foo`` is rendered similarly to:: struct Foo #include Description of Foo. but when set to ``False`` it is instead rendered as:: struct Foo Description of Foo. .. confval:: breathe_use_project_refids True or False setting to control if the refids generated by breathe for doxygen elements contain the project name or not. Legacy (breathe 4.6.0 and earlier) behavior was that all refids are prefixed with the project name. This causes trouble when trying to link documentation between multiple projects since the projects can't see each other's documentation elements. The new default behavior is to not prefix the refids with the project name. This:: breathe_use_project_refids = True will restore the legacy behavior if it is needed. .. confval:: breathe_order_parameters_first True or False setting to control if the parameters section from doxygen generated documentation should be placed immediately after the brief and detailed description or at the end, after the returns, remarks and warnings section. Default value and also the legacy behavior is False. .. confval:: breathe_separate_member_pages True or False setting to control if the input XML generated by Doxygen had the Doxygen SEPARATE_MEMBER_PAGES option set to YES or NO. The Doxygen option defaults to NO which generates XML that allows Breathe to resolve all references. When set to YES the refid/id of elements get an extra element which Breathe tries to get rid of when this setting is True. breathe-doc-breathe-10a36f3/documentation/source/domains.rst000066400000000000000000000113641475641424700242040ustar00rootroot00000000000000 Domains ======= Breathe has some limited support for Sphinx domains. It tries to output targets that the Sphinx domain references expect. This should allow you to use Sphinx domain roles like ``:c:func:`foo``` to link to output from Breathe. Class Example ------------- .. cpp:namespace:: @ex_domains_class Given the following Breathe directives: .. code-block:: rst .. doxygenclass:: TestNamespaceClasses::NamespacedClassTest :path: ../../examples/specific/class/xml Which create formatted output like: .. doxygenclass:: TestNamespaceClasses::NamespacedClassTest :path: ../../examples/specific/class/xml We can refer to **NamespacedClassTest** using: .. code-block:: rst :cpp:class:`TestNamespaceClasses::NamespacedClassTest` which renders as :cpp:class:`TestNamespaceClasses::NamespacedClassTest`, or using: .. code-block:: rst :cpp:class:`another reference ` which renders as: :cpp:class:`another reference `. Inner Class Example ------------------- .. cpp:namespace:: @ex_domains_inner_class Given the following Breathe directive:: .. doxygenclass:: OuterClass :path: ../../examples/specific/class/xml :members: Which create formatted output like: .. doxygenclass:: OuterClass :path: ../../examples/specific/class/xml :members: We can refer to **OuterClass::InnerClass** using:: :cpp:class:`OuterClass::InnerClass` which renders as :cpp:class:`OuterClass::InnerClass`. Function Examples ----------------- .. cpp:namespace:: @ex_domains_function Given the following Breathe directives: .. code-block:: rst .. doxygenfunction:: TestNamespaceClasses::NamespacedClassTest::function :path: ../../examples/specific/class/xml .. doxygenfunction:: frob_foos :path: ../../examples/specific/alias/xml Which create formatted output like: .. doxygenfunction:: TestNamespaceClasses::NamespacedClassTest::function :path: ../../examples/specific/class/xml .. doxygenfunction:: frob_foos :path: ../../examples/specific/alias/xml We can refer to **namespaceFunc** using: .. code-block:: rst :cpp:func:`TestNamespaceFunction::namespaceFunc()` which renders as :cpp:func:`TestNamespaceFunction::namespaceFunc()`, or using: .. code-block:: rst :cpp:func:`another reference ` which renders as: :cpp:func:`another reference `. Note the use of the **cpp** domain. And we can refer to **frob_foos** using: .. code-block:: rst :c:func:`frob_foos()` which renders as: :c:func:`frob_foos()`, or using: .. code-block:: rst :c:func:`another reference ` which renders as: :c:func:`another reference `. Note the use of the **c** domain. Typedef Examples ---------------- .. cpp:namespace:: @ex_domains_typedef Given the following Breathe directives: .. code-block:: rst .. doxygentypedef:: TestTypedef :path: ../../examples/specific/typedef/xml .. doxygennamespace:: TypeDefNamespace :path: ../../examples/specific/typedef/xml .. doxygenclass:: TestClass :path: ../../examples/specific/typedef/xml :members: which create formatted output like: .. doxygentypedef:: TestTypedef :path: ../../examples/specific/typedef/xml .. doxygennamespace:: TypeDefNamespace :path: ../../examples/specific/typedef/xml .. doxygenclass:: TestClass :path: ../../examples/specific/typedef/xml :members: We can refer to **TestTypedef** using: .. code-block:: rst :cpp:type:`TestTypedef` which renders as :cpp:type:`TestTypedef`, to **TypeDefNamespace::AnotherTypedef** using: .. code-block:: rst :cpp:type:`TypeDefNamespace::AnotherTypedef` which renders as :cpp:type:`TypeDefNamespace::AnotherTypedef` and to **TestClass::MemberTypedef** using: .. code-block:: rst :cpp:type:`TestClass::MemberTypedef` which renders as :cpp:type:`TestClass::MemberTypedef`. Enum Value Examples ------------------- .. cpp:namespace:: @ex_domains_enum Given the following Breathe directives: .. code-block:: rst .. doxygenenumvalue:: VALUE :path: ../../examples/specific/enum/xml .. doxygenenumvalue:: TestEnumNamespace::FIRST :path: ../../examples/specific/enum/xml Which create formatted output like: .. doxygenenumvalue:: VALUE :path: ../../examples/specific/enum/xml .. doxygenenumvalue:: TestEnumNamespace::FIRST :path: ../../examples/specific/enum/xml We can refer to **VALUE** using: .. code-block:: rst :cpp:enumerator:`VALUE` which renders as :cpp:enumerator:`VALUE` and to **TestEnumNamespace::FIRST** using: .. code-block:: rst :cpp:enumerator:`TestEnumNamespace::FIRST` which renders as :cpp:enumerator:`TestEnumNamespace::FIRST`. breathe-doc-breathe-10a36f3/documentation/source/dot_graphs.rst000066400000000000000000000064431475641424700247060ustar00rootroot00000000000000Using Dot Graphs ================ .. _graphviz: https://www.sphinx-doc.org/en/master/usage/extensions/graphviz.html#module-sphinx.ext.graphviz .. _dot: https://www.doxygen.nl/manual/commands.html#cmddot .. _dotfile: https://www.doxygen.nl/manual/commands.html#cmddotfile Sphinx graphviz prerequisites ----------------------------- To use Sphinx's graphviz_ directive at all, the project documentation's ``conf.py`` file must have ``sphinx.ext.graphviz`` added to the list of ``extensions``. .. code-block:: python extensions = ["breathe", "sphinx.ext.graphviz"] .. seealso:: To obtain the dot executable from the Graphviz library, see `the library's downloads section `_. .. note:: Typically, the dot executable's path should be added to your system's ``PATH`` environment variable. This is required for Sphinx, although the configuration option, `graphviz_dot `_, can compensate for abnormal dot executable installations. ``\dot`` and ``\dotfile`` commands ---------------------------------- By default, breathe will translate any dot_ and dotfile_ commands into Sphinx graphviz_ directives. However, there are some caveats: 1. The only graphviz_ option supported is the ``caption`` option. Graph captions are optionally specified using the dot_ or dotfile_ command syntax. All other graphviz_ directive options fallback to their default behavior. - any size hints from Doxygen's dot_ or dotfile_ commands are ignored. 2. Using Doxygen's ``@ref`` command within any dot syntax is functionally ignored and treated as literal text. Generated graphs from Doxygen ----------------------------- If Doxygen is configured to use the dot executable to generate certain graphs, then some of these graphs can be translated into Sphinx graphviz directives. Because this feature depends on having the dot executable installed to generate graphs in Sphinx, the option ``allow-dot-graphs`` must be specified for the following directives: - :ref:`doxygenclass` - :ref:`doxygenstruct` - :ref:`doxygenfile` - :ref:`doxygenindex` - :ref:`autodoxygenfile` - :ref:`autodoxygenindex` .. attention:: Only the following graphs generated by Doxygen can be found in its XML output: .. csv-table:: :header: graph relevance, configuration option files included within, `INCLUDE_GRAPH `_ files included by, `INCLUDED_BY_GRAPH `_ inheritance, `CLASS_GRAPH `_ collaboration, `COLLABORATION_GRAPH `_ Unfortunately, the ``call`` and ``caller`` graphs are not provided by Doxygen's XML output. Examples of graphs generated by Doxygen are shown in this documentation's `Diagrams section of the doxygen test suite `_ Example Graphs -------------- Graphs can be placed anywhere. For this example they are placed in a doxygen page. .. code-block:: rst .. doxygenpage:: dotgraphs :project: dot_graphs This will render as: .. doxygenpage:: dotgraphs :project: dot_graphs breathe-doc-breathe-10a36f3/documentation/source/doxygen.rst000066400000000000000000000065141475641424700242300ustar00rootroot00000000000000 Doxygen Test Suite ================== Class ----- .. cpp:namespace:: @ex_doxygen_class .. doxygenindex:: :project: class Interface --------- .. cpp:namespace:: @ex_doxygen_interface .. doxygenindex:: :path: ../../examples/doxygen/interface/xml Define ------ .. the macros are in the C domain, and anyway in global scope .. cpp:namespace:: 0 .. doxygenindex:: :path: ../../examples/doxygen/define/xml Enum ---- .. cpp:namespace:: @ex_doxygen_enum .. doxygenindex:: :path: ../../examples/doxygen/enum/xml File ----- .. cpp:namespace:: @ex_doxygen_file .. doxygenindex:: :path: ../../examples/doxygen/file/xml Func ---- .. cpp:namespace:: @ex_doxygen_func .. doxygenindex:: :path: ../../examples/doxygen/func/xml Page ---- .. this is not related to Sphinx, but let's reset the namespace anyway .. cpp:namespace:: 0 .. doxygenindex:: :path: ../../examples/doxygen/page/xml Relates ------- .. cpp:namespace:: @ex_doxygen_relates .. doxygenindex:: :path: ../../examples/doxygen/relates/xml Author ------ .. cpp:namespace:: @ex_doxygen_author .. doxygenindex:: :path: ../../examples/doxygen/author/xml Par --- .. cpp:namespace:: @ex_doxygen_par .. doxygenindex:: :path: ../../examples/doxygen/par/xml Parblock -------- .. cpp:namespace:: @ex_doxygen_parblock .. doxygenindex:: :path: ../../examples/doxygen/parblock/xml Overload -------- .. cpp:namespace:: @ex_doxygen_overload .. doxygenindex:: :path: ../../examples/doxygen/overload/xml Example ------- .. cpp:namespace:: @ex_doxygen_example .. doxygenindex:: :path: ../../examples/doxygen/example/xml Include ------- .. cpp:namespace:: @ex_doxygen_include .. doxygenindex:: :path: ../../examples/doxygen/include/xml QtStyle ------- .. cpp:namespace:: @ex_doxygen_qtstyle .. doxygenindex:: :path: ../../examples/doxygen/qtstyle/xml JdStyle ------- .. cpp:namespace:: @ex_doxygen_jdstyle .. doxygenindex:: :path: ../../examples/doxygen/jdstyle/xml StructCmd --------- .. cpp:namespace:: @ex_doxygen_structcmd .. doxygenindex:: :path: ../../examples/doxygen/structcmd/xml Autolink -------- .. cpp:namespace:: @ex_doxygen_autolink .. doxygenindex:: :path: ../../examples/doxygen/autolink/xml ResTypeDef ---------- .. cpp:namespace:: @ex_doxygen_restypedef .. doxygenindex:: :path: ../../examples/doxygen/restypedef/xml AfterDoc -------- .. cpp:namespace:: @ex_doxygen_afterdoc .. doxygenindex:: :path: ../../examples/doxygen/afterdoc/xml Template -------- .. cpp:namespace:: @ex_doxygen_template .. doxygenindex:: :path: ../../examples/doxygen/template/xml Tag --- .. cpp:namespace:: @ex_doxygen_tag .. doxygenindex:: :path: ../../examples/doxygen/tag/xml Group ----- .. cpp:namespace:: @ex_doxygen_group .. doxygenindex:: :path: ../../examples/doxygen/group/xml Diagrams -------- .. cpp:namespace:: @ex_doxygen_diagrams .. doxygenindex:: :path: ../../examples/doxygen/diagrams/xml :allow-dot-graphs: Memgrp ------ .. cpp:namespace:: @ex_doxygen_memgrp .. doxygenindex:: :path: ../../examples/doxygen/memgrp/xml Docstring --------- .. doxygenindex:: :path: ../../examples/doxygen/docstring/xml PyExample --------- .. doxygenindex:: :path: ../../examples/doxygen/pyexample/xml Manual ------ .. cpp:namespace:: @ex_doxygen_manual .. doxygenindex:: :path: ../../examples/doxygen/manual/xml breathe-doc-breathe-10a36f3/documentation/source/embeddedrst.rst000066400000000000000000000002311475641424700250230ustar00rootroot00000000000000 Embedded ReStructuredText ========================= .. cpp:namespace:: @ex_embedded_rst .. doxygenindex:: :path: ../../examples/specific/rst/xml breathe-doc-breathe-10a36f3/documentation/source/enum.rst000066400000000000000000000016041475641424700235120ustar00rootroot00000000000000 .. _enum-example: doxygenenum Directive Example =============================== Working Example --------------- .. cpp:namespace:: @ex_enum_example This should work: .. code-block:: rst .. doxygenenum:: NodeType :project: tinyxml It produces this output: .. doxygenenum:: NodeType :project: tinyxml Example with Namespace ---------------------- .. cpp:namespace:: @ex_enum_namespace This should work: .. code-block:: rst .. doxygenenum:: foo::ns::Letters :project: namespace It produces this output: .. doxygenenum:: foo::ns::Letters :project: namespace Failing Example --------------- .. cpp:namespace:: @ex_enum_failing This intentionally fails: .. code-block:: rst .. doxygenenum:: made_up_enum :project: restypedef It produces the following warning message: .. warning:: doxygenenum: Cannot find enum "made_up_enum" in doxygen xml output breathe-doc-breathe-10a36f3/documentation/source/enumvalue.rst000066400000000000000000000017151475641424700245520ustar00rootroot00000000000000 .. _enumvalue-example: doxygenenumvalue Directive Example ================================== Working Example --------------- .. cpp:namespace:: @ex_enumvalue_example This should work: .. code-block:: rst .. doxygenenumvalue:: TIXML_NO_ERROR :project: tinyxml It produces this output: .. doxygenenumvalue:: TIXML_NO_ERROR :project: tinyxml Example with Namespace ---------------------- .. cpp:namespace:: @ex_enumvalue_namespace This should work: .. code-block:: rst .. doxygenenumvalue:: foo::ns::A :project: namespace It produces this output: .. doxygenenumvalue:: foo::ns::A :project: namespace Failing Example --------------- .. cpp:namespace:: @ex_enumvalue_failing This intentionally fails: .. code-block:: rst .. doxygenenumvalue:: made_up_enumvalue :project: restypedef It produces the following warning message: .. warning:: doxygenenumvalue: Cannot find enumvalue "made_up_enumvalue" in doxygen xml output breathe-doc-breathe-10a36f3/documentation/source/file.rst000066400000000000000000000104671475641424700234740ustar00rootroot00000000000000 .. _file-example: doxygenfile Directive ===================== This directive generates the appropriate output for a single source file. It takes the standard ``project``, ``path``, ``outline`` and ``no-link`` options and additionally the ``sections`` options. For the standard option refer to the documentation on the main directives page. The directive-specific options are documented below. ``sections`` Limit the sections to render for the given source file to the given list. Many of the names come from Doxygen and Breathe internals and may not make sense from an external point of view. Nevertheless it is hoped this table is useful. .. csv-table:: Section types :header: "Type", "Description" "briefdescription", "Brief description" "dcop-func", "DCOP Function" "define", "Define" "derivedcompoundref", "Derived compound reference" "detaileddescription", "Detailed description" "enum", "Enumerator" "event", "Events" "friend", "Friend" "func", "Function" "innerclass", "**Must be given to show sections inside a class**" "innernamespace", "**Must be given to show sections inside a namespace**" "package-attrib", "Package attribute" "package-func", "Package function" "package-static-attrib", "Package static attribute" "package-static-func", "Package static function" "package-type", "Package type" "private-attrib", "Private attribute" "private-func", "Private function" "private-slot", "Private slot" "private-static-attrib", "Private static attribute" "private-static-func", "Private static function" "private-type", "Private type" "property", "Properties" "protected-attrib", "Protected attribute" "protected-func", "Protected function" "protected-slot", "Protected slot" "protected-static-attrib", "Protected static attribute" "protected-static-func", "Protected static function" "protected-type", "Protected type" "prototype", "Prototype" "public-attrib", "Public attribute" "public-func", "Public function" "public-slot", "Public slot" "public-static-attrib", "Public static attribute" "public-static-func", "Public static function" "public-type", "Public type" "related", "Related" "signal", "Signal" "typedef", "Type definition" "user-defined", "User defined" "var", "Variable" Example ------- .. cpp:namespace:: @ex_file_example This should work: .. code-block:: rst .. doxygenfile:: nutshell.h :project: nutshell It produces this output: ---- .. doxygenfile:: nutshell.h :project: nutshell Example with Selected and Ordered Sections ------------------------------------------ .. cpp:namespace:: @ex_file_section The following will only show the **briefdescription** and **public-type** sections, in that order: .. code-block:: rst .. doxygenfile:: nutshell.h :project: nutshell :sections: briefdescription innerclass public-type It produces this output: ---- .. doxygenfile:: nutshell.h :project: nutshell :sections: briefdescription innerclass public-type :no-link: Example with Nested Namespaces ------------------------------ .. cpp:namespace:: @ex_file_namespace This should work: .. code-block:: rst .. doxygenfile:: namespacefile.h :project: namespace It produces this output: ---- .. doxygenfile:: namespacefile.h :project: namespace Example for Multiple Files -------------------------- .. cpp:namespace:: @ex_file_multiple_files When there are multiple files with the same name in the project, you need to be more specific with the filename you provide. For example, in a project with the following two files: .. code-block:: text /some/long/project/path/parser/Util.h /some/long/project/path/finder/Util.h You should specify: .. code-block:: rst .. doxygenfile:: parser/Util.h .. doxygenfile:: finder/Util.h To uniquely identify them. Failing Example --------------- .. cpp:namespace:: @ex_file_failing This intentionally fails: .. code-block:: rst .. doxygenfile:: made_up_file.h :project: nutshell It produces the following warning message: .. warning:: Cannot find file "made_up_file.h" in doxygen xml output for project "nutshell" from directory: ../../examples/specific/nutshell/xml/ breathe-doc-breathe-10a36f3/documentation/source/function.rst000066400000000000000000000031701475641424700243730ustar00rootroot00000000000000 .. _function-example: doxygenfunction Directive Example ================================= This directive generates the appropriate output for a single function. The function name, including namespace, is required to be unique in the project. For functions which have a declaration and definition in separate files, doxygen generates two entries for the function and Breathe can get confused when faced with this. As a result Breathe ignores what it considers to be the implementation files when searching for the XML for the function documentation. In order to do this, it ignores any entries in files which have filename extensions listed in the :ref:`breathe_implementation_filename_extensions ` config variable. Working Example --------------- .. cpp:namespace:: @ex_function_example This should work: .. code-block:: rst .. doxygenfunction:: open :project: structcmd It produces this output: .. doxygenfunction:: open :project: structcmd Separated Declaration & Implementation Example ---------------------------------------------- .. cpp:namespace:: @ex_function_separated This should work: .. code-block:: rst .. doxygenfunction:: open_di :project: decl_impl It produces this output: .. doxygenfunction:: open_di :project: decl_impl Failing Example --------------- .. cpp:namespace:: @ex_function_failing This intentionally fails: .. code-block:: rst .. doxygenfunction:: made_up_function :project: structcmd It produces the following warning message: .. warning:: doxygenfunction: Cannot find function "made_up_function" in doxygen xml output breathe-doc-breathe-10a36f3/documentation/source/group.rst000066400000000000000000000151211475641424700237010ustar00rootroot00000000000000 .. _group-example: doxygengroup Directive ====================== This directive generates the appropriate output for the contents of a doxygen group. A doxygen group can be declared with specific doxygen markup in the source comments as cover in the `doxygen grouping documentation`_. It takes the standard ``project``, ``path``, ``outline`` and ``no-link`` options and additionally the ``content-only``, ``desc-only``, ``members``, ``protected-members``, ``private-members``, ``undoc-members`` and ``inner`` options. ``content-only`` If this flag is specified, then the directive does not output the name of the group or the group description and instead outputs the contents of the group. This can be useful if the groups are only used for organizational purposes and not to provide additional information. ``desc-only`` If specified, only the description and name of the group will be displayed. ``members`` If specified, the public members of any classes in the group output will be displayed. Unlike the ``doxygenclass`` ``members`` option, this does not optionally take a list of member names to display as this will be applied across multiple classes within the group. ``protected-members`` If specified, the protected members of any classes in the group output will be displayed. ``private-members`` If specified, the private members of any classes in the group output will be displayed. ``undoc-members`` If specified, the undocumented members of any classes in the group output will be displayed provided the appropriate ``members`` or ``private-members`` options are specified as well. If you would like to always specify some combination of ``members``, ``protected-members``, ``private-members`` and ``undoc-members`` then you can use the :confval:`breathe_default_members` configuration variable to set it in the ``conf.py``. ``inner`` If specified, the groups that were defined inside this group, by either defining them inside the scope of another group, or by using the Doxygen \ingroup command, are also parsed and loaded. .. _doxygen grouping documentation: https://www.doxygen.nl/manual/grouping.html Basic Example ------------- .. cpp:namespace:: @ex_group_basic The plain ``doxygengroup`` directive will output the group name and description and any top level publicly visible members of the group. .. code-block:: rst .. doxygengroup:: mygroup :project: group It produces this output: .. doxygengroup:: mygroup :project: group Content-Only Example -------------------- .. cpp:namespace:: @ex_group_content_only The ``content-only`` option changes the output to only include the content of the group and not the group name or description. So this: .. code-block:: rst .. doxygengroup:: mygroup :project: group :content-only: Produces this output: .. doxygengroup:: mygroup :project: group :content-only: :no-link: .. note:: As you can see from the output, section headings like 'Functions' are missing from the ``:content-only:`` display. This is due to an implementation detail. If post an issue on github if you'd like it addressed. Members Example --------------- .. cpp:namespace:: @ex_group_members The ``members`` option changes the output to include the public members of any classes. The output for any class in the group should be the same as if it had be produced by the :ref:`doxygenclass directive ` with the ``members`` option specified. .. code-block:: rst .. doxygengroup:: mygroup :project: group :members: It produces this output: .. doxygengroup:: mygroup :project: group :members: :no-link: Protected Members Example ------------------------- .. cpp:namespace:: @ex_group_members_protected The ``protected-members`` option changes the output to include the protected members of any classes. The output for any class in the group should be the same as if it had be produced by the :ref:`doxygenclass directive ` with the ``protected-members`` option specified. .. code-block:: rst .. doxygengroup:: mygroup :project: group :protected-members: It produces this output: .. doxygengroup:: mygroup :project: group :protected-members: :no-link: Private-Members Example ----------------------- .. cpp:namespace:: @ex_group_members_private The ``private-members`` option changes the output to include the private members of any classes. The output for any class in the group should be the same as if it had be produced by the :ref:`doxygenclass directive ` with the ``private-members`` option specified. .. code-block:: rst .. doxygengroup:: mygroup :project: group :private-members: Produces this output: .. doxygengroup:: mygroup :project: group :private-members: :no-link: Undocumented Members Example ---------------------------- .. cpp:namespace:: @ex_group_members_undocumented The ``undoc-members`` option changes the output to include any undocumentated members from the sections (public, protected, private) that are being displayed for the classes in the group output. .. code-block:: rst .. doxygengroup:: mygroup :project: group :private-members: :undoc-members: Produces this output: .. doxygengroup:: mygroup :project: group :private-members: :undoc-members: :no-link: .. note:: Undocumented classes are still not shown in the output due to an implementation issue. Please post an issue on github if you would like this resolved. Inner Example ------------- .. cpp:namespace:: @ex_group_inner The ``inner`` option changes the output to include groups that are defined inside other groups. .. code-block:: rst .. doxygengroup:: mygroup :project: group :inner: Produces this output: .. doxygengroup:: mygroup :project: group :inner: :no-link: Outline Example --------------- .. cpp:namespace:: @ex_group_outline This displays only the names of the members of the group and not their documentation. The other options determine which members are displayed. .. code-block:: rst .. doxygengroup:: mygroup :project: group :members: :outline: It produces this output: .. doxygengroup:: mygroup :project: group :members: :outline: :no-link: Failing Example --------------- .. cpp:namespace:: @ex_group_failing This intentionally fails: .. code-block:: rst .. doxygengroup:: madeupgroup :project: group It produces the following warning message: .. warning:: Cannot find file "madeupgroup" in doxygen xml output for project "group" from directory: ../../examples/specific/group/xml/ breathe-doc-breathe-10a36f3/documentation/source/groups.rst000066400000000000000000000014001475641424700240570ustar00rootroot00000000000000 Groups ====== .. cpp:namespace:: @ex_groups Breathe has basic support for the grouping functionality that Doxygen provides. Using the example from the Doxygen docs: .. literalinclude:: code/groups.h :language: cpp If we reference this with a directive, for example: .. code-block:: rst .. doxygenclass:: UserDefinedGroupTest :project: userdefined :members: :protected-members: It renders as: .. doxygenclass:: UserDefinedGroupTest :project: userdefined :members: :protected-members: .. note:: Any groups which are not named in the original source code will appear as **Unnamed Group** in the final output. This is different to Doxygen which will number the groups and so name them as Group1, Group2, Group3, etc. breathe-doc-breathe-10a36f3/documentation/source/index.rst000066400000000000000000000071021475641424700236540ustar00rootroot00000000000000.. BreatheExample documentation master file, created by sphinx-quickstart on Tue Feb 3 18:20:48 2009. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Breathe's documentation ======================= Breathe provides a bridge between the Sphinx and Doxygen documentation systems. It is an easy way to include Doxygen information in a set of documentation generated by Sphinx. The aim is to produce an autodoc like support for people who enjoy using Sphinx but work with languages other than Python. The system relies on the Doxygen's xml output. .. only:: documentation_build_readthedocs_latest .. warning:: This documentation is built from the latest `Breathe github project `_ code. It does not necessarily reflect a released version of Breathe on PyPI. .. only:: documentation_build_development .. warning:: This build of the documentation is not from a specific tagged release of Breathe. It reflects a work in progress state of Breathe. Please see the `github repository `_ for a more official source of information. Overview -------- * **Simple setup** - one doxygen config value, one Sphinx config value and one directive and you'll be on your way. * **High and low level directives** - reference the whole project, just a class or just a function with different directives. * **Support for multiple doxygen projects** - set it up to be aware of different projects and reference them by name or path for each directive. * **Allows embedded reStructuredText in doxygen markup** - some extra doxygen aliases allow you to add ``\rst`` - ``\endrst`` blocks to your comments and have the contents interpreted as reStructuredText. * **Basic support for Sphinx domains** - Link to functions in the breathe output with a standard Sphinx domain reference. Setup & Usage ------------- .. toctree:: :maxdepth: 1 quickstart directives differences readthedocs Features -------- .. toctree:: :maxdepth: 1 markups latexmath codeblocks domains customcss groups lists tables template dot_graphs Contributing ------------ .. toctree:: :maxdepth: 1 contributing codeguide credits Example/Test Pages ------------------ .. toctree:: :maxdepth: 1 testpages Download -------- Breathe is available from: * `PyPI, the Python Package Index `_ * `Github `_ License ------- Breathe is under the `BSD license `_. In a Nutshell ------------- You write code that looks a little like this: .. literalinclude:: code/nutshell.h :language: cpp Then you run this: .. code-block:: text doxygen With a setting that says this: .. code-block:: text GENERATE_XML = YES Then in your Sphinx documentation, you add something like this: .. code-block:: rst .. doxygenclass:: Nutshell :project: nutshell :members: With a ``conf.py`` setting like this: .. code-block:: python breathe_projects = { "nutshell": "../../examples/specific/nutshell/xml/", } And Breathe registered as an extension in ``conf.py`` like this: .. code-block:: rst extensions = ["breathe"] You get something like this: ---- .. cpp:namespace:: @ex_index .. doxygenclass:: Nutshell :project: nutshell :members: ---- Sound reasonable? To get started, go checkout the :doc:`quickstart guide `. breathe-doc-breathe-10a36f3/documentation/source/inline.rst000066400000000000000000000011171475641424700240230ustar00rootroot00000000000000 Inline Parameter Documentation ============================== This is currently flawed as it doesn't know where to sensibly put the parameters in the final description. It currently defaults to the top of the detail description block which means it comes between the brief description text and the detailed description text which is less than ideal, but attempts to programmatically figure out where the detail description text ends have failed. Something for future work. Example ------- .. cpp:namespace:: @ex_inline .. doxygenindex:: :path: ../../examples/specific/inline/xml breathe-doc-breathe-10a36f3/documentation/source/latexmath.rst000066400000000000000000000025011475641424700245320ustar00rootroot00000000000000 Latex Math ========== Breathe has basic support for latex math markup in the doxygen comments. A class with a comment like: .. code-block:: cpp /** * @brief A class * * A inline formula: \f$ f(x) = a + b \f$ * * A display style formula: * @f[ * \int_a^b f(x) dx = F(b) - F(a) * @f] */ class MathHelper { public: MathHelper() {} ~MathHelper() {} } Will be renderer as: .. cpp:namespace:: @ex_latexmath .. doxygenclass:: MathHelper :project: latexmath :members: :undoc-members: Without any additional configuration except for including a math extension in the Sphinx ``conf.py``: .. code-block:: python extensions = ["breathe", "sphinx.ext.mathjax"] The specific environment formula fails when using ``sphinx.ext.pngmath`` so more work is needed. Implementation -------------- Breathe uses a internal reStructuredText node provided by ``sphinx.ext.mathbase`` which is then picked up and rendered by the extension chosen in the ``conf.py``. It does not pass any additional options through to the node, so settings like ``label`` and ``nowrap`` are currently not supported. Credits ------- Thank you to `dazzlezhang `_ for providing examples and a full run down of necessary details. It made the implementation much easier. breathe-doc-breathe-10a36f3/documentation/source/lists.rst000066400000000000000000000047231475641424700237110ustar00rootroot00000000000000Lists ====== Breathe has support for lists in the doxygen documentation. They are output as follows. .. cpp:namespace:: @ex_lists_plus For unordered lists with list items prefixed with **+**: .. code-block:: rst .. doxygenclass:: SimpleList_1 :project: lists It renders as: ---- .. doxygenclass:: SimpleList_1 :project: lists ---- .. cpp:namespace:: @ex_lists_dash Unordered lists with list items prefixed with **-** render as: ---- .. doxygenclass:: SimpleList_2 :project: lists ---- .. cpp:namespace:: @ex_lists_star Unordered lists with list items prefixed with **\*** render as: ---- .. doxygenclass:: SimpleList_3 :project: lists ---- .. cpp:namespace:: @ex_lists_html Unordered lists defined using HTML tags **
  • ** render as: ---- .. doxygenclass:: SimpleList_6 :project: lists ---- .. cpp:namespace:: @ex_lists_auto Auto-numbered lists with list items prefixed with **-#** render as: ---- .. doxygenclass:: SimpleList_4 :project: lists ---- .. cpp:namespace:: @ex_lists_arabic Numbered lists with list items prefixed with Arabic numerals **1. 2. ...** render as: ---- .. doxygenclass:: SimpleList_5 :project: lists ---- .. note:: Numbered lists support for the moment only Arabic numerals. Nested lists are supported in all combinations, as long as they are valid doxygen markup. Below are a couple of examples of different nested lists documentation and their corresponding breathe output. .. cpp:namespace:: @ex_lists_nested_1 Documentation looking like this: .. literalinclude:: code/nested_list_1.h :language: cpp renders as: ---- .. doxygenclass:: NestedLists_1 :project: lists ---- .. cpp:namespace:: @ex_lists_nested_2 Documentation looking like this: .. literalinclude:: code/nested_list_2.h :language: cpp renders as: ---- .. doxygenclass:: NestedLists_2 :project: lists ---- .. cpp:namespace:: @ex_lists_nested_3 Documentation looking like this: .. literalinclude:: code/nested_list_3.h :language: cpp renders as: ---- .. doxygenclass:: NestedLists_3 :project: lists ---- .. cpp:namespace:: @ex_lists_nested_4 Documentation looking like this: .. literalinclude:: code/nested_list_4.h :language: cpp renders as: ---- .. doxygenclass:: NestedLists_4 :project: lists ---- .. cpp:namespace:: @ex_lists_nested_5 Documentation looking like this: .. literalinclude:: code/nested_list_5.h :language: cpp renders as: ---- .. doxygenclass:: NestedLists_5 :project: lists breathe-doc-breathe-10a36f3/documentation/source/markups.rst000066400000000000000000000145621475641424700242370ustar00rootroot00000000000000 Supported Markups ================= All comments in your code must be formatted in a doxygen-compliant way so that doxygen can do its job. Doxygen provides support for formatting your text with tags, such as ``\b`` for adding bold text, this information appears in the xml output and Breathe attempts to reproduce it accurately. In addition to this, is it possible to add reStructuredText into your comments within appropriately demarcated sections. reStructuredText ---------------- .. cpp:namespace:: @ex_markups_rst Breathe supports reStructuredText within doxygen **verbatim** blocks which begin with the markup **embed:rst**. This means that a comment block like this: .. code-block:: cpp /*! Inserting additional reStructuredText information. \verbatim embed:rst .. note:: This reStructuredText has been handled correctly. \endverbatim */ Will be rendered as: .. doxygenfunction:: TestClass::rawVerbatim :project: rst :no-link: Handling Leading Asterisks ~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cpp:namespace:: @ex_markups_leading_star Note that doxygen captures **all** content in a **verbatim** block. This can be rather an annoyance if you use a leading-asterisk style of comment block such as the following: .. code-block:: cpp /*! * Inserting additional reStructuredText information. * * \verbatim embed:rst * Some example code * * .. code-block:: cpp * * int example(int x) { * return x * 2; * } * \endverbatim */ As the leading asterisks are captured in the **verbatim** block this will appear to be an incorrectly formatted bullet list. Due to the syntactical problems Sphinx will issue warnings and the block will render as: .. Here we fake the bad output without actually using a bad example otherwise we'll get warnings in the build output. void **rawBadAsteriskVerbatim**\ () Inserting additional reStructuredText information. - Some example code: - int example(int x) { - return x \* 2; - } To prevent this, use an **embed:rst:leading-asterisk** tag: .. code-block:: cpp /*! * Inserting additional reStructuredText information. * * \verbatim embed:rst:leading-asterisk * Some example code:: * * int example(int x) { * return x * 2; * } * \endverbatim */ This will appropriately handle the leading asterisks and render as: ---- .. doxygenfunction:: TestClass::rawLeadingAsteriskVerbatim :project: rst ---- Handling Leading Slashes ~~~~~~~~~~~~~~~~~~~~~~~~ .. cpp:namespace:: @ex_markups_leading_slash Similar troubles can be encountered when using comment blocks that start with a triple forward slash. For example: .. code-block:: cpp /// Some kind of method /// /// @param something a parameter /// @returns the same value provided in something param /// /// @verbatim embed:rst:leading-slashes /// .. code-block:: c /// :linenos: /// /// bool foo(bool something) { /// return something; /// }; /// /// @endverbatim /// @note Documentation using `///` should begin and end in a blank line. For these kinds of blocks, you can use an **embed:rst:leading-slashes** tag as shown in the above example. This will appropriately handle the leading slashes and render as: ---- .. doxygenfunction:: TestClass::rawLeadingSlashesVerbatim :project: rst ---- Inline rST ~~~~~~~~~~ .. cpp:namespace:: @ex_markups_inline Normal verbatim elements result in block elements. But sometimes you'll want to generate rST references where they need to be rendered inline with the text. For example: .. code-block:: cpp /// Some kind of method /// /// @param something a parameter /// @returns the same value provided in something param /// /// @verbatim embed:rst:inline some inline text @endverbatim For these kinds of references, you can use an **embed:rst:inline** tag as shown in the above example. This will appropriately handle the leading slashes and render as: ---- .. doxygenfunction:: TestClass::rawInlineVerbatim :project: rst .. doxygenfunction:: TestClass::rawVerbatim :project: rst :outline: ---- Aliases ~~~~~~~ .. cpp:namespace:: @ex_markups_aliases To make these blocks appear as more appropriate doxygen-like markup in your comments you can add the following aliases to your doxygen configuration file: .. code-block:: text ALIASES = "rst=^^\verbatim embed:rst^^" ALIASES += "endrst=\endverbatim" Which allow you to write comments like: .. code-block:: cpp /*! Inserting additional reStructuredText information. \rst This is some funky non-xml compliant text: <& !>< .. note:: This reStructuredText has been handled correctly. \endrst This is just a standard verbatim block with code: \verbatim child = 0; while( child = parent->IterateChildren( child ) ) \endverbatim */ Which will be rendered as: .. doxygenfunction:: TestClass::function :project: rst .. note:: The character sequence ``^^`` in an ALIAS definition inserts a line break. The leading ``^^`` ensures that a RST ``\verbatim`` block never starts in a brief description (which would break the output), even if you put it on the first line of a comment. The trailing ``^^`` allows to start with RST content on the same line of the ``\rst`` command. The ALIAS given above only works for comment blocks without a leading comment character on each line. If you use a comment style with a leading comment character on each new line, use these aliases instead: .. code-block:: text ALIASES = "rst=^^\verbatim embed:rst:leading-asterisk^^" ALIASES += "endrst=\endverbatim" Due to an `undocumented behavior in doxygen `_, all leading comment characters (``*``, ``///`` or ``//!``) encountered in a verbatim section will be converted to asterisk (``*`` ) by Doxygen, when ``\verbatim`` is part of an alias. Therefore, the ALIAS above works in all comment blocks with leading line comment characters. If you want to hide reStructuredText output from Doxygen html and only include it in sphinx, use the Doxygen command ``\xmlonly``. This is an example alias that enables all RST sections in XML only: .. code-block:: text ALIASES = "rst=^^\xmlonlyembed:rst:leading-asterisk^^" ALIASES += "endrst=\endxmlonly" breathe-doc-breathe-10a36f3/documentation/source/members.rst000066400000000000000000000017751475641424700242110ustar00rootroot00000000000000 Members Tests ============= All Members ----------- .. cpp:namespace:: @ex_members_all .. doxygenclass:: testnamespace::NamespacedClassTest :path: ../../examples/specific/members/xml :members: Specific Members ---------------- .. cpp:namespace:: @ex_members_specific .. doxygenclass:: testnamespace::NamespacedClassTest :path: ../../examples/specific/members/xml :members: functionS, anotherFunction :no-link: No Members ---------- .. cpp:namespace:: @ex_members_no .. doxygenclass:: testnamespace::NamespacedClassTest :path: ../../examples/specific/members/xml :no-link: Struct Members ---------------- .. cpp:namespace:: @ex_members_struct .. doxygenfunction:: testnamespace::MyClass::MyClass() :path: ../../examples/specific/struct_function/xml .. doxygenfunction:: testnamespace::MyClass::MyClass(const MyClass&) :path: ../../examples/specific/struct_function/xml .. doxygenvariable:: testnamespace::MyClass::myMemberVar :path: ../../examples/specific/struct_function/xml breathe-doc-breathe-10a36f3/documentation/source/namespace.rst000066400000000000000000000146071475641424700245110ustar00rootroot00000000000000 .. _namespace-example: doxygennamespace Directive ========================== This directive generates the appropriate output for the contents of a namespace. It takes the standard ``project``, ``path``, ``outline`` and ``no-link`` options and additionally the ``content-only``, ``desc-only``, ``members``, ``protected-members``, ``private-members`` and ``undoc-members`` options. ``content-only`` If this flag is specified, then the directive does not output the name of the namespace or the namespace description and instead outputs the contents of the namespace. This can be useful for structuring your documentation but leaving out the namespace declaration itself which is often undocumented. ``desc-only`` If specified, only the description and name of the namespace will be displayed. ``members`` If specified, the public members of any classes in the namespace output will be displayed. Unlike the ``doxygenclass`` ``members`` option, this does not optionally take a list of member names to display as this will be applied across multiple classes within the namespace. ``protected-members`` If specified, the protected members of any classes in the namespace output will be displayed. ``private-members`` If specified, the private members of any classes in the namespace output will be displayed. ``undoc-members`` If specified, the undocumented members of any classes in the namespace output will be displayed provided the appropriate ``members`` or ``private-members`` options are specified as well. If you would like to always specify some combination of ``members``, ``protected-members``, ``private-members`` and ``undoc-members`` then you can use the :ref:`breathe_default_members ` configuration variable to set it in the ``conf.py``. Basic Example ------------- .. cpp:namespace:: @ex_namespace_basic The plain ``doxygennamespace`` directive will output the namespace name and description and any top level publicly visible members of the namespace. .. code-block:: rst .. doxygennamespace:: foo :project: namespace It produces this output: .. doxygennamespace:: foo :project: namespace Content-Only Example -------------------- .. cpp:namespace:: @ex_namespace_content_only The ``content-only`` option changes the output to only include the content of the namespace and not the namespace name or description. So this: .. code-block:: rst .. doxygennamespace:: foo :project: namespace :content-only: Produces this output: .. doxygennamespace:: foo :project: namespace :content-only: :no-link: .. note:: As you can see from the output, section headings like 'Functions' are missing from the ``:content-only:`` display. This is due to an implementation detail. Open an issue on github if you'd like it addressed. Members Example --------------- .. cpp:namespace:: @ex_namespace_members The ``members`` option changes the output to include the public members of any classes. The output for any class in the namespace should be the same as if it had be produced by the :ref:`doxygenclass directive ` with the ``members`` option specified. .. code-block:: rst .. doxygennamespace:: foo :project: namespace :members: It produces this output: .. doxygennamespace:: foo :project: namespace :members: :no-link: Protected Members Example ------------------------- .. cpp:namespace:: @ex_namespace_members_protected The ``protected-members`` option changes the output to include the protected members of any classes. The output for any class in the namespace should be the same as if it had be produced by the :ref:`doxygenclass directive ` with the ``protected-members`` option specified. .. code-block:: rst .. doxygennamespace:: foo :project: namespace :protected-members: It produces this output: .. doxygennamespace:: foo :project: namespace :protected-members: :no-link: Private-Members Example ----------------------- .. cpp:namespace:: @ex_namespace_members_private The ``private-members`` option changes the output to include the private members of any classes. The output for any class in the namespace should be the same as if it had be produced by the :ref:`doxygenclass directive ` with the ``private-members`` option specified. .. code-block:: rst .. doxygennamespace:: foo :project: namespace :private-members: Produces this output: .. doxygennamespace:: foo :project: namespace :private-members: :no-link: Undocumented Members Example ---------------------------- .. cpp:namespace:: @ex_namespace_members_undocumented The ``undoc-members`` option changes the output to include any undocumentated members from the sections (public, protected, private) that are being displayed for the classes in the namespace output. .. code-block:: rst .. doxygennamespace:: foo :project: namespace :private-members: :undoc-members: Produces this output: .. doxygennamespace:: foo :project: namespace :private-members: :undoc-members: :no-link: .. note:: Undocumented classes are still not shown in the output due to an implementation issue. Please post an issue on github if you would like this resolved. Outline Example --------------- .. cpp:namespace:: @ex_namespace_outline This displays only the names of the members of the namespace and not their documentation. The other options determine which members are displayed. .. code-block:: rst .. doxygennamespace:: foo :project: namespace :members: :outline: It produces this output: .. doxygennamespace:: foo :project: namespace :members: :outline: :no-link: Nested Example -------------- .. cpp:namespace:: @ex_namespace_nested The referenced namespace can be nested in another namespace. .. code-block:: rst .. doxygennamespace:: foo::ns :project: namespace Produces this output: .. doxygennamespace:: foo::ns :project: namespace :no-link: Failing Example --------------- .. cpp:namespace:: @ex_namespace_failing This intentionally fails: .. code-block:: rst .. doxygennamespace:: madeupnamespace :project: namespace It produces the following warning message: .. warning:: doxygennamespace: Cannot find namespace “madeupnamespace” in doxygen xml output for project “namespace” from directory: ../../examples/specific/namespacefile/xml/ breathe-doc-breathe-10a36f3/documentation/source/page.rst000066400000000000000000000024401475641424700234610ustar00rootroot00000000000000 .. _page-example: doxygenpage Directive ===================== This directive generates the appropriate output for the contents of a doxygen page. A doxygen page is created for each "key" of every \\xrefitem command used for markup in the source comments. For more information check the `doxygen documentation`_. It takes the standard ``project`` and ``path`` options. .. code-block:: rst .. doxygenpage:: :project: ... :path: ... .. _doxygen documentation: https://www.doxygen.nl/manual/commands.html#cmdxrefitem Basic Example ------------- .. cpp:namespace:: @ex_page_basic The plain ``doxygenpage`` directive will output the page name and description and any variable entries which were defined to be part of this page (with an \xrefitem usage). .. code-block:: rst .. doxygenpage:: xrefsample :project: xrefsect It produces this output: .. doxygenpage:: xrefsample :project: xrefsect Failing Example --------------- .. cpp:namespace:: @ex_page_failing This intentionally fails: .. code-block:: rst .. doxygengroup:: madeuppage :project: xrefsect It produces the following warning message: .. warning:: Cannot find file "madeuppage" in doxygen xml output for project "xrefsect" from directory: ../../examples/specific/xrefsect/xml/ breathe-doc-breathe-10a36f3/documentation/source/quickstart.rst000066400000000000000000000035611475641424700247440ustar00rootroot00000000000000Quick Start =========== For this quick start we assume the following prerequisites: * breathe was downloaded and extracted somewhere * doxygen was installed and doxygen output (XML format) was generated for the project that is to be documented (set GENERATE_XML tag to YES) We assume the following paths: * documentation root path: :file:`/home/me/docproj/` * breathe path: :file:`/home/me/docproj/ext/breathe/` * doxygen xml output: :file:`/home/me/docproj/doxyxml/` The documentation path should contain a folder :file:`source` containing the :file:`conf.py` file. The doxygen xml output folder should contain the :file:`index.xml` output file generated by doxygen. The following steps are required to integrate breathe functionality: #. Add the breathe path to your conf.py by adding the following line: .. code-block:: python sys.path.append("/home/me/docproj/ext/breathe/") #. Add breathe as an extension the line could look like this: .. code-block:: python extensions = ['sphinx.ext.pngmath', 'sphinx.ext.todo', 'breathe' ] #. Tell breathe about the projects: .. code-block:: python breathe_projects = {"myproject": "/home/me/docproj/doxyxml/"} #. Specify a default project: .. code-block:: python breathe_default_project = "myproject" Once this is done you may use the following commands to include documentation for different constructs: .. code-block:: rst .. doxygenindex:: .. doxygenfunction:: .. doxygenstruct:: .. doxygenenum:: .. doxygentypedef:: .. doxygenclass:: For each of these commands the following directives may be specified: ``project`` Specifies which project, as defined in the breathe_projects config value, should be used for this directive. This overrides the default. ``path`` Directly specifies the path to the folder with the doxygen output. This overrides the project and default project. breathe-doc-breathe-10a36f3/documentation/source/readthedocs.rst000066400000000000000000000067241475641424700250430ustar00rootroot00000000000000 Running on Read the Docs ========================= `Read the Docs`_ is an excellent site for hosting project documentation. It provides hooks into common project hosting sites like Github_ & Bitbucket_ and can rebuild your documentation automatically whenever you push new code. The site is designed for documentation written with Sphinx and supports Sphinx extensions via a correctly configured ``setup.py`` file. As Breathe is a Sphinx extension you can use it on Read the Docs. However, as Breathe requires doxygen XML files, some additional configuration is required. Doxygen Support --------------- Read the Docs do not explicitly support doxygen however they have had requests for it to be supported and it is currently installed on their build servers. Generating Doxygen XML Files ---------------------------- We assume that you are not checking your doxygen XML files into your source control system and so you will need to generate them on the Read the Docs server before Sphinx starts processing your documentation. One simple way of achieving this is to add the following code to your ``conf.py`` file: .. code-block:: python import subprocess, os read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True' if read_the_docs_build: subprocess.call('cd ../doxygen; doxygen', shell=True) The first line uses the ``READTHEDOCS`` environment variable to determine whether or not we are building on the Read the Docs servers. Read the Docs set this environment variable `specifically for this purpose`_. Then, if we are in a Read the Docs build, execute a simple shell command to build the doxygen xml for your project. This is a very simple example; the command will be determined by your project set up but something like this works for the Breathe documentation. As this is then executed right at the start of the ``sphinx-build`` process then all your doxygen XML files will be in place for the build. A More Involved Setup --------------------- If you'd rather do something more involved then you can run ``doxygen`` as part of a ``builder-inited`` event hook which you can install from your ``conf.py`` file by adding a ``setup`` function as shown below. This is an approximation of the code that Breathe has in its ``conf.py`` in order to run ``doxygen`` on the Read the Docs server. .. code-block:: python import subprocess, sys def run_doxygen(folder): """Run the doxygen make command in the designated folder""" try: retcode = subprocess.call("cd %s; make" % folder, shell=True) if retcode < 0: sys.stderr.write("doxygen terminated by signal %s" % (-retcode)) except OSError as e: sys.stderr.write("doxygen execution failed: %s" % e) def generate_doxygen_xml(app): """Run the doxygen make commands if we're on the ReadTheDocs server""" read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True' if read_the_docs_build: run_doxygen("../../examples/doxygen") run_doxygen("../../examples/specific") run_doxygen("../../examples/tinyxml") def setup(app): # Add hook for building doxygen xml when needed app.connect("builder-inited", generate_doxygen_xml) .. _Read the Docs: https://readthedocs.org/ .. _Github: https://github.com .. _Bitbucket: https://bitbucket.org .. _specifically for this purpose: https://docs.readthedocs.org/en/latest/faq.html#how-do-i-change-behavior-for-read-the-docs breathe-doc-breathe-10a36f3/documentation/source/specific.rst000066400000000000000000000150411475641424700243330ustar00rootroot00000000000000 Specific Examples Test Suite ============================ Template Type Alias ------------------- .. cpp:namespace:: @ex_specific_alias_template .. doxygentypedef:: IsFurry :path: ../../examples/specific/template_type_alias/xml .. doxygentypedef:: IsFuzzy :path: ../../examples/specific/template_type_alias/xml Typedef Examples ---------------- .. cpp:namespace:: @ex_specific_typedef .. doxygenindex:: :path: ../../examples/specific/typedef/xml Namespaced Function Examples ---------------------------- .. cpp:namespace:: @ex_specific_namespaced_function .. doxygenfunction:: TestNamespaceClasses::NamespacedClassTest::function :path: ../../examples/specific/class/xml .. doxygenfunction:: TestNamespaceClasses::ClassTest::function :path: ../../examples/specific/class/xml .. doxygenfunction:: TestNamespaceClasses::ClassTest::anotherFunction :path: ../../examples/specific/class/xml .. doxygenfunction:: ClassTest::function :path: ../../examples/specific/class/xml .. doxygenfunction:: ClassTest::anotherFunction :path: ../../examples/specific/class/xml .. doxygenfunction:: f0 :path: ../../examples/specific/class/xml .. doxygenfunction:: f0< std::string > :path: ../../examples/specific/class/xml .. doxygenfunction:: NS1::f1 :path: ../../examples/specific/class/xml .. doxygenfunction:: NS1::f1< std::string > :path: ../../examples/specific/class/xml .. doxygenfunction:: NS1::NS2::f2 :path: ../../examples/specific/class/xml .. doxygenfunction:: NS1::NS2::f2< std::string > :path: ../../examples/specific/class/xml Extern Examples --------------- .. cpp:namespace:: @ex_specific_extern_examples .. doxygenfunction:: cache_tree_free :project: c_file .. doxygenstruct:: cache_tree :project: c_file :outline: Fixed Width Font ---------------- .. cpp:namespace:: @ex_specific_fixed_width .. doxygenclass:: Out :path: ../../examples/specific/fixedwidthfont/xml :members: Function Overloads ------------------ .. cpp:namespace:: @ex_specific_function_overloads .. doxygenfunction:: f(int, int) :project: functionOverload .. doxygenfunction:: f(double, double) :project: functionOverload .. doxygenfunction:: test::g(int,int) :project: functionOverload .. doxygenfunction:: test::g(double, double) :project: functionOverload .. doxygenfunction:: h(std::string, MyType) :project: functionOverload .. doxygenfunction:: h(std::string, MyOtherType) :project: functionOverload .. doxygenfunction:: h(std::string, const int) :project: functionOverload .. doxygenfunction:: h(std::string, const T, const U) :project: functionOverload Program Listing --------------- .. cpp:namespace:: @ex_specific_program_listing .. doxygenclass:: Vector :project: programlisting .. doxygenfunction:: center :project: programlisting Image ----- .. cpp:namespace:: @ex_specific_image .. doxygenclass:: ImageClass :project: image Array Parameter --------------- .. doxygenfunction:: foo :project: array .. doxygenfunction:: bar :project: array C Struct -------- .. doxygenfile:: c_struct.h :project: c_struct C Union ------- .. doxygenfile:: c_union.h :project: c_union C Enum ------ .. doxygenenum:: GSM_BackupFormat :project: c_enum C Typedef --------- .. doxygenfile:: c_typedef.h :project: c_typedef C Macro ------- .. doxygenfile:: c_macro.h :project: c_macro C++ Macro --------- .. doxygenfile:: define.h :project: define Multifile --------- .. cpp:namespace:: @ex_specific_multifile .. doxygenfunction:: TestTemplateFunction :project: multifile Interface Class --------------- .. cpp:namespace:: @ex_specific_interface .. doxygeninterface:: InterfaceClass :project: interface C++ Anonymous Entities ---------------------- .. cpp:namespace:: @ex_specific_cpp_anon .. doxygenfile:: cpp_anon.h :project: cpp_anon C++ Union --------- .. cpp:namespace:: @ex_specific_cpp_union .. doxygenfile:: cpp_union.h :project: cpp_union C++ Enums --------- .. cpp:namespace:: @ex_specific_cpp_enum .. doxygenfile:: cpp_enum.h :project: cpp_enum C++ Functions ------------- .. cpp:namespace:: @ex_specific_cpp_function .. doxygenfile:: cpp_function.h :project: cpp_function C++ Friend Classes ------------------ .. cpp:namespace:: @ex_specific_cpp_friendclass .. doxygenfile:: cpp_friendclass.h :project: cpp_friendclass C++ Inherited Members --------------------- .. cpp:namespace:: @ex_specific_cpp_inherited_members .. doxygenclass:: Base :project: cpp_inherited_members .. doxygenclass:: A :project: cpp_inherited_members .. doxygenclass:: B :project: cpp_inherited_members C++ Template Specialization with Namespace ------------------------------------------ .. cpp:namespace:: @ex_specific_cpp_ns_template_specialization .. doxygenfile:: cpp_ns_template_specialization.h :project: cpp_ns_template_specialization C++ Trailing Return Type ------------------------ .. cpp:namespace:: @ex_specific_cpp_trailing_return_type .. doxygenfile:: cpp_trailing_return_type.h :project: cpp_trailing_return_type C++ Constexpr Handling ------------------------ .. cpp:namespace:: @ex_specific_cpp_constexpr_hax Test for issue 717. .. doxygenfile:: cpp_constexpr_hax.h :project: cpp_constexpr_hax C++ Function Lookup ------------------- .. cpp:namespace:: @ex_specific_cpp_function_lookup .. doxygenfunction:: fNoexcept() :project: cpp_function_lookup .. doxygenfunction:: fFinal() :project: cpp_function_lookup .. doxygenfunction:: fOverride() :project: cpp_function_lookup This one should actually have ``[[myattr]]`` but Doxygen seems to not put attributes into the XML: .. doxygenfunction:: fAttr() :project: cpp_function_lookup .. doxygenfunction:: fFInit() :project: cpp_function_lookup .. doxygenfunction:: fTrailing() :project: cpp_function_lookup .. doxygenfunction:: fInit(int) :project: cpp_function_lookup .. doxygenfunction:: fPlain(int) :project: cpp_function_lookup .. doxygenfunction:: fPtr(int*) :project: cpp_function_lookup .. doxygenfunction:: fLRef(int&) :project: cpp_function_lookup .. doxygenfunction:: fRRef(int&&) :project: cpp_function_lookup .. doxygenfunction:: fParamPack(T...) :project: cpp_function_lookup .. doxygenfunction:: fMemPtr(int A::*) :project: cpp_function_lookup .. doxygenfunction:: fParen(void (*)()) :project: cpp_function_lookup .. doxygenfunction:: fParenPlain(void (*)(int)) :project: cpp_function_lookup Doxygen xrefsect ---------------- .. doxygenfile:: xrefsect.h :project: xrefsect Doxygen simplesect ------------------ .. doxygenfile:: simplesect.h :project: simplesect breathe-doc-breathe-10a36f3/documentation/source/spelling_wordlist.txt000066400000000000000000000007571475641424700263310ustar00rootroot00000000000000STL TVal autodoxygenindex cdata cfile config doxygen doxygenenum doxygenfunction doxygenstruct doxygentypedef doxygenfile doxygenunion doxygenvariable doxygengroup doxygendefine doxygenclass doxygenindex bitmasks madeupgroup enum foo foos frob frobs namespace namespaces namespaced reStructuredText tabsize tinyXml tinyxml tinyXML programmatically struct py conf inline License autodoc renderers github heesch brandl goodger wildcard wildcards xml Func Memgrp Docstring Autolink GVal attributeB breathe-doc-breathe-10a36f3/documentation/source/struct.rst000066400000000000000000000133071475641424700240750ustar00rootroot00000000000000 .. This is more or less the class documentation with s/class/struct/g .. _struct-example: doxygenstruct Directive ======================= This directive generates the appropriate output for a single struct. It takes the standard ``project``, ``path``, ``outline`` and ``no-link`` options and additionally the ``members``, ``protected-members``, ``private-members``, ``undoc-members``, ``membergroups`` and ``members-only`` options. ``members`` Designed to behavior in a similar manner to the ``members`` option for the ``autostruct`` directive that comes with the Sphinx ``autodoc`` extension. If you do not specify this option you will not get any information about the struct members, just the general struct documentation. If you provide it without arguments, then Breathe adds all the public members and their documentation. If you specify it with **comma separated** arguments, then Breathe will treat the arguments as names of members and provide documentation for only those members that have been named. ``protected-members`` If specified, the protected members of the struct will be displayed. ``private-members`` If specified, the private members of the struct will be displayed. ``undoc-members`` If specified, the undocumented members of the struct will be displayed. ``membergroups`` If specified, only the groups in a space-delimited list following this directive will be displayed. ``members-only`` This will allow to show only the members, not the struct information. Child classes and structs are also not shown. If you would like to always specify some combination of ``members``, ``protected-members``, ``private-members`` and ``undoc-members`` then you can use the :ref:`breathe_default_members ` configuration variable to set it in the ``conf.py``. Basic Example ------------- .. cpp:namespace:: @ex_struct_basic This displays the struct documentation without any members: .. code-block:: rst .. doxygenstruct:: StructTest :project: struct It produces this output: .. doxygenstruct:: StructTest :project: struct Members Example --------------- .. cpp:namespace:: @ex_struct_members This directive call will display the struct documentation with all the public members: .. code-block:: rst .. doxygenstruct:: StructTest :project: struct :members: It produces this output: .. doxygenstruct:: StructTest :project: struct :members: :no-link: Specific Members Example ------------------------ .. cpp:namespace:: @ex_struct_members_specific This displays the struct documentation with only the members listed in the ``:members:`` option: .. code-block:: rst .. doxygenstruct:: StructTest :project: struct :members: publicFunction, protectedFunction It produces this output: .. doxygenstruct:: StructTest :project: struct :members: publicFunction, protectedFunction :no-link: Protected Members ----------------- .. cpp:namespace:: @ex_struct_members_protected This displays only the protected members of the struct. Normally this is combined with the ``:members:`` option to show the public members as well. .. code-block:: rst .. doxygenstruct:: StructTest :project: struct :protected-members: It produces this output: .. doxygenstruct:: StructTest :project: struct :protected-members: :no-link: Private Members --------------- .. cpp:namespace:: @ex_struct_members_private This displays only the private members of the struct. Normally this is combined with the ``:members:`` option to show the public members as well. .. code-block:: rst .. doxygenstruct:: StructTest :project: struct :private-members: It produces this output: .. doxygenstruct:: StructTest :project: struct :private-members: :no-link: Undocumented Members -------------------- .. cpp:namespace:: @ex_struct_members_undocumented This displays the undocumented members of the struct which are suppressed by default. Undocumented public members are only shown if the ``:members:`` option is also used. The same goes for the undocumented private members and the ``private-members`` option. .. code-block:: rst .. doxygenstruct:: StructTest :project: struct :members: :private-members: :undoc-members: It produces this output: .. doxygenstruct:: StructTest :project: struct :members: :private-members: :undoc-members: :no-link: .. note:: Undocumented internal classes are still not shown in the output due to an implementation issue. Please post an issue on github if you would like this resolved. Membergroups ------------ .. cpp:namespace:: @ex_struct_membersgroups Lists one or more names member groups. See the :ref:`doxygenclass documentation `. Members-only ------------ See the :ref:`doxygenclass documentation `. Outline Example --------------- .. cpp:namespace:: @ex_struct_outline This displays only the names of the struct members and not their documentation. The ``:members:`` and ``:private-members:`` options determine which members are displayed. .. code-block:: rst .. doxygenstruct:: StructTest :project: struct :members: :outline: It produces this output: .. doxygenstruct:: StructTest :project: struct :members: :outline: :no-link: Failing Example --------------- .. cpp:namespace:: @ex_struct_failing This intentionally fails: .. code-block:: rst .. doxygenstruct:: made_up_struct :project: struct :members: It produces the following warning message: .. warning:: doxygenstruct: Cannot find struct "made_up_struct" in doxygen xml output for project “struct” from directory: ../../examples/doxygen/struct/xml/ breathe-doc-breathe-10a36f3/documentation/source/tables.rst000066400000000000000000000024461475641424700240250ustar00rootroot00000000000000Tables ====== Breathe has support for tables in the doxygen documentation. They are output as follows. .. cpp:namespace:: @ex_tables_simple A simple Markdown syntax table: .. code-block:: rst .. doxygenclass:: Table_1 :project: tables It renders as: ---- .. doxygenclass:: Table_1 :project: tables ---- .. cpp:namespace:: @ex_tables_aligned A Markdown syntax table with alignment: .. code-block:: rst .. doxygenclass:: Table_2 :project: tables It renders as: ---- .. doxygenclass:: Table_2 :project: tables ---- .. cpp:namespace:: @ex_tables_rowspan A Markdown syntax table with rowspan (and alignment): .. code-block:: rst .. doxygenclass:: Table_3 :project: tables It renders as: ---- .. only:: html .. doxygenclass:: Table_3 :project: tables ---- .. cpp:namespace:: @ex_tables_colspan A Markdown syntax table with colspan (and alignment): .. code-block:: rst .. doxygenclass:: Table_4 :project: tables It renders as: ---- .. only:: html .. doxygenclass:: Table_4 :project: tables ---- .. cpp:namespace:: @ex_tables_doxygen A Doxygen syntax table: .. code-block:: rst .. doxygenclass:: Table_5 :project: tables It renders as: ---- .. only:: html .. doxygenclass:: Table_5 :project: tables breathe-doc-breathe-10a36f3/documentation/source/template.rst000066400000000000000000000021611475641424700243600ustar00rootroot00000000000000Template ======== .. cpp:namespace:: @ex_template_first Breathe has support for class and function templates. They are output as follows. For a class with a single template parameter: .. code-block:: rst .. doxygenclass:: templateclass :project: template_class :members: It renders as: ---- .. doxygenclass:: templateclass :project: template_class :members: ---- .. cpp:namespace:: @ex_template_multiple With multiple template parameters it renders as: ---- .. doxygenclass:: anothertemplateclass :project: template_class_non_type :members: ---- .. cpp:namespace:: @ex_template_function_single A function with single template parameter renders as: ---- .. doxygenfunction:: function1 :project: template_function ---- .. cpp:namespace:: @ex_template_function_single_specialization If specialized for a given type it renders as: ---- .. doxygenfunction:: function1< std::string > :project: template_function ---- .. cpp:namespace:: @ex_template_function_multiple With multiple template parameters it renders as: ---- .. doxygenfunction:: function2 :project: template_function breathe-doc-breathe-10a36f3/documentation/source/testpages.rst000066400000000000000000000001751475641424700245470ustar00rootroot00000000000000 Test Pages ========== .. toctree:: :maxdepth: 1 doxygen tinyxml specific embeddedrst inline members breathe-doc-breathe-10a36f3/documentation/source/tinyxml.rst000066400000000000000000000001331475641424700242460ustar00rootroot00000000000000 TinyXML Test Suite ================== .. cpp:namespace:: @ex_tinyxml .. doxygenindex:: breathe-doc-breathe-10a36f3/documentation/source/typedef.rst000066400000000000000000000016531475641424700242120ustar00rootroot00000000000000 .. _typedef-example: doxygentypedef Directive Example ================================ Working Example --------------- .. cpp:namespace:: @ex_typedef_example This should work: .. code-block:: rst .. doxygentypedef:: UINT32 :project: structcmd It produces this output: .. doxygentypedef:: UINT32 :project: structcmd Example with Namespace ---------------------- .. cpp:namespace:: @ex_typedef_namespace This should work: .. code-block:: rst .. doxygentypedef:: foo::ns::MyInt :project: namespace It produces this output: .. doxygentypedef:: foo::ns::MyInt :project: namespace Failing Example --------------- .. cpp:namespace:: @ex_typedef_failing This intentionally fails: .. code-block:: rst .. doxygentypedef:: made_up_typedef :project: restypedef It produces the following warning message: .. warning:: doxygentypedef: Cannot find typedef "made_up_typedef" in doxygen xml output breathe-doc-breathe-10a36f3/documentation/source/union.rst000066400000000000000000000017141475641424700237000ustar00rootroot00000000000000 .. _union-example: doxygenunion Directive Example ============================== Working Example --------------- .. cpp:namespace:: @ex_union_example This should work: .. code-block:: rst .. doxygenunion:: SeparateUnion :project: union It produces this output: .. doxygenunion:: SeparateUnion :project: union Example with Namespace ---------------------- .. cpp:namespace:: @ex_union_namespace This should work: .. code-block:: rst .. doxygenunion:: foo::MyUnion :project: union It produces this output: .. doxygenunion:: foo::MyUnion :project: union Failing Example --------------- .. cpp:namespace:: @ex_union_failing This intentionally fails: .. code-block:: rst .. doxygenunion:: made_up_union :project: union It produces the following warning message: .. warning:: doxygenunion: Cannot find union "made_up_union" in doxygen XML output for project "union" from directory: ../../examples/specific/union/xml/ breathe-doc-breathe-10a36f3/documentation/source/variable.rst000066400000000000000000000013751475641424700243400ustar00rootroot00000000000000 .. _variable-example: doxygenvariable Directive Example ================================= Working Example --------------- .. cpp:namespace:: @ex_variable_example This should work: .. code-block:: rst .. doxygenvariable:: global_cache_tree :project: c_file It produces this output: .. doxygenvariable:: global_cache_tree :project: c_file Failing Example --------------- .. cpp:namespace:: @ex_variable_failing This intentionally fails: .. code-block:: rst .. doxygenvariable:: made_up_variable :project: define It produces the following warning message: .. warning:: doxygenvariable: Cannot find variable “made_up_variable” in doxygen XML output for project "tinyxml" from directory: ../../examples/tinyxml/tinyxml/xml/ breathe-doc-breathe-10a36f3/examples/000077500000000000000000000000001475641424700174605ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/examples/doxygen/000077500000000000000000000000001475641424700211355ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/examples/doxygen/.gitignore000066400000000000000000000003351475641424700231260ustar00rootroot00000000000000afterdoc author autolink class concept define diagrams docstring enum example file func group include jdstyle manual memgrp overload page par parblock pyexample qtstyle relates restypedef structcmd tag template interface breathe-doc-breathe-10a36f3/examples/doxygen/Makefile000066400000000000000000000073321475641424700226020ustar00rootroot00000000000000# # This file was generated from Makefile.in on Sat Dec 13 12:17:28 GMT 2008 # DOXYGEN ?= `which doxygen` TMAKEPATH = ENV = env TMAKEPATH=$(TMAKEPATH) TMAKE = MAKE = /usr/bin/make PERL = /usr/bin/perl RM = rm -f CP = cp VERSION = 1.5.7.1 INSTALL = /tmp INSTTOOL = /usr/bin/install DOXYDOCS = .. DOCDIR = $(INSTALL)/share/doc/packages/doxygen QTDIR = HAVE_DOT = /usr/bin/dot all: class/xml/index.xml \ concept/xml/index.xml \ define/xml/index.xml \ enum/xml/index.xml \ file/xml/index.xml \ func/xml/index.xml \ page/xml/index.xml \ relates/xml/index.xml \ author/xml/index.xml \ par/xml/index.xml \ parblock/xml/index.xml \ overload/xml/index.xml \ example/xml/index.xml \ include/xml/index.xml \ qtstyle/xml/index.xml \ jdstyle/xml/index.xml \ structcmd/xml/index.xml \ autolink/xml/index.xml \ restypedef/xml/index.xml \ afterdoc/xml/index.xml \ template/xml/index.xml \ tag/xml/index.xml \ group/xml/index.xml \ diagrams/xml/index.xml \ memgrp/xml/index.xml \ docstring/xml/index.xml \ pyexample/xml/index.xml \ manual/xml/index.xml \ interface/xml/index.xml clean: rm -rf class concept define enum file func page relates author \ par parblock overload example include qtstyle jdstyle structcmd \ autolink tag restypedef afterdoc template tag group diagrams \ memgrp docstring pyexample manual interface class/xml/index.xml: class.h class.cfg $(DOXYGEN) class.cfg concept/xml/index.xml: concept.h concept.cfg $(DOXYGEN) concept.cfg define/xml/index.xml: define.h define.cfg $(DOXYGEN) define.cfg enum/xml/index.xml: enum.h enum.cfg $(DOXYGEN) enum.cfg file/xml/index.xml: file.h file.cfg $(DOXYGEN) file.cfg func/xml/index.xml: func.h func.cfg $(DOXYGEN) func.cfg page/xml/index.xml: page.doc page.cfg $(DOXYGEN) page.cfg relates/xml/index.xml: relates.cpp relates.cfg $(DOXYGEN) relates.cfg author/xml/index.xml: author.cpp author.cfg $(DOXYGEN) author.cfg par/xml/index.xml: par.cpp par.cfg $(DOXYGEN) par.cfg parblock/xml/index.xml: parblock.cpp parblock.cfg $(DOXYGEN) parblock.cfg overload/xml/index.xml: overload.cpp overload.cfg $(DOXYGEN) overload.cfg example/xml/index.xml: example.cpp example_test.cpp example.cfg $(DOXYGEN) example.cfg include/xml/index.xml: include.cpp example_test.cpp include.cfg $(DOXYGEN) include.cfg qtstyle/xml/index.xml: qtstyle.cpp qtstyle.cfg $(DOXYGEN) qtstyle.cfg jdstyle/xml/index.xml: jdstyle.cpp jdstyle.cfg $(DOXYGEN) jdstyle.cfg structcmd/xml/index.xml: structcmd.h structcmd.cfg $(DOXYGEN) structcmd.cfg autolink/xml/index.xml: autolink.cpp autolink.cfg $(DOXYGEN) autolink.cfg tag/xml/index.xml: tag.cpp tag.cfg example/xml/index.xml $(DOXYGEN) tag.cfg # sed -e "1,1s#perl#$(PERL)#g" tag/xml/installdox >tag/xml/installdox.perl # cd tag/xml ; $(PERL) installdox.perl -lexample.tag@../../example/xml restypedef/xml/index.xml: restypedef.cpp restypedef.cfg $(DOXYGEN) restypedef.cfg afterdoc/xml/index.xml: afterdoc.h afterdoc.cfg $(DOXYGEN) afterdoc.cfg template/xml/index.xml: templ.cpp templ.cfg $(DOXYGEN) templ.cfg group/xml/index.xml: group.cpp group.cfg $(DOXYGEN) group.cfg memgrp/xml/index.xml: memgrp.cpp memgrp.cfg $(DOXYGEN) memgrp.cfg pyexample/xml/index.xml: pyexample.py pyexample.cfg $(DOXYGEN) pyexample.cfg manual/xml/index.xml: manual.c manual.cfg $(DOXYGEN) manual.cfg docstring/xml/index.xml: docstring.py docstring.cfg $(DOXYGEN) docstring.cfg interface/xml/index.xml: interface.h interface.cfg $(DOXYGEN) interface.cfg diagrams/xml/index.xml: diagrams_a.h diagrams_b.h diagrams_c.h diagrams_d.h diagrams_e.h diagrams.cfg ifneq ($(HAVE_DOT),) $(DOXYGEN) diagrams.cfg endif breathe-doc-breathe-10a36f3/examples/doxygen/afterdoc.cfg000066400000000000000000000004161475641424700234060ustar00rootroot00000000000000PROJECT_NAME = "AfterDocs" OUTPUT_DIRECTORY = afterdoc GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = afterdoc.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/afterdoc.h000066400000000000000000000005561475641424700231030ustar00rootroot00000000000000/*! A test class */ class Test1 { public: /** An enum type. * The documentation block cannot be put after the enum! */ enum EnumType { int EVal1, /**< enum value 1 */ int EVal2 /**< enum value 2 */ }; void member(); //!< a member function. protected: int value; /*!< an integer value */ }; breathe-doc-breathe-10a36f3/examples/doxygen/author.cfg000066400000000000000000000004111475641424700231140ustar00rootroot00000000000000PROJECT_NAME = "Author Command" OUTPUT_DIRECTORY = author GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = author.cpp QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/author.cpp000066400000000000000000000007751475641424700231540ustar00rootroot00000000000000/*! \class WindowsNT * \brief Windows Nice Try. * \author Bill Gates * \author Several species of small furry animals gathered together * in a cave and grooving with a picture. * \version 4.0 * \date 1996-1998 * \bug It crashes a lot and requires huge amounts of memory. * \bug The class introduces the more bugs, the longer it is used. * \warning This class may explode in your face. * \warning If you inherit anything from this class, you're doomed. */ class WindowsNT {}; breathe-doc-breathe-10a36f3/examples/doxygen/autolink.cfg000066400000000000000000000004301475641424700234410ustar00rootroot00000000000000PROJECT_NAME = "Automatic link generation" OUTPUT_DIRECTORY = autolink GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = autolink.cpp QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/autolink.cpp000066400000000000000000000047411475641424700234750ustar00rootroot00000000000000/*! \file autolink.cpp Testing automatic link generation. A link to a member of the Test2 class: Test2::member, More specific links to the each of the overloaded members: Test2::member(int) and Test2#member(int,int) A link to a protected member variable of Test2: Test2#var, A link to the global variable #globVar. A link to the global enumeration type #GlobEnum. A link to the define #ABS_NUMBER(x). A link to the destructor of the Test2 class: Test2::~Test2, A link to the typedef ::Test2TypeDef. A link to the enumeration type Test2::EType A link to some enumeration values Test2::Val1 and ::GVal2 */ /*! Since this documentation block belongs to the class Test2 no link to Test2 is generated. Two ways to link to a constructor are: #Test2 and Test2(). Links to the destructor are: #~Test2 and ~Test2(). A link to a member in this class: member(). More specific links to the each of the overloaded members: member(int) and member(int,int). A link to the variable #var. A link to the global typedef ::Test2TypeDef. A link to the global enumeration type #GlobEnum. A link to the define ABS_NUMBER(x). A link to a variable \link #var using another text\endlink as a link. A link to the enumeration type #EType. A link to some enumeration values: \link Test2::Val1 Val1 \endlink and ::GVal1. And last but not least a link to a file: autolink.cpp. \sa Inside a see also section any word is checked, so EType, Val1, GVal1, ~Test2 and member will be replaced by links in HTML. */ class Test2 { public: Test2(); //!< constructor ~Test2(); //!< destructor void member(int); /**< A member function. Details. */ void member(int,int); /**< An overloaded member function. Details */ /** An enum type. More details */ enum EType { Val1, /**< enum value 1 */ Val2 /**< enum value 2 */ }; protected: int var; /**< A member variable */ }; /*! details. */ Test2::Test2() { } /*! details. */ Test2::~Test2() { } /*! A global variable. */ int globVar; /*! A global enum. */ enum GlobEnum { GVal1, /*!< global enum value 1 */ GVal2 /*!< global enum value 2 */ }; /*! * A macro definition. */ #define ABS_NUMBER(x) (((x)>0)?(x):-(x)) typedef Test2 Test2TypeDef; /*! \fn typedef Test2 Test2TypeDef * A type definition. */ breathe-doc-breathe-10a36f3/examples/doxygen/class.cfg000066400000000000000000000004041475641424700227210ustar00rootroot00000000000000PROJECT_NAME = "Class Command" OUTPUT_DIRECTORY = class GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = class.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/class.h000066400000000000000000000002321475641424700224100ustar00rootroot00000000000000/* A dummy class */ class Test3 { }; /*! \class Test class.h "inc/class.h" * \brief This is a test class. * * Some details about the Test class */ breathe-doc-breathe-10a36f3/examples/doxygen/concept.cfg000066400000000000000000000004121475641424700232460ustar00rootroot00000000000000PROJECT_NAME = "Concept Command" OUTPUT_DIRECTORY = concept GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = concept.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/concept.h000066400000000000000000000004741475641424700227460ustar00rootroot00000000000000template concept Hashable = requires(T a) { { std::hash{}(a) } -> std::convertible_to; }; /*! \concept Hashable concept.h "inc/concept.h" * \brief This is a test concept. * * It was stolen from the first example from * https://en.cppreference.com/w/cpp/language/constraints */ breathe-doc-breathe-10a36f3/examples/doxygen/define.cfg000066400000000000000000000004421475641424700230500ustar00rootroot00000000000000PROJECT_NAME = "Define Command" OUTPUT_DIRECTORY = define GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = define.h ENABLE_PREPROCESSING = YES QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/define.h000066400000000000000000000007101475641424700225360ustar00rootroot00000000000000/*! \file define.h \brief testing defines This is to test the documentation of defines. */ /*! \def MAX(x,y) Computes the maximum of \a x and \a y. */ /*! Computes the absolute value of its argument \a x. */ #define ABS(x) (((x)>0)?(x):-(x)) #define MAX(x,y) ((x)>(y)?(x):(y)) #define MIN(x,y) ((x)>(y)?(y):(x)) /*!< Computes the minimum of \a x and \a y. */ #define NOARGS (void*) /*!< Define with no arguments */ breathe-doc-breathe-10a36f3/examples/doxygen/diagrams.cfg000066400000000000000000000005771475641424700234160ustar00rootroot00000000000000PROJECT_NAME = "Diagrams" OUTPUT_DIRECTORY = diagrams HAVE_DOT = YES EXTRACT_ALL = YES GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO ENABLE_PREPROCESSING = YES INPUT = . FILE_PATTERNS = diagrams_*.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/diagrams_a.h000066400000000000000000000001231475641424700233710ustar00rootroot00000000000000#ifndef _DIAGRAMS_A_H #define _DIAGRAMS_A_H class A { public: A *m_self; }; #endif breathe-doc-breathe-10a36f3/examples/doxygen/diagrams_b.h000066400000000000000000000001311475641424700233710ustar00rootroot00000000000000#ifndef _DIAGRAMS_B_H #define _DIAGRAMS_B_H class A; class B { public: A *m_a; }; #endif breathe-doc-breathe-10a36f3/examples/doxygen/diagrams_c.h000066400000000000000000000001741475641424700234010ustar00rootroot00000000000000#ifndef _DIAGRAMS_C_H #define _DIAGRAMS_C_H #include "diagrams_c.h" class D; class C : public A { public: D *m_d; }; #endif breathe-doc-breathe-10a36f3/examples/doxygen/diagrams_d.h000066400000000000000000000002501475641424700233750ustar00rootroot00000000000000#ifndef _DIAGRAM_D_H #define _DIAGRAM_D_H #include "diagrams_a.h" #include "diagrams_b.h" class C; class D : virtual protected A, private B { public: C m_c; }; #endif breathe-doc-breathe-10a36f3/examples/doxygen/diagrams_e.h000066400000000000000000000001401475641424700233740ustar00rootroot00000000000000#ifndef _DIAGRAM_E_H #define _DIAGRAM_E_H #include "diagrams_d.h" class E : public D {}; #endif breathe-doc-breathe-10a36f3/examples/doxygen/docstring.cfg000066400000000000000000000004421475641424700236120ustar00rootroot00000000000000PROJECT_NAME = "Python" OUTPUT_DIRECTORY = docstring EXTRACT_ALL = YES GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO OPTIMIZE_OUTPUT_JAVA = YES INPUT = docstring.py QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/docstring.py000066400000000000000000000006621475641424700235070ustar00rootroot00000000000000"""@package docstring Documentation for this module. More details. """ from __future__ import annotations def func(): """Documentation for a function. More details. """ pass class PyClass: """Documentation for a class. More details. """ def __init__(self): """The constructor.""" self._memVar = 0 def PyMethod(self): """Documentation for a method.""" pass breathe-doc-breathe-10a36f3/examples/doxygen/enum.cfg000066400000000000000000000004011475641424700225550ustar00rootroot00000000000000PROJECT_NAME = "Enum Command" OUTPUT_DIRECTORY = enum GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = enum.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/enum.h000066400000000000000000000010601475641424700222470ustar00rootroot00000000000000class Test4 { public: enum TEnum { Val1, Val2 }; /*! Another enum, with inline docs */ enum AnotherEnum { V1, /*!< value 1 */ V2 /*!< value 2 */ }; /*! Another enum, with inline docs (using an explicit datatype) */ enum class AnotherScopedEnum : long { V1, /*!< value 1 */ V2 /*!< value 2 */ }; }; /*! \class Test4 * The class description. */ /*! \enum Test4::TEnum * A description of the enum type. */ /*! \var Test4::TEnum Test4::Val1 * The description of the first enum value. */ breathe-doc-breathe-10a36f3/examples/doxygen/example.cfg000066400000000000000000000005311475641424700232500ustar00rootroot00000000000000PROJECT_NAME = "Example Command" OUTPUT_DIRECTORY = example GENERATE_TAGFILE = example.tag GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = example.cpp EXAMPLE_PATH = example_test.cpp QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/example.cpp000066400000000000000000000005261475641424700232770ustar00rootroot00000000000000/** A Test5 class. * More details about this class. */ class Test5 { public: /** An example member function. * More details about this function. */ void example(); }; void Test5::example() {} /** \example example_test.cpp * This is an example of how to use the Test5 class. * More details about this example. */ breathe-doc-breathe-10a36f3/examples/doxygen/example_test.cpp000066400000000000000000000000521475641424700243300ustar00rootroot00000000000000void main() { Test7 t; t.example(); } breathe-doc-breathe-10a36f3/examples/doxygen/file.cfg000066400000000000000000000004011475641424700225300ustar00rootroot00000000000000PROJECT_NAME = "File Command" OUTPUT_DIRECTORY = file GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = file.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/file.h000066400000000000000000000002671475641424700222320ustar00rootroot00000000000000/** \file file.h * A brief file description. * A more elaborated file description. */ /** * A global integer value. * More details about this value. */ extern int globalValue; breathe-doc-breathe-10a36f3/examples/doxygen/func.cfg000066400000000000000000000003771475641424700225600ustar00rootroot00000000000000PROJECT_NAME = "Fn Command" OUTPUT_DIRECTORY = func GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = func.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/func.h000066400000000000000000000012321475641424700222370ustar00rootroot00000000000000class Test6 { public: const char *member(char,int) throw(std::out_of_range); }; const char *Test6::member(char c,int n) throw(std::out_of_range) {} /*! \class Test6 * \brief Test6 class. * * Details about Test6. */ /*! \fn const char *Test6::member(char c,int n) * \brief A member function. * \param c a character. * \param n an integer. * \exception std::out_of_range parameter is out of range. * \return a character pointer. */ /*! \brief Doing important things with parameter directions * * \param[out] a output * \param[in] b input * \param[in, out] c input but gets rewritten */ void myFunc(int * a, int * b, int * c); breathe-doc-breathe-10a36f3/examples/doxygen/group.cfg000066400000000000000000000004011475641424700227450ustar00rootroot00000000000000PROJECT_NAME = "Grouping" OUTPUT_DIRECTORY = group GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = group.cpp QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/group.cpp000066400000000000000000000027241475641424700230020ustar00rootroot00000000000000/** @defgroup group1 The First Group * This is the first group * @{ */ /** @brief class C1 in group 1 */ class C1 {}; /** @brief class C2 in group 1 */ class C2 {}; /** function in group 1 */ void func1() {} /** @} */ // end of group1 /** * @defgroup group2 The Second Group * This is the second group */ /** @defgroup group3 The Third Group * This is the third group */ /** @defgroup group4 The Fourth Group * @ingroup group3 * Group 4 is a subgroup of group 3 */ /** * @ingroup group2 * @brief class C3 in group 2 */ class C3 {}; /** @ingroup group2 * @brief class C4 in group 2 */ class C4 {}; /** @ingroup group3 * @brief class C5 in @link group3 the third group@endlink. */ class C5 {}; /** @ingroup group1 group2 group3 group4 * namespace N1 is in four groups * @sa @link group1 The first group@endlink, group2, group3, group4 * * Also see @ref mypage2 */ namespace N1 {}; /** @file * @ingroup group3 * @brief this file in group 3 */ /** @defgroup group5 The Fifth Group * This is the fifth group * @{ */ /** @page mypage1 This is a section in group 5 * Text of the first section */ /** @page mypage2 This is another section in group 5 * Text of the second section */ /** @} */ // end of group5 /** @addtogroup group1 * * More documentation for the first group. * @{ */ /** another function in group 1 */ void func2() {} /** yet another function in group 1 */ void func3() {} /** @} */ // end of group1 breathe-doc-breathe-10a36f3/examples/doxygen/include.cfg000066400000000000000000000004601475641424700232410ustar00rootroot00000000000000PROJECT_NAME = "Include Command" OUTPUT_DIRECTORY = include GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = include.cpp EXAMPLE_PATH = example_test.cpp QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/include.cpp000066400000000000000000000006401475641424700232640ustar00rootroot00000000000000 /*! A test class. */ class Test7 { public: /// a member function void example(); }; /*! \page example * \dontinclude example_test.cpp * Our main function starts like this: * \skip main * \until { * First we create a object \c t of the Test7 class. * \skipline Test7 * Then we call the example member function * \line example * After that our little test routine ends. * \line } */ breathe-doc-breathe-10a36f3/examples/doxygen/interface.cfg000066400000000000000000000004201475641424700235520ustar00rootroot00000000000000PROJECT_NAME = "Interface Command" OUTPUT_DIRECTORY = interface GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = interface.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/interface.h000066400000000000000000000004031475641424700232430ustar00rootroot00000000000000/* A dummy interface, which is really just a specially treated class in C++ */ class TestInterface { }; /*! \interface TestInterface interface.h "inc/interface.h" * \brief This is a test interface. * * Some details about the TestInterface interface */ breathe-doc-breathe-10a36f3/examples/doxygen/jdstyle.cfg000066400000000000000000000004221475641424700232720ustar00rootroot00000000000000PROJECT_NAME = "JavaDoc Style" OUTPUT_DIRECTORY = jdstyle GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = jdstyle.cpp QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/jdstyle.cpp000066400000000000000000000026501475641424700233220ustar00rootroot00000000000000/** * A test class. A more elaborate class description. */ class Test8 { public: /** * An enum. * More detailed enum description. */ enum TEnum { TVal1, /**< enum value TVal1. */ TVal2, /**< enum value TVal2. */ TVal3 /**< enum value TVal3. */ } *enumPtr, /**< enum pointer. Details. */ enumVar; /**< enum variable. Details. */ /** * A constructor. * A more elaborate description of the constructor. */ Test8(); /** * A destructor. * A more elaborate description of the destructor. */ ~Test8(); /** * a normal member taking two arguments and returning an integer value. * @param a an integer argument. * @param s a constant character pointer. * @see Test8() * @see ~Test8() * @see testMeToo() * @see publicVar() * @return The test results */ int testMe(int a,const char *s); /** * A pure virtual member. * @see testMe() * @param c1 the first argument. * @param c2 the second argument. */ virtual void testMeToo(char c1,char c2) = 0; /** * a public variable. * Details. */ int publicVar; /** * a function variable. * Details. */ int (*handler)(int a,int b); }; breathe-doc-breathe-10a36f3/examples/doxygen/make.bat000066400000000000000000000043731475641424700225510ustar00rootroot00000000000000@ECHO OFF set DOXYGEN=doxygen for /f "delims=" %%i in ('where doxygen') do set DOXYGEN=%%i set PERL=perl for /f "delims=" %%i in ('where perl') do set PERL=%%i set HAVE_DOT=dot for /f "delims=" %%i in ('where dot') do set HAVE_DOT=%%i @REM echo DOXYGEN : %DOXYGEN% @REM echo PERL : %PERL% @REM echo HAVE_DOT : %HAVE_DOT% if "%1" == "" ( call :all goto end ) if "%1" == "all" ( call :all goto end ) if "%1" == "clean" ( call :clean goto end ) goto end :all call :doxygen class.cfg call :doxygen concept.cfg call :doxygen define.cfg call :doxygen enum.cfg call :doxygen file.cfg call :doxygen func.cfg call :doxygen page.cfg call :doxygen relates.cfg call :doxygen author.cfg call :doxygen par.cfg call :doxygen parblock.cfg call :doxygen overload.cfg call :doxygen example.cfg call :doxygen include.cfg call :doxygen qtstyle.cfg call :doxygen jdstyle.cfg call :doxygen structcmd.cfg call :doxygen autolink.cfg call :doxygen restypedef.cfg call :doxygen afterdoc.cfg call :doxygen templ.cfg call :doxygen tag.cfg call :doxygen group.cfg call :doxygen diagrams.cfg call :doxygen memgrp.cfg call :doxygen docstring.cfg call :doxygen pyexample.cfg call :doxygen manual.cfg call :doxygen interface.cfg goto end :clean call :rmdir class call :rmdir concept call :rmdir define call :rmdir enum call :rmdir file call :rmdir func call :rmdir page call :rmdir relates call :rmdir author call :rmdir par call :rmdir parblock call :rmdir overload call :rmdir example call :rmdir include call :rmdir qtstyle call :rmdir jdstyle call :rmdir structcmd call :rmdir autolink call :rmdir restypedef call :rmdir afterdoc call :rmdir template call :rmdir tag call :rmdir group call :rmdir diagrams call :rmdir memgrp call :rmdir docstring call :rmdir pyexample call :rmdir manual call :rmdir interface goto end :doxygen set CFG=%~1 echo Running doxygen: %CFG% "%DOXYGEN%" %CFG% goto end :rmdir set DIR=%~1 if exist "%DIR%" ( echo Removing directory: %DIR% rmdir /s/q "%DIR%" ) goto end :endbreathe-doc-breathe-10a36f3/examples/doxygen/manual.c000066400000000000000000000022741475641424700225630ustar00rootroot00000000000000/** * \file manual.c */ typedef struct Object Object; //!< Object type typedef struct Vehicle Vehicle; //!< Vehicle type typedef struct Car Car; //!< Car type typedef struct Truck Truck; //!< Truck type /*! * Base object class. */ struct Object { int ref; //!< \private Reference count. }; /*! * Increments object reference count by one. * \public \memberof Object */ static Object * objRef(Object *obj); /*! * Decrements object reference count by one. * \public \memberof Object */ static Object * objUnref(Object *obj); /*! * Vehicle class. * \extends Object */ struct Vehicle { Object base; //!< \protected Base class. }; /*! * Starts the vehicle. * \public \memberof Vehicle */ void vehicleStart(Vehicle *obj); /*! * Stops the vehicle. * \public \memberof Vehicle */ void vehicleStop(Vehicle *obj); /*! * Car class. * \extends Vehicle */ struct Car { Vehicle base; //!< \protected Base class. }; /*! * Truck class. * \extends Vehicle */ struct Truck { Vehicle base; //!< \protected Base class. }; /*! * Main function. * * Ref vehicleStart(), objRef(), objUnref(). */ int main(void) { Car c; vehicleStart((Vehicle*) &c); } breathe-doc-breathe-10a36f3/examples/doxygen/manual.cfg000066400000000000000000000007751475641424700231040ustar00rootroot00000000000000PROJECT_NAME = "Manual inheritance and membership" OUTPUT_DIRECTORY = manual GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = manual.c QUIET = YES JAVADOC_AUTOBRIEF = YES EXTRACT_PRIVATE = YES EXTRACT_STATIC = YES TYPEDEF_HIDES_STRUCT = YES INLINE_SOURCES = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/memgrp.cfg000066400000000000000000000005371475641424700231120ustar00rootroot00000000000000PROJECT_NAME = "Member Grouping" OUTPUT_DIRECTORY = memgrp GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = memgrp.cpp QUIET = YES DISTRIBUTE_GROUP_DOC = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARN_IF_UNDOCUMENTED = NObreathe-doc-breathe-10a36f3/examples/doxygen/memgrp.cpp000066400000000000000000000015031475641424700231270ustar00rootroot00000000000000/** A class. Details */ class Test9 { public: //@{ /** Same documentation for both members. Details */ void func1InGroup1(); void func2InGroup1(); //@} /** Function without group. Details. */ void ungroupedFunction(); // intentionally not documenting this member? void func1InGroup2(); protected: void func2InGroup2(); }; void Test9::func1InGroup1() {} void Test9::func2InGroup1() {} /** @name Group2 * Description of group 2. */ //@{ /** Function 2 in group 2. Details. */ void Test9::func2InGroup2() {} /** Function 1 in group 2. Details. */ void Test9::func1InGroup2() {} //@} /*! \file * docs for this file */ //@{ //! one description for all members of this group //! (because DISTRIBUTE_GROUP_DOC is YES in the config file) #define A 1 #define B 2 void glob_func(); //@} breathe-doc-breathe-10a36f3/examples/doxygen/overload.cfg000066400000000000000000000004471475641424700234360ustar00rootroot00000000000000PROJECT_NAME = "Overloaded Command" OUTPUT_DIRECTORY = overload GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO SORT_MEMBER_DOCS = NO INPUT = overload.cpp QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/overload.cpp000066400000000000000000000007601475641424700234570ustar00rootroot00000000000000class Test10 { public: void drawRect(int,int,int,int); void drawRect(const Rect &r); }; void Test10::drawRect(int x,int y,int w,int h) {} void Test10::drawRect(const Rect &r) {} /*! \class Test10 * \brief A short description. * * More text. */ /*! \fn void Test10::drawRect(int x,int y,int w,int h) * This command draws a rectangle with a left upper corner at ( \a x , \a y ), * width \a w and height \a h. */ /*! * \overload void Test10::drawRect(const Rect &r) */ breathe-doc-breathe-10a36f3/examples/doxygen/page.cfg000066400000000000000000000004031475641424700225270ustar00rootroot00000000000000PROJECT_NAME = "Page Command" OUTPUT_DIRECTORY = page GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = page.doc QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/page.doc000066400000000000000000000005621475641424700225430ustar00rootroot00000000000000/*! \page page1 A documentation page Leading text. \section sec An example section This page contains the subsections \ref subsection1 and \ref subsection2. For more info see page \ref page2. \subsection subsection1 The first subsection Text. \subsection subsection2 The second subsection More text. */ /*! \page page2 Another page Even more info. */ breathe-doc-breathe-10a36f3/examples/doxygen/par.cfg000066400000000000000000000004001475641424700223720ustar00rootroot00000000000000PROJECT_NAME = "Par Command" OUTPUT_DIRECTORY = par GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = par.cpp QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/par.cpp000066400000000000000000000005151475641424700224240ustar00rootroot00000000000000/*! \class Test11 * Normal text. * * \par User defined paragraph: * Contents of the paragraph. * * \par * New paragraph under the same heading. * * \note * This note consists of two paragraphs. * This is the first paragraph. * * \par * And this is the second paragraph. * * More normal text. */ class Test11 {}; breathe-doc-breathe-10a36f3/examples/doxygen/parblock.cfg000066400000000000000000000004171475641424700234150ustar00rootroot00000000000000PROJECT_NAME = "Parblock Command" OUTPUT_DIRECTORY = parblock GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = parblock.cpp QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/parblock.cpp000066400000000000000000000007631475641424700234440ustar00rootroot00000000000000/*! \class Test15 * Normal text. * * \par A paragraph followed by a paragraph block: * \parblock * Contents of the first paragraph in the block. * * New paragraph under the same heading. * \endparblock * * \note * This note consists of three paragraphs in a block. * \parblock * This is the first paragraph in the block. * * And this is the second paragraph in the block. * * And still a third paragraph in the block. * \endparblock * * More normal text. */ class Test15 {}; breathe-doc-breathe-10a36f3/examples/doxygen/pyexample.cfg000066400000000000000000000004131475641424700236200ustar00rootroot00000000000000PROJECT_NAME = "Python" OUTPUT_DIRECTORY = pyexample GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO OPTIMIZE_OUTPUT_JAVA = YES INPUT = pyexample.py QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/pyexample.py000066400000000000000000000010171475641424700235120ustar00rootroot00000000000000## @package pyexample # Documentation for this module. # # More details. ## Documentation for a function. # # More details. from __future__ import annotations def func(): pass ## Documentation for a class. # # More details. class PyClass: ## The constructor. def __init__(self): self._memVar = 0 ## Documentation for a method. # @param self The object pointer. def PyMethod(self): pass ## A class variable. classVar = 0 ## @var _memVar # a member variable breathe-doc-breathe-10a36f3/examples/doxygen/qtstyle.cfg000066400000000000000000000004051475641424700233220ustar00rootroot00000000000000PROJECT_NAME = "Qt Style" OUTPUT_DIRECTORY = qtstyle GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = qtstyle.cpp QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/qtstyle.cpp000066400000000000000000000025571475641424700233570ustar00rootroot00000000000000//! A test class. /*! A more elaborate class description. */ class Test12 { public: //! An enum. /*! More detailed enum description. */ enum TEnum { TVal1, /*!< Enum value TVal1. */ TVal2, /*!< Enum value TVal2. */ TVal3 /*!< Enum value TVal3. */ } //! Enum pointer. /*! Details. */ *enumPtr, //! Enum variable. /*! Details. */ enumVar; //! A constructor. /*! A more elaborate description of the constructor. */ Test12(); //! A destructor. /*! A more elaborate description of the destructor. */ ~Test12(); //! A normal member taking two arguments and returning an integer value. /*! \param a an integer argument. \param s a constant character pointer. \return The test results \sa Test12(), ~Test12(), testMeToo() and publicVar() */ int testMe(int a,const char *s); //! A pure virtual member. /*! \sa testMe() \param c1 the first argument. \param c2 the second argument. */ virtual void testMeToo(char c1,char c2) = 0; //! A public variable. /*! Details. */ int publicVar; //! A function variable. /*! Details. */ int (*handler)(int a,int b); }; breathe-doc-breathe-10a36f3/examples/doxygen/relates.cfg000066400000000000000000000004141475641424700232540ustar00rootroot00000000000000PROJECT_NAME = "Relates Command" OUTPUT_DIRECTORY = relates GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = relates.cpp QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/relates.cpp000066400000000000000000000004101475641424700232730ustar00rootroot00000000000000/*! * A String class. */ class String { friend int strcmp(const String &,const String &); }; /*! * Compares two strings. */ int strcmp(const String &s1,const String &s2) { } /*! \relates String * A string debug function. */ void stringDebug() { } breathe-doc-breathe-10a36f3/examples/doxygen/restypedef.cfg000066400000000000000000000004251475641424700237710ustar00rootroot00000000000000PROJECT_NAME = "Resolving Typedefs" OUTPUT_DIRECTORY = restypedef GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = restypedef.cpp QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/restypedef.cpp000066400000000000000000000006421475641424700240150ustar00rootroot00000000000000/*! \file restypedef.cpp * An example of resolving typedefs. */ /*! \struct CoordStruct * A coordinate pair. */ struct CoordStruct { /*! The x coordinate */ float x; /*! The y coordinate */ float y; }; /*! Creates a type name for CoordStruct */ typedef CoordStruct Coord; /*! * This function returns the addition of \a c1 and \a c2, i.e: * (c1.x+c2.x,c1.y+c2.y) */ Coord add(Coord c1,Coord c2) { } breathe-doc-breathe-10a36f3/examples/doxygen/structcmd.cfg000066400000000000000000000004221475641424700236240ustar00rootroot00000000000000PROJECT_NAME = "Structural commands" OUTPUT_DIRECTORY = structcmd GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = structcmd.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/structcmd.h000066400000000000000000000025441475641424700233230ustar00rootroot00000000000000/*! \file structcmd.h \brief A Documented file. Details. */ /*! \def MAX_NUMBER(a,b) \brief A macro that returns the maximum of \a a and \a b. Details. */ /*! \var typedef unsigned int UINT32 \brief A type definition for a . Details. */ /*! \var int errno \brief Contains the last error code. \warning Not thread safe! */ /*! \fn int open(const char *pathname,int flags) \brief Opens a file descriptor. Detailed description. \param pathname The name of the descriptor. \param flags Opening flags. */ /*! \fn int close(int fd) \brief Closes the file descriptor \a fd. \param fd The descriptor to close. */ /*! \fn size_t write(int fd,const char *buf, size_t count) \brief Writes \a count bytes from \a buf to the file descriptor \a fd. \param fd The descriptor to write to. \param buf The data buffer to write. \param count The number of bytes to write. */ /*! \fn int read(int fd,char *buf,size_t count) \brief Read bytes from a file descriptor. \param fd The descriptor to read from. \param buf The buffer to read into. \param count The number of bytes to read. */ #define MAX_NUMBER(a,b) (((a)>(b))?(a):(b)) typedef unsigned int UINT32; int errno; int open(const char *,int); int close(int); size_t write(int,const char *, size_t); int read(int,char *,size_t); breathe-doc-breathe-10a36f3/examples/doxygen/tag.cfg000066400000000000000000000004601475641424700223710ustar00rootroot00000000000000PROJECT_NAME = "Tag Files" OUTPUT_DIRECTORY = tag GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = tag.cpp TAGFILES = example.tag=../../example/html QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/tag.cpp000066400000000000000000000002401475641424700224100ustar00rootroot00000000000000/*! A class that is inherited from the external class Test13. */ class Tag : public Test13 { public: /*! an overloaded member. */ void example(); }; breathe-doc-breathe-10a36f3/examples/doxygen/templ.cfg000066400000000000000000000004111475641424700227330ustar00rootroot00000000000000PROJECT_NAME = "Template Test" OUTPUT_DIRECTORY = template GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = templ.cpp QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/doxygen/templ.cpp000066400000000000000000000013311475641424700227600ustar00rootroot00000000000000 /*! A template class */ template class Test14 { public: Test14(); Test14(const Test14 &); }; /*! complete specialization */ template<> class Test14 { public: Test14(); }; /*! A partial template specialization */ template class Test14 : public Test14 { public: Test14(); }; /*! The constructor of the template class*/ template Test14::Test14() {} /*! The copy constructor */ template Test14::Test14(const Test14 &t) {} /*! The constructor of the partial specialization */ template Test14::Test14() {} /*! The constructor of the specialization */ template<> Test14::Test14() {} breathe-doc-breathe-10a36f3/examples/specific/000077500000000000000000000000001475641424700212455ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/examples/specific/.gitignore000066400000000000000000000002201475641424700232270ustar00rootroot00000000000000/functypedef /alias /class /inline /nutshell /rst /typedef /members /image /decl_impl */doxygen_sqlite3.db */xml/*.xml */xml/*.xsd */xml/*.xslt breathe-doc-breathe-10a36f3/examples/specific/Makefile000066400000000000000000000040341475641424700227060ustar00rootroot00000000000000# # This file was generated from Makefile.in on Sat Dec 13 12:17:28 GMT 2008 # DOXYGEN ?= `which doxygen` TMAKEPATH = ENV = env TMAKEPATH=$(TMAKEPATH) TMAKE = MAKE = /usr/bin/make PERL = /usr/bin/perl RM = rm -f CP = cp VERSION = 1.5.7.1 INSTALL = /tmp INSTTOOL = /usr/bin/install DOXYDOCS = .. DOCDIR = $(INSTALL)/share/doc/packages/doxygen QTDIR = HAVE_DOT = /usr/bin/dot projects = nutshell alias rst inline namespacefile array inheritance \ members userdefined fixedwidthfont latexmath functionOverload \ image name union group struct struct_function qtsignalsandslots lists \ headings links parameters template_class template_class_non_type \ template_function template_type_alias template_specialisation \ enum define interface xrefsect tables \ cpp_anon cpp_concept cpp_enum cpp_union cpp_function cpp_friendclass \ cpp_inherited_members cpp_trailing_return_type cpp_constexpr_hax \ cpp_function_lookup cpp_ns_template_specialization \ c_file c_struct c_enum c_typedef c_macro c_union membergroups \ simplesect code_blocks dot_graphs special = programlisting decl_impl multifilexml auto class typedef xmls := $(foreach project, $(projects), $(project)/xml/index.xml) special_xmls = $(foreach project, $(special), $(project)/xml/index.xml) all: $(xmls) $(special_xmls) clean: rm -rf $(projects) $(special) # General pattern # --------------- $(xmls): %/xml/index.xml: %.cfg %.h $(DOXYGEN) $< # Special Cases # ------------- programlisting/xml/index.xml: programlisting.h programlisting.cfg programlistinginclude.txt $(DOXYGEN) programlisting.cfg decl_impl/xml/index.xml: decl_impl.h decl_impl.cpp decl_impl.cfg $(DOXYGEN) decl_impl.cfg multifilexml/xml/index.xml: multifile/one/Util.h multifile/two/Util.h multifile.cfg $(DOXYGEN) multifile.cfg auto/xml/index.xml: auto_class.h auto_function.h auto.cfg $(DOXYGEN) auto.cfg class/xml/index.xml: class.h class.cpp class.cfg $(DOXYGEN) class.cfg typedef/xml/index.xml: typedef.h typedef.cfg $(DOXYGEN) typedef.cfg breathe-doc-breathe-10a36f3/examples/specific/alias.cfg000066400000000000000000000004761475641424700230260ustar00rootroot00000000000000PROJECT_NAME = "ALIAS Example" OUTPUT_DIRECTORY = alias GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = alias.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES ALIASES = "sideeffect=\par Side Effects^^" breathe-doc-breathe-10a36f3/examples/specific/alias.h000066400000000000000000000003671475641424700225150ustar00rootroot00000000000000 /*! @file alias.h */ /** * Foo frob routine. * \par bob this something else * @sideeffect Frobs any foos. * * \par bob this something else * * @sideeffect Frobs any foos. * * @param[out] Frobs any foos. */ void frob_foos(void* Frobs); breathe-doc-breathe-10a36f3/examples/specific/array.cfg000066400000000000000000000004371475641424700230500ustar00rootroot00000000000000PROJECT_NAME = "Array Command" OUTPUT_DIRECTORY = array GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = array.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES OPTIMIZE_OUTPUT_FOR_C = YESbreathe-doc-breathe-10a36f3/examples/specific/array.h000066400000000000000000000004331475641424700225340ustar00rootroot00000000000000 /** My function */ int foo(int a[5]); /** My other function * * @test This declaration is supposed to be * @code{.c} * int bar(int n, int a[static n]); * @endcode * But, Sphinx fails to recognize `int a[static n])` as a C specific array syntax */ int bar(int n, int a[]); breathe-doc-breathe-10a36f3/examples/specific/auto.cfg000066400000000000000000000004171475641424700227000ustar00rootroot00000000000000PROJECT_NAME = "Auto" OUTPUT_DIRECTORY = auto GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = auto_class.h auto_function.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/auto_class.h000066400000000000000000000003271475641424700235550ustar00rootroot00000000000000 //! \brief class outside of namespace class AutoClassTest { //! \brief non-namespaced class function void member() {}; //! \brief non-namespaced class other function void anotherMember() {}; }; breathe-doc-breathe-10a36f3/examples/specific/auto_function.h000066400000000000000000000002211475641424700242660ustar00rootroot00000000000000 //! \brief non-namespaced class function void autoFunction() {}; //! \brief non-namespaced class other function void anotherAutoFunction() {}; breathe-doc-breathe-10a36f3/examples/specific/c_enum.cfg000066400000000000000000000003771475641424700232030ustar00rootroot00000000000000PROJECT_NAME = "C Enum" OUTPUT_DIRECTORY = c_enum GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = c_enum.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/c_enum.h000066400000000000000000000026651475641424700226750ustar00rootroot00000000000000 // Example of a enum in C which has different syntax and different support in Sphinx to the C++ enum /** * Backup data. * * \ingroup Backup */ typedef enum { /** * Compatibility with old gboolean used instead of format. * * File type is guessed for extension, non unicode format used * for Gammu backup. */ GSM_Backup_Auto = 0, /** * Compatibility with old gboolean used instead of format. * * File type is guessed for extension, unicode format used * for Gammu backup. */ GSM_Backup_AutoUnicode = 1, /** * LMB format, compatible with Logo manager, can store * phonebooks and logos. */ GSM_Backup_LMB, /** * vCalendar standard, can store todo and calendar entries. */ GSM_Backup_VCalendar, /** * vCard standard, can store phone phonebook entries. */ GSM_Backup_VCard, /** * LDIF (LDAP Data Interchange Format), can store phone * phonebook entries. */ GSM_Backup_LDIF, /** * iCalendar standard, can store todo and calendar entries. */ GSM_Backup_ICS, /** * Gammu own format can store almost anything from phone. * * This is ASCII version of the format, Unicode strings are HEX * encoded. Use GSM_Backup_GammuUCS2 instead if possible. */ GSM_Backup_Gammu, /** * Gammu own format can store almost anything from phone. * * This is UCS2-BE version of the format. */ GSM_Backup_GammuUCS2, /** * vNote standard, can store phone notes. */ GSM_Backup_VNote, } GSM_BackupFormat; breathe-doc-breathe-10a36f3/examples/specific/c_file.cfg000066400000000000000000000004421475641424700231470ustar00rootroot00000000000000PROJECT_NAME = "C File Example" OUTPUT_DIRECTORY = c_file GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = c_file.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARN_IF_UNDOCUMENTED = NO breathe-doc-breathe-10a36f3/examples/specific/c_file.h000066400000000000000000000030151475641424700226360ustar00rootroot00000000000000/* Borrowed from git "cache-tree.h" as an example of C code */ #ifndef CACHE_TREE_H #define CACHE_TREE_H #include "tree.h" #include "tree-walk.h" struct cache_tree; struct cache_tree_sub { struct cache_tree *cache_tree; int namelen; int used; char name[FLEX_ARRAY]; }; struct cache_tree { int entry_count; /* negative means "invalid" */ unsigned char sha1[20]; int subtree_nr; int subtree_alloc; struct cache_tree_sub **down; }; /** Shared cache tree instance. */ extern struct cache_tree global_cache_tree; struct cache_tree *cache_tree(void); extern void cache_tree_free(struct cache_tree **); void cache_tree_invalidate_path(struct cache_tree *, const char *); struct cache_tree_sub *cache_tree_sub(struct cache_tree *, const char *); void cache_tree_write(struct strbuf *, struct cache_tree *root); struct cache_tree *cache_tree_read(const char *buffer, unsigned long size); int cache_tree_fully_valid(struct cache_tree *); int cache_tree_update(struct cache_tree *, struct cache_entry **, int, int, int); /** bitmasks to write_cache_as_tree flags */ #define WRITE_TREE_MISSING_OK 1 #define WRITE_TREE_IGNORE_CACHE_TREE 2 /** error return codes */ #define WRITE_TREE_UNREADABLE_INDEX (-1) #define WRITE_TREE_UNMERGED_INDEX (-2) #define WRITE_TREE_PREFIX_ERROR (-3) int write_cache_as_tree(unsigned char *sha1, int flags, const char *prefix); void prime_cache_tree(struct cache_tree **, struct tree *); extern int cache_tree_matches_traversal(struct cache_tree *, struct name_entry *ent, struct traverse_info *info); #endif breathe-doc-breathe-10a36f3/examples/specific/c_macro.cfg000066400000000000000000000004021475641424700233250ustar00rootroot00000000000000PROJECT_NAME = "C Macro" OUTPUT_DIRECTORY = c_macro GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = c_macro.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/c_macro.h000066400000000000000000000001141475641424700230150ustar00rootroot00000000000000 #define A_C_MACRO "hello world" #define ANOTHER_C_MACRO(name) "hello" name breathe-doc-breathe-10a36f3/examples/specific/c_struct.cfg000066400000000000000000000004401475641424700235520ustar00rootroot00000000000000PROJECT_NAME = "C Struct" OUTPUT_DIRECTORY = c_struct GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = c_struct.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARN_IF_UNDOCUMENTED = NO breathe-doc-breathe-10a36f3/examples/specific/c_struct.h000066400000000000000000000001051475641424700232400ustar00rootroot00000000000000 struct ACStruct { int i; struct ANestedStruct { int i; }; }; breathe-doc-breathe-10a36f3/examples/specific/c_typedef.cfg000066400000000000000000000004301475641424700236650ustar00rootroot00000000000000PROJECT_NAME = "Function Type Def Command" OUTPUT_DIRECTORY = c_typedef GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = c_typedef.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/c_typedef.h000066400000000000000000000004611475641424700233610ustar00rootroot00000000000000/** * Sample typedef for a function pointer */ typedef int (*cTypeDefTestFuncPtr)(void); typedef void* (*cVoidFuncPtr)(float, int); typedef void* cVoidPointer; typedef float* cFloatPointer; typedef float cFloatingPointNumber; /** * @brief Test for a simple C typedef */ typedef int cTestTypedef; breathe-doc-breathe-10a36f3/examples/specific/c_union.cfg000066400000000000000000000004351475641424700233620ustar00rootroot00000000000000PROJECT_NAME = "C Union" OUTPUT_DIRECTORY = c_union GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = c_union.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARN_IF_UNDOCUMENTED = NO breathe-doc-breathe-10a36f3/examples/specific/c_union.h000066400000000000000000000000351475641424700230460ustar00rootroot00000000000000 union ACUnion { int i; }; breathe-doc-breathe-10a36f3/examples/specific/class.cfg000066400000000000000000000004511475641424700230330ustar00rootroot00000000000000PROJECT_NAME = "Class Command" OUTPUT_DIRECTORY = class GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = class.h class.cpp QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARN_IF_UNDOCUMENTED = NO breathe-doc-breathe-10a36f3/examples/specific/class.cpp000066400000000000000000000003031475641424700230520ustar00rootroot00000000000000#include "class.h" /*! More documentation in the impl file */ void ClassTest::function(int myIntParameter) { } /*! More documentation in the impl file */ void ClassTest::anotherFunction() { } breathe-doc-breathe-10a36f3/examples/specific/class.h000066400000000000000000000043771475641424700225360ustar00rootroot00000000000000#include namespace TestNamespaceClasses { //! \brief first class inside of namespace class NamespacedClassTest { public: //! \brief namespaced class function virtual void function() const = 0; static void functionS(); explicit NamespacedClassTest() {} //! \brief namespaced class other function void anotherFunction() {} }; //! \brief second class inside of namespace class ClassTest { public: //! \brief second namespaced class function void function() {} //! \brief second namespaced class other function void anotherFunction() {} }; } // TestNamespaceClasses //! \brief class outside of namespace class OuterClass { public: //! \brief inner class class InnerClass {}; }; //! \brief class outside of namespace class ClassTest { public: /*! \brief non-namespaced class function More details in the header file. */ void function(int myParameter); //! \brief non-namespaced class other function void anotherFunction(); //! \brief namespaced class function virtual void publicFunction() const = 0; virtual void undocumentedPublicFunction() const = 0; //! A public class class PublicClass {}; class UndocumentedPublicClass {}; //! A public struct struct PublicStruct {}; struct UndocumentedPublicStruct {}; protected: //! A protected function void protectedFunction() {} void undocumentedProtectedFunction() {} //! A protected class class ProtectedClass {}; class UndocumentedProtectedClass {}; //! A protected struct struct ProtectedStruct {}; struct UndocumentedProtectedStruct {}; private: //! This is a private function virtual void privateFunction() const = 0; virtual void undocumentedPrivateFunction() const = 0; //! A private class class PrivateClass {}; class UndocumentedPrivateClass {}; //! A private struct struct PrivateStruct {}; struct UndocumentedPrivateStruct {}; }; template void f0(); template<> void f0(); namespace NS1 { template void f1(); template<> void f1(); namespace NS2 { template void f2(); template<> void f2(); } // namespace NS2 } // namespace NS1 breathe-doc-breathe-10a36f3/examples/specific/code_blocks.cfg000066400000000000000000000004161475641424700241760ustar00rootroot00000000000000PROJECT_NAME = "Code Blocks" OUTPUT_DIRECTORY = code_blocks GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = code_blocks.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/code_blocks.h000066400000000000000000000015271475641424700236720ustar00rootroot00000000000000 /** A function with an unannotated code block with C/C++ code. * * @code * char* buffer = new char[42]; * int charsAdded = sprintf(buffer, "Tabs are normally %d spaces\n", 8); * @endcode */ void with_standard_code_block(); /** A function with an unannotated code block with non-C/C++ code. * * @code * set(user_list A B C) * foreach(element ${user_list}) * message(STATUS "Element is ${element}") * endforeach() * @endcode * * Another code-block that explicitly remains not highlighted. * @code{.unparsed} * Show this as is. * @endcode */ void with_unannotated_cmake_code_block(); /** A function with an annotated cmake code block. * * @code{.cmake} * set(user_list A B C) * foreach(element ${user_list}) * message(STATUS "Element is ${element}") * endforeach() * @endcode */ void with_annotated_cmake_code_block(); breathe-doc-breathe-10a36f3/examples/specific/cpp_anon.cfg000066400000000000000000000004451475641424700235260ustar00rootroot00000000000000PROJECT_NAME = "C++ Anonymous" OUTPUT_DIRECTORY = cpp_anon GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = cpp_anon.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARN_IF_UNDOCUMENTED = NO breathe-doc-breathe-10a36f3/examples/specific/cpp_anon.h000066400000000000000000000001771475641424700232200ustar00rootroot00000000000000struct ClassWithAnonEntities { struct { int structMember; }; union { int unionMember; }; enum { Enumerator }; }; breathe-doc-breathe-10a36f3/examples/specific/cpp_concept.cfg000066400000000000000000000004161475641424700242240ustar00rootroot00000000000000PROJECT_NAME = "C++ Concept" OUTPUT_DIRECTORY = cpp_concept GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = cpp_concept.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/cpp_concept.h000066400000000000000000000001721475641424700237130ustar00rootroot00000000000000template concept Hashable = requires(T a) { { std::hash{}(a) } -> std::convertible_to; }; breathe-doc-breathe-10a36f3/examples/specific/cpp_constexpr_hax.cfg000066400000000000000000000004341475641424700254560ustar00rootroot00000000000000PROJECT_NAME = "Constexpr Hax" OUTPUT_DIRECTORY = cpp_constexpr_hax GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = cpp_constexpr_hax.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/cpp_constexpr_hax.h000066400000000000000000000002631475641424700251460ustar00rootroot00000000000000[[nodiscard]] constexpr static auto f1(std::false_type) {} [[nodiscard]] static constexpr auto f2(std::false_type) {} constexpr static int v1 = 42; static constexpr int v2 = 42; breathe-doc-breathe-10a36f3/examples/specific/cpp_enum.cfg000066400000000000000000000004051475641424700235330ustar00rootroot00000000000000PROJECT_NAME = "C++ Enum" OUTPUT_DIRECTORY = cpp_enum GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = cpp_enum.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/cpp_enum.h000066400000000000000000000003261475641424700232250ustar00rootroot00000000000000enum Unscoped : int { UnscopedEnumerator = 42 }; enum struct ScopedStruct : int { Enumerator = 42 }; enum class ScopedClass : int { Enumerator = 42 }; enum class ScopedClassNoUnderlying { Enumerator = 42 }; breathe-doc-breathe-10a36f3/examples/specific/cpp_friendclass.cfg000066400000000000000000000004661475641424700250730ustar00rootroot00000000000000PROJECT_NAME = "C++ Friend Class" OUTPUT_DIRECTORY = cpp_friendclass GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = cpp_friendclass.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARN_IF_UNDOCUMENTED = NO breathe-doc-breathe-10a36f3/examples/specific/cpp_friendclass.h000066400000000000000000000001141475641424700245510ustar00rootroot00000000000000struct A {}; struct B {}; struct C { friend class A; friend struct B; }; breathe-doc-breathe-10a36f3/examples/specific/cpp_function.cfg000066400000000000000000000004541475641424700244200ustar00rootroot00000000000000PROJECT_NAME = "C++ Function" OUTPUT_DIRECTORY = cpp_function GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = cpp_function.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARN_IF_UNDOCUMENTED = NO breathe-doc-breathe-10a36f3/examples/specific/cpp_function.h000066400000000000000000000005611475641424700241070ustar00rootroot00000000000000struct Foo{}; struct Class { virtual void f1() const volatile & = 0; virtual void f2() const volatile && = 0; static void f3(); void (*f_issue_489)(struct Foo *foo, int value); int f_issue_338() noexcept; }; /** A namespace to demonstrate a namespaced function */ namespace TestNamespaceFunction { /** A function within a namespace. */ void namespaceFunc(); } breathe-doc-breathe-10a36f3/examples/specific/cpp_function_lookup.cfg000066400000000000000000000004461475641424700260120ustar00rootroot00000000000000PROJECT_NAME = "C++ Function Lookup" OUTPUT_DIRECTORY = cpp_function_lookup GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = cpp_function_lookup.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/cpp_function_lookup.h000066400000000000000000000010701475641424700254740ustar00rootroot00000000000000// stuff on the paramQual void fNoexcept() noexcept; void fFinal() final; void fOverride() override; void fAttr() [[myattr]]; // TODO: Doxygen seems to strip attributes void fFInit() = default; auto fTrailing() -> int; // different parameters void fInit(int arg = 42); void fPlain(int arg); void fPtr(int *arg); void fLRef(int &arg); void fRRef(int &&arg); template void fParamPack(T ...arg); class A {}; void fMemPtr(int A::*arg); void fParen(void (*arg)()); // different parameters in a function pointer void fParenPlain(void (*arg)(int argInner)); breathe-doc-breathe-10a36f3/examples/specific/cpp_inherited_members.cfg000066400000000000000000000005101475641424700262510ustar00rootroot00000000000000PROJECT_NAME = "C++ Inherited Members" OUTPUT_DIRECTORY = cpp_inherited_members GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = cpp_inherited_members.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES INLINE_INHERITED_MEMB = YES breathe-doc-breathe-10a36f3/examples/specific/cpp_inherited_members.h000066400000000000000000000003011475641424700257370ustar00rootroot00000000000000/** * @file */ /// Base class class Base { public: /// Base-class member function void f_issue_356(); }; /// Class A class A : public Base {}; /// Class B class B : public Base {}; breathe-doc-breathe-10a36f3/examples/specific/cpp_ns_template_specialization.cfg000066400000000000000000000005561475641424700302070ustar00rootroot00000000000000PROJECT_NAME = "C++ Template Specialization with Namespace" OUTPUT_DIRECTORY = cpp_ns_template_specialization GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = cpp_ns_template_specialization.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARN_IF_UNDOCUMENTED = NO breathe-doc-breathe-10a36f3/examples/specific/cpp_ns_template_specialization.h000066400000000000000000000003771475641424700277000ustar00rootroot00000000000000namespace ns1 { struct Foo { int value; }; } // namespace ns1 namespace ns2 { template struct Trait { static constexpr bool valid = false; }; template <> struct Trait { static constexpr bool valid = true; }; } // namespace ns2 breathe-doc-breathe-10a36f3/examples/specific/cpp_trailing_return_type.cfg000066400000000000000000000004651475641424700270460ustar00rootroot00000000000000PROJECT_NAME = "C++ Trailing Return Type" OUTPUT_DIRECTORY = cpp_trailing_return_type GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = cpp_trailing_return_type.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/cpp_trailing_return_type.h000066400000000000000000000003011475641424700265230ustar00rootroot00000000000000/*! \file cpp_trailing_return_type.h */ /*! needed for references in global function return type */ class Thingy {}; //! \brief Function that creates a thingy. auto f_issue_441() -> Thingy*; breathe-doc-breathe-10a36f3/examples/specific/cpp_union.cfg000066400000000000000000000004431475641424700237210ustar00rootroot00000000000000PROJECT_NAME = "C++ Union" OUTPUT_DIRECTORY = cpp_union GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = cpp_union.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARN_IF_UNDOCUMENTED = NO breathe-doc-breathe-10a36f3/examples/specific/cpp_union.h000066400000000000000000000001111475641424700234010ustar00rootroot00000000000000 union Union { int i; }; struct Class { union Union { int i; }; }; breathe-doc-breathe-10a36f3/examples/specific/decl_impl.cfg000066400000000000000000000004471475641424700236630ustar00rootroot00000000000000PROJECT_NAME = "Declaration/Implementation" OUTPUT_DIRECTORY = decl_impl GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = decl_impl.h decl_impl.cpp QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/decl_impl.cpp000066400000000000000000000003531475641424700237020ustar00rootroot00000000000000/*! More detailed description Yeah and some more. */ int open_di(const char * pathname, int flags) { return 0; } namespace testnamespace { /*! Even more documentation. */ int another_open_di(const char *,int) { return 0; } } breathe-doc-breathe-10a36f3/examples/specific/decl_impl.h000066400000000000000000000005611475641424700233500ustar00rootroot00000000000000/*! \fn int open_di(const char *pathname,int flags) \brief Opens a file descriptor. Detailed description. \param pathname The name of the descriptor. \param flags Opening flags. */ int open_di(const char *,int); namespace testnamespace { /*! \brief Some documentation. More documentation. */ int another_open_di(const char *,int); } breathe-doc-breathe-10a36f3/examples/specific/define.cfg000066400000000000000000000004071475641424700231610ustar00rootroot00000000000000PROJECT_NAME = "Define example" OUTPUT_DIRECTORY = define GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = define.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/define.h000066400000000000000000000007761475641424700226620ustar00rootroot00000000000000/** * A simple define without a value */ #define USE_STUFF /** * A define with a simple value */ #define MAX_LENGTH 100 /** * A define with some parameters * * \param A The parameter A * \param B The parameter B * * \returns The maximum of A and B */ #define MAXIMUM(A,B) ((A > B)?(A):(B)) /** * A define which spans multiple lines */ #define SWAP(A,B) { \ (a) ^= (b); \ (b) ^= (a); \ (a) ^= (b); \ } breathe-doc-breathe-10a36f3/examples/specific/dot_graphs.cfg000066400000000000000000000005411475641424700240600ustar00rootroot00000000000000PROJECT_NAME = "Dot Graphs" HAVE_DOT = YES OUTPUT_DIRECTORY = dot_graphs DOTFILE_DIRS = . GENERATE_LATEX = NO GENERATE_RTF = NO GENERATE_MAN = NO CASE_SENSE_NAMES = NO INPUT = dot_graphs.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARNINGS = NO breathe-doc-breathe-10a36f3/examples/specific/dot_graphs.h000066400000000000000000000011051475641424700235450ustar00rootroot00000000000000/** * @file dot_graphs.h * * @page dotgraphs Dot Graph Demonstrations * * @section dotcmd Using \@dot command * * @dot "basic graph elements" * digraph G { * bgcolor="purple:pink" label="a graph" fontcolor="white" * subgraph cluster1 { * fillcolor="blue:cyan" label="a cluster" fontcolor="white" style="filled" gradientangle="270" * node [shape=box fillcolor="red:yellow" style="filled" gradientangle=90] * "a node"; * } * } * @enddot * * @section dotfilecmd Using \@dotfile command * * @dotfile "dotfile.dot" "Captions go here" */ breathe-doc-breathe-10a36f3/examples/specific/dotfile.dot000066400000000000000000000022271475641424700234060ustar00rootroot00000000000000digraph G {bgcolor="red:cyan" gradientangle=0 subgraph cluster_0 { style=filled; color=lightgrey; fillcolor="blue:yellow"; gradientangle=90; node [fillcolor="yellow:green" style=filled gradientangle=270] a0; node [fillcolor="green:red"] a1; node [fillcolor="red:cyan"] a2; node [fillcolor="cyan:blue"] a3; a0 -> a1 -> a2 -> a3; label = "process #1"; } subgraph cluster_1 { node [fillcolor="yellow:magenta" style=filled gradientangle=270] b0; node [fillcolor="magenta:cyan"] b1; node [fillcolor="cyan:red"] b2; node [fillcolor="red:blue"] b3; b0 -> b1 -> b2 -> b3; label = "process #2"; color=blue fillcolor="blue:yellow"; style=filled; gradientangle=90; } start -> a0; start -> b0; a1 -> b3; b2 -> a3; a3 -> a0; a3 -> end; b3 -> end; start [shape=Mdiamond , fillcolor="yellow:brown", gradientangle=90, style=radial]; end [shape=Msquare, fillcolor="orange:blue", style=radial, gradientangle=90]; } breathe-doc-breathe-10a36f3/examples/specific/enum.cfg000066400000000000000000000004011475641424700226650ustar00rootroot00000000000000PROJECT_NAME = "Enum Command" OUTPUT_DIRECTORY = enum GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = enum.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/enum.h000066400000000000000000000003761475641424700223700ustar00rootroot00000000000000 namespace TestEnumNamespace { //! \brief enum inside of namespace enum NamespacedEnumTest { //! \brief namespaced enum value FIRST, SECOND }; } //! \brief enum outside of namespace enum EnumTest { //! \brief enum value VALUE }; breathe-doc-breathe-10a36f3/examples/specific/fixedwidthfont.cfg000066400000000000000000000005041475641424700247530ustar00rootroot00000000000000PROJECT_NAME = "Fixed width font markup doc test" OUTPUT_DIRECTORY = fixedwidthfont GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = fixedwidthfont.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARN_IF_UNDOCUMENTED = NO breathe-doc-breathe-10a36f3/examples/specific/fixedwidthfont.h000066400000000000000000000002101475641424700244350ustar00rootroot00000000000000 class Out { public: //! \b Constructor \a for Out object Out() {} //! \a Destructor \b for Out object ~Out() {} }; breathe-doc-breathe-10a36f3/examples/specific/functionOverload.cfg000066400000000000000000000004361475641424700252520ustar00rootroot00000000000000PROJECT_NAME = "Function Overload" OUTPUT_DIRECTORY = functionOverload GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = functionOverload.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/functionOverload.h000066400000000000000000000024161475641424700247420ustar00rootroot00000000000000#include //! Non overloaded function void simplefunc(); //! Function which takes two int arguments void f(int, int); //! Function which takes two double arguments void f(double, double); namespace test { //! Another function which takes two int arguments void g(int, int); //! Another function which takes two double arguments void g(double, double); } /*! needed for references in global function parameters */ class MyType {}; /*! needed for references in global function parameters */ class MyOtherType {}; //! Another function which takes a custom type void h(std::string, MyType); //! Another function which takes another custom type void h(std::string, MyOtherType o); //! Another function which takes a basic type void h(std::string, float myfloat); //! Another function which takes a const custom type void h(std::string, const MyType& mytype); //! Another function which takes a const basic type void h(std::string, const int myint); //! Another function which takes a const basic type template void h(std::string, const T myType); //! Another function which takes a const basic type template void h(std::string, const T m, const U n); /** * Test function 1. */ void j(int); /** * Test function 2. */ void j(char); breathe-doc-breathe-10a36f3/examples/specific/group.cfg000066400000000000000000000005321475641424700230620ustar00rootroot00000000000000# For a case where Breathe was failing on the doxygen output PROJECT_NAME = "Group Test" OUTPUT_DIRECTORY = group GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = group.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARN_IF_UNDOCUMENTED = NO breathe-doc-breathe-10a36f3/examples/specific/group.h000066400000000000000000000031471475641424700225570ustar00rootroot00000000000000 /** @defgroup mygroup My Group * This is the first group * @{ */ //! \brief first class inside of namespace class GroupedClassTest { public: //! \brief namespaced class function virtual void publicFunction() const = 0; virtual void undocumentedPublicFunction() const = 0; //! A protected class class PublicClass {}; class UndocumentedPublicClass {}; protected: //! A protected function void protectedFunction() {}; void undocumentedProtectedFunction() {}; //! A protected class class ProtectedClass {}; class UndocumentedProtectedClass {}; private: //! This is a private function virtual void privateFunction() const = 0; virtual void undocumentedPrivateFunction() const = 0; //! A private class class PrivateClass {}; class UndocumentedPrivateClass {}; }; //! This function is in MyGroup void groupedFunction(); /** @} */ // end of mygroup /** @defgroup innergroup Inner Group * @ingroup mygroup * This is an inner group * @{ */ //! \brief inner class inside of namespace class InnerGroupClassTest { public: //! \brief inner namespaced class function void function() {}; private: //! A private function void innerGroupPrivateFunction() {}; class PrivateClass {}; }; /** @} */ // end of innergroup //! \brief second class inside of namespace class UngroupedClassTest { public: //! \brief second namespaced class function void function() {}; private: //! A private function void ungroupedPrivateFunction() {}; class PrivateClass {}; }; //! Ungrouped function void ungroupedFunction(); breathe-doc-breathe-10a36f3/examples/specific/headerfile.cfg000066400000000000000000000004231475641424700240150ustar00rootroot00000000000000PROJECT_NAME = "Headerfile Command" OUTPUT_DIRECTORY = headerfile GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = headerfile.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/headerfile.h000066400000000000000000000006231475641424700235070ustar00rootroot00000000000000 /** * \class ClassTest * \headerfile hearderfile.h "specific/headerfile.h" * \brief Class showing the header where it is defined */ class ClassTest { public: //! \brief Constructor ClassTest(); }; /** * \class ClassTest2 headerfile.h "specific/headerfile.h" * \brief Another way to show the header file */ class ClassTest2 { public: //! \brief Constructor ClassTest2(); } breathe-doc-breathe-10a36f3/examples/specific/headings.cfg000066400000000000000000000004051475641424700235070ustar00rootroot00000000000000PROJECT_NAME = "Headings" OUTPUT_DIRECTORY = headings GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = headings.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/headings.h000066400000000000000000000003121475641424700231740ustar00rootroot00000000000000/*! \brief This is a documentation This is more documentation.

    Header

    Text

    Header Bold Header Text

    Text Header --------- Text ### Header ### Text */ class HeadingsTest {}; breathe-doc-breathe-10a36f3/examples/specific/image.cfg000066400000000000000000000004201475641424700230040ustar00rootroot00000000000000PROJECT_NAME = "Image Test" OUTPUT_DIRECTORY = image GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = image.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES IMAGE_PATH = . breathe-doc-breathe-10a36f3/examples/specific/image.h000066400000000000000000000004221475641424700224760ustar00rootroot00000000000000/** * This is a class with an image in the description. It renders like this: * * \image HTML imageExample.png * * Breathe & Sphinx should automatically copy the image from the doxygen output directory into the * _images folder of the Sphinx output. */ class ImageClass {}; breathe-doc-breathe-10a36f3/examples/specific/imageExample.png000066400000000000000000000411541475641424700243560ustar00rootroot00000000000000PNG  IHDRddpTbKGD pHYs  tIME q IDATxڴw]Wy}3iF]$˲^I nڛ@&r3@›B@p. &WٲeIVkϜyǟfΜ*O=$ - Xc`HP{ Zų J{k-J)V~Ykc@m=i}1fk]Ůߕ_yB  " k-Rnp書o`(q3t0n9 JvS+'b倯5Y&ݍg6+xiܕڽeP*]ς ,XA#x=."lҝ`1X$w ĸ 7ւUQHsf+Rzk7ɫ ׬|jg܅ bmjv,Zp;`l5 5oIaAY7qA:)Jde$(>'no{ϫ=o){ok-Ƙ⋙vuWVع "= b- -e@k3a$elEaI/2n/kցn}~vcNN lR[9q">s詑:ػ7X֠x^Zę)NN'Cp:!"l`ۙ_v\ɯv}lbXe }|}¯5|{0҈(ڕ`RSY7<_T+?º DRU.rh7k9VǬ4#MZǴ֫J3!5?b+)Set 4NBbZoHým@T/6&wbK1kˮc,8/'pG9zF[ӌdBP8_ҿ+\QKEBVδ\Jnro_h?k[X,& oEƙ' "{h̝l[b/8˫KYk u޳y$6ƐC5mTg{{qeWx+kKE]YBENm"d5rX^+^mg^,_."M3l^e$.KG10_}|#yş9;BY&(1b⥉1Q9d+ /5oыe/ƔN˥)>IgU( (j=wxxُ7BĈUΆYA,x{f[oR2KK5a+w笱XWC8X'F!ZsV[.3um+m-+jf5Ҵ]jqjKbK* r-&B qO=_r~=7ٟ㷿<.&sK(YՙVȥ: vfRVZͷ]GW(ʐ $J!" }ٟ3vï7A 4JvkCWI$ gV&WkMDA^-hޗr]b9VgEXLFR(uؓM3u?y|{y{v~w[4#o\lǬ/5DmWXf]bV~y6ZT=9ǬRHIF@ "? Ν<z?+̏+emBkMZ|-RK /VY+Z99[ ~ˆل86hCN>ʍX|+x)nDˉs|c#"ww҉ M h\/VUIXKVF?/63_ Z-XZMZ׵rZ'Z `8](B'J Aǹc۟_ݹxwb i,ZIMM}5gV!gv]{t 1iy5(++mbYHlbC /a. 5kI$֒5'K ^.KKJ|{?B9vlg^Y0LVD*iγ A.#/lk]j~glb-}"R`b]Qy=Y #c0b1-TX|͚JwYdȩ|s+7Nyc {wK'^Ǯ =g]o2fEIX[0Xއu;G)yʼ|)]p1Zv9^_zիYY$`?8eSHFJ6-+*+Ee\Ws?>yֽ=|o o($PM*V)%K` |u=th!L_G6t /\ Zf*3#[oOs֜3Ҏ񯚅*8go0)V&iWKVi^#?K<{o;yݫ_K8 pzG/B,̈a6hĆFL$ﻟopQ(gW_s 7B Z ^$ltm,Ai/^wb!*}F=ΛnB[GAN¸O{)3` Z=z0>=}>w;_u7פ+%J8Fz]|?Kyjk Cvl?Z^;9p>;;q$akZ|QxVJٛe͕ĥCVNk .PjT!RHSl 1I3iߍ wQD,FF53wc,\k?7(Ώq'GYc CÈRA>Oy<5 F3 I(MOqG;f[?D5@ѐRI"a|p'WQ9 Drc$Vrٸ29仠bIuÍx9?emb;2ː%:rMPV6ָ0v I(Rвf?G>aQ0?ؿk' k1PI%jDfg9yx!Μx)/,PVu=DQE FRJ?(R^BG'=ٶ2ٳ-IH˶Y2 zk'.8n#Y^G?aC ϦtVFI N8` QL*C,i[2*M%^iÍGd QADqX]-&1V)8D1qTQѨU񴢧$Tk(L\#GD6B7Ǐ|xvbGB~pwR^l{\ζ[ٱ~yQ/ȉ#Ň˯a9}YMu|?=~kE'}iY¨T7XE,ƺ7X8ߤ>F)E JQD,Xłea.ڣ7$F1VA=O+(@5~zH C,J?~{xkߢV=HOuTM-ڸzܠc'f{|&V+l?#/_c mÇ >ݗw6`YxaM47֤Y֎¡仌xmY4+4 #Bbz'NѨUظATbĘ5BbCL#s&1J;NF )`8yf?wݯ'I b=[x۶me~f) <i`дB7%CbeID8}<< W{&x{hyXcE1Z *)wћчDA `xǞ/GG.W`rnc'N?|Kj$i093$$Aޅ֤l%>5>5frzDII&''\ݵں2,4T ] l29%,9'lciؘKb zR\@' DAj|GiAk/" @kGZDzОFAtI>oXϸ74?rn{anvӌ'L.0=3I}q#ejv |HG69ϙӧDN!xa0䂐FdHsg2W%#!Aeu^Y|^I\ (3]&e9f 0Hb2XCVcy굘޾^0$Q,<0\Z<<*T9pTi81>wp@R#- q7$?~b*uw/LQk-(͖UQQB$g&^46X3bUoh,$V{$294{e.R|# |#GDK {qy[ͥt{Z]t=͝)vKI,ʤ7":sJ QB$ѡ'&fb|7^w\RKaQJsJ,K8!H(jPZXࡃDA.u ! B<'D)FkE+?s/_$[:cO}ؑc:;x].'lk3Zk^oP-WU+-PZ,155V]m/)|3[5 &&'(r\ox an$3H&le¤1ָ3mm抌5c?2$D sX$&CZ\M *r9_UHl@G &q9| >~i65yzŊG"P#*qDl-FLŘxl3`KPS'Q]\IQL̰l0RUeVW^,#7b?.IDR׉X>w +bK#EM [עg0_m?KL;ـ'gMKb-6J jRJ6Z,xZTn"U,Jh:zFĂxtwb=xGFLcto qlP^ Zqi;RA卜nrFT Rf(nr z8{,"Q'1ZAIR,w"6'nW&&ak\*2̈́{{WYiZ8ZW}%Rn==a8T[,A. >3ET@Ҩc033MR⚫Y ݲ]R2qIR(0r$Tuj1(fgE!I`rb=fCOs+>h-a;׸(28 ,Qшh,"33<:''L剃0OV"G6Lxi[VX#&A4`=}EZsi+iLĦQ +GB{߿Sq3Ձ(Qf')>,թilAZ3;3 :@_wQKRFulFRkd<-$J B prlC& ۈ;~c35vlIb"TCI ]i$+ZWmiUb/6a~nnf~~O?yryF1S\x~}3$ el-QLpg%n&jco71$ &\Y"#V:޲39{1i7|Zt:FGX@ L,%*N] '܈cUxy?#~?8s1 N':s)?$Dk(vBH$fyC今\?A+_"=3O%\qh/;Zxkzzټy3 LOb4NmMҖLcZFQC" vV]բaxWEhΓQcG0g ҨAqVVفBam2ZubTܠZpȳl޸;v:quT2Ν; !cju!Eu.f4!\̡_ŶD`<,yXх+i=F٧azE*@u ˻'5HbRR.xcl۹]( ,&/`ir[ΘAfvbG|kouL Vj?gjϸY"֮^l0X\\EEXD֡!$U|pjiGEiX`[?4@}w.03O>J&N?i"sM s39W :V;Z{rd>CR,HD=% O) bБ/78ЦMttWDeLC')N`M(i/EZie4u1 VmSAi>*u&1V:}+_"I#Bu8؉h(FǹgyۿMk !ҴGZ 2Li> 4L! IDATa@_o/CC0"*I0D`@^XfH&mgIX)Z;Jp xhQ2 ra=~ZJI/Y9PPN]Ae~S^J=y+g7IS:j\#v&LR=x䃐b@g?C@k#Z7H. Z E1(+-yhoVE9vPS"jk=(j5av6Q~iYT>(Cpq<|d).0YVpM*3S֋c+6wh0GOWlز] P(U$:_yt[M`[а` w &6-"#])l$Ve3y]BfW6 MwjQAJ#t|?PźM h4  N4 $iOM`Kb[Z.A*Y^K?ql:juULO#ߧVO]lش,3|SK( 2kT1VkQ$ 0ƣ+vBњJWjpm!lgx#9!0 PJs8<|.OG޾AmFuwQmT/TH .(K`]Skb-r8aK޴2hgVf{֎DFV _79}vFFmL=~Sԫ>TS8 ')׸0~\K VTjl̾$8jFSJ!VТSxJ)O+t=[)j0`Т6W]CO!VnGz%<׮>Z9բ'.͝bqL\!=o3|c);}y7TRc(y䡇X\[_ҮWmQh~I9ok0򅐎u7PܶɅ9晳”M\Wz [)Eld2]>Z`VIf9*lT' ^ȹoݍ]FJKc2ڨCAR90M,QSOpY.|7z[u$kS-Hv)!^Ҿ%hO  :Y;cNO1](T>'BWJȎjV:uJCjѪ0b4h +PV#C23C TvY+5c 5E) J|Da HS].iS3b娺ip)սT^ye&GFy͖ |a\bk&ea5*,1PI|Bia>OWW6m`ӎ(F,F]8LL T]׶-bRYƮ|0ݼF r wh4!mŜSʗ_9AH1dI~7Ĕz89r9v_u{_ ²ST8DV Q;*j 㲝o1f)[CIU H&^,ũ[/y'::9wYhFhޭ(k0q=;sǏ4|+L< fnfRۡEz;ʇt\~Asa7 zlڲ9fX-BZZ#ZϛP~Ѫv9b ۷k^J*.S4"0`D^\\ %^4~ndW1013=$,IU hXk-.칳)]{-WvS4K7@ 0753O!D1VkC!s}|=a6jjɷZMPSR,Kd,ؔRhQ$LJ9Ĺ"7mb׾}t2:6̜]Riі/婯8=wݻX?'w?FosjΣL=~G~ ?3'Ob}r3 GS> +2FB<=}K-t6 iPz 2-f2,31%›Z{>R~@gWf{X\XKb^7նDXNo`٫-֎$sylL)ddQ'ZΏܓ 6o"nj?r<:xI9a.-Ւ@]V`uRºAh::8ɧ1BuiYmpU{r[;N (Y"P?Q\>Ϧm[@`bbUUFZv: S+qMa*ԬG(t]HS+[ DIO*OS9qpz9{m},PYPQ84 k#z6n_ΎRs Xpq~{ }6oL[νR+IuD7͙ \bGW^/y ۷ra<&h*jŠң?l#!0"eaS!㕔27" tVևW&>@R1X-H>Gn[oa;?ĸX\?9V4^)z7l45GI5B 7L^[&{ np=0HL]K2!ZT%3cE(%O.b}z [Ǚs,/sΠ%x|Bh15;n'fm7s!31˸K B͵(/vtпu+7VrA@#jL_|hʵtu9,D '"qLT*]\¹3|DžYTZ KM]a۬ **u6Sr$Oh,;^F晝%J Iٮe%=шe-/W]\eߧtf)W ĉ9Ė`ƕ:;z>o cǞc[?avz77am\HO}r*}<Y`ޫByFn9p=/c ^U f}fWU)A<N*XCR'yg99}b؂Bg'}} nv&u+{[GQQ}yZ^9GIbd#j#74W3ua\G/SH\dsC+tߧzaR ;|KͺvM_ ^͛e2$׋/=wVV<)JQ׉1Vy}/d$*Fu2̅q⪁ZidGDgR%SDfT.AJ#=Er}5sL?y[+50ݮtQV)$L>(!O'N } '/5Æut>F칂mCC0,$}^cIڰ03>%L=K`lCk 6r||Ε`뵴:і $G[wGYim^jވ|\o?۷3Cj&7tQΡx=3LϻKl~7~}Chk7mša\Ka#1B`x)Hl0̮͛8p>vm`"wp[Sm{V* }W~y+JVv e,rI T Z[w"~9\3 Vw!~πm0M6nݗgɞ^<۶1ɮ-ܚڕ+. s Q=Gr 2LkFouBuʳ#P; -J(A䋘\u..ă,OcMwɻ 0||xݝؾnPhL,.سy /6^}(t4VK4/~ݦ**b[@'\sPs~j BpK1,R`B'"xIƁk#HeɄ*-Nb7C[ߕxcL^v;o{;`zz>÷?s?# 6},V B$;a1& PIى1m;.s ]CR1m9փ%;%ոRVv]DvT,RsWwb3£ب j c-( |HOMbrKn&<8{_Wb5P]=P,`SQ; HL{4B!b?OV:Csg\KF>df^Ct2Hi5j fM=c.6j`_+FK9W"713Y,9h>jiQUȺ؎HTFj_n}1בjdfyS9? :=qO+{ꗰ[N$zʝ(&3ߣjh# =XDF\z!b@WeV7m`r<1N$+%X_qo"7k9yY噁@GzFĶ Sp]ϱo~i\n{!3ig1lԾԇcĈ*s$|=]S}3Gtn[\?2݄DdDug(%-m4j̓z# 2#IbP>W؝7_=}/PjԨg>oAVN !"(wc4lvgoYxjs Tket."HࣽŜ;yoOP_>9N?6DeTv<3ǙG8y]f!$O$%4rRBGbbc(䔇 rQw2`E[MU /cZ{?";w_FwL.xYŮF5BkǪjrTKhͻTTyYl!7asSw7u ?ݘɦzB3Z@sTeRt$bhB{bH(@JaSnDk y5-RYE;hM|GJbLX sGxq6ma˺$Vc,=m$@ҙʝ``ZK`LbDi R[""g=uS㜟-z%31h=sP\48K:BU' BgB]Kg*JIUS:ILBl=b* X J5=h?IG5/$PS灃Q\{ӁAZq0PhS]QI}~{Jr³j1A!334Ƨxͯ$ яwҪvmd1Th@{z&jS7~hhMX^nr >:Ui'E Ff F#[[JN!'LOSO10+"!7ˁ2pCT*&CA؋[㔠i̤L)UY aL[®m|?͉O}d$"};/cA쬃E(I?V/ۍk 2mZ$AG)ĸ=RjSJ]&Je JC[kpSO%SeHH3ok-7WC~ǧO9ꪮ|$I0TDݹDD$Q22~\Qnx "GzٳŮeټňUy(':$/N;_h֤dCl14i3+;f=dP"eh>ov  {_RNB 8)]__? ZD0@̞Ss7 vDl Թhc!27.f:#earqD_PU8b}8|S1aav㵤?GӻBݾo\{ {*NjÂ$I~狔&t?^iR */:C'fg8ی](8'=sIDATbr 5UUi5MO5BTz}$ePt`.~R Þ>qcp-CN#:h\wnN|*Sn}2l8N[]HvU&ĂvFUUxSdA$eCݐCUIu`KҨsv2փ(-DQOH:m 6"q[NpvQOr.n' =֗? U -T.1I吸C/z\* qJPI(H5 1)GH͉e[&?n-&p>n~ ?Jr#ÅwZF&F:YwMV,e!X4%CI ">ȟ0 mILF>+(ZTT/6x. cf]jٜ㭦O IENDB`breathe-doc-breathe-10a36f3/examples/specific/inheritance.cfg000066400000000000000000000004161475641424700242200ustar00rootroot00000000000000PROJECT_NAME = "Inheritance" OUTPUT_DIRECTORY = inheritance GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = inheritance.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/inheritance.h000066400000000000000000000002771475641424700237150ustar00rootroot00000000000000 class BaseA {}; class BaseB {}; /*! \brief This is the main class we're interested in */ class Main : public BaseA, BaseB {}; class ChildA : public Main {}; class ChildB : public Main {}; breathe-doc-breathe-10a36f3/examples/specific/inline.cfg000066400000000000000000000004221475641424700232020ustar00rootroot00000000000000PROJECT_NAME = "Inline Parameter Doc Test" OUTPUT_DIRECTORY = inline GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = inline.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/inline.h000066400000000000000000000006201475641424700226720ustar00rootroot00000000000000#include /** A class to demonstrate inline documentation syntax. */ class InlineTest { public: /** A member function. * * Details about member function * * \exception std::out_of_range parameter is out of range. * @return a character pointer. */ const char *member(char c, ///< c a character. int n) ///< n an integer. throw(std::out_of_range); }; breathe-doc-breathe-10a36f3/examples/specific/interface.cfg000066400000000000000000000004201475641424700236620ustar00rootroot00000000000000PROJECT_NAME = "Interface Command" OUTPUT_DIRECTORY = interface GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = interface.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/interface.h000066400000000000000000000004141475641424700233550ustar00rootroot00000000000000/* A dummy interface, which is really just a specially treated class in C++ */ class InterfaceClass { }; /*! \interface InterfaceClass interface.h "inc/interface.h" * \brief This is a test interface class. * * Some details about the InterfaceClass interface */ breathe-doc-breathe-10a36f3/examples/specific/latexmath.cfg000066400000000000000000000004201475641424700237110ustar00rootroot00000000000000PROJECT_NAME = "Latex Math Option" OUTPUT_DIRECTORY = latexmath GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = latexmath.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/latexmath.h000066400000000000000000000003321475641424700234030ustar00rootroot00000000000000 /** * @brief A class * * A inline formula: \f$ f(x) = a + b \f$ * * A display style formula: * @f[ * \int_a^b f(x) dx = F(b) - F(a) * @f] */ class MathHelper { public: MathHelper() {} ~MathHelper() {} } breathe-doc-breathe-10a36f3/examples/specific/links.cfg000066400000000000000000000004041475641424700230440ustar00rootroot00000000000000PROJECT_NAME = "Links Command" OUTPUT_DIRECTORY = links GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = links.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/links.h000066400000000000000000000003251475641424700225360ustar00rootroot00000000000000 /*! \brief first struct inside of namespace This is a longer description with a link to a webpage in the text https://github.com in order to test out Breathe's handling of links. */ class LinksTest {}; breathe-doc-breathe-10a36f3/examples/specific/lists.cfg000066400000000000000000000004031475641424700230610ustar00rootroot00000000000000PROJECT_NAME = "Lists Option" OUTPUT_DIRECTORY = lists GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = lists.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/lists.h000066400000000000000000000070531475641424700225610ustar00rootroot00000000000000/** * \brief This is a list example. * * Following is a list using '+' for bullets: * + One item. * + Two items. * + Three items. * + Four. * * And this is some more text. */ class SimpleList_1 { }; /** * \brief This is a list example. * * Following is a list using '-' for bullets: * - One item. * - Two items. * - Three items. * - Four. * * And this is some more text. */ class SimpleList_2 { }; /** * \brief This is a list example. * * Following is a list using '*' for bullets: * * One item. * * Two items. * * Three items. * * Four. * * And this is some more text. */ class SimpleList_3 { }; /** * \brief This is a list example. * * Following is an auto-numbered list: * -# One item. * -# Two items. * -# Three items. * -# Four. * * And this is some more text. */ class SimpleList_4 { }; /** * \brief This is a list example. * * Following is a numbered list: * 1. One item. * 2. Two items. * 3. Three items. * 4. Four. * * And this is some more text. */ class SimpleList_5 { }; /** * \brief This is a list example. * * Following is an unordered list using 'HTML' tags: *
    • One item. *
    • Two items. *
    • Three items. *
    • Four. *
    * * And this is some more text. */ class SimpleList_6 { }; /** * A list of events: * - mouse events * -# mouse move event * -# mouse click event\n * More info about the click event. * -# mouse double click event * - keyboard events * 1. key down event * 2. key up event * * More text here. */ class NestedLists_1 { }; /** * Text before the list * - list item 1 * - sub item 1 * - sub sub item 1 * - sub sub item 2 * . * The dot above ends the sub sub item list. * * More text for the first sub item * . * The dot above ends the first sub item. * * More text for the first list item * - sub item 2 * - sub item 3 * - list item 2 * . * More text in the same paragraph. * * More text in a new paragraph. */ class NestedLists_2 { }; /*! * A list of events: *
      *
    • mouse events *
        *
      1. mouse move event *
      2. mouse click event
        * More info about the click event. *
      3. mouse double click event *
      *
    • keyboard events *
        *
      1. key down event *
      2. key up event *
      *
    * More text here. */ class NestedLists_3 { }; /** * A list of events: * 1. mouse events * -# mouse move event * 1. swipe event * 2. circle event * 3. wave event * -# mouse click event\n * More info about the click event. * -# mouse double click event * 2. keyboard events * -# key down event * -# key up event * 3. touch events * -# pinch event * -# swipe event * More text here. */ class NestedLists_4 { }; /** * A deeply nested list of events: * 1. mouse events * -# mouse move event * 1. swipe event * -# swipe left * -# swipe right * 2. circle event * 3. wave event * -# mouse click event\n * More info about the click event. * -# mouse double click event * 2. keyboard events * -# key down event * -# key up event * 3. touch events * -# pinch event * -# swipe event * More text here. */ class NestedLists_5 { }; breathe-doc-breathe-10a36f3/examples/specific/make.bat000066400000000000000000000110011475641424700226430ustar00rootroot00000000000000@ECHO OFF set DOXYGEN=doxygen for /f "delims=" %%i in ('where doxygen') do set DOXYGEN=%%i set PERL=perl for /f "delims=" %%i in ('where perl') do set PERL=%%i set HAVE_DOT=dot for /f "delims=" %%i in ('where dot') do set HAVE_DOT=%%i @REM echo DOXYGEN : %DOXYGEN% @REM echo PERL : %PERL% @REM echo HAVE_DOT : %HAVE_DOT% if "%1" == "" ( call :all goto end ) if "%1" == "all" ( call :all goto end ) if "%1" == "clean" ( call :clean goto end ) goto end :all @REM --------------- @REM General Pattern @REM --------------- call :doxygen nutshell.cfg call :doxygen alias.cfg call :doxygen rst.cfg call :doxygen inline.cfg call :doxygen namespacefile.cfg call :doxygen array.cfg call :doxygen inheritance.cfg call :doxygen members.cfg call :doxygen userdefined.cfg call :doxygen fixedwidthfont.cfg call :doxygen latexmath.cfg call :doxygen functionOverload.cfg call :doxygen image.cfg call :doxygen name.cfg call :doxygen union.cfg call :doxygen group.cfg call :doxygen struct.cfg call :doxygen struct_function.cfg call :doxygen qtsignalsandslots.cfg call :doxygen lists.cfg call :doxygen headings.cfg call :doxygen links.cfg call :doxygen parameters.cfg call :doxygen template_class.cfg call :doxygen template_class_non_type.cfg call :doxygen template_function.cfg call :doxygen template_type_alias.cfg call :doxygen template_specialisation.cfg call :doxygen enum.cfg call :doxygen define.cfg call :doxygen interface.cfg call :doxygen xrefsect.cfg call :doxygen tables.cfg call :doxygen cpp_anon.cfg call :doxygen cpp_concept.cfg call :doxygen cpp_enum.cfg call :doxygen cpp_union.cfg call :doxygen cpp_function.cfg call :doxygen cpp_friendclass.cfg call :doxygen cpp_inherited_members.cfg call :doxygen cpp_trailing_return_type.cfg call :doxygen cpp_constexpr_hax.cfg call :doxygen cpp_function_lookup.cfg call :doxygen c_file.cfg call :doxygen c_struct.cfg call :doxygen c_enum.cfg call :doxygen c_typedef.cfg call :doxygen c_macro.cfg call :doxygen c_union.cfg call :doxygen membergroups.cfg call :doxygen simplesect.cfg call :doxygen code_blocks.cfg call :doxygen dot_graphs.cfg @REM ------------- @REM Special Cases @REM ------------- call :doxygen programlisting.cfg call :doxygen decl_impl.cfg call :doxygen multifile.cfg call :doxygen auto.cfg call :doxygen class.cfg call :doxygen typedef.cfg goto end :clean @REM --------------- @REM General Pattern @REM --------------- call :rmdir nutshell call :rmdir alias call :rmdir rst call :rmdir inline call :rmdir namespacefile call :rmdir array call :rmdir inheritance call :rmdir members call :rmdir userdefined call :rmdir fixedwidthfont call :rmdir latexmath call :rmdir functionOverload call :rmdir image call :rmdir name call :rmdir union call :rmdir group call :rmdir struct call :rmdir struct_function call :rmdir qtsignalsandslots call :rmdir lists call :rmdir headings call :rmdir links call :rmdir parameters call :rmdir template_class call :rmdir template_class_non_type call :rmdir template_function call :rmdir template_type_alias call :rmdir template_specialisation call :rmdir enum call :rmdir define call :rmdir interface call :rmdir xrefsect call :rmdir tables call :rmdir cpp_anon call :rmdir cpp_concept call :rmdir cpp_enum call :rmdir cpp_union call :rmdir cpp_function call :rmdir cpp_friendclass call :rmdir cpp_inherited_members call :rmdir cpp_trailing_return_type call :rmdir cpp_constexpr_hax call :rmdir cpp_function_lookup call :rmdir c_file call :rmdir c_struct call :rmdir c_enum call :rmdir c_typedef call :rmdir c_macro call :rmdir c_union call :rmdir membergroups call :rmdir simplesect call :rmdir code_blocks call :rmdir dot_graphs @REM ------------- @REM Special Cases @REM ------------- call :rmdir programlisting call :rmdir decl_impl call :rmdir multifilexml call :rmdir auto call :rmdir class call :rmdir typedef goto end :doxygen set CFG=%~1 echo Running doxygen: %CFG% "%DOXYGEN%" %CFG% goto end :rmdir set DIR=%~1 if exist "%DIR%" ( echo Removing directory: %DIR% rmdir /s/q "%DIR%" ) goto end :endbreathe-doc-breathe-10a36f3/examples/specific/membergroups.cfg000066400000000000000000000004221475641424700244330ustar00rootroot00000000000000PROJECT_NAME = "Member Groups" OUTPUT_DIRECTORY = membergroups GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = membergroups.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/membergroups.h000066400000000000000000000004671475641424700241340ustar00rootroot00000000000000//! \brief demonstrates member groups class GroupedMembers { public: ///@{ @name myGroup void in_mygroup_one(int myParameter); ///< A function void in_mygroup_two(int myParameter); ///< Another function ///@} void not_in_mygroup(int myParameter); ///< This one is not in myGroup }; breathe-doc-breathe-10a36f3/examples/specific/members.cfg000066400000000000000000000004111475641424700233540ustar00rootroot00000000000000PROJECT_NAME = "Members Option" OUTPUT_DIRECTORY = members GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = members.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/members.h000066400000000000000000000006161475641424700230530ustar00rootroot00000000000000 namespace testnamespace { //! \brief first class inside of namespace class NamespacedClassTest { public: //! \brief namespaced class function virtual void function() const = 0; explicit NamespacedClassTest() {}; protected: //! Some kind of function static void functionS(); private: //! \brief namespaced class other function void anotherFunction() {}; }; } breathe-doc-breathe-10a36f3/examples/specific/multifile.cfg000066400000000000000000000004731475641424700237240ustar00rootroot00000000000000PROJECT_NAME = "Multifile" OUTPUT_DIRECTORY = multifilexml GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = multifile RECURSIVE = YES QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARN_IF_UNDOCUMENTED = NO breathe-doc-breathe-10a36f3/examples/specific/multifile/000077500000000000000000000000001475641424700232375ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/examples/specific/multifile/one/000077500000000000000000000000001475641424700240205ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/examples/specific/multifile/one/Util.h000066400000000000000000000002051475641424700251030ustar00rootroot00000000000000 namespace test { typedef float MyFloat; void TestFunc() {}; } class TestClass { public: /// enum docs enum Enum {}; }; breathe-doc-breathe-10a36f3/examples/specific/multifile/two/000077500000000000000000000000001475641424700240505ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/examples/specific/multifile/two/Util.h000066400000000000000000000003241475641424700251350ustar00rootroot00000000000000#include "../one/Util.h" namespace test { typedef int MyInt; struct TestStruct {}; } /// The non-type template parameter references a different file template void TestTemplateFunction(); breathe-doc-breathe-10a36f3/examples/specific/name.cfg000066400000000000000000000004741475641424700226530ustar00rootroot00000000000000# For a case where Breathe was failing on the doxygen output PROJECT_NAME = "Name Test" OUTPUT_DIRECTORY = name GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = name.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/name.h000066400000000000000000000004701475641424700223370ustar00rootroot00000000000000 /*! \brief A failing class * \class Failing */ class Failing { public: /** * @name Some section . * THIS IS CAUSING THE ERROR, must have an empty star line above * * @{ */ int getSomething() const; ///< some docs bool isSomething() const; ///< some more docs //@} }; breathe-doc-breathe-10a36f3/examples/specific/namespacefile.cfg000066400000000000000000000004631475641424700245250ustar00rootroot00000000000000PROJECT_NAME = "Namespace in file" OUTPUT_DIRECTORY = namespacefile GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = namespacefile.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARN_IF_UNDOCUMENTED = NO breathe-doc-breathe-10a36f3/examples/specific/namespacefile.h000066400000000000000000000026761475641424700242250ustar00rootroot00000000000000 namespace foo { /** This appears in the documentation */ class Bar { public: //! \brief namespaced class function virtual void publicFunction() const = 0; virtual void undocumentedPublicFunction() const = 0; //! A protected class class PublicClass {}; class UndocumentedPublicClass {}; protected: //! A protected function void protectedFunction() {}; void undocumentedProtectedFunction() {}; //! A protected class class ProtectedClass {}; class UndocumentedProtectedClass {}; private: //! This is a private function virtual void privateFunction() const = 0; virtual void undocumentedPrivateFunction() const = 0; //! A private class class PrivateClass {}; class UndocumentedPrivateClass {}; }; /** This also appears */ int baz(); /** More examples in a nested namespace */ namespace ns { typedef int MyInt; enum Letters { A, /**< A documented enumeration constant */ B, C }; /** Documentation here */ struct FooStruct {}; class FooClass { class InnerFoo {}; }; } } /** This is outside the namespace */ class OuterBar { /** This appears as a sub class */ class InnerBar {}; }; /** Function outside of the namespace */ void outerFunction() {}; breathe-doc-breathe-10a36f3/examples/specific/nutshell.cfg000066400000000000000000000004321475641424700235630ustar00rootroot00000000000000PROJECT_NAME = "Breathe in a nutshell example" OUTPUT_DIRECTORY = nutshell GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = nutshell.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/nutshell.h000066400000000000000000000015011475641424700232510ustar00rootroot00000000000000/** \file nutshell.h An overly extended example of how to use breathe */ /*! With a little bit of a elaboration, should you feel it necessary. */ class Nutshell { public: //! Our tool set /*! The various tools we can opt to use to crack this particular nut */ enum Tool { kHammer = 0, //!< What? It does the job kNutCrackers, //!< Boring kNinjaThrowingStars //!< Stealthy }; //! Nutshell constructor Nutshell(); //! Nutshell destructor ~Nutshell(); /*! Crack that shell with specified tool \param tool the tool with which to crack the nut */ void crack( Tool tool ); /*! \return Whether or not the nut is cracked */ bool isCracked(); private: //! Our cracked state bool m_isCracked; }; breathe-doc-breathe-10a36f3/examples/specific/parameters.cfg000066400000000000000000000005161475641424700240730ustar00rootroot00000000000000# For a case where Breathe was failing on the doxygen output PROJECT_NAME = "Parameters Test" OUTPUT_DIRECTORY = parameters GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = parameters.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/parameters.h000066400000000000000000000001631475641424700235610ustar00rootroot00000000000000 /*! My function */ int f(int a, float b, int* c, int (*p)[3]); class MyClass {}; int g(MyClass a, MyClass* b); breathe-doc-breathe-10a36f3/examples/specific/programlisting.cfg000066400000000000000000000006541475641424700247740ustar00rootroot00000000000000PROJECT_NAME = "Program Listing Test" OUTPUT_DIRECTORY = programlisting GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = programlisting.h EXAMPLE_PATH = . QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES EXTRACT_ALL = YES ENABLE_PREPROCESSING = YES MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES PREDEFINED = LEAP_EXPORT="" breathe-doc-breathe-10a36f3/examples/specific/programlisting.h000066400000000000000000000005131475641424700244560ustar00rootroot00000000000000 /*! Vector class */ class Vector {}; /*! * The center of the InteractionBox in device coordinates (millimeters). This point * is equidistant from all sides of the box. * * \include programlistinginclude.txt * * @returns The InteractionBox center in device coordinates. * @since 1.0 */ LEAP_EXPORT Vector center() const; breathe-doc-breathe-10a36f3/examples/specific/programlistinginclude.txt000066400000000000000000000001561475641424700264150ustar00rootroot00000000000000Vector boxCenter = interactionBox.center(); Vector max = interactionBox.max(); Vector diff = max - boxCenter; breathe-doc-breathe-10a36f3/examples/specific/qtsignalsandslots.cfg000066400000000000000000000004741475641424700255100ustar00rootroot00000000000000PROJECT_NAME = "Qt Signals & Slots" OUTPUT_DIRECTORY = qtsignalsandslots GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = qtsignalsandslots.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARN_IF_UNDOCUMENTED = NO breathe-doc-breathe-10a36f3/examples/specific/qtsignalsandslots.h000066400000000000000000000013311475641424700251710ustar00rootroot00000000000000#ifndef QT_OBJECT_H #define QT_OBJECT_H /*! *\brief Forward declaration of QT API class QT slots and signals typically `#include `, but this example is parsed without QT SDK installed. */ extern class QObject; class QtSignalSlotExample: public QObject { Q_OBJECT public: /*! *\param iShownParameter This is shown in declaration */ void workingFunction( int iShownParameter ) { Q_UNUSED( iShownParameter ; ) } signals: /*! \param iShown This is in function declaration */ void workingSignal( int iShown ); public slots: /*! \param iShown This is in function declaration */ void workingSlot( int iShown ) { iShown; } }; #endif breathe-doc-breathe-10a36f3/examples/specific/rst.cfg000066400000000000000000000005631475641424700225420ustar00rootroot00000000000000PROJECT_NAME = "Rst Test" OUTPUT_DIRECTORY = rst GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = rst.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES ALIASES = "rst=\verbatim embed:rst" ALIASES += "endrst=\endverbatim" ALIASES += "inlinerst=\verbatim embed:rst:inline" breathe-doc-breathe-10a36f3/examples/specific/rst.h000066400000000000000000000033451475641424700222330ustar00rootroot00000000000000 //! \brief first class inside of namespace class TestClass { public: /*! Inserting additional reStructuredText information. \rst This is some funky non-XML compliant text: <& !>< .. note:: This reStructuredText has been handled correctly. \endrst This is just a standard verbatim block with code: \verbatim child = 0; while( child = parent->IterateChildren( child ) ) \endverbatim */ virtual void function() const = 0; /*! Inserting additional reStructuredText information. \verbatim embed:rst .. note:: This reStructuredText has been handled correctly. \endverbatim */ virtual void rawVerbatim() const = 0; /*! * Inserting additional reStructuredText information. * * \verbatim embed:rst:leading-asterisk * Some example code:: * * int example(int x) { * return x * 2; * } * \endverbatim */ virtual void rawLeadingAsteriskVerbatim() const = 0; /// Some kind of method /// /// @param something a parameter /// /// @verbatim embed:rst:leading-slashes /// .. code-block:: c /// :linenos: /// /// bool foo(bool something) { /// return something; /// }; /// /// @endverbatim /// @note Documentation using `///` should begin and end in a blank line. virtual void rawLeadingSlashesVerbatim(int something) const = 0; /*! Inserting an inline reStructuredText snippet. Linking to another function: \inlinerst :cpp:func:`TestClass::rawVerbatim` \endrst */ virtual void rawInlineVerbatim() const = 0; //! Brief description virtual void testFunction() const {}; }; breathe-doc-breathe-10a36f3/examples/specific/simplesect.cfg000066400000000000000000000004131475641424700240740ustar00rootroot00000000000000PROJECT_NAME = "Simplesect" OUTPUT_DIRECTORY = simplesect GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = simplesect.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/simplesect.h000066400000000000000000000006451475641424700235730ustar00rootroot00000000000000/*! \pre stuff must be correct \pre more stuff must be correct \post stuff will be nice \post more stuff will be nice \return nothing \par par, something \warning warning, don't do this \note note, be careful \see see, f_raw \sa sa, f_raw \remark remark, 1 \remark remark, 2 \remarks remarks, 1 \remarks remarks, 2 */ template void f(int a, float b, std::string c); breathe-doc-breathe-10a36f3/examples/specific/struct.cfg000066400000000000000000000004421475641424700232520ustar00rootroot00000000000000PROJECT_NAME = "Struct Command" OUTPUT_DIRECTORY = struct GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = struct.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARN_IF_UNDOCUMENTED = NO breathe-doc-breathe-10a36f3/examples/specific/struct.h000066400000000000000000000026201475641424700227420ustar00rootroot00000000000000 namespace testnamespace { //! \brief first struct inside of namespace struct NamespacedStructTest { //! \brief namespaced struct function virtual void function() const = 0; static void functionS(); explicit NamespacedStructTest() {}; //! \brief namespaced struct other function void anotherFunction() {}; }; //! \brief second struct inside of namespace struct StructTest { //! \brief second namespaced struct function void function() {}; //! \brief second namespaced struct other function void anotherFunction() {}; //! A public class class PublicClass {}; class UndocumentedPublicClass {}; }; }; //! \brief struct outside of namespace struct StructTest { //! \brief namespaced class function virtual void publicFunction() const = 0; virtual void undocumentedPublicFunction() const = 0; //! A public class class PublicClass {}; class UndocumentedPublicClass {}; protected: //! A protected function void protectedFunction() {}; void undocumentedProtectedFunction() {}; //! A protected class class ProtectedClass {}; class UndocumentedProtectedClass {}; private: //! This is a private function virtual void privateFunction() const = 0; virtual void undocumentedPrivateFunction() const = 0; //! A private class class PrivateClass {}; class UndocumentedPrivateClass {}; }; breathe-doc-breathe-10a36f3/examples/specific/struct_function.cfg000066400000000000000000000004751475641424700251650ustar00rootroot00000000000000PROJECT_NAME = "Struct Function Command" OUTPUT_DIRECTORY = struct_function GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = struct_function.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARN_IF_UNDOCUMENTED = NO breathe-doc-breathe-10a36f3/examples/specific/struct_function.h000066400000000000000000000004071475641424700246500ustar00rootroot00000000000000 namespace testnamespace { //! \brief templated struct with functions template struct MyClass { //! \brief struct empty constructor MyClass(); //! \brief struct copy constructor MyClass(const MyClass&); int myMemberVar; }; } breathe-doc-breathe-10a36f3/examples/specific/tables.cfg000066400000000000000000000004061475641424700232000ustar00rootroot00000000000000PROJECT_NAME = "Tables Option" OUTPUT_DIRECTORY = tables GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = tables.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/tables.h000066400000000000000000000045501475641424700226740ustar00rootroot00000000000000/** * \brief This is a simple Markdown table example. * * Following is a simple table using Markdown syntax. * * First Header | Second Header * ------------- | ------------- * Content Cell | Content Cell * Content Cell | Content Cell * * And this is some more text. */ class Table_1 { }; /** * \brief This is a Markdown table with alignment. * * Following is a table with alignment using Markdown syntax. * * | Right | Center | Left | * | ----: | :----: | :---- | * | 10 | 10 | 10 | * | 1000 | 1000 | 1000 | * * And this is some more text. */ class Table_2 { }; /** * \brief This is a Markdown table with rowspan and alignment. * * Following is a table with rowspan and alignment using Markdown syntax. * * | Right | Center | Left | * | ----: | :----: | :---- | * | 10 | 10 | 10 | * | ^ | 1000 | 1000 | * * And this is some more text. */ class Table_3 { }; /** * \brief This is a Markdown table with colspan and alignment. * * Following is a table with colspan and alignment using Markdown syntax. * * | Right | Center | Left | * | ----: | :----: | :---- | * | 10 | 10 | 10 | * | 1000 ||| * * And this is some more text. */ class Table_4 { }; /** * \brief This is a Doxygen table. * * Following is a table using Doxygen syntax (and all supported features). * * * *
    Complex table
    Column 1 Column 2 Column 3 *
    cell row=1+2,col=1cell row=1,col=2cell row=1,col=3 *
    cell row=2+3,col=2 cell row=2,col=3 *
    cell row=3,col=1 cell row=3+4,col=3 *
    cell row=4,col=1+2 *
    cell row=5,col=1 cell row=5,col=2+3 *
    cell row=6+7,col=1+2 cell row=6,col=3 *
    cell row=7,col=3 *
    cell row=8,col=1 cell row=8,col=2\n * *
    Inner cell row=1,col=1Inner cell row=1,col=2 *
    Inner cell row=2,col=1Inner cell row=2,col=2 *
    *
    cell row=8,col=3 *
      *
    • Item 1 *
    • Item 2 *
    *
    * * And this is some more text. */ class Table_5 { }; breathe-doc-breathe-10a36f3/examples/specific/template_class.cfg000066400000000000000000000003631475641424700247300ustar00rootroot00000000000000PROJECT_NAME = "Template Class" OUTPUT_DIRECTORY = template_class GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = template_class.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/template_class.h000066400000000000000000000011251475641424700244150ustar00rootroot00000000000000/** * @brief a class with a template parameter * * @tparam T this is the template parameter */ template class templateclass { public: /// default constructor templateclass() {} /** * @brief constructor with template argument * * @param m the argument */ templateclass(T const & m) : member(m) {} /** * @brief member accepting template argument and returning template argument * * @param t argument of type T * @return returns value of type T */ T method(T const & t); private: /// a member with templated type T member; }; breathe-doc-breathe-10a36f3/examples/specific/template_class_non_type.cfg000066400000000000000000000004161475641424700266420ustar00rootroot00000000000000PROJECT_NAME = "Template Class Non Type" OUTPUT_DIRECTORY = template_class_non_type GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = template_class_non_type.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/template_class_non_type.h000066400000000000000000000016131475641424700263320ustar00rootroot00000000000000/** * @brief a class with three template parameters * * @tparam T this is the first template parameter * @tparam U this is the second template parameter * @tparam N this is the third template parameter, it is a non-type parameter */ template class anothertemplateclass { public: /// default constructor anothertemplateclass() {} /** * @brief constructor with two template argument * * @param m1 first argument * @param m2 second argument */ anothertemplateclass(T const & m1, U const & m2) : member1(m1), member2(m2) {} /** * @brief member accepting template argument and returning template argument * * @param t argument * @return returns value of type U */ U method(T const & t); private: /// a member with templated type T member1; /// another member with templated type U member2; }; breathe-doc-breathe-10a36f3/examples/specific/template_function.cfg000066400000000000000000000003741475641424700254520ustar00rootroot00000000000000PROJECT_NAME = "Template Function" OUTPUT_DIRECTORY = template_function GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = template_function.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/template_function.h000066400000000000000000000016521475641424700251420ustar00rootroot00000000000000#include /** * @brief a function with one template arguments * * @tparam T this is the template parameter * * @param arg1 argument of type T * * @return return value of type T */ template T function1(T arg1) {} /** * @brief a function with one template argument specialized for `std::string` * * @param arg1 argument of type `std::string` * * @return return value of type `std::string` */ template <> std::string function1(std::string arg1) {} /** * @brief a function with three template arguments * * @tparam T this is the first template parameter * @tparam U this is the second template parameter * @tparam N this is the third template parameter, it is a non-type parameter * * @param arg1 first argument of type T * @param arg2 second argument of type U * * @return return value of type T */ template T function2(T arg1, U arg2) {} breathe-doc-breathe-10a36f3/examples/specific/template_specialisation.cfg000066400000000000000000000004621475641424700266320ustar00rootroot00000000000000PROJECT_NAME = "Template Specialisation" OUTPUT_DIRECTORY = template_specialisation GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = template_specialisation.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/template_specialisation.h000066400000000000000000000003111475641424700263130ustar00rootroot00000000000000 /*! A generic template class. */ template class TemplateClass { }; /*! A partial specialization of TemplateClass for pointer types. */ template class TemplateClass { }; breathe-doc-breathe-10a36f3/examples/specific/template_type_alias.cfg000066400000000000000000000004021475641424700257470ustar00rootroot00000000000000PROJECT_NAME = "Template Type Alias" OUTPUT_DIRECTORY = template_type_alias GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = template_type_alias.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/template_type_alias.h000066400000000000000000000007571475641424700254540ustar00rootroot00000000000000/** * @brief a type alias with one template argument * * @tparam T this is the template parameter * */ template using IsFuzzy = std::is_fuzzy; /** * @brief a type alias with three template arguments * * @tparam T this is the first template parameter * @tparam U this is the second template parameter * @tparam N this is the third template parameter, it is a non-type parameter * */ template using IsFurry = std::is_furry; breathe-doc-breathe-10a36f3/examples/specific/typedef.cfg000066400000000000000000000004571475641424700233740ustar00rootroot00000000000000PROJECT_NAME = "Function Type Def Command" OUTPUT_DIRECTORY = typedef GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = typedef.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES WARN_IF_UNDOCUMENTED = NO breathe-doc-breathe-10a36f3/examples/specific/typedef.h000066400000000000000000000007721475641424700230640ustar00rootroot00000000000000 class TypeDefTest { }; /* A dummy typedef */ typedef TypeDefTest (*TypeDefTestFuncPtr)(void); typedef void* (*voidFuncPtr)(float, int); typedef void* voidPointer; typedef float* floatPointer; typedef float floatingPointNumber; typedef int TestTypedef; namespace TypeDefNamespace { typedef char *AnotherTypedef; } class TestClass { public: /** A typedef defined in a class. */ typedef void *MemberTypedef; typedef void (*MemberTypedefFuncPointer)(int, double); }; using TypeAlias = int; breathe-doc-breathe-10a36f3/examples/specific/union.cfg000066400000000000000000000003741475641424700230620ustar00rootroot00000000000000PROJECT_NAME = "Union" OUTPUT_DIRECTORY = union GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = union.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/union.h000066400000000000000000000011611475641424700225450ustar00rootroot00000000000000 /// A union of two values union SeparateUnion { int size; ///< The size of the thing float depth; ///< How deep it is }; namespace foo { /// A union of two values union MyUnion { int someInt; ///< The int of it all float someFloat; ///< The float side of things }; } /// A class with a union class ClassWithUnion { /// A union with two values union UnionInClass { int intvalue; ///< An int value float floatvalue; ///< A float value }; /// Documented class class ExtraClass { int a_member; float another_member; }; }; breathe-doc-breathe-10a36f3/examples/specific/userdefined.cfg000066400000000000000000000005151475641424700242240ustar00rootroot00000000000000PROJECT_NAME = "User Defined Example" OUTPUT_DIRECTORY = userdefined GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = userdefined.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES DISTRIBUTE_GROUP_DOC = YES WARN_IF_UNDOCUMENTED = NO breathe-doc-breathe-10a36f3/examples/specific/userdefined.h000066400000000000000000000014101475641424700237070ustar00rootroot00000000000000// Example from Doxygen documentation /** A class. More details about the UserDefinedGroupTest class */ class UserDefinedGroupTest { public: //@{ /** Same documentation for both members. Details */ void func1InGroup1(); void func2InGroup1(); //@} /** Function without group. Details. */ void ungroupedFunction(); void func1InCustomGroup(); protected: void func2InCustomGroup(); }; void UserDefinedGroupTest::func1InGroup1() {} void UserDefinedGroupTest::func2InGroup1() {} /** @name Custom Group * Description of custom group */ //@{ /** Function 2 in custom group. Details. */ void UserDefinedGroupTest::func2InCustomGroup() {} /** Function 1 in custom group. Details. */ void UserDefinedGroupTest::func1InCustomGroup() {} //@} breathe-doc-breathe-10a36f3/examples/specific/using_in_ns.cfg000066400000000000000000000004141475641424700242400ustar00rootroot00000000000000PROJECT_NAME = "UsingInNS" OUTPUT_DIRECTORY = using_in_ns GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = using_in_ns.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES breathe-doc-breathe-10a36f3/examples/specific/using_in_ns.h000066400000000000000000000005541475641424700237350ustar00rootroot00000000000000// // When declaring a type using a "using" directive inside a namespace, // Doxygen adds a spurious "typedef" in the corresponding XML definition // // $ doxygen --version // 1.8.11 // namespace foo { using foo_int = int; // using foo::foo_int = typedef int } using global_int = int; // using global_int = int breathe-doc-breathe-10a36f3/examples/specific/xrefsect.cfg000066400000000000000000000005321475641424700235510ustar00rootroot00000000000000PROJECT_NAME = "Doxygen xrefsect" OUTPUT_DIRECTORY = xrefsect GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = xrefsect.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES ALIASES = "xrefsample=\xrefitem xrefsample \"xref Sample\" \"xref Sample\" " breathe-doc-breathe-10a36f3/examples/specific/xrefsect.h000066400000000000000000000012341475641424700232410ustar00rootroot00000000000000/** * @file xrefsect.h * A few examples of xrefsect items support. */ /** * An example of using Doxygen's todo command. * * @todo Implement this function. */ int unimplemented(void); /** * An example of using Doxygen's bug and test commands. * * @bug Does not work yet. * * @test Add proper unit testing first. */ void buggy_function(int param); /** * An example of using Doxygen's deprecated command. * * @deprecated Should not be used on new code. */ void old_function(void); /** * An example of a custom Doxygen xrefitem declared as an ALIAS. * * @xrefsample This text shows up in the xref output. */ void sample_xrefitem_function(void); breathe-doc-breathe-10a36f3/examples/tinyxml/000077500000000000000000000000001475641424700211645ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/examples/tinyxml/.gitignore000066400000000000000000000000111475641424700231440ustar00rootroot00000000000000tinyxml/ breathe-doc-breathe-10a36f3/examples/tinyxml/Makefile000066400000000000000000000010471475641424700226260ustar00rootroot00000000000000# # This file was generated from Makefile.in on Sat Dec 13 12:17:28 GMT 2008 # DOXYGEN ?= `which doxygen` TMAKEPATH = ENV = env TMAKEPATH=$(TMAKEPATH) TMAKE = MAKE = /usr/bin/make PERL = /usr/bin/perl RM = rm -f CP = cp VERSION = 1.5.7.1 INSTALL = /tmp INSTTOOL = /usr/bin/install DOXYDOCS = .. DOCDIR = $(INSTALL)/share/doc/packages/doxygen QTDIR = HAVE_DOT = /usr/bin/dot all: tinyxml/xml/index.xml clean: rm -rf tinyxml tinyxml/xml/index.xml: tinyxml.h tinyxml.cfg $(DOXYGEN) tinyxml.cfg breathe-doc-breathe-10a36f3/examples/tinyxml/make.bat000066400000000000000000000014541475641424700225750ustar00rootroot00000000000000@ECHO OFF set DOXYGEN=doxygen for /f "delims=" %%i in ('where doxygen') do set DOXYGEN=%%i set PERL=perl for /f "delims=" %%i in ('where perl') do set PERL=%%i set HAVE_DOT=dot for /f "delims=" %%i in ('where dot') do set HAVE_DOT=%%i @REM echo DOXYGEN : %DOXYGEN% @REM echo PERL : %PERL% @REM echo HAVE_DOT : %HAVE_DOT% if "%1" == "" ( call :all goto end ) if "%1" == "all" ( call :all goto end ) if "%1" == "clean" ( call :clean goto end ) goto end :all call :doxygen tinyxml.cfg goto end :clean call :rmdir tinyxml goto end :doxygen set CFG=%~1 echo Running doxygen: %CFG% "%DOXYGEN%" %CFG% goto end :rmdir set DIR=%~1 if exist "%DIR%" ( echo Removing directory: %DIR% rmdir /s/q "%DIR%" ) goto end :endbreathe-doc-breathe-10a36f3/examples/tinyxml/tinyxml.cfg000066400000000000000000000007031475641424700233510ustar00rootroot00000000000000PROJECT_NAME = "TinyXML classes" OUTPUT_DIRECTORY = tinyxml GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = tinyxml.h QUIET = YES JAVADOC_AUTOBRIEF = YES GENERATE_HTML = NO GENERATE_XML = YES # tinyxml.h is huge! Ignore any problems since the project is not maintained (moved to TinyXML-2 project). WARN_IF_UNDOCUMENTED = NO WARN_IF_INCOMPLETE_DOC = NO WARN_IF_DOC_ERROR = NObreathe-doc-breathe-10a36f3/examples/tinyxml/tinyxml.h000066400000000000000000001743051475641424700230530ustar00rootroot00000000000000/* www.sourceforge.net/projects/tinyxml Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #ifndef TINYXML_INCLUDED #define TINYXML_INCLUDED // DNEG: jons - Defined for the library build #define TIXML_USE_STL #ifdef _MSC_VER #pragma warning( push ) #pragma warning( disable : 4530 ) #pragma warning( disable : 4786 ) #endif #include #include #include #include #include // Help out windows: #if defined( _DEBUG ) && !defined( DEBUG ) #define DEBUG #endif #ifdef TIXML_USE_STL #include #include #include #define TIXML_STRING std::string #else #include "tinystr.h" #define TIXML_STRING TiXmlString #endif // Deprecated library function hell. Compilers want to use the // new safe versions. This probably doesn't fully address the problem, // but it gets closer. There are too many compilers for me to fully // test. If you get compilation troubles, undefine TIXML_SAFE #define TIXML_SAFE #ifdef TIXML_SAFE #if defined(_MSC_VER) && (_MSC_VER >= 1400 ) // Microsoft visual studio, version 2005 and higher. #define TIXML_SNPRINTF _snprintf_s #define TIXML_SNSCANF _snscanf_s #elif defined(_MSC_VER) && (_MSC_VER >= 1200 ) // Microsoft visual studio, version 6 and higher. //#pragma message( "Using _sn* functions." ) #define TIXML_SNPRINTF _snprintf #define TIXML_SNSCANF _snscanf #elif defined(__GNUC__) && (__GNUC__ >= 3 ) // GCC version 3 and higher.s //#warning( "Using sn* functions." ) #define TIXML_SNPRINTF snprintf #define TIXML_SNSCANF snscanf #endif #endif class TiXmlDocument; class TiXmlElement; class TiXmlComment; class TiXmlUnknown; class TiXmlAttribute; class TiXmlText; class TiXmlDeclaration; class TiXmlParsingData; const int TIXML_MAJOR_VERSION = 2; const int TIXML_MINOR_VERSION = 5; const int TIXML_PATCH_VERSION = 2; /* Internal structure for tracking location of items in the XML file. */ struct TiXmlCursor { TiXmlCursor() { Clear(); } void Clear() { row = col = -1; } int row; // 0 based. int col; // 0 based. }; /** If you call the Accept() method, it requires being passed a TiXmlVisitor class to handle callbacks. For nodes that contain other nodes (Document, Element) you will get called with a VisitEnter/VisitExit pair. Nodes that are always leaves are simple called with Visit(). If you return 'true' from a Visit method, recursive parsing will continue. If you return false, no children of this node or its sibilings will be Visited. All flavors of Visit methods have a default implementation that returns 'true' (continue visiting). You need to only override methods that are interesting to you. Generally Accept() is called on the TiXmlDocument, although all nodes support Visiting. You should never change the document from a callback. @sa TiXmlNode::Accept() */ class TiXmlVisitor { public: virtual ~TiXmlVisitor() {} /// Visit a document. virtual bool VisitEnter( const TiXmlDocument& ) { return true; } /// Visit a document. virtual bool VisitExit( const TiXmlDocument& ) { return true; } /// Visit an element. virtual bool VisitEnter( const TiXmlElement& , const TiXmlAttribute* ) { return true; } /// Visit an element. virtual bool VisitExit( const TiXmlElement& ) { return true; } /// Visit a declaration virtual bool Visit( const TiXmlDeclaration& ) { return true; } /// Visit a text node virtual bool Visit( const TiXmlText& ) { return true; } /// Visit a comment node virtual bool Visit( const TiXmlComment& ) { return true; } /// Visit an unknown node virtual bool Visit( const TiXmlUnknown& ) { return true; } }; // Only used by Attribute::Query functions enum { TIXML_SUCCESS, TIXML_NO_ATTRIBUTE, TIXML_WRONG_TYPE }; // Used by the parsing routines. enum TiXmlEncoding { TIXML_ENCODING_UNKNOWN, TIXML_ENCODING_UTF8, TIXML_ENCODING_LEGACY }; const TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN; /** TiXmlBase is a base class for every class in TinyXml. It does little except to establish that TinyXml classes can be printed and provide some utility functions. In XML, the document and elements can contain other elements and other types of nodes. @verbatim A Document can contain: Element (container or leaf) Comment (leaf) Unknown (leaf) Declaration( leaf ) An Element can contain: Element (container or leaf) Text (leaf) Attributes (not on tree) Comment (leaf) Unknown (leaf) A Decleration contains: Attributes (not on tree) @endverbatim */ class TiXmlBase { friend class TiXmlNode; friend class TiXmlElement; friend class TiXmlDocument; public: TiXmlBase() : userData(0) {} virtual ~TiXmlBase() {} /** All TinyXml classes can print themselves to a file stream or the string class (TiXmlString in non-STL mode, std::string in STL mode.) Either or both cfile and str can be null. This is a formatted print, and will insert tabs and newlines. (For an unformatted stream, use the << operator.) */ virtual void Print( FILE* cfile, int depth ) const = 0; /** The world does not agree on whether white space should be kept or not. In order to make everyone happy, these global, static functions are provided to set whether or not TinyXml will condense all white space into a single space or not. The default is to condense. Note changing this value is not thread safe. */ static void SetCondenseWhiteSpace( bool condense ) { condenseWhiteSpace = condense; } /// Return the current white space setting. static bool IsWhiteSpaceCondensed() { return condenseWhiteSpace; } /** Return the position, in the original source file, of this node or attribute. The row and column are 1-based. (That is the first row and first column is 1,1). If the returns values are 0 or less, then the parser does not have a row and column value. Generally, the row and column value will be set when the TiXmlDocument::Load(), TiXmlDocument::LoadFile(), or any TiXmlNode::Parse() is called. It will NOT be set when the DOM was created from operator>>. The values reflect the initial load. Once the DOM is modified programmatically (by adding or changing nodes and attributes) the new values will NOT update to reflect changes in the document. There is a minor performance cost to computing the row and column. Computation can be disabled if TiXmlDocument::SetTabSize() is called with 0 as the value. @sa TiXmlDocument::SetTabSize() */ int Row() const { return location.row + 1; } int Column() const { return location.col + 1; } ///< See Row() void SetUserData( void* user ) { userData = user; } ///< Set a pointer to arbitrary user data. void* GetUserData() { return userData; } ///< Get a pointer to arbitrary user data. const void* GetUserData() const { return userData; } ///< Get a pointer to arbitrary user data. // Table that returs, for a given lead byte, the total number of bytes // in the UTF-8 sequence. static const int utf8ByteTable[256]; virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding /*= TIXML_ENCODING_UNKNOWN */ ) = 0; enum { TIXML_NO_ERROR = 0, TIXML_ERROR, TIXML_ERROR_OPENING_FILE, TIXML_ERROR_OUT_OF_MEMORY, TIXML_ERROR_PARSING_ELEMENT, TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, TIXML_ERROR_READING_ELEMENT_VALUE, TIXML_ERROR_READING_ATTRIBUTES, TIXML_ERROR_PARSING_EMPTY, TIXML_ERROR_READING_END_TAG, TIXML_ERROR_PARSING_UNKNOWN, TIXML_ERROR_PARSING_COMMENT, TIXML_ERROR_PARSING_DECLARATION, TIXML_ERROR_DOCUMENT_EMPTY, TIXML_ERROR_EMBEDDED_NULL, TIXML_ERROR_PARSING_CDATA, TIXML_ERROR_DOCUMENT_TOP_ONLY, TIXML_ERROR_STRING_COUNT }; protected: static const char* SkipWhiteSpace( const char*, TiXmlEncoding encoding ); inline static bool IsWhiteSpace( char c ) { return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' ); } inline static bool IsWhiteSpace( int c ) { if ( c < 256 ) return IsWhiteSpace( (char) c ); return false; // Again, only truly correct for English/Latin...but usually works. } #ifdef TIXML_USE_STL static bool StreamWhiteSpace( std::istream * in, TIXML_STRING * tag ); static bool StreamTo( std::istream * in, int character, TIXML_STRING * tag ); #endif /* Reads an XML name into the string provided. Returns a pointer just past the last character of the name, or 0 if the function has an error. */ static const char* ReadName( const char* p, TIXML_STRING* name, TiXmlEncoding encoding ); /* Reads text. Returns a pointer past the given end tag. Wickedly complex options, but it keeps the (sensitive) code in one place. */ static const char* ReadText( const char* in, // where to start TIXML_STRING* text, // the string read bool ignoreWhiteSpace, // whether to keep the white space const char* endTag, // what ends this text bool ignoreCase, // whether to ignore case in the end tag TiXmlEncoding encoding ); // the current encoding // If an entity has been found, transform it into a character. static const char* GetEntity( const char* in, char* value, int* length, TiXmlEncoding encoding ); // Get a character, while interpreting entities. // The length can be from 0 to 4 bytes. inline static const char* GetChar( const char* p, char* _value, int* length, TiXmlEncoding encoding ) { assert( p ); if ( encoding == TIXML_ENCODING_UTF8 ) { *length = utf8ByteTable[ *((const unsigned char*)p) ]; assert( *length >= 0 && *length < 5 ); } else { *length = 1; } if ( *length == 1 ) { if ( *p == '&' ) return GetEntity( p, _value, length, encoding ); *_value = *p; return p+1; } else if ( *length ) { //strncpy( _value, p, *length ); // lots of compilers don't like this function (unsafe), // and the null terminator isn't needed for( int i=0; p[i] && i<*length; ++i ) { _value[i] = p[i]; } return p + (*length); } else { // Not valid text. return 0; } } // Puts a string to a stream, expanding entities as it goes. // Note this should not contian the '<', '>', etc, or they will be transformed into entities! static void PutString( const TIXML_STRING& str, TIXML_STRING* out ); // Return true if the next characters in the stream are any of the endTag sequences. // Ignore case only works for English, and should only be relied on when comparing // to English words: StringEqual( p, "version", true ) is fine. static bool StringEqual( const char* p, const char* endTag, bool ignoreCase, TiXmlEncoding encoding ); static const char* errorString[ TIXML_ERROR_STRING_COUNT ]; TiXmlCursor location; /// Field containing a generic user pointer void* userData; // None of these methods are reliable for any language except English. // Good for approximation, not great for accuracy. static int IsAlpha( unsigned char anyByte, TiXmlEncoding encoding ); static int IsAlphaNum( unsigned char anyByte, TiXmlEncoding encoding ); inline static int ToLower( int v, TiXmlEncoding encoding ) { if ( encoding == TIXML_ENCODING_UTF8 ) { if ( v < 128 ) return tolower( v ); return v; } else { return tolower( v ); } } static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ); private: TiXmlBase( const TiXmlBase& ); // not implemented. void operator=( const TiXmlBase& base ); // not allowed. struct Entity { const char* str; unsigned int strLength; char chr; }; enum { NUM_ENTITY = 5, MAX_ENTITY_LENGTH = 6 }; static Entity entity[ NUM_ENTITY ]; static bool condenseWhiteSpace; }; /** The parent class for everything in the Document Object Model. (Except for attributes). Nodes have siblings, a parent, and children. A node can be in a document, or stand on its own. The type of a TiXmlNode can be queried, and it can be cast to its more defined type. */ class TiXmlNode : public TiXmlBase { friend class TiXmlDocument; friend class TiXmlElement; public: #ifdef TIXML_USE_STL /** An input stream operator, for every class. Tolerant of newlines and formatting, but doesn't expect them. */ friend std::istream& operator >> (std::istream& in, TiXmlNode& base); /** An output stream operator, for every class. Note that this outputs without any newlines or formatting, as opposed to Print(), which includes tabs and new lines. The operator<< and operator>> are not completely symmetric. Writing a node to a stream is very well defined. You'll get a nice stream of output, without any extra whitespace or newlines. But reading is not as well defined. (As it always is.) If you create a TiXmlElement (for example) and read that from an input stream, the text needs to define an element or junk will result. This is true of all input streams, but it's worth keeping in mind. A TiXmlDocument will read nodes until it reads a root element, and all the children of that root element. */ friend std::ostream& operator<< (std::ostream& out, const TiXmlNode& base); /// Appends the XML node or attribute to a std::string. friend std::string& operator<< (std::string& out, const TiXmlNode& base ); #endif /** The types of XML nodes supported by TinyXml. (All the unsupported types are picked up by UNKNOWN.) */ enum NodeType { DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, DECLARATION, TYPECOUNT }; virtual ~TiXmlNode(); /** The meaning of 'value' changes for the specific type of TiXmlNode. @verbatim Document: filename of the xml file Element: name of the element Comment: the comment text Unknown: the tag contents Text: the text string @endverbatim The subclasses will wrap this function. */ const char *Value() const { return value.c_str (); } #ifdef TIXML_USE_STL /** Return Value() as a std::string. If you only use STL, this is more efficient than calling Value(). Only available in STL mode. */ const std::string& ValueStr() const { return value; } #endif /** Changes the value of the node. Defined as: @verbatim Document: filename of the xml file Element: name of the element Comment: the comment text Unknown: the tag contents Text: the text string @endverbatim */ void SetValue(const char * _value) { value = _value;} #ifdef TIXML_USE_STL /// STL std::string form. void SetValue( const std::string& _value ) { value = _value; } #endif /// Delete all the children of this node. Does not affect 'this'. void Clear(); /// One step up the DOM. TiXmlNode* Parent() { return parent; } const TiXmlNode* Parent() const { return parent; } const TiXmlNode* FirstChild() const { return firstChild; } ///< The first child of this node. Will be null if there are no children. TiXmlNode* FirstChild() { return firstChild; } const TiXmlNode* FirstChild( const char * value ) const; ///< The first child of this node with the matching 'value'. Will be null if none found. /// The first child of this node with the matching 'value'. Will be null if none found. TiXmlNode* FirstChild( const char * _value ) { // Call through to the const version - safe since nothing is changed. Exiting syntax: cast this to a const (always safe) // call the method, cast the return back to non-const. return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->FirstChild( _value )); } const TiXmlNode* LastChild() const { return lastChild; } /// The last child of this node. Will be null if there are no children. TiXmlNode* LastChild() { return lastChild; } const TiXmlNode* LastChild( const char * value ) const; /// The last child of this node matching 'value'. Will be null if there are no children. TiXmlNode* LastChild( const char * _value ) { return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->LastChild( _value )); } #ifdef TIXML_USE_STL const TiXmlNode* FirstChild( const std::string& _value ) const { return FirstChild (_value.c_str ()); } ///< STL std::string form. TiXmlNode* FirstChild( const std::string& _value ) { return FirstChild (_value.c_str ()); } ///< STL std::string form. const TiXmlNode* LastChild( const std::string& _value ) const { return LastChild (_value.c_str ()); } ///< STL std::string form. TiXmlNode* LastChild( const std::string& _value ) { return LastChild (_value.c_str ()); } ///< STL std::string form. #endif /** An alternate way to walk the children of a node. One way to iterate over nodes is: @verbatim for( child = parent->FirstChild(); child; child = child->NextSibling() ) @endverbatim IterateChildren does the same thing with the syntax: @verbatim child = 0; while( child = parent->IterateChildren( child ) ) @endverbatim IterateChildren takes the previous child as input and finds the next one. If the previous child is null, it returns the first. IterateChildren will return null when done. */ const TiXmlNode* IterateChildren( const TiXmlNode* previous ) const; TiXmlNode* IterateChildren( const TiXmlNode* previous ) { return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( previous ) ); } /// This flavor of IterateChildren searches for children with a particular 'value' const TiXmlNode* IterateChildren( const char * value, const TiXmlNode* previous ) const; TiXmlNode* IterateChildren( const char * _value, const TiXmlNode* previous ) { return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( _value, previous ) ); } #ifdef TIXML_USE_STL const TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) const { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form. TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form. #endif /** Add a new node related to this. Adds a child past the LastChild. Returns a pointer to the new object or NULL if an error occurred. */ TiXmlNode* InsertEndChild( const TiXmlNode& addThis ); /** Add a new node related to this. Adds a child past the LastChild. NOTE: the node to be added is passed by pointer, and will be henceforth owned (and deleted) by tinyXml. This method is efficient and avoids an extra copy, but should be used with care as it uses a different memory model than the other insert functions. @sa InsertEndChild */ TiXmlNode* LinkEndChild( TiXmlNode* addThis ); /** Add a new node related to this. Adds a child before the specified child. Returns a pointer to the new object or NULL if an error occurred. */ TiXmlNode* InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis ); /** Add a new node related to this. Adds a child after the specified child. Returns a pointer to the new object or NULL if an error occurred. */ TiXmlNode* InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis ); /** Replace a child of this node. Returns a pointer to the new object or NULL if an error occurred. */ TiXmlNode* ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis ); /// Delete a child of this node. bool RemoveChild( TiXmlNode* removeThis ); /// Navigate to a sibling node. const TiXmlNode* PreviousSibling() const { return prev; } TiXmlNode* PreviousSibling() { return prev; } /// Navigate to a sibling node. const TiXmlNode* PreviousSibling( const char * ) const; TiXmlNode* PreviousSibling( const char *_prev ) { return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->PreviousSibling( _prev ) ); } #ifdef TIXML_USE_STL const TiXmlNode* PreviousSibling( const std::string& _value ) const { return PreviousSibling (_value.c_str ()); } ///< STL std::string form. TiXmlNode* PreviousSibling( const std::string& _value ) { return PreviousSibling (_value.c_str ()); } ///< STL std::string form. const TiXmlNode* NextSibling( const std::string& _value) const { return NextSibling (_value.c_str ()); } ///< STL std::string form. TiXmlNode* NextSibling( const std::string& _value) { return NextSibling (_value.c_str ()); } ///< STL std::string form. #endif /// Navigate to a sibling node. const TiXmlNode* NextSibling() const { return next; } TiXmlNode* NextSibling() { return next; } /// Navigate to a sibling node with the given 'value'. const TiXmlNode* NextSibling( const char * ) const; TiXmlNode* NextSibling( const char* _next ) { return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->NextSibling( _next ) ); } /** Convenience function to get through elements. Calls NextSibling and ToElement. Will skip all non-Element nodes. Returns 0 if there is not another element. */ const TiXmlElement* NextSiblingElement() const; TiXmlElement* NextSiblingElement() { return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement() ); } /** Convenience function to get through elements. Calls NextSibling and ToElement. Will skip all non-Element nodes. Returns 0 if there is not another element. */ const TiXmlElement* NextSiblingElement( const char * ) const; TiXmlElement* NextSiblingElement( const char *_next ) { return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement( _next ) ); } #ifdef TIXML_USE_STL const TiXmlElement* NextSiblingElement( const std::string& _value) const { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form. TiXmlElement* NextSiblingElement( const std::string& _value) { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form. #endif /// Convenience function to get through elements. const TiXmlElement* FirstChildElement() const; TiXmlElement* FirstChildElement() { return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement() ); } /// Convenience function to get through elements. const TiXmlElement* FirstChildElement( const char * _value ) const; TiXmlElement* FirstChildElement( const char * _value ) { return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement( _value ) ); } #ifdef TIXML_USE_STL const TiXmlElement* FirstChildElement( const std::string& _value ) const { return FirstChildElement (_value.c_str ()); } ///< STL std::string form. TiXmlElement* FirstChildElement( const std::string& _value ) { return FirstChildElement (_value.c_str ()); } ///< STL std::string form. #endif /** Query the type (as an enumerated value, above) of this node. The possible types are: DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, and DECLARATION. */ int Type() const { return type; } /** Return a pointer to the Document this node lives in. Returns null if not in a document. */ const TiXmlDocument* GetDocument() const; TiXmlDocument* GetDocument() { return const_cast< TiXmlDocument* >( (const_cast< const TiXmlNode* >(this))->GetDocument() ); } /// Returns true if this node has no children. bool NoChildren() const { return !firstChild; } virtual const TiXmlDocument* ToDocument() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual const TiXmlElement* ToElement() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual const TiXmlComment* ToComment() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual const TiXmlUnknown* ToUnknown() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual const TiXmlText* ToText() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual const TiXmlDeclaration* ToDeclaration() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual TiXmlDocument* ToDocument() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual TiXmlElement* ToElement() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual TiXmlComment* ToComment() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual TiXmlUnknown* ToUnknown() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual TiXmlText* ToText() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. virtual TiXmlDeclaration* ToDeclaration() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. /** Create an exact duplicate of this node and return it. The memory must be deleted by the caller. */ virtual TiXmlNode* Clone() const = 0; /** Accept a hierarchical visit the nodes in the TinyXML DOM. Every node in the XML tree will be conditionally visited and the host will be called back via the TiXmlVisitor interface. This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse the XML for the callbacks, so the performance of TinyXML is unchanged by using this interface versus any other.) The interface has been based on ideas from: - http://www.saxproject.org/ - http://c2.com/cgi/wiki?HierarchicalVisitorPattern Which are both good references for "visiting". An example of using Accept(): @verbatim TiXmlPrinter printer; tinyxmlDoc.Accept( &printer ); const char* xmlcstr = printer.CStr(); @endverbatim */ virtual bool Accept( TiXmlVisitor* visitor ) const = 0; protected: TiXmlNode( NodeType _type ); // Copy to the allocated object. Shared functionality between Clone, Copy constructor, // and the assignment operator. void CopyTo( TiXmlNode* target ) const; #ifdef TIXML_USE_STL // The real work of the input operator. virtual void StreamIn( std::istream* in, TIXML_STRING* tag ) = 0; #endif // Figure out what is at *p, and parse it. Returns null if it is not an xml node. TiXmlNode* Identify( const char* start, TiXmlEncoding encoding ); TiXmlNode* parent; NodeType type; TiXmlNode* firstChild; TiXmlNode* lastChild; TIXML_STRING value; TiXmlNode* prev; TiXmlNode* next; private: TiXmlNode( const TiXmlNode& ); // not implemented. void operator=( const TiXmlNode& base ); // not allowed. }; /** An attribute is a name-value pair. Elements have an arbitrary number of attributes, each with a unique name. @note The attributes are not TiXmlNodes, since they are not part of the tinyXML document object model. There are other suggested ways to look at this problem. */ class TiXmlAttribute : public TiXmlBase { friend class TiXmlAttributeSet; public: /// Construct an empty attribute. TiXmlAttribute() : TiXmlBase() { document = 0; prev = next = 0; } #ifdef TIXML_USE_STL /// std::string constructor. TiXmlAttribute( const std::string& _name, const std::string& _value ) { name = _name; value = _value; document = 0; prev = next = 0; } #endif /// Construct an attribute with a name and value. TiXmlAttribute( const char * _name, const char * _value ) { name = _name; value = _value; document = 0; prev = next = 0; } const char* Name() const { return name.c_str(); } ///< Return the name of this attribute. const char* Value() const { return value.c_str(); } ///< Return the value of this attribute. #ifdef TIXML_USE_STL const std::string& ValueStr() const { return value; } ///< Return the value of this attribute. #endif int IntValue() const; ///< Return the value of this attribute, converted to an integer. double DoubleValue() const; ///< Return the value of this attribute, converted to a double. // Get the tinyxml string representation const TIXML_STRING& NameTStr() const { return name; } /** QueryIntValue examines the value string. It is an alternative to the IntValue() method with richer error checking. If the value is an integer, it is stored in 'value' and the call returns TIXML_SUCCESS. If it is not an integer, it returns TIXML_WRONG_TYPE. A specialized but useful call. Note that for success it returns 0, which is the opposite of almost all other TinyXml calls. */ int QueryIntValue( int* _value ) const; /// QueryDoubleValue examines the value string. See QueryIntValue(). int QueryDoubleValue( double* _value ) const; void SetName( const char* _name ) { name = _name; } ///< Set the name of this attribute. void SetValue( const char* _value ) { value = _value; } ///< Set the value. void SetIntValue( int _value ); ///< Set the value from an integer. void SetDoubleValue( double _value ); ///< Set the value from a double. #ifdef TIXML_USE_STL /// STL std::string form. void SetName( const std::string& _name ) { name = _name; } /// STL std::string form. void SetValue( const std::string& _value ) { value = _value; } #endif /// Get the next sibling attribute in the DOM. Returns null at end. const TiXmlAttribute* Next() const; TiXmlAttribute* Next() { return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Next() ); } /// Get the previous sibling attribute in the DOM. Returns null at beginning. const TiXmlAttribute* Previous() const; TiXmlAttribute* Previous() { return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Previous() ); } bool operator==( const TiXmlAttribute& rhs ) const { return rhs.name == name; } bool operator<( const TiXmlAttribute& rhs ) const { return name < rhs.name; } bool operator>( const TiXmlAttribute& rhs ) const { return name > rhs.name; } /* Attribute parsing starts: first letter of the name returns: the next char after the value end quote */ virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); // Prints this Attribute to a FILE stream. virtual void Print( FILE* cfile, int depth ) const { Print( cfile, depth, 0 ); } void Print( FILE* cfile, int depth, TIXML_STRING* str ) const; // [internal use] // Set the document pointer so the attribute can report errors. void SetDocument( TiXmlDocument* doc ) { document = doc; } private: TiXmlAttribute( const TiXmlAttribute& ); // not implemented. void operator=( const TiXmlAttribute& base ); // not allowed. TiXmlDocument* document; // A pointer back to a document, for error reporting. TIXML_STRING name; TIXML_STRING value; TiXmlAttribute* prev; TiXmlAttribute* next; }; /* A class used to manage a group of attributes. It is only used internally, both by the ELEMENT and the DECLARATION. The set can be changed transparent to the Element and Declaration classes that use it, but NOT transparent to the Attribute which has to implement a next() and previous() method. Which makes it a bit problematic and prevents the use of STL. This version is implemented with circular lists because: - I like circular lists - it demonstrates some independence from the (typical) doubly linked list. */ class TiXmlAttributeSet { public: TiXmlAttributeSet(); ~TiXmlAttributeSet(); void Add( TiXmlAttribute* attribute ); void Remove( TiXmlAttribute* attribute ); const TiXmlAttribute* First() const { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } TiXmlAttribute* First() { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } const TiXmlAttribute* Last() const { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } TiXmlAttribute* Last() { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } const TiXmlAttribute* Find( const char* _name ) const; TiXmlAttribute* Find( const char* _name ) { return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) ); } #ifdef TIXML_USE_STL const TiXmlAttribute* Find( const std::string& _name ) const; TiXmlAttribute* Find( const std::string& _name ) { return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) ); } #endif private: //*ME: Because of hidden/disabled copy-construktor in TiXmlAttribute (sentinel-element), //*ME: this class must be also use a hidden/disabled copy-constructor !!! TiXmlAttributeSet( const TiXmlAttributeSet& ); // not allowed void operator=( const TiXmlAttributeSet& ); // not allowed (as TiXmlAttribute) TiXmlAttribute sentinel; }; /** The element is a container class. It has a value, the element name, and can contain other elements, text, comments, and unknowns. Elements also contain an arbitrary number of attributes. */ class TiXmlElement : public TiXmlNode { public: /// Construct an element. TiXmlElement (const char * in_value); #ifdef TIXML_USE_STL /// std::string constructor. TiXmlElement( const std::string& _value ); #endif TiXmlElement( const TiXmlElement& ); void operator=( const TiXmlElement& base ); virtual ~TiXmlElement(); /** Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. */ const char* Attribute( const char* name ) const; /** Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. If the attribute exists and can be converted to an integer, the integer value will be put in the return 'i', if 'i' is non-null. */ const char* Attribute( const char* name, int* i ) const; /** Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. If the attribute exists and can be converted to an double, the double value will be put in the return 'd', if 'd' is non-null. */ const char* Attribute( const char* name, double* d ) const; /** QueryIntAttribute examines the attribute - it is an alternative to the Attribute() method with richer error checking. If the attribute is an integer, it is stored in 'value' and the call returns TIXML_SUCCESS. If it is not an integer, it returns TIXML_WRONG_TYPE. If the attribute does not exist, then TIXML_NO_ATTRIBUTE is returned. */ int QueryIntAttribute( const char* name, int* _value ) const; /// QueryDoubleAttribute examines the attribute - see QueryIntAttribute(). int QueryDoubleAttribute( const char* name, double* _value ) const; /// QueryFloatAttribute examines the attribute - see QueryIntAttribute(). int QueryFloatAttribute( const char* name, float* _value ) const { double d; int result = QueryDoubleAttribute( name, &d ); if ( result == TIXML_SUCCESS ) { *_value = (float)d; } return result; } #ifdef TIXML_USE_STL /** Template form of the attribute query which will try to read the attribute into the specified type. Very easy, very powerful, but be careful to make sure to call this with the correct type. @return TIXML_SUCCESS, TIXML_WRONG_TYPE, or TIXML_NO_ATTRIBUTE */ template< typename T > int QueryValueAttribute( const std::string& name, T* outValue ) const { const TiXmlAttribute* node = attributeSet.Find( name ); if ( !node ) return TIXML_NO_ATTRIBUTE; std::stringstream sstream( node->ValueStr() ); sstream >> *outValue; if ( !sstream.fail() ) return TIXML_SUCCESS; return TIXML_WRONG_TYPE; } #endif /** Sets an attribute of name to a given value. The attribute will be created if it does not exist, or changed if it does. */ void SetAttribute( const char* name, const char * _value ); #ifdef TIXML_USE_STL const std::string* Attribute( const std::string& name ) const; const std::string* Attribute( const std::string& name, int* i ) const; const std::string* Attribute( const std::string& name, double* d ) const; int QueryIntAttribute( const std::string& name, int* _value ) const; int QueryDoubleAttribute( const std::string& name, double* _value ) const; /// STL std::string form. void SetAttribute( const std::string& name, const std::string& _value ); ///< STL std::string form. void SetAttribute( const std::string& name, int _value ); #endif /** Sets an attribute of name to a given value. The attribute will be created if it does not exist, or changed if it does. */ void SetAttribute( const char * name, int value ); /** Sets an attribute of name to a given value. The attribute will be created if it does not exist, or changed if it does. */ void SetDoubleAttribute( const char * name, double value ); /** Deletes an attribute with the given name. */ void RemoveAttribute( const char * name ); #ifdef TIXML_USE_STL void RemoveAttribute( const std::string& name ) { RemoveAttribute (name.c_str ()); } ///< STL std::string form. #endif const TiXmlAttribute* FirstAttribute() const { return attributeSet.First(); } ///< Access the first attribute in this element. TiXmlAttribute* FirstAttribute() { return attributeSet.First(); } const TiXmlAttribute* LastAttribute() const { return attributeSet.Last(); } ///< Access the last attribute in this element. TiXmlAttribute* LastAttribute() { return attributeSet.Last(); } /** Convenience function for easy access to the text inside an element. Although easy and concise, GetText() is limited compared to getting the TiXmlText child and accessing it directly. If the first child of 'this' is a TiXmlText, the GetText() returns the character string of the Text node, else null is returned. This is a convenient method for getting the text of simple contained text: @verbatim This is text const char* str = fooElement->GetText(); @endverbatim 'str' will be a pointer to "This is text". Note that this function can be misleading. If the element foo was created from this XML: @verbatim This is text @endverbatim then the value of str would be null. The first child node isn't a text node, it is another element. From this XML: @verbatim This is text @endverbatim GetText() will return "This is ". WARNING: GetText() accesses a child node - don't become confused with the similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are safe type casts on the referenced node. */ const char* GetText() const; /// Creates a new Element and returns it - the returned element is a copy. virtual TiXmlNode* Clone() const; // Print the Element to a FILE stream. virtual void Print( FILE* cfile, int depth ) const; /* Attribtue parsing starts: next char past '<' returns: next char past '>' */ virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); virtual const TiXmlElement* ToElement() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. virtual TiXmlElement* ToElement() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. /** Walk the XML tree visiting this node and all of its children. */ virtual bool Accept( TiXmlVisitor* visitor ) const; protected: void CopyTo( TiXmlElement* target ) const; void ClearThis(); // like clear, but initializes 'this' object as well // Used to be public [internal use] #ifdef TIXML_USE_STL virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); #endif /* [internal use] Reads the "value" of the element -- another element, or text. This should terminate with the current end tag. */ const char* ReadValue( const char* in, TiXmlParsingData* prevData, TiXmlEncoding encoding ); private: TiXmlAttributeSet attributeSet; }; /** An XML comment. */ class TiXmlComment : public TiXmlNode { public: /// Constructs an empty comment. TiXmlComment() : TiXmlNode( TiXmlNode::COMMENT ) {} /// Construct a comment from text. TiXmlComment( const char* _value ) : TiXmlNode( TiXmlNode::COMMENT ) { SetValue( _value ); } TiXmlComment( const TiXmlComment& ); void operator=( const TiXmlComment& base ); virtual ~TiXmlComment() {} /// Returns a copy of this Comment. virtual TiXmlNode* Clone() const; // Write this Comment to a FILE stream. virtual void Print( FILE* cfile, int depth ) const; /* Attribtue parsing starts: at the ! of the !-- returns: next char past '>' */ virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); virtual const TiXmlComment* ToComment() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. virtual TiXmlComment* ToComment() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. /** Walk the XML tree visiting this node and all of its children. */ virtual bool Accept( TiXmlVisitor* visitor ) const; protected: void CopyTo( TiXmlComment* target ) const; // used to be public #ifdef TIXML_USE_STL virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); #endif // virtual void StreamOut( TIXML_OSTREAM * out ) const; private: }; /** XML text. A text node can have 2 ways to output the next. "normal" output and CDATA. It will default to the mode it was parsed from the XML file and you generally want to leave it alone, but you can change the output mode with SetCDATA() and query it with CDATA(). */ class TiXmlText : public TiXmlNode { friend class TiXmlElement; public: /** Constructor for text element. By default, it is treated as normal, encoded text. If you want it be output as a CDATA text element, set the parameter _cdata to 'true' */ TiXmlText (const char * initValue ) : TiXmlNode (TiXmlNode::TEXT) { SetValue( initValue ); cdata = false; } virtual ~TiXmlText() {} #ifdef TIXML_USE_STL /// Constructor. TiXmlText( const std::string& initValue ) : TiXmlNode (TiXmlNode::TEXT) { SetValue( initValue ); cdata = false; } #endif TiXmlText( const TiXmlText& copy ) : TiXmlNode( TiXmlNode::TEXT ) { copy.CopyTo( this ); } void operator=( const TiXmlText& base ) { base.CopyTo( this ); } // Write this text object to a FILE stream. virtual void Print( FILE* cfile, int depth ) const; /// Queries whether this represents text using a CDATA section. bool CDATA() const { return cdata; } /// Turns on or off a CDATA representation of text. void SetCDATA( bool _cdata ) { cdata = _cdata; } virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); virtual const TiXmlText* ToText() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. virtual TiXmlText* ToText() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. /** Walk the XML tree visiting this node and all of its children. */ virtual bool Accept( TiXmlVisitor* content ) const; protected : /// [internal use] Creates a new Element and returns it. virtual TiXmlNode* Clone() const; void CopyTo( TiXmlText* target ) const; bool Blank() const; // returns true if all white space and new lines // [internal use] #ifdef TIXML_USE_STL virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); #endif private: bool cdata; // true if this should be input and output as a CDATA style text element }; /** In correct XML the declaration is the first entry in the file. @verbatim @endverbatim TinyXml will happily read or write files without a declaration, however. There are 3 possible attributes to the declaration: version, encoding, and standalone. Note: In this version of the code, the attributes are handled as special cases, not generic attributes, simply because there can only be at most 3 and they are always the same. */ class TiXmlDeclaration : public TiXmlNode { public: /// Construct an empty declaration. TiXmlDeclaration() : TiXmlNode( TiXmlNode::DECLARATION ) {} #ifdef TIXML_USE_STL /// Constructor. TiXmlDeclaration( const std::string& _version, const std::string& _encoding, const std::string& _standalone ); #endif /// Construct. TiXmlDeclaration( const char* _version, const char* _encoding, const char* _standalone ); TiXmlDeclaration( const TiXmlDeclaration& copy ); void operator=( const TiXmlDeclaration& copy ); virtual ~TiXmlDeclaration() {} /// Version. Will return an empty string if none was found. const char *Version() const { return version.c_str (); } /// Encoding. Will return an empty string if none was found. const char *Encoding() const { return encoding.c_str (); } /// Is this a standalone document? const char *Standalone() const { return standalone.c_str (); } /// Creates a copy of this Declaration and returns it. virtual TiXmlNode* Clone() const; // Print this declaration to a FILE stream. virtual void Print( FILE* cfile, int depth, TIXML_STRING* str ) const; virtual void Print( FILE* cfile, int depth ) const { Print( cfile, depth, 0 ); } virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); virtual const TiXmlDeclaration* ToDeclaration() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. virtual TiXmlDeclaration* ToDeclaration() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. /** Walk the XML tree visiting this node and all of its children. */ virtual bool Accept( TiXmlVisitor* visitor ) const; protected: void CopyTo( TiXmlDeclaration* target ) const; // used to be public #ifdef TIXML_USE_STL virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); #endif private: TIXML_STRING version; TIXML_STRING encoding; TIXML_STRING standalone; }; /** Any tag that tinyXml doesn't recognize is saved as an unknown. It is a tag of text, but should not be modified. It will be written back to the XML, unchanged, when the file is saved. DTD tags get thrown into TiXmlUnknowns. */ class TiXmlUnknown : public TiXmlNode { public: TiXmlUnknown() : TiXmlNode( TiXmlNode::UNKNOWN ) {} virtual ~TiXmlUnknown() {} TiXmlUnknown( const TiXmlUnknown& copy ) : TiXmlNode( TiXmlNode::UNKNOWN ) { copy.CopyTo( this ); } void operator=( const TiXmlUnknown& copy ) { copy.CopyTo( this ); } /// Creates a copy of this Unknown and returns it. virtual TiXmlNode* Clone() const; // Print this Unknown to a FILE stream. virtual void Print( FILE* cfile, int depth ) const; virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); virtual const TiXmlUnknown* ToUnknown() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. virtual TiXmlUnknown* ToUnknown() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. /** Walk the XML tree visiting this node and all of its children. */ virtual bool Accept( TiXmlVisitor* content ) const; protected: void CopyTo( TiXmlUnknown* target ) const; #ifdef TIXML_USE_STL virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); #endif private: }; /** Always the top level node. A document binds together all the XML pieces. It can be saved, loaded, and printed to the screen. The 'value' of a document node is the xml file name. */ class TiXmlDocument : public TiXmlNode { public: /// Create an empty document, that has no name. TiXmlDocument(); /// Create a document with a name. The name of the document is also the filename of the xml. TiXmlDocument( const char * documentName ); #ifdef TIXML_USE_STL /// Constructor. TiXmlDocument( const std::string& documentName ); #endif TiXmlDocument( const TiXmlDocument& copy ); void operator=( const TiXmlDocument& copy ); virtual ~TiXmlDocument() {} /** Load a file using the current document value. Returns true if successful. Will delete any existing document data before loading. */ bool LoadFile( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); /// Save a file using the current document value. Returns true if successful. bool SaveFile() const; /// Load a file using the given filename. Returns true if successful. bool LoadFile( const char * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); /// Save a file using the given filename. Returns true if successful. bool SaveFile( const char * filename ) const; /** Load a file using the given FILE*. Returns true if successful. Note that this method doesn't stream - the entire object pointed at by the FILE* will be interpreted as an XML file. TinyXML doesn't stream in XML from the current file location. Streaming may be added in the future. */ bool LoadFile( FILE*, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); /// Save a file using the given FILE*. Returns true if successful. bool SaveFile( FILE* ) const; #ifdef TIXML_USE_STL bool LoadFile( const std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ) ///< STL std::string version. { // StringToBuffer f( filename ); // return ( f.buffer && LoadFile( f.buffer, encoding )); return LoadFile( filename.c_str(), encoding ); } bool SaveFile( const std::string& filename ) const ///< STL std::string version. { // StringToBuffer f( filename ); // return ( f.buffer && SaveFile( f.buffer )); return SaveFile( filename.c_str() ); } #endif /** Parse the given null terminated block of xml data. Passing in an encoding to this method (either TIXML_ENCODING_LEGACY or TIXML_ENCODING_UTF8 will force TinyXml to use that encoding, regardless of what TinyXml might otherwise try to detect. */ virtual const char* Parse( const char* p, TiXmlParsingData* data = 0, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); /** Get the root element -- the only top level element -- of the document. In well formed XML, there should only be one. TinyXml is tolerant of multiple elements at the document level. */ const TiXmlElement* RootElement() const { return FirstChildElement(); } TiXmlElement* RootElement() { return FirstChildElement(); } /** If an error occurs, Error will be set to true. Also, - The ErrorId() will contain the integer identifier of the error (not generally useful) - The ErrorDesc() method will return the name of the error. (very useful) - The ErrorRow() and ErrorCol() will return the location of the error (if known) */ bool Error() const { return error; } /// Contains a textual (English) description of the error if one occurs. const char * ErrorDesc() const { return errorDesc.c_str (); } /** Generally, you probably want the error string ( ErrorDesc() ). But if you prefer the ErrorId, this function will fetch it. */ int ErrorId() const { return errorId; } /** Returns the location (if known) of the error. The first column is column 1, and the first row is row 1. A value of 0 means the row and column wasn't applicable (memory errors, for example, have no row/column) or the parser lost the error. (An error in the error reporting, in that case.) @sa SetTabSize, Row, Column */ int ErrorRow() const { return errorLocation.row+1; } int ErrorCol() const { return errorLocation.col+1; } ///< The column where the error occurred. See ErrorRow() /** SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to report the correct values for row and column. It does not change the output or input in any way. By calling this method, with a tab size greater than 0, the row and column of each node and attribute is stored when the file is loaded. Very useful for tracking the DOM back in to the source file. The tab size is required for calculating the location of nodes. If not set, the default of 4 is used. The tabsize is set per document. Setting the tabsize to 0 disables row/column tracking. Note that row and column tracking is not supported when using operator>>. The tab size needs to be enabled before the parse or load. Correct usage: @verbatim TiXmlDocument doc; doc.SetTabSize( 8 ); doc.Load( "myfile.xml" ); @endverbatim @sa Row, Column */ void SetTabSize( int _tabsize ) { tabsize = _tabsize; } int TabSize() const { return tabsize; } /** If you have handled the error, it can be reset with this call. The error state is automatically cleared if you Parse a new XML block. */ void ClearError() { error = false; errorId = 0; errorDesc = ""; errorLocation.row = errorLocation.col = 0; //errorLocation.last = 0; } /** Write the document to standard out using formatted printing ("pretty print"). */ void Print() const { Print( stdout, 0 ); } /* Write the document to a string using formatted printing ("pretty print"). This will allocate a character array (new char[]) and return it as a pointer. The calling code pust call delete[] on the return char* to avoid a memory leak. */ //char* PrintToMemory() const; /// Print this Document to a FILE stream. virtual void Print( FILE* cfile, int depth = 0 ) const; // [internal use] void SetError( int err, const char* errorLocation, TiXmlParsingData* prevData, TiXmlEncoding encoding ); virtual const TiXmlDocument* ToDocument() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. virtual TiXmlDocument* ToDocument() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. /** Walk the XML tree visiting this node and all of its children. */ virtual bool Accept( TiXmlVisitor* content ) const; protected : // [internal use] virtual TiXmlNode* Clone() const; #ifdef TIXML_USE_STL virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); #endif private: void CopyTo( TiXmlDocument* target ) const; bool error; int errorId; TIXML_STRING errorDesc; int tabsize; TiXmlCursor errorLocation; bool useMicrosoftBOM; // the UTF-8 BOM were found when read. Note this, and try to write. }; /** A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly useful thing. Note that TiXmlHandle is not part of the TinyXml DOM structure. It is a separate utility class. Take an example: @verbatim @endverbatim Assuming you want the value of "attributeB" in the second "Child" element, it's very easy to write a *lot* of code that looks like: @verbatim TiXmlElement* root = document.FirstChildElement( "Document" ); if ( root ) { TiXmlElement* element = root->FirstChildElement( "Element" ); if ( element ) { TiXmlElement* child = element->FirstChildElement( "Child" ); if ( child ) { TiXmlElement* child2 = child->NextSiblingElement( "Child" ); if ( child2 ) { // Finally do something useful. @endverbatim And that doesn't even cover "else" cases. TiXmlHandle addresses the verbosity of such code. A TiXmlHandle checks for null pointers so it is perfectly safe and correct to use: @verbatim TiXmlHandle docHandle( &document ); TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement(); if ( child2 ) { // do something useful @endverbatim Which is MUCH more concise and useful. It is also safe to copy handles - internally they are nothing more than node pointers. @verbatim TiXmlHandle handleCopy = handle; @endverbatim What they should not be used for is iteration: @verbatim int i=0; while ( true ) { TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", i ).ToElement(); if ( !child ) break; // do something ++i; } @endverbatim It seems reasonable, but it is in fact two embedded while loops. The Child method is a linear walk to find the element, so this code would iterate much more than it needs to. Instead, prefer: @verbatim TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild( "Child" ).ToElement(); for( child; child; child=child->NextSiblingElement() ) { // do something } @endverbatim */ class TiXmlHandle { public: /// Create a handle from any node (at any depth of the tree.) This can be a null pointer. TiXmlHandle( TiXmlNode* _node ) { this->node = _node; } /// Copy constructor TiXmlHandle( const TiXmlHandle& ref ) { this->node = ref.node; } TiXmlHandle operator=( const TiXmlHandle& ref ) { this->node = ref.node; return *this; } /// Return a handle to the first child node. TiXmlHandle FirstChild() const; /// Return a handle to the first child node with the given name. TiXmlHandle FirstChild( const char * value ) const; /// Return a handle to the first child element. TiXmlHandle FirstChildElement() const; /// Return a handle to the first child element with the given name. TiXmlHandle FirstChildElement( const char * value ) const; /** Return a handle to the "index" child with the given name. The first child is 0, the second 1, etc. */ TiXmlHandle Child( const char* value, int index ) const; /** Return a handle to the "index" child. The first child is 0, the second 1, etc. */ TiXmlHandle Child( int index ) const; /** Return a handle to the "index" child element with the given name. The first child element is 0, the second 1, etc. Note that only TiXmlElements are indexed: other types are not counted. */ TiXmlHandle ChildElement( const char* value, int index ) const; /** Return a handle to the "index" child element. The first child element is 0, the second 1, etc. Note that only TiXmlElements are indexed: other types are not counted. */ TiXmlHandle ChildElement( int index ) const; #ifdef TIXML_USE_STL TiXmlHandle FirstChild( const std::string& _value ) const { return FirstChild( _value.c_str() ); } TiXmlHandle FirstChildElement( const std::string& _value ) const { return FirstChildElement( _value.c_str() ); } TiXmlHandle Child( const std::string& _value, int index ) const { return Child( _value.c_str(), index ); } TiXmlHandle ChildElement( const std::string& _value, int index ) const { return ChildElement( _value.c_str(), index ); } #endif /** Return the handle as a TiXmlNode. This may return null. */ TiXmlNode* ToNode() const { return node; } /** Return the handle as a TiXmlElement. This may return null. */ TiXmlElement* ToElement() const { return ( ( node && node->ToElement() ) ? node->ToElement() : 0 ); } /** Return the handle as a TiXmlText. This may return null. */ TiXmlText* ToText() const { return ( ( node && node->ToText() ) ? node->ToText() : 0 ); } /** Return the handle as a TiXmlUnknown. This may return null. */ TiXmlUnknown* ToUnknown() const { return ( ( node && node->ToUnknown() ) ? node->ToUnknown() : 0 ); } /** @deprecated use ToNode. Return the handle as a TiXmlNode. This may return null. */ TiXmlNode* Node() const { return ToNode(); } /** @deprecated use ToElement. Return the handle as a TiXmlElement. This may return null. */ TiXmlElement* Element() const { return ToElement(); } /** @deprecated use ToText() Return the handle as a TiXmlText. This may return null. */ TiXmlText* Text() const { return ToText(); } /** @deprecated use ToUnknown() Return the handle as a TiXmlUnknown. This may return null. */ TiXmlUnknown* Unknown() const { return ToUnknown(); } private: TiXmlNode* node; }; /** Print to memory functionality. The TiXmlPrinter is useful when you need to: -# Print to memory (especially in non-STL mode) -# Control formatting (line endings, etc.) When constructed, the TiXmlPrinter is in its default "pretty printing" mode. Before calling Accept() you can call methods to control the printing of the XML document. After TiXmlNode::Accept() is called, the printed document can be accessed via the CStr(), Str(), and Size() methods. TiXmlPrinter uses the Visitor API. @verbatim TiXmlPrinter printer; printer.SetIndent( "\t" ); doc.Accept( &printer ); fprintf( stdout, "%s", printer.CStr() ); @endverbatim */ class TiXmlPrinter : public TiXmlVisitor { public: TiXmlPrinter() : depth( 0 ), simpleTextPrint( false ), buffer(), indent( " " ), lineBreak( "\n" ) {} virtual bool VisitEnter( const TiXmlDocument& doc ); virtual bool VisitExit( const TiXmlDocument& doc ); virtual bool VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute ); virtual bool VisitExit( const TiXmlElement& element ); virtual bool Visit( const TiXmlDeclaration& declaration ); virtual bool Visit( const TiXmlText& text ); virtual bool Visit( const TiXmlComment& comment ); virtual bool Visit( const TiXmlUnknown& unknown ); /** Set the indent characters for printing. By default 4 spaces but tab (\t) is also useful, or null/empty string for no indentation. */ void SetIndent( const char* _indent ) { indent = _indent ? _indent : "" ; } /// Query the indention string. const char* Indent() { return indent.c_str(); } /** Set the line breaking string. By default set to newline (\c \n). Some operating systems prefer other characters, or can be set to the null/empty string for no indentation. */ void SetLineBreak( const char* _lineBreak ) { lineBreak = _lineBreak ? _lineBreak : ""; } /// Query the current line breaking string. const char* LineBreak() { return lineBreak.c_str(); } /** Switch over to "stream printing" which is the most dense formatting without line breaks. Common when the XML is needed for network transmission. */ void SetStreamPrinting() { indent = ""; lineBreak = ""; } /// Return the result. const char* CStr() { return buffer.c_str(); } /// Return the length of the result string. size_t Size() { return buffer.size(); } #ifdef TIXML_USE_STL /// Return the result. const std::string& Str() { return buffer; } #endif private: void DoIndent() { for( int i=0; i=3.7"] build-backend = "flit_core.buildapi" # project metadata [project] name = "breathe" description = "Sphinx Doxygen renderer" readme = "README.rst" urls.Changelog = "https://github.com/breathe-doc/breathe/blob/main/CHANGELOG.rst" urls.Code = "https://github.com/breathe-doc/breathe/" urls.Download = "https://pypi.org/project/breathe/" urls.Documentation = "https://breathe.readthedocs.io/" urls.Homepage = "https://www.breathe-doc.org/" urls."Issue tracker" = "https://github.com/breathe-doc/breathe/issues" license.text = "BSD-3-Clause" requires-python = ">=3.9" # Classifiers list: https://pypi.org/classifiers/ classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Environment :: Web Environment", "Framework :: Sphinx", "Framework :: Sphinx :: Extension", "Intended Audience :: Developers", "Intended Audience :: Education", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Topic :: Documentation", "Topic :: Documentation :: Sphinx", "Topic :: Software Development", "Topic :: Software Development :: Documentation", "Topic :: Text Processing", "Topic :: Utilities", ] dependencies = [ "Sphinx>=7.2", ] dynamic = ["version"] [project.optional-dependencies] docs = [ "furo", "sphinx-copybutton", "sphinxcontrib-spelling", ] lint = [ "ruff==0.9.2", "mypy>=1", "types-docutils", "types-Pygments", "pytest>=8.0", # for mypy "sphinxcontrib-phpdomain", # for mypy "sphinx-csharp", # for mypy ] test = [ "pytest>=8.0", ] [[project.authors]] name = "Michael Jones" email = "m.pricejones@gmail.com" [project.scripts] breathe-apidoc = "breathe.apidoc:main" [tool.flit.module] name = "breathe" [tool.flit.sdist] include = [ "LICENSE", "CHANGELOG.rst", "CONTRIBUTING.rst", "CONTRIBUTORS.rst", # Documentation "documentation/", # Tests "tests/", # Utilities "Makefile", "mkrelease", ] exclude = [ "documentation/build", ] [tool.mypy] files = [ "breathe", "examples", "tests", ] show_column_numbers = true show_error_context = true python_version = "3.9" warn_unused_configs = true warn_redundant_casts = true warn_unused_ignores = true [[tool.mypy.overrides]] module = [ "breathe.parser.compound", "breathe.parser.compoundsuper", "breathe.parser.index", "breathe.parser.indexsuper", ] ignore_errors = true breathe-doc-breathe-10a36f3/tests/000077500000000000000000000000001475641424700170045ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/tests/conftest.py000066400000000000000000000001211475641424700211750ustar00rootroot00000000000000from __future__ import annotations pytest_plugins = ["sphinx.testing.fixtures"] breathe-doc-breathe-10a36f3/tests/data/000077500000000000000000000000001475641424700177155ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/tests/data/arange.xml000066400000000000000000000132321475641424700216750ustar00rootroot00000000000000 Tensor Tensor at::arange (Scalar end, const TensorOptions &options={}) arange Scalar end const TensorOptions & options {} Tensor Tensor at::arange (Scalar end, c10::optional< ScalarType > dtype, c10::optional< Layout > layout, c10::optional< Device > device, c10::optional< bool > pin_memory) arange Scalar end c10::optional< ScalarType > dtype c10::optional< Layout > layout c10::optional< Device > device c10::optional< bool > pin_memory Tensor Tensor at::arange (Scalar start, Scalar end, const TensorOptions &options={}) arange Scalar start Scalar end const TensorOptions & options {} Tensor Tensor at::arange (Scalar start, Scalar end, c10::optional< ScalarType > dtype, c10::optional< Layout > layout, c10::optional< Device > device, c10::optional< bool > pin_memory) arange Scalar start Scalar end c10::optional< ScalarType > dtype c10::optional< Layout > layout c10::optional< Device > device c10::optional< bool > pin_memory Tensor Tensor at::arange (Scalar start, Scalar end, Scalar step, const TensorOptions &options={}) range Scalar start Scalar end Scalar step const TensorOptions & options {} Tensor Tensor at::arange (Scalar start, Scalar end, Scalar step, c10::optional< ScalarType > dtype, c10::optional< Layout > layout, c10::optional< Device > device, c10::optional< bool > pin_memory) range Scalar start Scalar end Scalar step c10::optional< ScalarType > dtype c10::optional< Layout > layout c10::optional< Device > device c10::optional< bool > pin_memory breathe-doc-breathe-10a36f3/tests/data/ellipsis.xml000066400000000000000000000007751475641424700222740ustar00rootroot00000000000000 double double amici::spline_pos (double t, int num,...) spline_pos double t int num ... breathe-doc-breathe-10a36f3/tests/runtests.sh000077500000000000000000000001241475641424700212270ustar00rootroot00000000000000#!/bin/sh export PYTHONPATH="../${PYTHONPATH:+:$PYTHONPATH}" python3 -m pytest -v breathe-doc-breathe-10a36f3/tests/test_renderer.py000066400000000000000000000425201475641424700222260ustar00rootroot00000000000000from __future__ import annotations import os from pathlib import Path import pytest import sphinx.addnodes import sphinx.environment from docutils import frontend, nodes, parsers, utils from breathe.parser.compound import ( MixedContainer, compounddefTypeSub, linkedTextTypeSub, memberdefTypeSub, paramTypeSub, refTypeSub, ) from breathe.renderer.filter import OpenFilter from breathe.renderer.sphinxrenderer import SphinxRenderer sphinx.locale.init([], "") TESTS_ROOT = Path(__file__).resolve().parent @pytest.fixture def app(test_params, app_params, make_app, shared_result): """ Based on sphinx.testing.fixtures.app """ args, kwargs = app_params assert "srcdir" in kwargs os.makedirs(kwargs["srcdir"], exist_ok=True) (kwargs["srcdir"] / "conf.py").write_text("", encoding="ascii") app_ = make_app(*args, **kwargs) yield app_ print("# testroot:", kwargs.get("testroot", "root")) print("# builder:", app_.builder.name) print("# srcdir:", app_.srcdir) print("# outdir:", app_.outdir) print("# status:", "\n" + app_._status.getvalue()) print("# warning:", "\n" + app_._warning.getvalue()) if test_params["shared_result"]: shared_result.store(test_params["shared_result"], app_) class WrappedDoxygenNode: """A base class for test wrappers of Doxygen nodes. It allows setting all attributes via keyword arguments in the constructor. """ def __init__(self, cls, *args, **kwargs): if cls: cls.__init__(self, args) for name, value in kwargs.items(): if not hasattr(self, name): raise AttributeError("invalid attribute " + name) setattr(self, name, value) class WrappedMixedContainer(MixedContainer, WrappedDoxygenNode): """A test wrapper of Doxygen mixed container.""" def __init__(self, **kwargs): MixedContainer.__init__(self, None, None, None, None) WrappedDoxygenNode.__init__(self, None, **kwargs) class WrappedLinkedText(linkedTextTypeSub, WrappedDoxygenNode): """A test wrapper of Doxygen linked text.""" def __init__(self, **kwargs): WrappedDoxygenNode.__init__(self, linkedTextTypeSub, **kwargs) class WrappedMemberDef(memberdefTypeSub, WrappedDoxygenNode): """A test wrapper of Doxygen class/file/namespace member symbol such as a function declaration.""" def __init__(self, **kwargs): WrappedDoxygenNode.__init__(self, memberdefTypeSub, **kwargs) class WrappedParam(paramTypeSub, WrappedDoxygenNode): """A test wrapper of Doxygen parameter.""" def __init__(self, **kwargs): WrappedDoxygenNode.__init__(self, paramTypeSub, **kwargs) class WrappedRef(refTypeSub, WrappedDoxygenNode): """A test wrapper of Doxygen ref.""" def __init__(self, node_name, **kwargs): WrappedDoxygenNode.__init__(self, refTypeSub, node_name, **kwargs) class WrappedCompoundDef(compounddefTypeSub, WrappedDoxygenNode): """A test wrapper of Doxygen compound definition.""" def __init__(self, **kwargs): WrappedDoxygenNode.__init__(self, compounddefTypeSub, **kwargs) class MockMemo: def __init__(self): self.title_styles = "" self.section_level = "" class MockState: def __init__(self, app): from breathe.parser import DoxygenParserFactory from breathe.project import ProjectInfoFactory env = sphinx.environment.BuildEnvironment(app) env.setup(app) env.temp_data["docname"] = "mock-doc" env.temp_data["breathe_project_info_factory"] = ProjectInfoFactory(app) env.temp_data["breathe_parser_factory"] = DoxygenParserFactory(app) settings = frontend.get_default_settings(parsers.rst.Parser) settings.env = env self.document = utils.new_document("", settings) # In sphinx 5.3.0 the method state.nested_parse is not called directly # so this memo object should exists here self.memo = MockMemo() def nested_parse(self, content, content_offset, contentnode, match_titles=1): pass class MockReporter: def __init__(self): pass def warning(self, description, line): pass def debug(self, message): pass class MockStateMachine: def __init__(self): self.reporter = MockReporter() def get_source_and_line(self, lineno: int): if lineno is None: lineno = 42 return "mock-doc", lineno class MockMaskFactory: def __init__(self): pass def mask(self, node): return node class MockContext: def __init__(self, app, node_stack, domain=None, options=[]): from docutils.statemachine import StringList self.domain = domain self.node_stack = node_stack self.directive_args = [ None, # name None, # arguments options, # options StringList([], items=[]), # content None, # lineno None, # content_offset None, # block_text MockState(app), MockStateMachine(), ] self.child = None self.mask_factory = MockMaskFactory() def create_child_context(self, attribute): return self class MockTargetHandler: def __init__(self): pass def create_target(self, refid): pass class MockDocument: def __init__(self): self.reporter = MockReporter() class MockCompoundParser: """ A compound parser reads a doxygen XML file from disk; this mock implements a mapping of what would be the file name on disk to data using a dict. """ def __init__(self, compound_dict): self.compound_dict = compound_dict class MockFileData: def __init__(self, compounddef): self.compounddef = compounddef def parse(self, compoundname): compounddef = self.compound_dict[compoundname] return self.MockFileData(compounddef) class NodeFinder(nodes.NodeVisitor): """Find node with specified class name.""" def __init__(self, name, document): nodes.NodeVisitor.__init__(self, document) self.name = name self.found_nodes = [] def unknown_visit(self, node): if node.__class__.__name__ == self.name: self.found_nodes.append(node) def find_nodes(nodes, name): """Find all docutils nodes with specified class name in *nodes*.""" finder = NodeFinder(name, MockDocument()) for node in nodes: node.walk(finder) return finder.found_nodes def find_node(nodes, name): """ Find a single docutils node with specified class name in *nodes*. Throw an exception if there isn't exactly one such node. """ found_nodes = find_nodes(nodes, name) if len(found_nodes) != 1: raise Exception(f"the number of nodes {name} is {len(found_nodes)}") return found_nodes[0] def test_find_nodes(): section = nodes.section() foo = nodes.Text("foo") desc = nodes.description() bar = nodes.Text("bar") section.children = [foo, desc, bar] assert find_nodes(section, "description") == [desc] assert find_nodes([section, desc], "description") == [desc, desc] assert find_nodes([], "description") == [] assert find_nodes(section, "unknown") == [] assert find_nodes(section, "Text") == [foo, bar] def check_exception(func, message): """Check if func() throws an exception with the specified message.""" exception = None try: func() except Exception as e: exception = e print(str(exception)) assert exception assert str(exception) == message def test_find_node(): section = nodes.section() foo = nodes.Text("foo") desc = nodes.description() bar = nodes.Text("bar") section.children = [foo, desc, bar] assert find_node(section, "description") == desc check_exception( lambda: find_node([section, desc], "description"), "the number of nodes description is 2" ) check_exception(lambda: find_node([], "description"), "the number of nodes description is 0") check_exception(lambda: find_node([section], "unknown"), "the number of nodes unknown is 0") check_exception(lambda: find_node([section], "Text"), "the number of nodes Text is 2") def render( app, member_def, domain=None, show_define_initializer=False, compound_parser=None, options=[] ): """Render Doxygen *member_def* with *renderer_class*.""" app.config.breathe_separate_member_pages = False app.config.breathe_use_project_refids = False app.config.breathe_show_define_initializer = show_define_initializer app.config.breathe_order_parameters_first = False app.config.breathe_debug_trace_directives = False app.config.breathe_debug_trace_doxygen_ids = False app.config.breathe_debug_trace_qualification = False renderer = SphinxRenderer( app, None, # project_info [], # node_stack None, # state None, # document MockTargetHandler(), compound_parser, OpenFilter(), ) renderer.context = MockContext(app, [member_def], domain, options) return renderer.render(member_def) def test_render_func(app): member_def = WrappedMemberDef( kind="function", definition="void foo", type_="void", name="foo", argsstring="(int)", virt="non-virtual", param=[ WrappedParam(type_=WrappedLinkedText(content_=[WrappedMixedContainer(value="int")])) ], ) signature = find_node(render(app, member_def), "desc_signature") assert signature.astext().startswith("void") n = find_node(signature, "desc_name")[0] assert isinstance(n, sphinx.addnodes.desc_sig_name) assert len(n) == 1 assert n[0] == "foo" params = find_node(signature, "desc_parameterlist") assert len(params) == 1 param = params[0] assert isinstance(param[0], sphinx.addnodes.desc_sig_keyword_type) assert param[0][0] == "int" def test_render_typedef(app): member_def = WrappedMemberDef( kind="typedef", definition="typedef int foo", type_="int", name="foo" ) signature = find_node(render(app, member_def), "desc_signature") assert signature.astext() == "typedef int foo" def test_render_c_typedef(app): member_def = WrappedMemberDef( kind="typedef", definition="typedef unsigned int bar", type_="unsigned int", name="bar" ) signature = find_node(render(app, member_def, domain="c"), "desc_signature") assert signature.astext() == "typedef unsigned int bar" def test_render_c_function_typedef(app): member_def = WrappedMemberDef( kind="typedef", definition="typedef void* (*voidFuncPtr)(float, int)", type_="void* (*", name="voidFuncPtr", argsstring=")(float, int)", ) signature = find_node(render(app, member_def, domain="c"), "desc_signature") assert signature.astext().startswith("typedef void *") # the use of desc_parameterlist in this case was not correct, # it should only be used for a top-level function def test_render_using_alias(app): member_def = WrappedMemberDef( kind="typedef", definition="using foo = int", type_="int", name="foo" ) signature = find_node(render(app, member_def), "desc_signature") assert signature.astext() == "using foo = int" def test_render_const_func(app): member_def = WrappedMemberDef( kind="function", definition="void f", type_="void", name="f", argsstring="() const", virt="non-virtual", const="yes", ) signature = find_node(render(app, member_def), "desc_signature") assert "_CPPv2NK1fEv" in signature["ids"] def test_render_lvalue_func(app): member_def = WrappedMemberDef( kind="function", definition="void f", type_="void", name="f", argsstring="() &", virt="non-virtual", refqual="lvalue", ) signature = find_node(render(app, member_def), "desc_signature") assert signature.astext().endswith("&") def test_render_rvalue_func(app): member_def = WrappedMemberDef( kind="function", definition="void f", type_="void", name="f", argsstring="() &&", virt="non-virtual", refqual="rvalue", ) signature = find_node(render(app, member_def), "desc_signature") assert signature.astext().endswith("&&") def test_render_const_lvalue_func(app): member_def = WrappedMemberDef( kind="function", definition="void f", type_="void", name="f", argsstring="() const &", virt="non-virtual", const="yes", refqual="lvalue", ) signature = find_node(render(app, member_def), "desc_signature") assert signature.astext().endswith("const &") def test_render_const_rvalue_func(app): member_def = WrappedMemberDef( kind="function", definition="void f", type_="void", name="f", argsstring="() const &&", virt="non-virtual", const="yes", refqual="rvalue", ) signature = find_node(render(app, member_def), "desc_signature") assert signature.astext().endswith("const &&") def test_render_variable_initializer(app): member_def = WrappedMemberDef( kind="variable", definition="const int EOF", type_="const int", name="EOF", initializer=WrappedMixedContainer(value="= -1"), ) signature = find_node(render(app, member_def), "desc_signature") assert signature.astext() == "const int EOF = -1" def test_render_define_initializer(app): member_def = WrappedMemberDef( kind="define", name="MAX_LENGTH", initializer=WrappedLinkedText(content_=[WrappedMixedContainer(value="100")]), ) signature_w_initializer = find_node( render(app, member_def, show_define_initializer=True), "desc_signature" ) assert signature_w_initializer.astext() == "MAX_LENGTH 100" member_def_no_show = WrappedMemberDef( kind="define", name="MAX_LENGTH_NO_INITIALIZER", initializer=WrappedLinkedText(content_=[WrappedMixedContainer(value="100")]), ) signature_wo_initializer = find_node( render(app, member_def_no_show, show_define_initializer=False), "desc_signature" ) assert signature_wo_initializer.astext() == "MAX_LENGTH_NO_INITIALIZER" def test_render_define_no_initializer(app): sphinx.addnodes.setup(app) member_def = WrappedMemberDef(kind="define", name="USE_MILK") signature = find_node(render(app, member_def), "desc_signature") assert signature.astext() == "USE_MILK" def test_render_innergroup(app): refid = "group__innergroup" mock_compound_parser = MockCompoundParser({ refid: WrappedCompoundDef( kind="group", compoundname="InnerGroup", briefdescription="InnerGroup" ) }) ref = WrappedRef("InnerGroup", refid=refid) compound_def = WrappedCompoundDef( kind="group", compoundname="OuterGroup", briefdescription="OuterGroup", innergroup=[ref] ) assert all( el.astext() != "InnerGroup" for el in render(app, compound_def, compound_parser=mock_compound_parser) ) assert any( el.astext() == "InnerGroup" for el in render(app, compound_def, compound_parser=mock_compound_parser, options=["inner"]) ) def get_directive(app): from docutils.statemachine import StringList from breathe.directives.function import DoxygenFunctionDirective app.config.breathe_separate_member_pages = False app.config.breathe_default_project = "test_project" app.config.breathe_domain_by_extension = {} app.config.breathe_domain_by_file_pattern = {} app.config.breathe_use_project_refids = False cls_args = ( "doxygenclass", ["at::Tensor"], {"members": "", "protected-members": None, "undoc-members": None}, StringList([], items=[]), 20, 24, ( ".. doxygenclass:: at::Tensor\n :members:\n" " :protected-members:\n :undoc-members:" ), MockState(app), MockStateMachine(), ) # fmt: skip return DoxygenFunctionDirective(*cls_args) def get_matches(datafile): from xml.dom import minidom from breathe.parser.compoundsuper import sectiondefType argsstrings = [] xml = TESTS_ROOT.joinpath("data", datafile).read_text(encoding="utf-8") doc = minidom.parseString(xml) sectiondef = sectiondefType.factory() for child in doc.documentElement.childNodes: sectiondef.buildChildren(child, "memberdef") if getattr(child, "tagName", None) == "memberdef": # Get the argsstring function declaration argsstrings.append(child.getElementsByTagName("argsstring")[0].childNodes[0].data) matches = [[m, sectiondef] for m in sectiondef.memberdef] return argsstrings, matches def test_resolve_overrides(app): # Test that multiple function overrides works argsstrings, matches = get_matches("arange.xml") cls = get_directive(app) # Verify that the exact arguments returns one override for args in argsstrings: ast_param = cls._parse_args(args) _ = cls._resolve_function(matches, ast_param, None) def test_ellipsis(app): argsstrings, matches = get_matches("ellipsis.xml") cls = get_directive(app) # Verify that parsing an ellipsis works ast_param = cls._parse_args(argsstrings[0]) _ = cls._resolve_function(matches, ast_param, None) breathe-doc-breathe-10a36f3/tests/test_utils.py000066400000000000000000000052551475641424700215640ustar00rootroot00000000000000from __future__ import annotations from xml.dom import minidom from breathe import path_handler from breathe.parser.compoundsuper import memberdefType from breathe.renderer.sphinxrenderer import get_definition_without_template_args, get_param_decl def test_param_decl(): # From xml from: examples/specific/parameters.h xml = """ int a float b int * c int(**) p [3] MyClass a MyClass * b int(&) r [3] """ doc = minidom.parseString(xml) memberdef = memberdefType.factory() for child in doc.documentElement.childNodes: memberdef.buildChildren(child, "param") assert get_param_decl(memberdef.param[0]) == "int a" assert get_param_decl(memberdef.param[1]) == "float b" assert get_param_decl(memberdef.param[2]) == "int * c" assert get_param_decl(memberdef.param[3]) == "int(**p)[3]" assert get_param_decl(memberdef.param[4]) == "MyClass a" assert get_param_decl(memberdef.param[5]) == "MyClass * b" assert get_param_decl(memberdef.param[6]) == "int(&r)[3]" def test_definition_without_template_args(): def get_definition(definition, name, bitfield=""): class MockDataObject: def __init__(self, definition, name, bitfield): self.definition = definition self.name = name self.bitfield = bitfield return get_definition_without_template_args(MockDataObject(definition, name, bitfield)) assert "void A::foo" == get_definition("void A::foo", "foo") # Template arguments in the return type should be preserved: assert "Result A::f" == get_definition("Result A::f", "f") # Nested template arguments: assert "Result A::f" == get_definition("Result A< B >::f", "f") # Bit fields assert "int f : 3" == get_definition("int f", "f", "3") def test_path_handler(): assert path_handler.includes_directory("directory/file.h") is True assert path_handler.includes_directory("directory\\file.h") is True assert path_handler.includes_directory("file.h") is False breathe-doc-breathe-10a36f3/tests/warnings/000077500000000000000000000000001475641424700206345ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/tests/warnings/Makefile000066400000000000000000000152541475641424700223030ustar00rootroot00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = build # User-friendly check for sphinx-build ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from https://www.sphinx-doc.org/) endif # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " xml to make Docutils-native XML files" @echo " pseudoxml to make pseudoxml-XML files for display purposes" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/TestBreatheWarnings.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/TestBreatheWarnings.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/TestBreatheWarnings" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/TestBreatheWarnings" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." latexpdfja: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through platex and dvipdfmx..." $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." xml: $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml @echo @echo "Build finished. The XML files are in $(BUILDDIR)/xml." pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." breathe-doc-breathe-10a36f3/tests/warnings/make.bat000066400000000000000000000145431475641424700222500ustar00rootroot00000000000000@ECHO OFF REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set BUILDDIR=build set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source set I18NSPHINXOPTS=%SPHINXOPTS% source if NOT "%PAPER%" == "" ( set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% ) if "%1" == "" goto help if "%1" == "help" ( :help echo.Please use `make ^` where ^ is one of echo. html to make standalone HTML files echo. dirhtml to make HTML files named index.html in directories echo. singlehtml to make a single large HTML file echo. pickle to make pickle files echo. json to make JSON files echo. htmlhelp to make HTML files and a HTML help project echo. qthelp to make HTML files and a qthelp project echo. devhelp to make HTML files and a Devhelp project echo. epub to make an epub echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter echo. text to make text files echo. man to make manual pages echo. texinfo to make Texinfo files echo. gettext to make PO message catalogs echo. changes to make an overview over all changed/added/deprecated items echo. xml to make Docutils-native XML files echo. pseudoxml to make pseudoxml-XML files for display purposes echo. linkcheck to check all external links for integrity echo. doctest to run all doctests embedded in the documentation if enabled goto end ) if "%1" == "clean" ( for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i del /q /s %BUILDDIR%\* goto end ) %SPHINXBUILD% 2> nul if errorlevel 9009 ( echo. echo.The 'sphinx-build' command was not found. Make sure you have Sphinx echo.installed, then set the SPHINXBUILD environment variable to point echo.to the full path of the 'sphinx-build' executable. Alternatively you echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from echo.https://www.sphinx-doc.org/ exit /b 1 ) if "%1" == "html" ( %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/html. goto end ) if "%1" == "dirhtml" ( %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. goto end ) if "%1" == "singlehtml" ( %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. goto end ) if "%1" == "pickle" ( %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the pickle files. goto end ) if "%1" == "json" ( %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the JSON files. goto end ) if "%1" == "htmlhelp" ( %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run HTML Help Workshop with the ^ .hhp project file in %BUILDDIR%/htmlhelp. goto end ) if "%1" == "qthelp" ( %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: echo.^> qcollectiongenerator %BUILDDIR%\qthelp\TestBreatheWarnings.qhcp echo.To view the help file: echo.^> assistant -collectionFile %BUILDDIR%\qthelp\TestBreatheWarnings.ghc goto end ) if "%1" == "devhelp" ( %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp if errorlevel 1 exit /b 1 echo. echo.Build finished. goto end ) if "%1" == "epub" ( %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub if errorlevel 1 exit /b 1 echo. echo.Build finished. The epub file is in %BUILDDIR%/epub. goto end ) if "%1" == "latex" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex if errorlevel 1 exit /b 1 echo. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. goto end ) if "%1" == "latexpdf" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex cd %BUILDDIR%/latex make all-pdf cd %BUILDDIR%/.. echo. echo.Build finished; the PDF files are in %BUILDDIR%/latex. goto end ) if "%1" == "latexpdfja" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex cd %BUILDDIR%/latex make all-pdf-ja cd %BUILDDIR%/.. echo. echo.Build finished; the PDF files are in %BUILDDIR%/latex. goto end ) if "%1" == "text" ( %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text if errorlevel 1 exit /b 1 echo. echo.Build finished. The text files are in %BUILDDIR%/text. goto end ) if "%1" == "man" ( %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man if errorlevel 1 exit /b 1 echo. echo.Build finished. The manual pages are in %BUILDDIR%/man. goto end ) if "%1" == "texinfo" ( %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo if errorlevel 1 exit /b 1 echo. echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. goto end ) if "%1" == "gettext" ( %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale if errorlevel 1 exit /b 1 echo. echo.Build finished. The message catalogs are in %BUILDDIR%/locale. goto end ) if "%1" == "changes" ( %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes if errorlevel 1 exit /b 1 echo. echo.The overview file is in %BUILDDIR%/changes. goto end ) if "%1" == "linkcheck" ( %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck if errorlevel 1 exit /b 1 echo. echo.Link check complete; look for any errors in the above output ^ or in %BUILDDIR%/linkcheck/output.txt. goto end ) if "%1" == "doctest" ( %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest if errorlevel 1 exit /b 1 echo. echo.Testing of doctests in the sources finished, look at the ^ results in %BUILDDIR%/doctest/output.txt. goto end ) if "%1" == "xml" ( %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml if errorlevel 1 exit /b 1 echo. echo.Build finished. The XML files are in %BUILDDIR%/xml. goto end ) if "%1" == "pseudoxml" ( %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml if errorlevel 1 exit /b 1 echo. echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. goto end ) :end breathe-doc-breathe-10a36f3/tests/warnings/source/000077500000000000000000000000001475641424700221345ustar00rootroot00000000000000breathe-doc-breathe-10a36f3/tests/warnings/source/class.rst000066400000000000000000000004561475641424700240000ustar00rootroot00000000000000 Class Warnings ============== Test 'cannot find project' warning. .. doxygenclass:: MyClass :project: nonexistent Test 'cannot find xml' warning: .. doxygenclass:: MyClass :project: invalidproject Test 'cannot find class' warning: .. doxygenclass:: NonExistentClass :project: class breathe-doc-breathe-10a36f3/tests/warnings/source/conf.py000066400000000000000000000007321475641424700234350ustar00rootroot00000000000000# mypy: ignore-errors from __future__ import annotations import sys sys.path.append("../../") extensions = ["breathe"] # Breathe configuration parameters breathe_projects = { "class": "../../../examples/doxygen/class/xml/", "function": "../../../examples/specific/functionOverload/xml/", "group": "../../../examples/specific/group/xml/", "invalidproject": "invalid/path/", } master_doc = "index" project = "Test Breathe Warnings" html_theme = "default" breathe-doc-breathe-10a36f3/tests/warnings/source/define.rst000066400000000000000000000003231475641424700241160ustar00rootroot00000000000000 Define Warnings =============== Test 'cannot find project' warning. .. doxygendefine:: MY_DEFINE :project: nonexistent Test 'cannot find define' warning. .. doxygendefine:: MY_DEFINE :project: class breathe-doc-breathe-10a36f3/tests/warnings/source/function.rst000066400000000000000000000006331475641424700245150ustar00rootroot00000000000000 Function Warnings ================= Test 'cannot find project' warning. .. doxygenfunction:: MyFunction :project: nonexistent Test 'cannot find xml' warning: .. doxygenfunction:: MyFunction :project: invalidproject Test 'cannot find function' warning. .. doxygenfunction:: NonExistentFunction :project: function Test 'too many matches' warning. .. doxygenfunction:: f :project: function breathe-doc-breathe-10a36f3/tests/warnings/source/group.rst000066400000000000000000000004721475641424700240250ustar00rootroot00000000000000 Function Warnings ================= Test 'cannot find project' warning. .. doxygengroup:: MyFunction :project: nonexistent Test 'cannot find xml' warning: .. doxygengroup:: MyGroup :project: invalidproject Test 'cannot find function' warning. .. doxygengroup:: NonExistentGroup :project: group breathe-doc-breathe-10a36f3/tests/warnings/source/index.rst000066400000000000000000000004231475641424700237740ustar00rootroot00000000000000 Test Breathe Warnings ===================== This Sphinx instance is designed to call Breathe in every single incorrect way in order to test that the warnings work without crashing the build process. .. toctree:: :maxdepth: 2 class function group define