• 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 "gn/target.h"
9 
10 class FunctionCallNode;
11 
12 // Collects and writes specified data.
13 class RustValuesGenerator {
14  public:
15   RustValuesGenerator(Target* target,
16                       Scope* scope,
17                       const FunctionCallNode* function_call,
18                       Err* err);
19   ~RustValuesGenerator();
20 
21   void Run();
22 
23  private:
24   bool FillCrateName();
25   bool FillCrateRoot();
26   bool FillCrateType();
27   bool FillEdition();
28   bool FillAliasedDeps();
29 
30   Target* target_;
31   Scope* scope_;
32   const FunctionCallNode* function_call_;
33   Err* err_;
34 
35   RustValuesGenerator(const RustValuesGenerator&) = delete;
36   RustValuesGenerator& operator=(const RustValuesGenerator&) = delete;
37 };
38 
39 #endif  // TOOLS_GN_RUST_VALUES_GENERATOR_H_
40