• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2019 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef TOOLS_GN_RUST_VALUES_GENERATOR_H_
6 #define TOOLS_GN_RUST_VALUES_GENERATOR_H_
7 
8 #include "base/macros.h"
9 #include "gn/target.h"
10 
11 class FunctionCallNode;
12 
13 // Collects and writes specified data.
14 class RustTargetGenerator {
15  public:
16   RustTargetGenerator(Target* target,
17                       Scope* scope,
18                       const FunctionCallNode* function_call,
19                       Err* err);
20   ~RustTargetGenerator();
21 
22   void Run();
23 
24  private:
25   bool FillCrateName();
26   bool FillCrateRoot();
27   bool FillCrateType();
28   bool FillEdition();
29   bool FillAliasedDeps();
30 
31   Target* target_;
32   Scope* scope_;
33   const FunctionCallNode* function_call_;
34   Err* err_;
35 
36   DISALLOW_COPY_AND_ASSIGN(RustTargetGenerator);
37 };
38 
39 #endif  // TOOLS_GN_RUST_VALUES_GENERATOR_H_
40