ΒΆbool formatAndApplyAllReplacements(
const std::map<std::string, Replacements>&
FileToReplaces,
clang::Rewriter& Rewrite,
llvm::StringRef Style = "file")
bool formatAndApplyAllReplacements(
const std::map<std::string, Replacements>&
FileToReplaces,
clang::Rewriter& Rewrite,
llvm::StringRef Style = "file")
Description
Groups \p Replaces by the file path and applies each group of Replacements on the related file in \p Rewriter. In addition to applying given Replacements, this function also formats the changed code. FileToReplaces will be deduplicated with `groupReplacementsByFile` before application. Replacement applications happen independently of the success of other applications.
Declared at: clang/include/clang/Tooling/Refactoring.h:92
Parameters
- const std::map<std::string, Replacements>& FileToReplaces
- Replacements (grouped by files) to apply.
- clang::Rewriter& Rewrite
- The `Rewritter` to apply replacements on.
- llvm::StringRef Style = "file"
- The style name used for reformatting. See ```getStyle``` in "include/clang/Format/Format.h" for all possible style forms.
Returns
true if all replacements applied and formatted. false otherwise.