#ifndef TOOLS_GN_BUNDLE_FILE_RULE_H_
#define TOOLS_GN_BUNDLE_FILE_RULE_H_
#include <vector>
#include "gn/source_file.h"
#include "gn/substitution_pattern.h"
class BundleData;
class Settings;
class SourceFile;
class Target;
class OutputFile;
class BundleFileRule {
public:
BundleFileRule(const Target* bundle_data_target,
const std::vector<SourceFile> sources,
const SubstitutionPattern& pattern);
BundleFileRule(const BundleFileRule& other);
~BundleFileRule();
bool ApplyPatternToSource(const Settings* settings,
const Target* target,
const BundleData& bundle_data,
const SourceFile& source_file,
SourceFile* expanded_source_file,
Err* err) const;
bool ApplyPatternToSourceAsOutputFile(const Settings* settings,
const Target* target,
const BundleData& bundle_data,
const SourceFile& source_file,
OutputFile* expanded_output_file,
Err* err) const;
const Target* target() const { return target_; }
const std::vector<SourceFile>& sources() const { return sources_; }
private:
const Target* target_;
std::vector<SourceFile> sources_;
SubstitutionPattern pattern_;
};
#endif