clang  8.0.0svn
Classes | Public Types | Public Member Functions | List of all members
clang::edit::Commit Class Reference

#include "clang/Edit/Commit.h"

Classes

struct  Edit
 

Public Types

enum  EditKind { Act_Insert, Act_InsertFromRange, Act_Remove }
 
using edit_iterator = SmallVectorImpl< Edit >::const_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 30 of file Commit.h.

Member Typedef Documentation

◆ edit_iterator

Definition at line 120 of file Commit.h.

Member Enumeration Documentation

◆ EditKind

Enumerator
Act_Insert 
Act_InsertFromRange 
Act_Remove 

Definition at line 32 of file Commit.h.

Constructor & Destructor Documentation

◆ Commit() [1/2]

Commit::Commit ( EditedSource Editor)
explicit

Definition at line 44 of file Commit.cpp.

◆ Commit() [2/2]

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

Definition at line 65 of file Commit.h.

Member Function Documentation

◆ edit_begin()

edit_iterator clang::edit::Commit::edit_begin ( ) const
inline

Definition at line 122 of file Commit.h.

Referenced by clang::edit::EditedSource::commit().

◆ edit_end()

edit_iterator clang::edit::Commit::edit_end ( ) const
inline

Definition at line 123 of file Commit.h.

References length(), and clang::edit::Commit::Edit::OrigLoc.

Referenced by clang::edit::EditedSource::commit().

◆ insert()

bool Commit::insert ( SourceLocation  loc,
StringRef  text,
bool  afterToken = false,
bool  beforePreviousInsertions = false 
)

◆ insertAfterToken()

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

Definition at line 74 of file Commit.h.

References insert().

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

◆ insertBefore()

bool clang::edit::Commit::insertBefore ( SourceLocation  loc,
StringRef  text 
)
inline

◆ insertFromRange() [1/2]

bool Commit::insertFromRange ( SourceLocation  loc,
CharSourceRange  range,
bool  afterToken = false,
bool  beforePreviousInsertions = false 
)

◆ insertFromRange() [2/2]

bool clang::edit::Commit::insertFromRange ( SourceLocation  loc,
SourceRange  TokenRange,
bool  afterToken = false,
bool  beforePreviousInsertions = false 
)
inline

Definition at line 96 of file Commit.h.

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

◆ insertWrap() [1/2]

bool Commit::insertWrap ( StringRef  before,
CharSourceRange  range,
StringRef  after 
)

◆ insertWrap() [2/2]

bool clang::edit::Commit::insertWrap ( StringRef  before,
SourceRange  TokenRange,
StringRef  after 
)
inline

Definition at line 103 of file Commit.h.

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

◆ isCommitable()

bool clang::edit::Commit::isCommitable ( ) const
inline

◆ remove() [1/2]

bool Commit::remove ( CharSourceRange  range)

◆ remove() [2/2]

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

Definition at line 107 of file Commit.h.

References clang::CharSourceRange::getTokenRange().

◆ replace() [1/2]

bool Commit::replace ( CharSourceRange  range,
StringRef  text 
)

◆ replace() [2/2]

bool clang::edit::Commit::replace ( SourceRange  TokenRange,
StringRef  text 
)
inline

Definition at line 111 of file Commit.h.

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

◆ replaceText()

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

◆ replaceWithInner() [1/2]

bool Commit::replaceWithInner ( CharSourceRange  range,
CharSourceRange  innerRange 
)

◆ replaceWithInner() [2/2]

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

Definition at line 115 of file Commit.h.

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


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