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=0)
 Write the modified source files.
virtual bool IncludeInDiagnosticCounts () const
virtual void HandleDiagnostic (DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info)
void Diag (SourceLocation Loc, unsigned DiagID)
 Emit a diagnostic via the adapted diagnostic client.
DiagnosticConsumerclone (DiagnosticsEngine &Diags) const
 Clone the diagnostic consumer, producing an equivalent consumer that can be used in a different context.

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 
)

Initialize a new fix-it rewriter.

Definition at line 30 of file FixItRewriter.cpp.

References clang::DiagnosticsEngine::ownsClient(), clang::DiagnosticsEngine::setClient(), and clang::DiagnosticsEngine::takeClient().

Referenced by clone().

FixItRewriter::~FixItRewriter ( )

Destroy the fix-it rewriter.

Definition at line 44 of file FixItRewriter.cpp.

References clang::DiagnosticsEngine::setClient(), and clang::DiagnosticsEngine::takeClient().


Member Function Documentation

iterator clang::FixItRewriter::buffer_begin ( ) [inline]

Definition at line 97 of file FixItRewriter.h.

References clang::Rewriter::buffer_begin().

Referenced by WriteFixedFiles().

iterator clang::FixItRewriter::buffer_end ( ) [inline]

Definition at line 98 of file FixItRewriter.h.

References clang::Rewriter::buffer_end().

Referenced by WriteFixedFiles().

DiagnosticConsumer * FixItRewriter::clone ( DiagnosticsEngine Diags) const [virtual]

Clone the diagnostic consumer, producing an equivalent consumer that can be used in a different context.

Implements clang::DiagnosticConsumer.

Definition at line 200 of file FixItRewriter.cpp.

References FixItRewriter(), clang::Rewriter::getLangOpts(), and clang::DiagnosticsEngine::getSourceManager().

void FixItRewriter::Diag ( SourceLocation  Loc,
unsigned  DiagID 
)
void FixItRewriter::HandleDiagnostic ( DiagnosticsEngine::Level  DiagLevel,
const Diagnostic Info 
) [virtual]
bool FixItRewriter::IncludeInDiagnosticCounts ( ) const [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 113 of file FixItRewriter.cpp.

References clang::DiagnosticConsumer::IncludeInDiagnosticCounts().

bool clang::FixItRewriter::IsModified ( FileID  ID) const [inline]

Check whether there are modifications for a given file.

Definition at line 92 of file FixItRewriter.h.

References clang::Rewriter::getRewriteBufferFor(), and NULL.

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 49 of file FixItRewriter.cpp.

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

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

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