Change next_proto member type.
[chromium-blink-merge.git] / tools / gn / action_values.h
blob3b546f29dd1b3ba70d4cfc45c1c04b4a3d5221e6
1 // Copyright (c) 2013 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.
5 #ifndef TOOLS_GN_ACTION_VALUES_H_
6 #define TOOLS_GN_ACTION_VALUES_H_
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "tools/gn/source_file.h"
13 #include "tools/gn/substitution_list.h"
15 class Target;
17 // Holds the values (outputs, args, script name, etc.) for either an action or
18 // an action_foreach target.
19 class ActionValues {
20 public:
21 ActionValues();
22 ~ActionValues();
24 // Filename of the script to execute.
25 const SourceFile& script() const { return script_; }
26 void set_script(const SourceFile& s) { script_ = s; }
28 // Arguments to the script.
29 SubstitutionList& args() { return args_; }
30 const SubstitutionList& args() const { return args_; }
32 // Files created by the script. These are strings rather than SourceFiles
33 // since they will often contain {{source expansions}}.
34 SubstitutionList& outputs() { return outputs_; }
35 const SubstitutionList& outputs() const { return outputs_; }
37 // Expands the outputs() above to the final SourceFile list.
38 void GetOutputsAsSourceFiles(const Target* target,
39 std::vector<SourceFile>* result) const;
41 // Depfile generated by the script.
42 const SubstitutionPattern& depfile() const { return depfile_; }
43 bool has_depfile() const { return !depfile_.ranges().empty(); }
44 void set_depfile(const SubstitutionPattern& depfile) { depfile_ = depfile; }
46 private:
47 SourceFile script_;
48 SubstitutionList args_;
49 SubstitutionList outputs_;
50 SubstitutionPattern depfile_;
52 DISALLOW_COPY_AND_ASSIGN(ActionValues);
55 #endif // TOOLS_GN_ACTION_VALUES_H_