sphinx_c_autodoc.clang package#

Submodules#

sphinx_c_autodoc.clang.comments module#

Expose some CXComment functionality to python for libclang

class sphinx_c_autodoc.clang.comments.Comment[source]#

Bases: Structure

A CXComment from clang

as_xml() str | None[source]#

Return this comment as an xml string

node#

Structure/Union member

tu#

Structure/Union member

sphinx_c_autodoc.clang.patches module#

Provide functionality to patch the python clang bindings for some missing functionality.

sphinx_c_autodoc.clang.patches.Cursor_cached_raw_comment(self: Cursor) str | None[source]#

Provides a caching mechanism to a Cursor’s raw comment instead of looking it up each time it’s called.

sphinx_c_autodoc.clang.patches.Cursor_comment_extent(self: Cursor) SourceRange[source]#

Gets the extent of the associated comment.

For some reason libclang calls this “range” while other parts of the interface use the term “extent”, for consistency with the python API naming extent was used here.

Returns:

The extent for the cursor’s raw_comment.

Return type:

cindex.SourceRange

sphinx_c_autodoc.clang.patches.Cursor_getParsedComment(self: Cursor) Comment[source]#

Get the parsed comment for the cursor

Returns:

The comment for the cursor

Return type:

Comment

sphinx_c_autodoc.clang.patches.Cursor_is_macro_function_like(self: Cursor) bool[source]#

Determine if the macro is a function like macro

Returns:

True if the macro is function like

Return type:

boo

sphinx_c_autodoc.clang.patches.Cursor_set_comment_extent(self: Cursor, value: SourceRange) None[source]#

Provides a mechanism to a set a Cursor’s comment extent. For things like macros clang doesn’t provide a mechanism to associate comments. So it may be done later, but the cursors can still be passed around like normal.

sphinx_c_autodoc.clang.patches.Cursor_set_raw_comment(self: Cursor, value: str) None[source]#

Provides a mechanism to a set a Cursor’s raw comment. For things like macros clang doesn’t provide a mechanism to associate comments. So it may be done later, but the cursors can still be passed around like normal.

sphinx_c_autodoc.clang.patches.Cursor_tu(self: Cursor) TranslationUnit[source]#

Provide the cursor’s translation unit in a “public” The Cursors have translation units as protected, underscore, but one can’t do very much querying without access to the translation unit.

sphinx_c_autodoc.clang.patches.SourceLocation_isFromMainFile(self: SourceLocation) bool[source]#

Tests if a cindex.SourceLocation is in the main translation unit being parsed.

Returns:

True if this location is in the main file of the translation unit.

False otherwise.

Return type:

bool

sphinx_c_autodoc.clang.patches.add_dll_entry_points() None[source]#

Add functions available in the clang dll but not listed in the python clang bindings.

sphinx_c_autodoc.clang.patches.add_new_methods() None[source]#

Add new methods to the classes in clang.

sphinx_c_autodoc.clang.patches.override_methods() None[source]#

Override some methods and properties in the bindings to make them more pythonic and or more efficient.

sphinx_c_autodoc.clang.patches.patch_clang() None[source]#

This will patch the variables and classes in cindex to provide more functionality than usual as well as make some things a little more pythonic.

Module contents#