1*67e74705SXin Li /*==-- clang-c/Documentation.h - Utilities for comment processing -*- C -*-===*\ 2*67e74705SXin Li |* *| 3*67e74705SXin Li |* The LLVM Compiler Infrastructure *| 4*67e74705SXin Li |* *| 5*67e74705SXin Li |* This file is distributed under the University of Illinois Open Source *| 6*67e74705SXin Li |* License. See LICENSE.TXT for details. *| 7*67e74705SXin Li |* *| 8*67e74705SXin Li |*===----------------------------------------------------------------------===*| 9*67e74705SXin Li |* *| 10*67e74705SXin Li |* This header provides a supplementary interface for inspecting *| 11*67e74705SXin Li |* documentation comments. *| 12*67e74705SXin Li |* *| 13*67e74705SXin Li \*===----------------------------------------------------------------------===*/ 14*67e74705SXin Li 15*67e74705SXin Li #ifndef LLVM_CLANG_C_DOCUMENTATION_H 16*67e74705SXin Li #define LLVM_CLANG_C_DOCUMENTATION_H 17*67e74705SXin Li 18*67e74705SXin Li #include "clang-c/Index.h" 19*67e74705SXin Li 20*67e74705SXin Li #ifdef __cplusplus 21*67e74705SXin Li extern "C" { 22*67e74705SXin Li #endif 23*67e74705SXin Li 24*67e74705SXin Li /** 25*67e74705SXin Li * \defgroup CINDEX_COMMENT Comment introspection 26*67e74705SXin Li * 27*67e74705SXin Li * The routines in this group provide access to information in documentation 28*67e74705SXin Li * comments. These facilities are distinct from the core and may be subject to 29*67e74705SXin Li * their own schedule of stability and deprecation. 30*67e74705SXin Li * 31*67e74705SXin Li * @{ 32*67e74705SXin Li */ 33*67e74705SXin Li 34*67e74705SXin Li /** 35*67e74705SXin Li * \brief A parsed comment. 36*67e74705SXin Li */ 37*67e74705SXin Li typedef struct { 38*67e74705SXin Li const void *ASTNode; 39*67e74705SXin Li CXTranslationUnit TranslationUnit; 40*67e74705SXin Li } CXComment; 41*67e74705SXin Li 42*67e74705SXin Li /** 43*67e74705SXin Li * \brief Given a cursor that represents a documentable entity (e.g., 44*67e74705SXin Li * declaration), return the associated parsed comment as a 45*67e74705SXin Li * \c CXComment_FullComment AST node. 46*67e74705SXin Li */ 47*67e74705SXin Li CINDEX_LINKAGE CXComment clang_Cursor_getParsedComment(CXCursor C); 48*67e74705SXin Li 49*67e74705SXin Li /** 50*67e74705SXin Li * \brief Describes the type of the comment AST node (\c CXComment). A comment 51*67e74705SXin Li * node can be considered block content (e. g., paragraph), inline content 52*67e74705SXin Li * (plain text) or neither (the root AST node). 53*67e74705SXin Li */ 54*67e74705SXin Li enum CXCommentKind { 55*67e74705SXin Li /** 56*67e74705SXin Li * \brief Null comment. No AST node is constructed at the requested location 57*67e74705SXin Li * because there is no text or a syntax error. 58*67e74705SXin Li */ 59*67e74705SXin Li CXComment_Null = 0, 60*67e74705SXin Li 61*67e74705SXin Li /** 62*67e74705SXin Li * \brief Plain text. Inline content. 63*67e74705SXin Li */ 64*67e74705SXin Li CXComment_Text = 1, 65*67e74705SXin Li 66*67e74705SXin Li /** 67*67e74705SXin Li * \brief A command with word-like arguments that is considered inline content. 68*67e74705SXin Li * 69*67e74705SXin Li * For example: \\c command. 70*67e74705SXin Li */ 71*67e74705SXin Li CXComment_InlineCommand = 2, 72*67e74705SXin Li 73*67e74705SXin Li /** 74*67e74705SXin Li * \brief HTML start tag with attributes (name-value pairs). Considered 75*67e74705SXin Li * inline content. 76*67e74705SXin Li * 77*67e74705SXin Li * For example: 78*67e74705SXin Li * \verbatim 79*67e74705SXin Li * <br> <br /> <a href="http://example.org/"> 80*67e74705SXin Li * \endverbatim 81*67e74705SXin Li */ 82*67e74705SXin Li CXComment_HTMLStartTag = 3, 83*67e74705SXin Li 84*67e74705SXin Li /** 85*67e74705SXin Li * \brief HTML end tag. Considered inline content. 86*67e74705SXin Li * 87*67e74705SXin Li * For example: 88*67e74705SXin Li * \verbatim 89*67e74705SXin Li * </a> 90*67e74705SXin Li * \endverbatim 91*67e74705SXin Li */ 92*67e74705SXin Li CXComment_HTMLEndTag = 4, 93*67e74705SXin Li 94*67e74705SXin Li /** 95*67e74705SXin Li * \brief A paragraph, contains inline comment. The paragraph itself is 96*67e74705SXin Li * block content. 97*67e74705SXin Li */ 98*67e74705SXin Li CXComment_Paragraph = 5, 99*67e74705SXin Li 100*67e74705SXin Li /** 101*67e74705SXin Li * \brief A command that has zero or more word-like arguments (number of 102*67e74705SXin Li * word-like arguments depends on command name) and a paragraph as an 103*67e74705SXin Li * argument. Block command is block content. 104*67e74705SXin Li * 105*67e74705SXin Li * Paragraph argument is also a child of the block command. 106*67e74705SXin Li * 107*67e74705SXin Li * For example: \\brief has 0 word-like arguments and a paragraph argument. 108*67e74705SXin Li * 109*67e74705SXin Li * AST nodes of special kinds that parser knows about (e. g., \\param 110*67e74705SXin Li * command) have their own node kinds. 111*67e74705SXin Li */ 112*67e74705SXin Li CXComment_BlockCommand = 6, 113*67e74705SXin Li 114*67e74705SXin Li /** 115*67e74705SXin Li * \brief A \\param or \\arg command that describes the function parameter 116*67e74705SXin Li * (name, passing direction, description). 117*67e74705SXin Li * 118*67e74705SXin Li * For example: \\param [in] ParamName description. 119*67e74705SXin Li */ 120*67e74705SXin Li CXComment_ParamCommand = 7, 121*67e74705SXin Li 122*67e74705SXin Li /** 123*67e74705SXin Li * \brief A \\tparam command that describes a template parameter (name and 124*67e74705SXin Li * description). 125*67e74705SXin Li * 126*67e74705SXin Li * For example: \\tparam T description. 127*67e74705SXin Li */ 128*67e74705SXin Li CXComment_TParamCommand = 8, 129*67e74705SXin Li 130*67e74705SXin Li /** 131*67e74705SXin Li * \brief A verbatim block command (e. g., preformatted code). Verbatim 132*67e74705SXin Li * block has an opening and a closing command and contains multiple lines of 133*67e74705SXin Li * text (\c CXComment_VerbatimBlockLine child nodes). 134*67e74705SXin Li * 135*67e74705SXin Li * For example: 136*67e74705SXin Li * \\verbatim 137*67e74705SXin Li * aaa 138*67e74705SXin Li * \\endverbatim 139*67e74705SXin Li */ 140*67e74705SXin Li CXComment_VerbatimBlockCommand = 9, 141*67e74705SXin Li 142*67e74705SXin Li /** 143*67e74705SXin Li * \brief A line of text that is contained within a 144*67e74705SXin Li * CXComment_VerbatimBlockCommand node. 145*67e74705SXin Li */ 146*67e74705SXin Li CXComment_VerbatimBlockLine = 10, 147*67e74705SXin Li 148*67e74705SXin Li /** 149*67e74705SXin Li * \brief A verbatim line command. Verbatim line has an opening command, 150*67e74705SXin Li * a single line of text (up to the newline after the opening command) and 151*67e74705SXin Li * has no closing command. 152*67e74705SXin Li */ 153*67e74705SXin Li CXComment_VerbatimLine = 11, 154*67e74705SXin Li 155*67e74705SXin Li /** 156*67e74705SXin Li * \brief A full comment attached to a declaration, contains block content. 157*67e74705SXin Li */ 158*67e74705SXin Li CXComment_FullComment = 12 159*67e74705SXin Li }; 160*67e74705SXin Li 161*67e74705SXin Li /** 162*67e74705SXin Li * \brief The most appropriate rendering mode for an inline command, chosen on 163*67e74705SXin Li * command semantics in Doxygen. 164*67e74705SXin Li */ 165*67e74705SXin Li enum CXCommentInlineCommandRenderKind { 166*67e74705SXin Li /** 167*67e74705SXin Li * \brief Command argument should be rendered in a normal font. 168*67e74705SXin Li */ 169*67e74705SXin Li CXCommentInlineCommandRenderKind_Normal, 170*67e74705SXin Li 171*67e74705SXin Li /** 172*67e74705SXin Li * \brief Command argument should be rendered in a bold font. 173*67e74705SXin Li */ 174*67e74705SXin Li CXCommentInlineCommandRenderKind_Bold, 175*67e74705SXin Li 176*67e74705SXin Li /** 177*67e74705SXin Li * \brief Command argument should be rendered in a monospaced font. 178*67e74705SXin Li */ 179*67e74705SXin Li CXCommentInlineCommandRenderKind_Monospaced, 180*67e74705SXin Li 181*67e74705SXin Li /** 182*67e74705SXin Li * \brief Command argument should be rendered emphasized (typically italic 183*67e74705SXin Li * font). 184*67e74705SXin Li */ 185*67e74705SXin Li CXCommentInlineCommandRenderKind_Emphasized 186*67e74705SXin Li }; 187*67e74705SXin Li 188*67e74705SXin Li /** 189*67e74705SXin Li * \brief Describes parameter passing direction for \\param or \\arg command. 190*67e74705SXin Li */ 191*67e74705SXin Li enum CXCommentParamPassDirection { 192*67e74705SXin Li /** 193*67e74705SXin Li * \brief The parameter is an input parameter. 194*67e74705SXin Li */ 195*67e74705SXin Li CXCommentParamPassDirection_In, 196*67e74705SXin Li 197*67e74705SXin Li /** 198*67e74705SXin Li * \brief The parameter is an output parameter. 199*67e74705SXin Li */ 200*67e74705SXin Li CXCommentParamPassDirection_Out, 201*67e74705SXin Li 202*67e74705SXin Li /** 203*67e74705SXin Li * \brief The parameter is an input and output parameter. 204*67e74705SXin Li */ 205*67e74705SXin Li CXCommentParamPassDirection_InOut 206*67e74705SXin Li }; 207*67e74705SXin Li 208*67e74705SXin Li /** 209*67e74705SXin Li * \param Comment AST node of any kind. 210*67e74705SXin Li * 211*67e74705SXin Li * \returns the type of the AST node. 212*67e74705SXin Li */ 213*67e74705SXin Li CINDEX_LINKAGE enum CXCommentKind clang_Comment_getKind(CXComment Comment); 214*67e74705SXin Li 215*67e74705SXin Li /** 216*67e74705SXin Li * \param Comment AST node of any kind. 217*67e74705SXin Li * 218*67e74705SXin Li * \returns number of children of the AST node. 219*67e74705SXin Li */ 220*67e74705SXin Li CINDEX_LINKAGE unsigned clang_Comment_getNumChildren(CXComment Comment); 221*67e74705SXin Li 222*67e74705SXin Li /** 223*67e74705SXin Li * \param Comment AST node of any kind. 224*67e74705SXin Li * 225*67e74705SXin Li * \param ChildIdx child index (zero-based). 226*67e74705SXin Li * 227*67e74705SXin Li * \returns the specified child of the AST node. 228*67e74705SXin Li */ 229*67e74705SXin Li CINDEX_LINKAGE 230*67e74705SXin Li CXComment clang_Comment_getChild(CXComment Comment, unsigned ChildIdx); 231*67e74705SXin Li 232*67e74705SXin Li /** 233*67e74705SXin Li * \brief A \c CXComment_Paragraph node is considered whitespace if it contains 234*67e74705SXin Li * only \c CXComment_Text nodes that are empty or whitespace. 235*67e74705SXin Li * 236*67e74705SXin Li * Other AST nodes (except \c CXComment_Paragraph and \c CXComment_Text) are 237*67e74705SXin Li * never considered whitespace. 238*67e74705SXin Li * 239*67e74705SXin Li * \returns non-zero if \c Comment is whitespace. 240*67e74705SXin Li */ 241*67e74705SXin Li CINDEX_LINKAGE unsigned clang_Comment_isWhitespace(CXComment Comment); 242*67e74705SXin Li 243*67e74705SXin Li /** 244*67e74705SXin Li * \returns non-zero if \c Comment is inline content and has a newline 245*67e74705SXin Li * immediately following it in the comment text. Newlines between paragraphs 246*67e74705SXin Li * do not count. 247*67e74705SXin Li */ 248*67e74705SXin Li CINDEX_LINKAGE 249*67e74705SXin Li unsigned clang_InlineContentComment_hasTrailingNewline(CXComment Comment); 250*67e74705SXin Li 251*67e74705SXin Li /** 252*67e74705SXin Li * \param Comment a \c CXComment_Text AST node. 253*67e74705SXin Li * 254*67e74705SXin Li * \returns text contained in the AST node. 255*67e74705SXin Li */ 256*67e74705SXin Li CINDEX_LINKAGE CXString clang_TextComment_getText(CXComment Comment); 257*67e74705SXin Li 258*67e74705SXin Li /** 259*67e74705SXin Li * \param Comment a \c CXComment_InlineCommand AST node. 260*67e74705SXin Li * 261*67e74705SXin Li * \returns name of the inline command. 262*67e74705SXin Li */ 263*67e74705SXin Li CINDEX_LINKAGE 264*67e74705SXin Li CXString clang_InlineCommandComment_getCommandName(CXComment Comment); 265*67e74705SXin Li 266*67e74705SXin Li /** 267*67e74705SXin Li * \param Comment a \c CXComment_InlineCommand AST node. 268*67e74705SXin Li * 269*67e74705SXin Li * \returns the most appropriate rendering mode, chosen on command 270*67e74705SXin Li * semantics in Doxygen. 271*67e74705SXin Li */ 272*67e74705SXin Li CINDEX_LINKAGE enum CXCommentInlineCommandRenderKind 273*67e74705SXin Li clang_InlineCommandComment_getRenderKind(CXComment Comment); 274*67e74705SXin Li 275*67e74705SXin Li /** 276*67e74705SXin Li * \param Comment a \c CXComment_InlineCommand AST node. 277*67e74705SXin Li * 278*67e74705SXin Li * \returns number of command arguments. 279*67e74705SXin Li */ 280*67e74705SXin Li CINDEX_LINKAGE 281*67e74705SXin Li unsigned clang_InlineCommandComment_getNumArgs(CXComment Comment); 282*67e74705SXin Li 283*67e74705SXin Li /** 284*67e74705SXin Li * \param Comment a \c CXComment_InlineCommand AST node. 285*67e74705SXin Li * 286*67e74705SXin Li * \param ArgIdx argument index (zero-based). 287*67e74705SXin Li * 288*67e74705SXin Li * \returns text of the specified argument. 289*67e74705SXin Li */ 290*67e74705SXin Li CINDEX_LINKAGE 291*67e74705SXin Li CXString clang_InlineCommandComment_getArgText(CXComment Comment, 292*67e74705SXin Li unsigned ArgIdx); 293*67e74705SXin Li 294*67e74705SXin Li /** 295*67e74705SXin Li * \param Comment a \c CXComment_HTMLStartTag or \c CXComment_HTMLEndTag AST 296*67e74705SXin Li * node. 297*67e74705SXin Li * 298*67e74705SXin Li * \returns HTML tag name. 299*67e74705SXin Li */ 300*67e74705SXin Li CINDEX_LINKAGE CXString clang_HTMLTagComment_getTagName(CXComment Comment); 301*67e74705SXin Li 302*67e74705SXin Li /** 303*67e74705SXin Li * \param Comment a \c CXComment_HTMLStartTag AST node. 304*67e74705SXin Li * 305*67e74705SXin Li * \returns non-zero if tag is self-closing (for example, <br />). 306*67e74705SXin Li */ 307*67e74705SXin Li CINDEX_LINKAGE 308*67e74705SXin Li unsigned clang_HTMLStartTagComment_isSelfClosing(CXComment Comment); 309*67e74705SXin Li 310*67e74705SXin Li /** 311*67e74705SXin Li * \param Comment a \c CXComment_HTMLStartTag AST node. 312*67e74705SXin Li * 313*67e74705SXin Li * \returns number of attributes (name-value pairs) attached to the start tag. 314*67e74705SXin Li */ 315*67e74705SXin Li CINDEX_LINKAGE unsigned clang_HTMLStartTag_getNumAttrs(CXComment Comment); 316*67e74705SXin Li 317*67e74705SXin Li /** 318*67e74705SXin Li * \param Comment a \c CXComment_HTMLStartTag AST node. 319*67e74705SXin Li * 320*67e74705SXin Li * \param AttrIdx attribute index (zero-based). 321*67e74705SXin Li * 322*67e74705SXin Li * \returns name of the specified attribute. 323*67e74705SXin Li */ 324*67e74705SXin Li CINDEX_LINKAGE 325*67e74705SXin Li CXString clang_HTMLStartTag_getAttrName(CXComment Comment, unsigned AttrIdx); 326*67e74705SXin Li 327*67e74705SXin Li /** 328*67e74705SXin Li * \param Comment a \c CXComment_HTMLStartTag AST node. 329*67e74705SXin Li * 330*67e74705SXin Li * \param AttrIdx attribute index (zero-based). 331*67e74705SXin Li * 332*67e74705SXin Li * \returns value of the specified attribute. 333*67e74705SXin Li */ 334*67e74705SXin Li CINDEX_LINKAGE 335*67e74705SXin Li CXString clang_HTMLStartTag_getAttrValue(CXComment Comment, unsigned AttrIdx); 336*67e74705SXin Li 337*67e74705SXin Li /** 338*67e74705SXin Li * \param Comment a \c CXComment_BlockCommand AST node. 339*67e74705SXin Li * 340*67e74705SXin Li * \returns name of the block command. 341*67e74705SXin Li */ 342*67e74705SXin Li CINDEX_LINKAGE 343*67e74705SXin Li CXString clang_BlockCommandComment_getCommandName(CXComment Comment); 344*67e74705SXin Li 345*67e74705SXin Li /** 346*67e74705SXin Li * \param Comment a \c CXComment_BlockCommand AST node. 347*67e74705SXin Li * 348*67e74705SXin Li * \returns number of word-like arguments. 349*67e74705SXin Li */ 350*67e74705SXin Li CINDEX_LINKAGE 351*67e74705SXin Li unsigned clang_BlockCommandComment_getNumArgs(CXComment Comment); 352*67e74705SXin Li 353*67e74705SXin Li /** 354*67e74705SXin Li * \param Comment a \c CXComment_BlockCommand AST node. 355*67e74705SXin Li * 356*67e74705SXin Li * \param ArgIdx argument index (zero-based). 357*67e74705SXin Li * 358*67e74705SXin Li * \returns text of the specified word-like argument. 359*67e74705SXin Li */ 360*67e74705SXin Li CINDEX_LINKAGE 361*67e74705SXin Li CXString clang_BlockCommandComment_getArgText(CXComment Comment, 362*67e74705SXin Li unsigned ArgIdx); 363*67e74705SXin Li 364*67e74705SXin Li /** 365*67e74705SXin Li * \param Comment a \c CXComment_BlockCommand or 366*67e74705SXin Li * \c CXComment_VerbatimBlockCommand AST node. 367*67e74705SXin Li * 368*67e74705SXin Li * \returns paragraph argument of the block command. 369*67e74705SXin Li */ 370*67e74705SXin Li CINDEX_LINKAGE 371*67e74705SXin Li CXComment clang_BlockCommandComment_getParagraph(CXComment Comment); 372*67e74705SXin Li 373*67e74705SXin Li /** 374*67e74705SXin Li * \param Comment a \c CXComment_ParamCommand AST node. 375*67e74705SXin Li * 376*67e74705SXin Li * \returns parameter name. 377*67e74705SXin Li */ 378*67e74705SXin Li CINDEX_LINKAGE 379*67e74705SXin Li CXString clang_ParamCommandComment_getParamName(CXComment Comment); 380*67e74705SXin Li 381*67e74705SXin Li /** 382*67e74705SXin Li * \param Comment a \c CXComment_ParamCommand AST node. 383*67e74705SXin Li * 384*67e74705SXin Li * \returns non-zero if the parameter that this AST node represents was found 385*67e74705SXin Li * in the function prototype and \c clang_ParamCommandComment_getParamIndex 386*67e74705SXin Li * function will return a meaningful value. 387*67e74705SXin Li */ 388*67e74705SXin Li CINDEX_LINKAGE 389*67e74705SXin Li unsigned clang_ParamCommandComment_isParamIndexValid(CXComment Comment); 390*67e74705SXin Li 391*67e74705SXin Li /** 392*67e74705SXin Li * \param Comment a \c CXComment_ParamCommand AST node. 393*67e74705SXin Li * 394*67e74705SXin Li * \returns zero-based parameter index in function prototype. 395*67e74705SXin Li */ 396*67e74705SXin Li CINDEX_LINKAGE 397*67e74705SXin Li unsigned clang_ParamCommandComment_getParamIndex(CXComment Comment); 398*67e74705SXin Li 399*67e74705SXin Li /** 400*67e74705SXin Li * \param Comment a \c CXComment_ParamCommand AST node. 401*67e74705SXin Li * 402*67e74705SXin Li * \returns non-zero if parameter passing direction was specified explicitly in 403*67e74705SXin Li * the comment. 404*67e74705SXin Li */ 405*67e74705SXin Li CINDEX_LINKAGE 406*67e74705SXin Li unsigned clang_ParamCommandComment_isDirectionExplicit(CXComment Comment); 407*67e74705SXin Li 408*67e74705SXin Li /** 409*67e74705SXin Li * \param Comment a \c CXComment_ParamCommand AST node. 410*67e74705SXin Li * 411*67e74705SXin Li * \returns parameter passing direction. 412*67e74705SXin Li */ 413*67e74705SXin Li CINDEX_LINKAGE 414*67e74705SXin Li enum CXCommentParamPassDirection clang_ParamCommandComment_getDirection( 415*67e74705SXin Li CXComment Comment); 416*67e74705SXin Li 417*67e74705SXin Li /** 418*67e74705SXin Li * \param Comment a \c CXComment_TParamCommand AST node. 419*67e74705SXin Li * 420*67e74705SXin Li * \returns template parameter name. 421*67e74705SXin Li */ 422*67e74705SXin Li CINDEX_LINKAGE 423*67e74705SXin Li CXString clang_TParamCommandComment_getParamName(CXComment Comment); 424*67e74705SXin Li 425*67e74705SXin Li /** 426*67e74705SXin Li * \param Comment a \c CXComment_TParamCommand AST node. 427*67e74705SXin Li * 428*67e74705SXin Li * \returns non-zero if the parameter that this AST node represents was found 429*67e74705SXin Li * in the template parameter list and 430*67e74705SXin Li * \c clang_TParamCommandComment_getDepth and 431*67e74705SXin Li * \c clang_TParamCommandComment_getIndex functions will return a meaningful 432*67e74705SXin Li * value. 433*67e74705SXin Li */ 434*67e74705SXin Li CINDEX_LINKAGE 435*67e74705SXin Li unsigned clang_TParamCommandComment_isParamPositionValid(CXComment Comment); 436*67e74705SXin Li 437*67e74705SXin Li /** 438*67e74705SXin Li * \param Comment a \c CXComment_TParamCommand AST node. 439*67e74705SXin Li * 440*67e74705SXin Li * \returns zero-based nesting depth of this parameter in the template parameter list. 441*67e74705SXin Li * 442*67e74705SXin Li * For example, 443*67e74705SXin Li * \verbatim 444*67e74705SXin Li * template<typename C, template<typename T> class TT> 445*67e74705SXin Li * void test(TT<int> aaa); 446*67e74705SXin Li * \endverbatim 447*67e74705SXin Li * for C and TT nesting depth is 0, 448*67e74705SXin Li * for T nesting depth is 1. 449*67e74705SXin Li */ 450*67e74705SXin Li CINDEX_LINKAGE 451*67e74705SXin Li unsigned clang_TParamCommandComment_getDepth(CXComment Comment); 452*67e74705SXin Li 453*67e74705SXin Li /** 454*67e74705SXin Li * \param Comment a \c CXComment_TParamCommand AST node. 455*67e74705SXin Li * 456*67e74705SXin Li * \returns zero-based parameter index in the template parameter list at a 457*67e74705SXin Li * given nesting depth. 458*67e74705SXin Li * 459*67e74705SXin Li * For example, 460*67e74705SXin Li * \verbatim 461*67e74705SXin Li * template<typename C, template<typename T> class TT> 462*67e74705SXin Li * void test(TT<int> aaa); 463*67e74705SXin Li * \endverbatim 464*67e74705SXin Li * for C and TT nesting depth is 0, so we can ask for index at depth 0: 465*67e74705SXin Li * at depth 0 C's index is 0, TT's index is 1. 466*67e74705SXin Li * 467*67e74705SXin Li * For T nesting depth is 1, so we can ask for index at depth 0 and 1: 468*67e74705SXin Li * at depth 0 T's index is 1 (same as TT's), 469*67e74705SXin Li * at depth 1 T's index is 0. 470*67e74705SXin Li */ 471*67e74705SXin Li CINDEX_LINKAGE 472*67e74705SXin Li unsigned clang_TParamCommandComment_getIndex(CXComment Comment, unsigned Depth); 473*67e74705SXin Li 474*67e74705SXin Li /** 475*67e74705SXin Li * \param Comment a \c CXComment_VerbatimBlockLine AST node. 476*67e74705SXin Li * 477*67e74705SXin Li * \returns text contained in the AST node. 478*67e74705SXin Li */ 479*67e74705SXin Li CINDEX_LINKAGE 480*67e74705SXin Li CXString clang_VerbatimBlockLineComment_getText(CXComment Comment); 481*67e74705SXin Li 482*67e74705SXin Li /** 483*67e74705SXin Li * \param Comment a \c CXComment_VerbatimLine AST node. 484*67e74705SXin Li * 485*67e74705SXin Li * \returns text contained in the AST node. 486*67e74705SXin Li */ 487*67e74705SXin Li CINDEX_LINKAGE CXString clang_VerbatimLineComment_getText(CXComment Comment); 488*67e74705SXin Li 489*67e74705SXin Li /** 490*67e74705SXin Li * \brief Convert an HTML tag AST node to string. 491*67e74705SXin Li * 492*67e74705SXin Li * \param Comment a \c CXComment_HTMLStartTag or \c CXComment_HTMLEndTag AST 493*67e74705SXin Li * node. 494*67e74705SXin Li * 495*67e74705SXin Li * \returns string containing an HTML tag. 496*67e74705SXin Li */ 497*67e74705SXin Li CINDEX_LINKAGE CXString clang_HTMLTagComment_getAsString(CXComment Comment); 498*67e74705SXin Li 499*67e74705SXin Li /** 500*67e74705SXin Li * \brief Convert a given full parsed comment to an HTML fragment. 501*67e74705SXin Li * 502*67e74705SXin Li * Specific details of HTML layout are subject to change. Don't try to parse 503*67e74705SXin Li * this HTML back into an AST, use other APIs instead. 504*67e74705SXin Li * 505*67e74705SXin Li * Currently the following CSS classes are used: 506*67e74705SXin Li * \li "para-brief" for \\brief paragraph and equivalent commands; 507*67e74705SXin Li * \li "para-returns" for \\returns paragraph and equivalent commands; 508*67e74705SXin Li * \li "word-returns" for the "Returns" word in \\returns paragraph. 509*67e74705SXin Li * 510*67e74705SXin Li * Function argument documentation is rendered as a \<dl\> list with arguments 511*67e74705SXin Li * sorted in function prototype order. CSS classes used: 512*67e74705SXin Li * \li "param-name-index-NUMBER" for parameter name (\<dt\>); 513*67e74705SXin Li * \li "param-descr-index-NUMBER" for parameter description (\<dd\>); 514*67e74705SXin Li * \li "param-name-index-invalid" and "param-descr-index-invalid" are used if 515*67e74705SXin Li * parameter index is invalid. 516*67e74705SXin Li * 517*67e74705SXin Li * Template parameter documentation is rendered as a \<dl\> list with 518*67e74705SXin Li * parameters sorted in template parameter list order. CSS classes used: 519*67e74705SXin Li * \li "tparam-name-index-NUMBER" for parameter name (\<dt\>); 520*67e74705SXin Li * \li "tparam-descr-index-NUMBER" for parameter description (\<dd\>); 521*67e74705SXin Li * \li "tparam-name-index-other" and "tparam-descr-index-other" are used for 522*67e74705SXin Li * names inside template template parameters; 523*67e74705SXin Li * \li "tparam-name-index-invalid" and "tparam-descr-index-invalid" are used if 524*67e74705SXin Li * parameter position is invalid. 525*67e74705SXin Li * 526*67e74705SXin Li * \param Comment a \c CXComment_FullComment AST node. 527*67e74705SXin Li * 528*67e74705SXin Li * \returns string containing an HTML fragment. 529*67e74705SXin Li */ 530*67e74705SXin Li CINDEX_LINKAGE CXString clang_FullComment_getAsHTML(CXComment Comment); 531*67e74705SXin Li 532*67e74705SXin Li /** 533*67e74705SXin Li * \brief Convert a given full parsed comment to an XML document. 534*67e74705SXin Li * 535*67e74705SXin Li * A Relax NG schema for the XML can be found in comment-xml-schema.rng file 536*67e74705SXin Li * inside clang source tree. 537*67e74705SXin Li * 538*67e74705SXin Li * \param Comment a \c CXComment_FullComment AST node. 539*67e74705SXin Li * 540*67e74705SXin Li * \returns string containing an XML document. 541*67e74705SXin Li */ 542*67e74705SXin Li CINDEX_LINKAGE CXString clang_FullComment_getAsXML(CXComment Comment); 543*67e74705SXin Li 544*67e74705SXin Li /** 545*67e74705SXin Li * @} 546*67e74705SXin Li */ 547*67e74705SXin Li 548*67e74705SXin Li 549*67e74705SXin Li #ifdef __cplusplus 550*67e74705SXin Li } 551*67e74705SXin Li #endif 552*67e74705SXin Li 553*67e74705SXin Li #endif /* CLANG_C_DOCUMENTATION_H */ 554*67e74705SXin Li 555