OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef TOOLS_GN_BUNDLE_FILE_RULE_H_ | 5 #ifndef TOOLS_GN_BUNDLE_FILE_RULE_H_ |
6 #define TOOLS_GN_BUNDLE_FILE_RULE_H_ | 6 #define TOOLS_GN_BUNDLE_FILE_RULE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "tools/gn/source_file.h" | 10 #include "tools/gn/source_file.h" |
11 #include "tools/gn/substitution_pattern.h" | 11 #include "tools/gn/substitution_pattern.h" |
12 | 12 |
13 class BundleData; | 13 class BundleData; |
14 class Settings; | 14 class Settings; |
15 class SourceFile; | 15 class SourceFile; |
16 class OutputFile; | 16 class OutputFile; |
17 | 17 |
18 // BundleFileRule contains the information found in a "bundle_data" target. | 18 // BundleFileRule contains the information found in a "bundle_data" target. |
19 class BundleFileRule { | 19 class BundleFileRule { |
20 public: | 20 public: |
21 BundleFileRule(const std::vector<SourceFile> sources, | 21 BundleFileRule(const std::vector<SourceFile> sources, |
22 const SubstitutionPattern& pattern); | 22 const SubstitutionPattern& pattern); |
| 23 BundleFileRule(const BundleFileRule& other); |
23 ~BundleFileRule(); | 24 ~BundleFileRule(); |
24 | 25 |
25 // Applies the substitution pattern to a source file, returning the result | 26 // Applies the substitution pattern to a source file, returning the result |
26 // as either a SourceFile or an OutputFile. | 27 // as either a SourceFile or an OutputFile. |
27 SourceFile ApplyPatternToSource(const Settings* settings, | 28 SourceFile ApplyPatternToSource(const Settings* settings, |
28 const BundleData& bundle_data, | 29 const BundleData& bundle_data, |
29 const SourceFile& source_file) const; | 30 const SourceFile& source_file) const; |
30 OutputFile ApplyPatternToSourceAsOutputFile( | 31 OutputFile ApplyPatternToSourceAsOutputFile( |
31 const Settings* settings, | 32 const Settings* settings, |
32 const BundleData& bundle_data, | 33 const BundleData& bundle_data, |
33 const SourceFile& source_file) const; | 34 const SourceFile& source_file) const; |
34 | 35 |
35 // Returns the list of SourceFiles. | 36 // Returns the list of SourceFiles. |
36 const std::vector<SourceFile>& sources() const { return sources_; } | 37 const std::vector<SourceFile>& sources() const { return sources_; } |
37 | 38 |
38 private: | 39 private: |
39 std::vector<SourceFile> sources_; | 40 std::vector<SourceFile> sources_; |
40 SubstitutionPattern pattern_; | 41 SubstitutionPattern pattern_; |
41 }; | 42 }; |
42 | 43 |
43 #endif // TOOLS_GN_BUNDLE_FILE_RULE_H_ | 44 #endif // TOOLS_GN_BUNDLE_FILE_RULE_H_ |
OLD | NEW |