OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SUBSTITUTION_TYPE_H_ | 5 #ifndef TOOLS_GN_SUBSTITUTION_TYPE_H_ |
6 #define TOOLS_GN_SUBSTITUTION_TYPE_H_ | 6 #define TOOLS_GN_SUBSTITUTION_TYPE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 class Err; | 10 class Err; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 bool SubstitutionIsInOutputDir(SubstitutionType type); | 111 bool SubstitutionIsInOutputDir(SubstitutionType type); |
112 | 112 |
113 // Returns true if the given substitution pattern references the bundle | 113 // Returns true if the given substitution pattern references the bundle |
114 // directory. This is used to check strings that begin with a substitution to | 114 // directory. This is used to check strings that begin with a substitution to |
115 // verify that they produce a file in the bundle directory. | 115 // verify that they produce a file in the bundle directory. |
116 bool SubstitutionIsInBundleDir(SubstitutionType type); | 116 bool SubstitutionIsInBundleDir(SubstitutionType type); |
117 | 117 |
118 // Returns true if the given substitution is valid for the named purpose. | 118 // Returns true if the given substitution is valid for the named purpose. |
119 bool IsValidBundleDataSubstitution(SubstitutionType type); | 119 bool IsValidBundleDataSubstitution(SubstitutionType type); |
120 bool IsValidSourceSubstitution(SubstitutionType type); | 120 bool IsValidSourceSubstitution(SubstitutionType type); |
| 121 bool IsValidScriptArgsSubstitution(SubstitutionType type); |
| 122 |
121 // Both compiler and linker tools. | 123 // Both compiler and linker tools. |
122 bool IsValidToolSubstitution(SubstitutionType type); | 124 bool IsValidToolSubstitution(SubstitutionType type); |
123 bool IsValidCompilerSubstitution(SubstitutionType type); | 125 bool IsValidCompilerSubstitution(SubstitutionType type); |
124 bool IsValidCompilerOutputsSubstitution(SubstitutionType type); | 126 bool IsValidCompilerOutputsSubstitution(SubstitutionType type); |
125 bool IsValidLinkerSubstitution(SubstitutionType type); | 127 bool IsValidLinkerSubstitution(SubstitutionType type); |
126 bool IsValidLinkerOutputsSubstitution(SubstitutionType type); | 128 bool IsValidLinkerOutputsSubstitution(SubstitutionType type); |
127 bool IsValidALinkSubstitution(SubstitutionType type); | 129 bool IsValidALinkSubstitution(SubstitutionType type); |
128 bool IsValidCopySubstitution(SubstitutionType type); | 130 bool IsValidCopySubstitution(SubstitutionType type); |
129 bool IsValidCompileXCassetsSubstitution(SubstitutionType type); | 131 bool IsValidCompileXCassetsSubstitution(SubstitutionType type); |
130 | 132 |
131 // Like the "IsValid..." version above but checks a list of types and sets a | 133 // Validates that each substitution type in the vector passes the given |
132 // an error blaming the given source if the test fails. | 134 // is_valid_subst predicate. Returns true on success. On failure, fills in the |
133 bool EnsureValidSourcesSubstitutions( | 135 // error object with an appropriate message and returns false. |
| 136 bool EnsureValidSubstitutions( |
134 const std::vector<SubstitutionType>& types, | 137 const std::vector<SubstitutionType>& types, |
| 138 bool (*is_valid_subst)(SubstitutionType), |
135 const ParseNode* origin, | 139 const ParseNode* origin, |
136 Err* err); | 140 Err* err); |
137 | 141 |
138 #endif // TOOLS_GN_SUBSTITUTION_TYPE_H_ | 142 #endif // TOOLS_GN_SUBSTITUTION_TYPE_H_ |
OLD | NEW |