Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to support cpp:namespace directives #980

Open
wants to merge 82 commits into
base: main
Choose a base branch
from

Conversation

Rouslan
Copy link

@Rouslan Rouslan commented Apr 14, 2024

This pull request adds a single config option: breathe_use_cpp_namespace. I added the following to the documentation, which describes the new option as well as I can:

breathe_use_cpp_namespace

If set to True, the cpp:namespace, cpp:namespace-push and cpp:namespace-pop directives are observed.

The namespace specified by the aforementioned directives shall be referred to as the "current" namespace in this text.

With the exception of doxygendefine, all doxygen- directives will search for a symbol under the current C++ namespace. Parent namespaces will not be searched. In other words: if the symbol isn't found in the current namespace, it is not found at all.

Similarly to the directives of the cpp domain, the current namespace is not included in the definition of the symbol in the output generated by Sphinx, but is still taken into account for cross-referencing.

Additionally, this changes the default behavior of how doxygenclass, doxygenstruct, doxygennamespace and doxygenunion are presented. By default, the namespace is always omitted for these directives. When breathe_use_cpp_namespace is True, they are treated like the other directives and include the namespace (as given by the doxygen- directive, not the "current" namespace).

By default, this is False.

I had to change the behavior of the class/struct/namespace/union directives, as described above, so that the namespace directives could be used to control how much of the namespace to show. I decided to play it safe and only have the behavior change when breathe_use_cpp_namespace is enabled.

This pull request includes the changes in #967 and #934.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants