clang  13.0.0git
EditsReceiver.h
Go to the documentation of this file.
1 //===- EditedSource.h - Collection of source edits --------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_CLANG_EDIT_EDITSRECEIVER_H
10 #define LLVM_CLANG_EDIT_EDITSRECEIVER_H
11 
12 #include "clang/Basic/LLVM.h"
14 #include "llvm/ADT/StringRef.h"
15 
16 namespace clang {
17 namespace edit {
18 
20 public:
21  virtual ~EditsReceiver() = default;
22 
23  virtual void insert(SourceLocation loc, StringRef text) = 0;
24  virtual void replace(CharSourceRange range, StringRef text) = 0;
25 
26  /// By default it calls replace with an empty string.
27  virtual void remove(CharSourceRange range);
28 };
29 
30 } // namespace edit
31 } // namespace clang
32 
33 #endif // LLVM_CLANG_EDIT_EDITSRECEIVER_H
clang::comments::tok::text
@ text
Definition: CommentLexer.h:35
clang::edit::EditsReceiver::remove
virtual void remove(CharSourceRange range)
By default it calls replace with an empty string.
Definition: EditedSource.cpp:30
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:89
clang::edit::EditsReceiver::replace
virtual void replace(CharSourceRange range, StringRef text)=0
clang::edit::EditsReceiver
Definition: EditsReceiver.h:19
clang::transformer::edit
EditGenerator edit(ASTEdit E)
Generates a single (specified) edit.
Definition: RewriteRule.cpp:75
SourceLocation.h
clang::CharSourceRange
Represents a character-granular source range.
Definition: SourceLocation.h:255
LLVM.h
clang::edit::EditsReceiver::~EditsReceiver
virtual ~EditsReceiver()=default
clang
Dataflow Directional Tag Classes.
Definition: CalledOnceCheck.h:17
clang::edit::EditsReceiver::insert
virtual void insert(SourceLocation loc, StringRef text)=0
clang::transformer::range
RangeSelector range(RangeSelector Begin, RangeSelector End)
DEPRECATED. Use enclose.
Definition: RangeSelector.h:41