File: bundle_file_rule.h

package info (click to toggle)
qtwebengine-opensource-src 5.11.3%2Bdfsg-2%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,551,988 kB
  • sloc: cpp: 10,064,061; ansic: 3,832,841; asm: 590,489; python: 455,759; xml: 261,729; sh: 90,157; objc: 77,089; perl: 71,296; makefile: 27,041; cs: 23,492; yacc: 14,360; tcl: 12,756; php: 4,714; lex: 4,028; pascal: 3,741; ml: 3,543; ruby: 1,497; lisp: 1,490; awk: 183; csh: 117; sed: 54
file content (51 lines) | stat: -rw-r--r-- 1,649 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef TOOLS_GN_BUNDLE_FILE_RULE_H_
#define TOOLS_GN_BUNDLE_FILE_RULE_H_

#include <vector>

#include "tools/gn/source_file.h"
#include "tools/gn/substitution_pattern.h"

class BundleData;
class Settings;
class SourceFile;
class Target;
class OutputFile;

// BundleFileRule contains the information found in a "bundle_data" target.
class BundleFileRule {
 public:
  BundleFileRule(const Target* bundle_data_target,
                 const std::vector<SourceFile> sources,
                 const SubstitutionPattern& pattern);
  BundleFileRule(const BundleFileRule& other);
  ~BundleFileRule();

  // Applies the substitution pattern to a source file, returning the result
  // as either a SourceFile or an OutputFile.
  SourceFile ApplyPatternToSource(const Settings* settings,
                                  const BundleData& bundle_data,
                                  const SourceFile& source_file) const;
  OutputFile ApplyPatternToSourceAsOutputFile(
      const Settings* settings,
      const BundleData& bundle_data,
      const SourceFile& source_file) const;

  // Returns the associated target (of type Target::BUNDLE_DATA). May be
  // null during testing.
  const Target* target() const { return target_; }

  // Returns the list of SourceFiles.
  const std::vector<SourceFile>& sources() const { return sources_; }

 private:
  const Target* target_;
  std::vector<SourceFile> sources_;
  SubstitutionPattern pattern_;
};

#endif  // TOOLS_GN_BUNDLE_FILE_RULE_H_