Chromium Code Reviews| Index: tools/gn/substitution_pattern.h |
| diff --git a/tools/gn/substitution_pattern.h b/tools/gn/substitution_pattern.h |
| index 70fc5eb375a00e4fcc909feaa0d648c9a62e7ea9..2ee554272939d4bf2a5a1935f6e24a3886ee4864 100644 |
| --- a/tools/gn/substitution_pattern.h |
| +++ b/tools/gn/substitution_pattern.h |
| @@ -5,11 +5,13 @@ |
| #ifndef TOOLS_GN_SUBSTITUTION_PATTERN_H_ |
| #define TOOLS_GN_SUBSTITUTION_PATTERN_H_ |
| +#include <functional> |
|
jamesr
2014/08/19 19:30:41
doesn't appear to be used
|
| #include <string> |
| #include <vector> |
| #include "tools/gn/substitution_type.h" |
| +class BuildSettings; |
| class Err; |
| class ParseNode; |
| class Value; |
| @@ -22,6 +24,10 @@ class SubstitutionPattern { |
| Subrange(SubstitutionType t, const std::string& l = std::string()); |
| ~Subrange(); |
| + inline bool operator==(const Subrange& other) const { |
| + return type == other.type && literal == other.literal; |
| + } |
| + |
| SubstitutionType type; |
| // When type_ == LITERAL, this specifies the literal. |
| @@ -41,7 +47,13 @@ class SubstitutionPattern { |
| // Sets the bits in the given vector corresponding to the substitutions used |
| // by this pattern. SUBSTITUTION_LITERAL is ignored. |
| - void FillRequiredTypes(bool required_types[SUBSTITUTION_NUM_TYPES]) const; |
| + void FillRequiredTypes(SubstitutionBits* bits) const; |
| + |
| + // Checks whether this pattern resolves to something in the output directory |
| + // for the given build settings. If not, returns false and fills in the given |
| + // error. |
| + bool IsInOutputDir(const BuildSettings* build_settings, |
| + Err* err) const; |
| // Returns a vector listing the substitutions used by this pattern, not |
| // counting SUBSTITUTION_LITERAL. |
| @@ -54,6 +66,7 @@ class SubstitutionPattern { |
| private: |
| std::vector<Subrange> ranges_; |
| + const ParseNode* origin_; |
| std::vector<SubstitutionType> required_types_; |
| }; |