clang  10.0.0svn
Public Member Functions | Static Public Member Functions | List of all members
clang::transformer::Stencil Class Reference

A sequence of code fragments, references to parameters and code-generation operations that together can be evaluated to (a fragment of) source code, given a match result. More...

#include "clang/Tooling/Transformer/Stencil.h"

Public Member Functions

 Stencil ()=default
 
void append (Stencil OtherStencil)
 Appends data from a OtherStencil to this stencil. More...
 
llvm::Expected< std::string > eval (const ast_matchers::MatchFinder::MatchResult &Match) const
 
llvm::Expected< std::string > operator() (const ast_matchers::MatchFinder::MatchResult &Result) const
 
std::string toString () const
 Constructs a string representation of the Stencil. More...
 

Static Public Member Functions

template<typename... Ts>
static Stencil cat (Ts &&... Parts)
 Composes a stencil from a series of parts. More...
 

Detailed Description

A sequence of code fragments, references to parameters and code-generation operations that together can be evaluated to (a fragment of) source code, given a match result.

Definition at line 90 of file Stencil.h.

Constructor & Destructor Documentation

◆ Stencil()

clang::transformer::Stencil::Stencil ( )
default

Member Function Documentation

◆ append()

void Stencil::append ( Stencil  OtherStencil)

Appends data from a OtherStencil to this stencil.

Definition at line 261 of file Stencil.cpp.

◆ cat()

template<typename... Ts>
static Stencil clang::transformer::Stencil::cat ( Ts &&...  Parts)
inlinestatic

Composes a stencil from a series of parts.

Definition at line 95 of file Stencil.h.

Referenced by clang::transformer::cat().

◆ eval()

llvm::Expected< std::string > Stencil::eval ( const ast_matchers::MatchFinder::MatchResult Match) const

Definition at line 267 of file Stencil.cpp.

References clang::transformer::text(), and Text.

◆ operator()()

llvm::Expected<std::string> clang::transformer::Stencil::operator() ( const ast_matchers::MatchFinder::MatchResult Result) const
inline

Definition at line 113 of file Stencil.h.

References clang::transformer::StencilPartInterface::eval().

◆ toString()

std::string clang::transformer::Stencil::toString ( ) const
inline

Constructs a string representation of the Stencil.

The string is not guaranteed to be unique.

Definition at line 119 of file Stencil.h.

References Text.


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