clang-tools  14.0.0git
ReorderFieldsAction.h
Go to the documentation of this file.
1 //===-- tools/extra/clang-reorder-fields/ReorderFieldsAction.h -*- 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 /// \file
10 /// This file contains the declarations of the ReorderFieldsAction class and
11 /// the FieldPosition struct.
12 ///
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_REORDER_FIELDS_ACTION_H
16 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_REORDER_FIELDS_ACTION_H
17 
18 #include "clang/Tooling/Refactoring.h"
19 
20 namespace clang {
21 class ASTConsumer;
22 
23 namespace reorder_fields {
24 
26  llvm::StringRef RecordName;
27  llvm::ArrayRef<std::string> DesiredFieldsOrder;
28  std::map<std::string, tooling::Replacements> &Replacements;
29 
30 public:
32  llvm::StringRef RecordName,
33  llvm::ArrayRef<std::string> DesiredFieldsOrder,
34  std::map<std::string, tooling::Replacements> &Replacements)
35  : RecordName(RecordName), DesiredFieldsOrder(DesiredFieldsOrder),
36  Replacements(Replacements) {}
37 
38  ReorderFieldsAction(const ReorderFieldsAction &) = delete;
40 
41  std::unique_ptr<ASTConsumer> newASTConsumer();
42 };
43 } // namespace reorder_fields
44 } // namespace clang
45 
46 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_REORDER_FIELDS_ACTION_H
clang::reorder_fields::ReorderFieldsAction
Definition: ReorderFieldsAction.h:25
clang::reorder_fields::ReorderFieldsAction::ReorderFieldsAction
ReorderFieldsAction(llvm::StringRef RecordName, llvm::ArrayRef< std::string > DesiredFieldsOrder, std::map< std::string, tooling::Replacements > &Replacements)
Definition: ReorderFieldsAction.h:31
ASTConsumer
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition: ApplyReplacements.h:27
clang::reorder_fields::ReorderFieldsAction::newASTConsumer
std::unique_ptr< ASTConsumer > newASTConsumer()
Definition: ReorderFieldsAction.cpp:306
clang::reorder_fields::ReorderFieldsAction::operator=
ReorderFieldsAction & operator=(const ReorderFieldsAction &)=delete