xref: /netbsd-src/external/apache2/llvm/dist/clang/include/clang-c/Documentation.h (revision e038c9c4676b0f19b1b7dd08a940c6ed64a6d5ae)
17330f729Sjoerg /*==-- clang-c/Documentation.h - Utilities for comment processing -*- C -*-===*\
27330f729Sjoerg |*                                                                            *|
37330f729Sjoerg |* Part of the LLVM Project, under the Apache License v2.0 with LLVM          *|
47330f729Sjoerg |* Exceptions.                                                                *|
57330f729Sjoerg |* See https://llvm.org/LICENSE.txt for license information.                  *|
67330f729Sjoerg |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception                    *|
77330f729Sjoerg |*                                                                            *|
87330f729Sjoerg |*===----------------------------------------------------------------------===*|
97330f729Sjoerg |*                                                                            *|
107330f729Sjoerg |* This header provides a supplementary interface for inspecting              *|
117330f729Sjoerg |* documentation comments.                                                    *|
127330f729Sjoerg |*                                                                            *|
137330f729Sjoerg \*===----------------------------------------------------------------------===*/
147330f729Sjoerg 
157330f729Sjoerg #ifndef LLVM_CLANG_C_DOCUMENTATION_H
167330f729Sjoerg #define LLVM_CLANG_C_DOCUMENTATION_H
177330f729Sjoerg 
18*e038c9c4Sjoerg #include "clang-c/ExternC.h"
197330f729Sjoerg #include "clang-c/Index.h"
207330f729Sjoerg 
21*e038c9c4Sjoerg LLVM_CLANG_C_EXTERN_C_BEGIN
227330f729Sjoerg 
237330f729Sjoerg /**
247330f729Sjoerg  * \defgroup CINDEX_COMMENT Comment introspection
257330f729Sjoerg  *
267330f729Sjoerg  * The routines in this group provide access to information in documentation
277330f729Sjoerg  * comments. These facilities are distinct from the core and may be subject to
287330f729Sjoerg  * their own schedule of stability and deprecation.
297330f729Sjoerg  *
307330f729Sjoerg  * @{
317330f729Sjoerg  */
327330f729Sjoerg 
337330f729Sjoerg /**
347330f729Sjoerg  * A parsed comment.
357330f729Sjoerg  */
367330f729Sjoerg typedef struct {
377330f729Sjoerg   const void *ASTNode;
387330f729Sjoerg   CXTranslationUnit TranslationUnit;
397330f729Sjoerg } CXComment;
407330f729Sjoerg 
417330f729Sjoerg /**
427330f729Sjoerg  * Given a cursor that represents a documentable entity (e.g.,
437330f729Sjoerg  * declaration), return the associated parsed comment as a
447330f729Sjoerg  * \c CXComment_FullComment AST node.
457330f729Sjoerg  */
467330f729Sjoerg CINDEX_LINKAGE CXComment clang_Cursor_getParsedComment(CXCursor C);
477330f729Sjoerg 
487330f729Sjoerg /**
497330f729Sjoerg  * Describes the type of the comment AST node (\c CXComment).  A comment
507330f729Sjoerg  * node can be considered block content (e. g., paragraph), inline content
517330f729Sjoerg  * (plain text) or neither (the root AST node).
527330f729Sjoerg  */
537330f729Sjoerg enum CXCommentKind {
547330f729Sjoerg   /**
557330f729Sjoerg    * Null comment.  No AST node is constructed at the requested location
567330f729Sjoerg    * because there is no text or a syntax error.
577330f729Sjoerg    */
587330f729Sjoerg   CXComment_Null = 0,
597330f729Sjoerg 
607330f729Sjoerg   /**
617330f729Sjoerg    * Plain text.  Inline content.
627330f729Sjoerg    */
637330f729Sjoerg   CXComment_Text = 1,
647330f729Sjoerg 
657330f729Sjoerg   /**
667330f729Sjoerg    * A command with word-like arguments that is considered inline content.
677330f729Sjoerg    *
687330f729Sjoerg    * For example: \\c command.
697330f729Sjoerg    */
707330f729Sjoerg   CXComment_InlineCommand = 2,
717330f729Sjoerg 
727330f729Sjoerg   /**
737330f729Sjoerg    * HTML start tag with attributes (name-value pairs).  Considered
747330f729Sjoerg    * inline content.
757330f729Sjoerg    *
767330f729Sjoerg    * For example:
777330f729Sjoerg    * \verbatim
787330f729Sjoerg    * <br> <br /> <a href="http://example.org/">
797330f729Sjoerg    * \endverbatim
807330f729Sjoerg    */
817330f729Sjoerg   CXComment_HTMLStartTag = 3,
827330f729Sjoerg 
837330f729Sjoerg   /**
847330f729Sjoerg    * HTML end tag.  Considered inline content.
857330f729Sjoerg    *
867330f729Sjoerg    * For example:
877330f729Sjoerg    * \verbatim
887330f729Sjoerg    * </a>
897330f729Sjoerg    * \endverbatim
907330f729Sjoerg    */
917330f729Sjoerg   CXComment_HTMLEndTag = 4,
927330f729Sjoerg 
937330f729Sjoerg   /**
947330f729Sjoerg    * A paragraph, contains inline comment.  The paragraph itself is
957330f729Sjoerg    * block content.
967330f729Sjoerg    */
977330f729Sjoerg   CXComment_Paragraph = 5,
987330f729Sjoerg 
997330f729Sjoerg   /**
1007330f729Sjoerg    * A command that has zero or more word-like arguments (number of
1017330f729Sjoerg    * word-like arguments depends on command name) and a paragraph as an
1027330f729Sjoerg    * argument.  Block command is block content.
1037330f729Sjoerg    *
1047330f729Sjoerg    * Paragraph argument is also a child of the block command.
1057330f729Sjoerg    *
1067330f729Sjoerg    * For example: \has 0 word-like arguments and a paragraph argument.
1077330f729Sjoerg    *
1087330f729Sjoerg    * AST nodes of special kinds that parser knows about (e. g., \\param
1097330f729Sjoerg    * command) have their own node kinds.
1107330f729Sjoerg    */
1117330f729Sjoerg   CXComment_BlockCommand = 6,
1127330f729Sjoerg 
1137330f729Sjoerg   /**
1147330f729Sjoerg    * A \\param or \\arg command that describes the function parameter
1157330f729Sjoerg    * (name, passing direction, description).
1167330f729Sjoerg    *
1177330f729Sjoerg    * For example: \\param [in] ParamName description.
1187330f729Sjoerg    */
1197330f729Sjoerg   CXComment_ParamCommand = 7,
1207330f729Sjoerg 
1217330f729Sjoerg   /**
1227330f729Sjoerg    * A \\tparam command that describes a template parameter (name and
1237330f729Sjoerg    * description).
1247330f729Sjoerg    *
1257330f729Sjoerg    * For example: \\tparam T description.
1267330f729Sjoerg    */
1277330f729Sjoerg   CXComment_TParamCommand = 8,
1287330f729Sjoerg 
1297330f729Sjoerg   /**
1307330f729Sjoerg    * A verbatim block command (e. g., preformatted code).  Verbatim
1317330f729Sjoerg    * block has an opening and a closing command and contains multiple lines of
1327330f729Sjoerg    * text (\c CXComment_VerbatimBlockLine child nodes).
1337330f729Sjoerg    *
1347330f729Sjoerg    * For example:
1357330f729Sjoerg    * \\verbatim
1367330f729Sjoerg    * aaa
1377330f729Sjoerg    * \\endverbatim
1387330f729Sjoerg    */
1397330f729Sjoerg   CXComment_VerbatimBlockCommand = 9,
1407330f729Sjoerg 
1417330f729Sjoerg   /**
1427330f729Sjoerg    * A line of text that is contained within a
1437330f729Sjoerg    * CXComment_VerbatimBlockCommand node.
1447330f729Sjoerg    */
1457330f729Sjoerg   CXComment_VerbatimBlockLine = 10,
1467330f729Sjoerg 
1477330f729Sjoerg   /**
1487330f729Sjoerg    * A verbatim line command.  Verbatim line has an opening command,
1497330f729Sjoerg    * a single line of text (up to the newline after the opening command) and
1507330f729Sjoerg    * has no closing command.
1517330f729Sjoerg    */
1527330f729Sjoerg   CXComment_VerbatimLine = 11,
1537330f729Sjoerg 
1547330f729Sjoerg   /**
1557330f729Sjoerg    * A full comment attached to a declaration, contains block content.
1567330f729Sjoerg    */
1577330f729Sjoerg   CXComment_FullComment = 12
1587330f729Sjoerg };
1597330f729Sjoerg 
1607330f729Sjoerg /**
1617330f729Sjoerg  * The most appropriate rendering mode for an inline command, chosen on
1627330f729Sjoerg  * command semantics in Doxygen.
1637330f729Sjoerg  */
1647330f729Sjoerg enum CXCommentInlineCommandRenderKind {
1657330f729Sjoerg   /**
1667330f729Sjoerg    * Command argument should be rendered in a normal font.
1677330f729Sjoerg    */
1687330f729Sjoerg   CXCommentInlineCommandRenderKind_Normal,
1697330f729Sjoerg 
1707330f729Sjoerg   /**
1717330f729Sjoerg    * Command argument should be rendered in a bold font.
1727330f729Sjoerg    */
1737330f729Sjoerg   CXCommentInlineCommandRenderKind_Bold,
1747330f729Sjoerg 
1757330f729Sjoerg   /**
1767330f729Sjoerg    * Command argument should be rendered in a monospaced font.
1777330f729Sjoerg    */
1787330f729Sjoerg   CXCommentInlineCommandRenderKind_Monospaced,
1797330f729Sjoerg 
1807330f729Sjoerg   /**
1817330f729Sjoerg    * Command argument should be rendered emphasized (typically italic
1827330f729Sjoerg    * font).
1837330f729Sjoerg    */
184*e038c9c4Sjoerg   CXCommentInlineCommandRenderKind_Emphasized,
185*e038c9c4Sjoerg 
186*e038c9c4Sjoerg   /**
187*e038c9c4Sjoerg    * Command argument should not be rendered (since it only defines an anchor).
188*e038c9c4Sjoerg    */
189*e038c9c4Sjoerg   CXCommentInlineCommandRenderKind_Anchor
1907330f729Sjoerg };
1917330f729Sjoerg 
1927330f729Sjoerg /**
1937330f729Sjoerg  * Describes parameter passing direction for \\param or \\arg command.
1947330f729Sjoerg  */
1957330f729Sjoerg enum CXCommentParamPassDirection {
1967330f729Sjoerg   /**
1977330f729Sjoerg    * The parameter is an input parameter.
1987330f729Sjoerg    */
1997330f729Sjoerg   CXCommentParamPassDirection_In,
2007330f729Sjoerg 
2017330f729Sjoerg   /**
2027330f729Sjoerg    * The parameter is an output parameter.
2037330f729Sjoerg    */
2047330f729Sjoerg   CXCommentParamPassDirection_Out,
2057330f729Sjoerg 
2067330f729Sjoerg   /**
2077330f729Sjoerg    * The parameter is an input and output parameter.
2087330f729Sjoerg    */
2097330f729Sjoerg   CXCommentParamPassDirection_InOut
2107330f729Sjoerg };
2117330f729Sjoerg 
2127330f729Sjoerg /**
2137330f729Sjoerg  * \param Comment AST node of any kind.
2147330f729Sjoerg  *
2157330f729Sjoerg  * \returns the type of the AST node.
2167330f729Sjoerg  */
2177330f729Sjoerg CINDEX_LINKAGE enum CXCommentKind clang_Comment_getKind(CXComment Comment);
2187330f729Sjoerg 
2197330f729Sjoerg /**
2207330f729Sjoerg  * \param Comment AST node of any kind.
2217330f729Sjoerg  *
2227330f729Sjoerg  * \returns number of children of the AST node.
2237330f729Sjoerg  */
2247330f729Sjoerg CINDEX_LINKAGE unsigned clang_Comment_getNumChildren(CXComment Comment);
2257330f729Sjoerg 
2267330f729Sjoerg /**
2277330f729Sjoerg  * \param Comment AST node of any kind.
2287330f729Sjoerg  *
2297330f729Sjoerg  * \param ChildIdx child index (zero-based).
2307330f729Sjoerg  *
2317330f729Sjoerg  * \returns the specified child of the AST node.
2327330f729Sjoerg  */
2337330f729Sjoerg CINDEX_LINKAGE
2347330f729Sjoerg CXComment clang_Comment_getChild(CXComment Comment, unsigned ChildIdx);
2357330f729Sjoerg 
2367330f729Sjoerg /**
2377330f729Sjoerg  * A \c CXComment_Paragraph node is considered whitespace if it contains
2387330f729Sjoerg  * only \c CXComment_Text nodes that are empty or whitespace.
2397330f729Sjoerg  *
2407330f729Sjoerg  * Other AST nodes (except \c CXComment_Paragraph and \c CXComment_Text) are
2417330f729Sjoerg  * never considered whitespace.
2427330f729Sjoerg  *
2437330f729Sjoerg  * \returns non-zero if \c Comment is whitespace.
2447330f729Sjoerg  */
2457330f729Sjoerg CINDEX_LINKAGE unsigned clang_Comment_isWhitespace(CXComment Comment);
2467330f729Sjoerg 
2477330f729Sjoerg /**
2487330f729Sjoerg  * \returns non-zero if \c Comment is inline content and has a newline
2497330f729Sjoerg  * immediately following it in the comment text.  Newlines between paragraphs
2507330f729Sjoerg  * do not count.
2517330f729Sjoerg  */
2527330f729Sjoerg CINDEX_LINKAGE
2537330f729Sjoerg unsigned clang_InlineContentComment_hasTrailingNewline(CXComment Comment);
2547330f729Sjoerg 
2557330f729Sjoerg /**
2567330f729Sjoerg  * \param Comment a \c CXComment_Text AST node.
2577330f729Sjoerg  *
2587330f729Sjoerg  * \returns text contained in the AST node.
2597330f729Sjoerg  */
2607330f729Sjoerg CINDEX_LINKAGE CXString clang_TextComment_getText(CXComment Comment);
2617330f729Sjoerg 
2627330f729Sjoerg /**
2637330f729Sjoerg  * \param Comment a \c CXComment_InlineCommand AST node.
2647330f729Sjoerg  *
2657330f729Sjoerg  * \returns name of the inline command.
2667330f729Sjoerg  */
2677330f729Sjoerg CINDEX_LINKAGE
2687330f729Sjoerg CXString clang_InlineCommandComment_getCommandName(CXComment Comment);
2697330f729Sjoerg 
2707330f729Sjoerg /**
2717330f729Sjoerg  * \param Comment a \c CXComment_InlineCommand AST node.
2727330f729Sjoerg  *
2737330f729Sjoerg  * \returns the most appropriate rendering mode, chosen on command
2747330f729Sjoerg  * semantics in Doxygen.
2757330f729Sjoerg  */
2767330f729Sjoerg CINDEX_LINKAGE enum CXCommentInlineCommandRenderKind
2777330f729Sjoerg clang_InlineCommandComment_getRenderKind(CXComment Comment);
2787330f729Sjoerg 
2797330f729Sjoerg /**
2807330f729Sjoerg  * \param Comment a \c CXComment_InlineCommand AST node.
2817330f729Sjoerg  *
2827330f729Sjoerg  * \returns number of command arguments.
2837330f729Sjoerg  */
2847330f729Sjoerg CINDEX_LINKAGE
2857330f729Sjoerg unsigned clang_InlineCommandComment_getNumArgs(CXComment Comment);
2867330f729Sjoerg 
2877330f729Sjoerg /**
2887330f729Sjoerg  * \param Comment a \c CXComment_InlineCommand AST node.
2897330f729Sjoerg  *
2907330f729Sjoerg  * \param ArgIdx argument index (zero-based).
2917330f729Sjoerg  *
2927330f729Sjoerg  * \returns text of the specified argument.
2937330f729Sjoerg  */
2947330f729Sjoerg CINDEX_LINKAGE
2957330f729Sjoerg CXString clang_InlineCommandComment_getArgText(CXComment Comment,
2967330f729Sjoerg                                                unsigned ArgIdx);
2977330f729Sjoerg 
2987330f729Sjoerg /**
2997330f729Sjoerg  * \param Comment a \c CXComment_HTMLStartTag or \c CXComment_HTMLEndTag AST
3007330f729Sjoerg  * node.
3017330f729Sjoerg  *
3027330f729Sjoerg  * \returns HTML tag name.
3037330f729Sjoerg  */
3047330f729Sjoerg CINDEX_LINKAGE CXString clang_HTMLTagComment_getTagName(CXComment Comment);
3057330f729Sjoerg 
3067330f729Sjoerg /**
3077330f729Sjoerg  * \param Comment a \c CXComment_HTMLStartTag AST node.
3087330f729Sjoerg  *
3097330f729Sjoerg  * \returns non-zero if tag is self-closing (for example, &lt;br /&gt;).
3107330f729Sjoerg  */
3117330f729Sjoerg CINDEX_LINKAGE
3127330f729Sjoerg unsigned clang_HTMLStartTagComment_isSelfClosing(CXComment Comment);
3137330f729Sjoerg 
3147330f729Sjoerg /**
3157330f729Sjoerg  * \param Comment a \c CXComment_HTMLStartTag AST node.
3167330f729Sjoerg  *
3177330f729Sjoerg  * \returns number of attributes (name-value pairs) attached to the start tag.
3187330f729Sjoerg  */
3197330f729Sjoerg CINDEX_LINKAGE unsigned clang_HTMLStartTag_getNumAttrs(CXComment Comment);
3207330f729Sjoerg 
3217330f729Sjoerg /**
3227330f729Sjoerg  * \param Comment a \c CXComment_HTMLStartTag AST node.
3237330f729Sjoerg  *
3247330f729Sjoerg  * \param AttrIdx attribute index (zero-based).
3257330f729Sjoerg  *
3267330f729Sjoerg  * \returns name of the specified attribute.
3277330f729Sjoerg  */
3287330f729Sjoerg CINDEX_LINKAGE
3297330f729Sjoerg CXString clang_HTMLStartTag_getAttrName(CXComment Comment, unsigned AttrIdx);
3307330f729Sjoerg 
3317330f729Sjoerg /**
3327330f729Sjoerg  * \param Comment a \c CXComment_HTMLStartTag AST node.
3337330f729Sjoerg  *
3347330f729Sjoerg  * \param AttrIdx attribute index (zero-based).
3357330f729Sjoerg  *
3367330f729Sjoerg  * \returns value of the specified attribute.
3377330f729Sjoerg  */
3387330f729Sjoerg CINDEX_LINKAGE
3397330f729Sjoerg CXString clang_HTMLStartTag_getAttrValue(CXComment Comment, unsigned AttrIdx);
3407330f729Sjoerg 
3417330f729Sjoerg /**
3427330f729Sjoerg  * \param Comment a \c CXComment_BlockCommand AST node.
3437330f729Sjoerg  *
3447330f729Sjoerg  * \returns name of the block command.
3457330f729Sjoerg  */
3467330f729Sjoerg CINDEX_LINKAGE
3477330f729Sjoerg CXString clang_BlockCommandComment_getCommandName(CXComment Comment);
3487330f729Sjoerg 
3497330f729Sjoerg /**
3507330f729Sjoerg  * \param Comment a \c CXComment_BlockCommand AST node.
3517330f729Sjoerg  *
3527330f729Sjoerg  * \returns number of word-like arguments.
3537330f729Sjoerg  */
3547330f729Sjoerg CINDEX_LINKAGE
3557330f729Sjoerg unsigned clang_BlockCommandComment_getNumArgs(CXComment Comment);
3567330f729Sjoerg 
3577330f729Sjoerg /**
3587330f729Sjoerg  * \param Comment a \c CXComment_BlockCommand AST node.
3597330f729Sjoerg  *
3607330f729Sjoerg  * \param ArgIdx argument index (zero-based).
3617330f729Sjoerg  *
3627330f729Sjoerg  * \returns text of the specified word-like argument.
3637330f729Sjoerg  */
3647330f729Sjoerg CINDEX_LINKAGE
3657330f729Sjoerg CXString clang_BlockCommandComment_getArgText(CXComment Comment,
3667330f729Sjoerg                                               unsigned ArgIdx);
3677330f729Sjoerg 
3687330f729Sjoerg /**
3697330f729Sjoerg  * \param Comment a \c CXComment_BlockCommand or
3707330f729Sjoerg  * \c CXComment_VerbatimBlockCommand AST node.
3717330f729Sjoerg  *
3727330f729Sjoerg  * \returns paragraph argument of the block command.
3737330f729Sjoerg  */
3747330f729Sjoerg CINDEX_LINKAGE
3757330f729Sjoerg CXComment clang_BlockCommandComment_getParagraph(CXComment Comment);
3767330f729Sjoerg 
3777330f729Sjoerg /**
3787330f729Sjoerg  * \param Comment a \c CXComment_ParamCommand AST node.
3797330f729Sjoerg  *
3807330f729Sjoerg  * \returns parameter name.
3817330f729Sjoerg  */
3827330f729Sjoerg CINDEX_LINKAGE
3837330f729Sjoerg CXString clang_ParamCommandComment_getParamName(CXComment Comment);
3847330f729Sjoerg 
3857330f729Sjoerg /**
3867330f729Sjoerg  * \param Comment a \c CXComment_ParamCommand AST node.
3877330f729Sjoerg  *
3887330f729Sjoerg  * \returns non-zero if the parameter that this AST node represents was found
3897330f729Sjoerg  * in the function prototype and \c clang_ParamCommandComment_getParamIndex
3907330f729Sjoerg  * function will return a meaningful value.
3917330f729Sjoerg  */
3927330f729Sjoerg CINDEX_LINKAGE
3937330f729Sjoerg unsigned clang_ParamCommandComment_isParamIndexValid(CXComment Comment);
3947330f729Sjoerg 
3957330f729Sjoerg /**
3967330f729Sjoerg  * \param Comment a \c CXComment_ParamCommand AST node.
3977330f729Sjoerg  *
3987330f729Sjoerg  * \returns zero-based parameter index in function prototype.
3997330f729Sjoerg  */
4007330f729Sjoerg CINDEX_LINKAGE
4017330f729Sjoerg unsigned clang_ParamCommandComment_getParamIndex(CXComment Comment);
4027330f729Sjoerg 
4037330f729Sjoerg /**
4047330f729Sjoerg  * \param Comment a \c CXComment_ParamCommand AST node.
4057330f729Sjoerg  *
4067330f729Sjoerg  * \returns non-zero if parameter passing direction was specified explicitly in
4077330f729Sjoerg  * the comment.
4087330f729Sjoerg  */
4097330f729Sjoerg CINDEX_LINKAGE
4107330f729Sjoerg unsigned clang_ParamCommandComment_isDirectionExplicit(CXComment Comment);
4117330f729Sjoerg 
4127330f729Sjoerg /**
4137330f729Sjoerg  * \param Comment a \c CXComment_ParamCommand AST node.
4147330f729Sjoerg  *
4157330f729Sjoerg  * \returns parameter passing direction.
4167330f729Sjoerg  */
4177330f729Sjoerg CINDEX_LINKAGE
4187330f729Sjoerg enum CXCommentParamPassDirection clang_ParamCommandComment_getDirection(
4197330f729Sjoerg                                                             CXComment Comment);
4207330f729Sjoerg 
4217330f729Sjoerg /**
4227330f729Sjoerg  * \param Comment a \c CXComment_TParamCommand AST node.
4237330f729Sjoerg  *
4247330f729Sjoerg  * \returns template parameter name.
4257330f729Sjoerg  */
4267330f729Sjoerg CINDEX_LINKAGE
4277330f729Sjoerg CXString clang_TParamCommandComment_getParamName(CXComment Comment);
4287330f729Sjoerg 
4297330f729Sjoerg /**
4307330f729Sjoerg  * \param Comment a \c CXComment_TParamCommand AST node.
4317330f729Sjoerg  *
4327330f729Sjoerg  * \returns non-zero if the parameter that this AST node represents was found
4337330f729Sjoerg  * in the template parameter list and
4347330f729Sjoerg  * \c clang_TParamCommandComment_getDepth and
4357330f729Sjoerg  * \c clang_TParamCommandComment_getIndex functions will return a meaningful
4367330f729Sjoerg  * value.
4377330f729Sjoerg  */
4387330f729Sjoerg CINDEX_LINKAGE
4397330f729Sjoerg unsigned clang_TParamCommandComment_isParamPositionValid(CXComment Comment);
4407330f729Sjoerg 
4417330f729Sjoerg /**
4427330f729Sjoerg  * \param Comment a \c CXComment_TParamCommand AST node.
4437330f729Sjoerg  *
4447330f729Sjoerg  * \returns zero-based nesting depth of this parameter in the template parameter list.
4457330f729Sjoerg  *
4467330f729Sjoerg  * For example,
4477330f729Sjoerg  * \verbatim
4487330f729Sjoerg  *     template<typename C, template<typename T> class TT>
4497330f729Sjoerg  *     void test(TT<int> aaa);
4507330f729Sjoerg  * \endverbatim
4517330f729Sjoerg  * for C and TT nesting depth is 0,
4527330f729Sjoerg  * for T nesting depth is 1.
4537330f729Sjoerg  */
4547330f729Sjoerg CINDEX_LINKAGE
4557330f729Sjoerg unsigned clang_TParamCommandComment_getDepth(CXComment Comment);
4567330f729Sjoerg 
4577330f729Sjoerg /**
4587330f729Sjoerg  * \param Comment a \c CXComment_TParamCommand AST node.
4597330f729Sjoerg  *
4607330f729Sjoerg  * \returns zero-based parameter index in the template parameter list at a
4617330f729Sjoerg  * given nesting depth.
4627330f729Sjoerg  *
4637330f729Sjoerg  * For example,
4647330f729Sjoerg  * \verbatim
4657330f729Sjoerg  *     template<typename C, template<typename T> class TT>
4667330f729Sjoerg  *     void test(TT<int> aaa);
4677330f729Sjoerg  * \endverbatim
4687330f729Sjoerg  * for C and TT nesting depth is 0, so we can ask for index at depth 0:
4697330f729Sjoerg  * at depth 0 C's index is 0, TT's index is 1.
4707330f729Sjoerg  *
4717330f729Sjoerg  * For T nesting depth is 1, so we can ask for index at depth 0 and 1:
4727330f729Sjoerg  * at depth 0 T's index is 1 (same as TT's),
4737330f729Sjoerg  * at depth 1 T's index is 0.
4747330f729Sjoerg  */
4757330f729Sjoerg CINDEX_LINKAGE
4767330f729Sjoerg unsigned clang_TParamCommandComment_getIndex(CXComment Comment, unsigned Depth);
4777330f729Sjoerg 
4787330f729Sjoerg /**
4797330f729Sjoerg  * \param Comment a \c CXComment_VerbatimBlockLine AST node.
4807330f729Sjoerg  *
4817330f729Sjoerg  * \returns text contained in the AST node.
4827330f729Sjoerg  */
4837330f729Sjoerg CINDEX_LINKAGE
4847330f729Sjoerg CXString clang_VerbatimBlockLineComment_getText(CXComment Comment);
4857330f729Sjoerg 
4867330f729Sjoerg /**
4877330f729Sjoerg  * \param Comment a \c CXComment_VerbatimLine AST node.
4887330f729Sjoerg  *
4897330f729Sjoerg  * \returns text contained in the AST node.
4907330f729Sjoerg  */
4917330f729Sjoerg CINDEX_LINKAGE CXString clang_VerbatimLineComment_getText(CXComment Comment);
4927330f729Sjoerg 
4937330f729Sjoerg /**
4947330f729Sjoerg  * Convert an HTML tag AST node to string.
4957330f729Sjoerg  *
4967330f729Sjoerg  * \param Comment a \c CXComment_HTMLStartTag or \c CXComment_HTMLEndTag AST
4977330f729Sjoerg  * node.
4987330f729Sjoerg  *
4997330f729Sjoerg  * \returns string containing an HTML tag.
5007330f729Sjoerg  */
5017330f729Sjoerg CINDEX_LINKAGE CXString clang_HTMLTagComment_getAsString(CXComment Comment);
5027330f729Sjoerg 
5037330f729Sjoerg /**
5047330f729Sjoerg  * Convert a given full parsed comment to an HTML fragment.
5057330f729Sjoerg  *
5067330f729Sjoerg  * Specific details of HTML layout are subject to change.  Don't try to parse
5077330f729Sjoerg  * this HTML back into an AST, use other APIs instead.
5087330f729Sjoerg  *
5097330f729Sjoerg  * Currently the following CSS classes are used:
5107330f729Sjoerg  * \li "para-brief" for \paragraph and equivalent commands;
5117330f729Sjoerg  * \li "para-returns" for \\returns paragraph and equivalent commands;
5127330f729Sjoerg  * \li "word-returns" for the "Returns" word in \\returns paragraph.
5137330f729Sjoerg  *
5147330f729Sjoerg  * Function argument documentation is rendered as a \<dl\> list with arguments
5157330f729Sjoerg  * sorted in function prototype order.  CSS classes used:
5167330f729Sjoerg  * \li "param-name-index-NUMBER" for parameter name (\<dt\>);
5177330f729Sjoerg  * \li "param-descr-index-NUMBER" for parameter description (\<dd\>);
5187330f729Sjoerg  * \li "param-name-index-invalid" and "param-descr-index-invalid" are used if
5197330f729Sjoerg  * parameter index is invalid.
5207330f729Sjoerg  *
5217330f729Sjoerg  * Template parameter documentation is rendered as a \<dl\> list with
5227330f729Sjoerg  * parameters sorted in template parameter list order.  CSS classes used:
5237330f729Sjoerg  * \li "tparam-name-index-NUMBER" for parameter name (\<dt\>);
5247330f729Sjoerg  * \li "tparam-descr-index-NUMBER" for parameter description (\<dd\>);
5257330f729Sjoerg  * \li "tparam-name-index-other" and "tparam-descr-index-other" are used for
5267330f729Sjoerg  * names inside template template parameters;
5277330f729Sjoerg  * \li "tparam-name-index-invalid" and "tparam-descr-index-invalid" are used if
5287330f729Sjoerg  * parameter position is invalid.
5297330f729Sjoerg  *
5307330f729Sjoerg  * \param Comment a \c CXComment_FullComment AST node.
5317330f729Sjoerg  *
5327330f729Sjoerg  * \returns string containing an HTML fragment.
5337330f729Sjoerg  */
5347330f729Sjoerg CINDEX_LINKAGE CXString clang_FullComment_getAsHTML(CXComment Comment);
5357330f729Sjoerg 
5367330f729Sjoerg /**
5377330f729Sjoerg  * Convert a given full parsed comment to an XML document.
5387330f729Sjoerg  *
5397330f729Sjoerg  * A Relax NG schema for the XML can be found in comment-xml-schema.rng file
5407330f729Sjoerg  * inside clang source tree.
5417330f729Sjoerg  *
5427330f729Sjoerg  * \param Comment a \c CXComment_FullComment AST node.
5437330f729Sjoerg  *
5447330f729Sjoerg  * \returns string containing an XML document.
5457330f729Sjoerg  */
5467330f729Sjoerg CINDEX_LINKAGE CXString clang_FullComment_getAsXML(CXComment Comment);
5477330f729Sjoerg 
5487330f729Sjoerg /**
5497330f729Sjoerg  * @}
5507330f729Sjoerg  */
5517330f729Sjoerg 
552*e038c9c4Sjoerg LLVM_CLANG_C_EXTERN_C_END
5537330f729Sjoerg 
5547330f729Sjoerg #endif /* CLANG_C_DOCUMENTATION_H */
5557330f729Sjoerg 
556