class DeclarationFragments
Declaration
class DeclarationFragments { /* full declaration omitted */ };
Description
DeclarationFragments is a vector of tagged important parts of a symbol's declaration. The fragments sequence can be joined to form spans of declaration text, with attached information useful for purposes like syntax-highlighting etc. For example:
Declared at: clang/include/clang/ExtractAPI/DeclarationFragments.h:43
Member Variables
- private std::vector<Fragment> Fragments
Method Overview
- public DeclarationFragments()
- public clang::extractapi::DeclarationFragments & append(llvm::StringRef Spelling, clang::extractapi::DeclarationFragments::FragmentKind Kind, llvm::StringRef PreciseIdentifier = "")
- public clang::extractapi::DeclarationFragments & append(clang::extractapi::DeclarationFragments && Other)
- public clang::extractapi::DeclarationFragments & appendSpace()
- public static llvm::StringRef getFragmentKindString(clang::extractapi::DeclarationFragments::FragmentKind Kind)
- public const std::vector<Fragment> & getFragments() const
- public static clang::extractapi::DeclarationFragments::FragmentKind parseFragmentKindFromString(llvm::StringRef S)
Methods
¶DeclarationFragments()
DeclarationFragments()
Declared at: clang/include/clang/ExtractAPI/DeclarationFragments.h:45
¶clang::extractapi::DeclarationFragments& append(
llvm::StringRef Spelling,
clang::extractapi::DeclarationFragments::
FragmentKind Kind,
llvm::StringRef PreciseIdentifier = "")
clang::extractapi::DeclarationFragments& append(
llvm::StringRef Spelling,
clang::extractapi::DeclarationFragments::
FragmentKind Kind,
llvm::StringRef PreciseIdentifier = "")
Description
Append a new Fragment to the end of the Fragments.
Declared at: clang/include/clang/ExtractAPI/DeclarationFragments.h:101
Parameters
- llvm::StringRef Spelling
- clang::extractapi::DeclarationFragments:: FragmentKind Kind
- llvm::StringRef PreciseIdentifier = ""
Returns
a reference to the DeclarationFragments object itself after appending to chain up consecutive appends.
¶clang::extractapi::DeclarationFragments& append(
clang::extractapi::DeclarationFragments&&
Other)
clang::extractapi::DeclarationFragments& append(
clang::extractapi::DeclarationFragments&&
Other)
Description
Append another DeclarationFragments to the end. Note: \p Other is moved from and cannot be used after a call to this method.
Declared at: clang/include/clang/ExtractAPI/DeclarationFragments.h:121
Parameters
Returns
a reference to the DeclarationFragments object itself after appending to chain up consecutive appends.
¶clang::extractapi::DeclarationFragments&
appendSpace()
clang::extractapi::DeclarationFragments&
appendSpace()
Description
Append a text Fragment of a space character.
Declared at: clang/include/clang/ExtractAPI/DeclarationFragments.h:133
Returns
a reference to the DeclarationFragments object itself after appending to chain up consecutive appends.
¶static llvm::StringRef getFragmentKindString(
clang::extractapi::DeclarationFragments::
FragmentKind Kind)
static llvm::StringRef getFragmentKindString(
clang::extractapi::DeclarationFragments::
FragmentKind Kind)
Description
Get the string description of a FragmentKind \p Kind.
Declared at: clang/include/clang/ExtractAPI/DeclarationFragments.h:136
Parameters
- clang::extractapi::DeclarationFragments:: FragmentKind Kind
¶const std::vector<Fragment>& getFragments() const
const std::vector<Fragment>& getFragments() const
Declared at: clang/include/clang/ExtractAPI/DeclarationFragments.h:95
¶static clang::extractapi::DeclarationFragments::
FragmentKind
parseFragmentKindFromString(llvm::StringRef S)
static clang::extractapi::DeclarationFragments::
FragmentKind
parseFragmentKindFromString(llvm::StringRef S)
Description
Get the corresponding FragmentKind from string \p S.
Declared at: clang/include/clang/ExtractAPI/DeclarationFragments.h:139