OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_PATTERN_H_ | 5 #ifndef TOOLS_GN_PATTERN_H_ |
6 #define TOOLS_GN_PATTERN_H_ | 6 #define TOOLS_GN_PATTERN_H_ |
7 | 7 |
| 8 #include <stddef.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 #include <vector> | 11 #include <vector> |
10 | 12 |
11 #include "tools/gn/value.h" | 13 #include "tools/gn/value.h" |
12 | 14 |
13 class Pattern { | 15 class Pattern { |
14 public: | 16 public: |
15 struct Subrange { | 17 struct Subrange { |
16 enum Type { | 18 enum Type { |
17 LITERAL, // Matches exactly the contents of the string. | 19 LITERAL, // Matches exactly the contents of the string. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 void SetFromValue(const Value& v, Err* err); | 81 void SetFromValue(const Value& v, Err* err); |
80 | 82 |
81 bool MatchesString(const std::string& s) const; | 83 bool MatchesString(const std::string& s) const; |
82 bool MatchesValue(const Value& v) const; | 84 bool MatchesValue(const Value& v) const; |
83 | 85 |
84 private: | 86 private: |
85 std::vector<Pattern> patterns_; | 87 std::vector<Pattern> patterns_; |
86 }; | 88 }; |
87 | 89 |
88 #endif // TOOLS_GN_PATTERN_H_ | 90 #endif // TOOLS_GN_PATTERN_H_ |
OLD | NEW |