clang 17.0.0git
Static Public Member Functions | List of all members
clang::extractapi::DeclarationFragmentsBuilder Class Reference

A factory class to build DeclarationFragments for different kinds of Decl. More...

#include "clang/ExtractAPI/DeclarationFragments.h"

Static Public Member Functions

static DeclarationFragments getFragmentsForVar (const VarDecl *)
 Build DeclarationFragments for a variable declaration VarDecl.
 
static DeclarationFragments getFragmentsForFunction (const FunctionDecl *)
 Build DeclarationFragments for a function declaration FunctionDecl.
 
static DeclarationFragments getFragmentsForEnumConstant (const EnumConstantDecl *)
 Build DeclarationFragments for an enum constant declaration EnumConstantDecl.
 
static DeclarationFragments getFragmentsForEnum (const EnumDecl *)
 Build DeclarationFragments for an enum declaration EnumDecl.
 
static DeclarationFragments getFragmentsForField (const FieldDecl *)
 Build DeclarationFragments for a field declaration FieldDecl.
 
static DeclarationFragments getFragmentsForStruct (const RecordDecl *)
 Build DeclarationFragments for a struct record declaration RecordDecl.
 
static DeclarationFragments getFragmentsForObjCCategory (const ObjCCategoryDecl *)
 Build DeclarationFragments for an Objective-C category declaration ObjCCategoryDecl.
 
static DeclarationFragments getFragmentsForObjCInterface (const ObjCInterfaceDecl *)
 Build DeclarationFragments for an Objective-C interface declaration ObjCInterfaceDecl.
 
static DeclarationFragments getFragmentsForObjCMethod (const ObjCMethodDecl *)
 Build DeclarationFragments for an Objective-C method declaration ObjCMethodDecl.
 
static DeclarationFragments getFragmentsForObjCProperty (const ObjCPropertyDecl *)
 Build DeclarationFragments for an Objective-C property declaration ObjCPropertyDecl.
 
static DeclarationFragments getFragmentsForObjCProtocol (const ObjCProtocolDecl *)
 Build DeclarationFragments for an Objective-C protocol declaration ObjCProtocolDecl.
 
static DeclarationFragments getFragmentsForMacro (StringRef Name, const MacroDirective *MD)
 Build DeclarationFragments for a macro.
 
static DeclarationFragments getFragmentsForTypedef (const TypedefNameDecl *Decl)
 Build DeclarationFragments for a typedef TypedefNameDecl.
 
static DeclarationFragments getSubHeading (const NamedDecl *)
 Build sub-heading fragments for a NamedDecl.
 
static DeclarationFragments getSubHeading (const ObjCMethodDecl *)
 Build sub-heading fragments for an Objective-C method.
 
static DeclarationFragments getSubHeadingForMacro (StringRef Name)
 Build a sub-heading for macro Name.
 
template<typename FunctionT >
static FunctionSignature getFunctionSignature (const FunctionT *)
 Build FunctionSignature for a function-like declaration FunctionT like FunctionDecl or ObjCMethodDecl.
 

Detailed Description

A factory class to build DeclarationFragments for different kinds of Decl.

Definition at line 210 of file DeclarationFragments.h.

Member Function Documentation

◆ getFragmentsForEnum()

DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForEnum ( const EnumDecl EnumDecl)
static

◆ getFragmentsForEnumConstant()

DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForEnumConstant ( const EnumConstantDecl EnumConstDecl)
static

◆ getFragmentsForField()

DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForField ( const FieldDecl Field)
static

◆ getFragmentsForFunction()

DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForFunction ( const FunctionDecl Func)
static

◆ getFragmentsForMacro()

DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForMacro ( StringRef  Name,
const MacroDirective MD 
)
static

◆ getFragmentsForObjCCategory()

DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForObjCCategory ( const ObjCCategoryDecl Category)
static

◆ getFragmentsForObjCInterface()

DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForObjCInterface ( const ObjCInterfaceDecl Interface)
static

◆ getFragmentsForObjCMethod()

DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForObjCMethod ( const ObjCMethodDecl Method)
static

◆ getFragmentsForObjCProperty()

DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForObjCProperty ( const ObjCPropertyDecl Property)
static

◆ getFragmentsForObjCProtocol()

DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForObjCProtocol ( const ObjCProtocolDecl Protocol)
static

◆ getFragmentsForStruct()

DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForStruct ( const RecordDecl Record)
static

◆ getFragmentsForTypedef()

DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForTypedef ( const TypedefNameDecl Decl)
static

◆ getFragmentsForVar()

DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForVar ( const VarDecl Var)
static

◆ getFunctionSignature()

template<typename FunctionT >
template FunctionSignature DeclarationFragmentsBuilder::getFunctionSignature ( const FunctionT *  )
static

Build FunctionSignature for a function-like declaration FunctionT like FunctionDecl or ObjCMethodDecl.

The logic and implementation of building a signature for a FunctionDecl and an ObjCMethodDecl are exactly the same, but they do not share a common base. This template helps reuse the code.

Definition at line 768 of file DeclarationFragments.cpp.

References clang::extractapi::FunctionSignature::addParameter(), clang::extractapi::DeclarationFragments::append(), clang::NamedDecl::getName(), and clang::extractapi::FunctionSignature::setReturnType().

Referenced by clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::recordObjCMethods(), and clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::VisitFunctionDecl().

◆ getSubHeading() [1/2]

DeclarationFragments DeclarationFragmentsBuilder::getSubHeading ( const NamedDecl Decl)
static

◆ getSubHeading() [2/2]

DeclarationFragments DeclarationFragmentsBuilder::getSubHeading ( const ObjCMethodDecl Method)
static

◆ getSubHeadingForMacro()

DeclarationFragments DeclarationFragmentsBuilder::getSubHeadingForMacro ( StringRef  Name)
static

Build a sub-heading for macro Name.

Definition at line 818 of file DeclarationFragments.cpp.

References clang::extractapi::DeclarationFragments::append(), and clang::extractapi::DeclarationFragments::Identifier.


The documentation for this class was generated from the following files: