clang API Documentation

Public Member Functions
clang::tooling::RefactoringTool Class Reference

A tool to run refactorings. More...

#include <Refactoring.h>

Inheritance diagram for clang::tooling::RefactoringTool:
Inheritance graph
[legend]
Collaboration diagram for clang::tooling::RefactoringTool:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 RefactoringTool (const CompilationDatabase &Compilations, ArrayRef< std::string > SourcePaths)
ReplacementsgetReplacements ()
 Returns the set of replacements to which replacements should be added during the run of the tool.
int runAndSave (FrontendActionFactory *ActionFactory)
 Call run(), apply all generated replacements, and immediately save the results to disk.
bool applyAllReplacements (Rewriter &Rewrite)
 Apply all stored replacements to the given Rewriter.

Detailed Description

A tool to run refactorings.

This is a refactoring specific version of

See also:
ClangTool. FrontendActions passed to run() and runAndSave() should add replacements to getReplacements().

Definition at line 37 of file Refactoring.h.


Constructor & Destructor Documentation

clang::tooling::RefactoringTool::RefactoringTool ( const CompilationDatabase Compilations,
ArrayRef< std::string >  SourcePaths 
)
See also:
ClangTool::ClangTool.

Definition at line 28 of file Refactoring.cpp.


Member Function Documentation

Apply all stored replacements to the given Rewriter.

Replacement applications happen independently of the success of other applications.

Returns:
true if all replacements apply. false otherwise.

Definition at line 55 of file Refactoring.cpp.

Referenced by runAndSave().

Returns the set of replacements to which replacements should be added during the run of the tool.

Definition at line 32 of file Refactoring.cpp.

Call run(), apply all generated replacements, and immediately save the results to disk.

Returns:
0 upon success. Non-zero upon failure.

Definition at line 34 of file Refactoring.cpp.

References applyAllReplacements(), clang::tooling::ClangTool::getFiles(), and clang::tooling::ClangTool::run().


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