clang API Documentation

Classes | Public Types | Public Member Functions
clang::edit::Commit Class Reference

#include <Commit.h>

List of all members.

Classes

struct  Edit

Public Types

enum  EditKind { Act_Insert, Act_InsertFromRange, Act_Remove }
typedef SmallVectorImpl< Edit >
::const_iterator 
edit_iterator

Public Member Functions

 Commit (EditedSource &Editor)
 Commit (const SourceManager &SM, const LangOptions &LangOpts, const PPConditionalDirectiveRecord *PPRec=nullptr)
bool isCommitable () const
bool insert (SourceLocation loc, StringRef text, bool afterToken=false, bool beforePreviousInsertions=false)
bool insertAfterToken (SourceLocation loc, StringRef text, bool beforePreviousInsertions=false)
bool insertBefore (SourceLocation loc, StringRef text)
bool insertFromRange (SourceLocation loc, CharSourceRange range, bool afterToken=false, bool beforePreviousInsertions=false)
bool insertWrap (StringRef before, CharSourceRange range, StringRef after)
bool remove (CharSourceRange range)
bool replace (CharSourceRange range, StringRef text)
bool replaceWithInner (CharSourceRange range, CharSourceRange innerRange)
bool replaceText (SourceLocation loc, StringRef text, StringRef replacementText)
bool insertFromRange (SourceLocation loc, SourceRange TokenRange, bool afterToken=false, bool beforePreviousInsertions=false)
bool insertWrap (StringRef before, SourceRange TokenRange, StringRef after)
bool remove (SourceRange TokenRange)
bool replace (SourceRange TokenRange, StringRef text)
bool replaceWithInner (SourceRange TokenRange, SourceRange TokenInnerRange)
edit_iterator edit_begin () const
edit_iterator edit_end () const

Detailed Description

Definition at line 25 of file Commit.h.


Member Typedef Documentation

typedef SmallVectorImpl<Edit>::const_iterator clang::edit::Commit::edit_iterator

Definition at line 109 of file Commit.h.


Member Enumeration Documentation

Enumerator:
Act_Insert 
Act_InsertFromRange 
Act_Remove 

Definition at line 27 of file Commit.h.


Constructor & Destructor Documentation

Commit::Commit ( EditedSource Editor) [explicit]

Definition at line 38 of file Commit.cpp.

clang::edit::Commit::Commit ( const SourceManager SM,
const LangOptions LangOpts,
const PPConditionalDirectiveRecord PPRec = nullptr 
) [inline]

Definition at line 60 of file Commit.h.


Member Function Documentation

Definition at line 110 of file Commit.h.

Referenced by applyCocoaAPICheck(), and clang::edit::EditedSource::commit().

Definition at line 111 of file Commit.h.

Referenced by applyCocoaAPICheck(), and clang::edit::EditedSource::commit().

bool Commit::insert ( SourceLocation  loc,
StringRef  text,
bool  afterToken = false,
bool  beforePreviousInsertions = false 
)
bool clang::edit::Commit::insertAfterToken ( SourceLocation  loc,
StringRef  text,
bool  beforePreviousInsertions = false 
) [inline]

Definition at line 69 of file Commit.h.

References insert().

Referenced by insertWrap(), rewriteToDictionaryLiteral(), and rewriteToObjCInterfaceDecl().

bool clang::edit::Commit::insertBefore ( SourceLocation  loc,
StringRef  text 
) [inline]
bool Commit::insertFromRange ( SourceLocation  loc,
CharSourceRange  range,
bool  afterToken = false,
bool  beforePreviousInsertions = false 
)
bool clang::edit::Commit::insertFromRange ( SourceLocation  loc,
SourceRange  TokenRange,
bool  afterToken = false,
bool  beforePreviousInsertions = false 
) [inline]

Definition at line 89 of file Commit.h.

References clang::CharSourceRange::getTokenRange(), and insertFromRange().

bool Commit::insertWrap ( StringRef  before,
CharSourceRange  range,
StringRef  after 
)
bool clang::edit::Commit::insertWrap ( StringRef  before,
SourceRange  TokenRange,
StringRef  after 
) [inline]

Definition at line 95 of file Commit.h.

References clang::CharSourceRange::getTokenRange(), and insertWrap().

bool clang::edit::Commit::remove ( SourceRange  TokenRange) [inline]

Definition at line 98 of file Commit.h.

References clang::CharSourceRange::getTokenRange().

bool Commit::replace ( CharSourceRange  range,
StringRef  text 
)
bool clang::edit::Commit::replace ( SourceRange  TokenRange,
StringRef  text 
) [inline]

Definition at line 101 of file Commit.h.

References clang::CharSourceRange::getTokenRange(), and replace().

bool Commit::replaceText ( SourceLocation  loc,
StringRef  text,
StringRef  replacementText 
)

Definition at line 160 of file Commit.cpp.

bool clang::edit::Commit::replaceWithInner ( SourceRange  TokenRange,
SourceRange  TokenInnerRange 
) [inline]

Definition at line 104 of file Commit.h.

References clang::CharSourceRange::getTokenRange(), and replaceWithInner().


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