Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: tools/gn/pattern.h

Issue 500423003: Enhance GN diagnostic tools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use patterns for gn check Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/gn/label_pattern_unittest.cc ('k') | tools/gn/pattern.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "tools/gn/value.h" 11 #include "tools/gn/value.h"
12 12
13 extern const char kPattern_Help[];
14
15 class Pattern { 13 class Pattern {
16 public: 14 public:
17 struct Subrange { 15 struct Subrange {
18 enum Type { 16 enum Type {
19 LITERAL, // Matches exactly the contents of the string. 17 LITERAL, // Matches exactly the contents of the string.
20 ANYTHING, // * (zero or more chars). 18 ANYTHING, // * (zero or more chars).
21 PATH_BOUNDARY // '/' or beginning of string. 19 PATH_BOUNDARY // '/' or beginning of string.
22 }; 20 };
23 21
24 Subrange(Type t, const std::string& l = std::string()) 22 Subrange(Type t, const std::string& l = std::string())
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 void SetFromValue(const Value& v, Err* err); 79 void SetFromValue(const Value& v, Err* err);
82 80
83 bool MatchesString(const std::string& s) const; 81 bool MatchesString(const std::string& s) const;
84 bool MatchesValue(const Value& v) const; 82 bool MatchesValue(const Value& v) const;
85 83
86 private: 84 private:
87 std::vector<Pattern> patterns_; 85 std::vector<Pattern> patterns_;
88 }; 86 };
89 87
90 #endif // TOOLS_GN_PATTERN_H_ 88 #endif // TOOLS_GN_PATTERN_H_
OLDNEW
« no previous file with comments | « tools/gn/label_pattern_unittest.cc ('k') | tools/gn/pattern.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698