clang API Documentation

Public Types | Public Member Functions
clang::FixItRewriter Class Reference

#include <FixItRewriter.h>

Inheritance diagram for clang::FixItRewriter:
Inheritance graph
[legend]
Collaboration diagram for clang::FixItRewriter:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Rewriter::buffer_iterator iterator

Public Member Functions

 FixItRewriter (DiagnosticsEngine &Diags, SourceManager &SourceMgr, const LangOptions &LangOpts, FixItOptions *FixItOpts)
 Initialize a new fix-it rewriter.
 ~FixItRewriter ()
 Destroy the fix-it rewriter.
bool IsModified (FileID ID) const
 Check whether there are modifications for a given file.
iterator buffer_begin ()
iterator buffer_end ()
bool WriteFixedFile (FileID ID, raw_ostream &OS)
 Write a single modified source file.
bool WriteFixedFiles (std::vector< std::pair< std::string, std::string > > *RewrittenFiles=nullptr)
 Write the modified source files.
bool IncludeInDiagnosticCounts () const override
void HandleDiagnostic (DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) override
void Diag (SourceLocation Loc, unsigned DiagID)
 Emit a diagnostic via the adapted diagnostic client.

Detailed Description

Definition at line 56 of file FixItRewriter.h.


Member Typedef Documentation

Definition at line 82 of file FixItRewriter.h.


Constructor & Destructor Documentation

FixItRewriter::FixItRewriter ( DiagnosticsEngine Diags,
SourceManager SourceMgr,
const LangOptions LangOpts,
FixItOptions FixItOpts 
)

Destroy the fix-it rewriter.

Definition at line 44 of file FixItRewriter.cpp.

References clang::DiagnosticsEngine::setClient().


Member Function Documentation

Definition at line 97 of file FixItRewriter.h.

References clang::Rewriter::buffer_begin().

Referenced by WriteFixedFiles().

Definition at line 98 of file FixItRewriter.h.

References clang::Rewriter::buffer_end().

Referenced by WriteFixedFiles().

void FixItRewriter::Diag ( SourceLocation  Loc,
unsigned  DiagID 
)

Emit a diagnostic via the adapted diagnostic client.

Definition at line 186 of file FixItRewriter.cpp.

References clang::DiagnosticsEngine::Clear(), clang::DiagnosticsEngine::Report(), and clang::DiagnosticsEngine::setClient().

Referenced by HandleDiagnostic(), and WriteFixedFiles().

void FixItRewriter::HandleDiagnostic ( DiagnosticsEngine::Level  DiagLevel,
const Diagnostic Info 
) [override, virtual]
bool FixItRewriter::IncludeInDiagnosticCounts ( ) const [override, virtual]

IncludeInDiagnosticCounts - This method (whose default implementation returns true) indicates whether the diagnostics handled by this DiagnosticConsumer should be included in the number of diagnostics reported by DiagnosticsEngine.

Reimplemented from clang::DiagnosticConsumer.

Definition at line 111 of file FixItRewriter.cpp.

References clang::DiagnosticConsumer::IncludeInDiagnosticCounts().

Check whether there are modifications for a given file.

Definition at line 92 of file FixItRewriter.h.

References clang::Rewriter::getRewriteBufferFor().

bool FixItRewriter::WriteFixedFile ( FileID  ID,
raw_ostream &  OS 
)

Write a single modified source file.

Returns:
true if there was an error, false otherwise.

Definition at line 48 of file FixItRewriter.cpp.

References clang::Rewriter::getRewriteBufferFor(), and clang::RewriteBuffer::write().

bool FixItRewriter::WriteFixedFiles ( std::vector< std::pair< std::string, std::string > > *  RewrittenFiles = nullptr)

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