| 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 bool binary_compress); |
| 23 BundleFileRule(const BundleFileRule& other); | 24 BundleFileRule(const BundleFileRule& other); |
| 24 ~BundleFileRule(); | 25 ~BundleFileRule(); |
| 25 | 26 |
| 26 // Applies the substitution pattern to a source file, returning the result | 27 // Applies the substitution pattern to a source file, returning the result |
| 27 // as either a SourceFile or an OutputFile. | 28 // as either a SourceFile or an OutputFile. |
| 28 SourceFile ApplyPatternToSource(const Settings* settings, | 29 SourceFile ApplyPatternToSource(const Settings* settings, |
| 29 const BundleData& bundle_data, | 30 const BundleData& bundle_data, |
| 30 const SourceFile& source_file) const; | 31 const SourceFile& source_file) const; |
| 31 OutputFile ApplyPatternToSourceAsOutputFile( | 32 OutputFile ApplyPatternToSourceAsOutputFile( |
| 32 const Settings* settings, | 33 const Settings* settings, |
| 33 const BundleData& bundle_data, | 34 const BundleData& bundle_data, |
| 34 const SourceFile& source_file) const; | 35 const SourceFile& source_file) const; |
| 35 | 36 |
| 36 // Returns the list of SourceFiles. | 37 // Returns the list of SourceFiles. |
| 37 const std::vector<SourceFile>& sources() const { return sources_; } | 38 const std::vector<SourceFile>& sources() const { return sources_; } |
| 38 | 39 |
| 40 bool binary_compress() const { return binary_compress_; } |
| 41 |
| 39 private: | 42 private: |
| 40 std::vector<SourceFile> sources_; | 43 std::vector<SourceFile> sources_; |
| 41 SubstitutionPattern pattern_; | 44 SubstitutionPattern pattern_; |
| 45 bool binary_compress_; |
| 42 }; | 46 }; |
| 43 | 47 |
| 44 #endif // TOOLS_GN_BUNDLE_FILE_RULE_H_ | 48 #endif // TOOLS_GN_BUNDLE_FILE_RULE_H_ |
| OLD | NEW |