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

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

Issue 964203002: tools/gn: Fix errors found by Facebook's flint tool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix chromium-style plugin errors Created 5 years, 9 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/standard_out.cc ('k') | tools/gn/target_generator.h » ('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 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_PATTERN_H_ 5 #ifndef TOOLS_GN_SUBSTITUTION_PATTERN_H_
6 #define TOOLS_GN_SUBSTITUTION_PATTERN_H_ 6 #define TOOLS_GN_SUBSTITUTION_PATTERN_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "tools/gn/substitution_type.h" 11 #include "tools/gn/substitution_type.h"
12 12
13 class BuildSettings; 13 class BuildSettings;
14 class Err; 14 class Err;
15 class ParseNode; 15 class ParseNode;
16 class Value; 16 class Value;
17 17
18 // Represents a string with {{substitution_patterns}} in them. 18 // Represents a string with {{substitution_patterns}} in them.
19 class SubstitutionPattern { 19 class SubstitutionPattern {
20 public: 20 public:
21 struct Subrange { 21 struct Subrange {
22 Subrange(); 22 Subrange();
23 Subrange(SubstitutionType t, const std::string& l = std::string()); 23 explicit Subrange(SubstitutionType t, const std::string& l = std::string());
24 ~Subrange(); 24 ~Subrange();
25 25
26 inline bool operator==(const Subrange& other) const { 26 inline bool operator==(const Subrange& other) const {
27 return type == other.type && literal == other.literal; 27 return type == other.type && literal == other.literal;
28 } 28 }
29 29
30 SubstitutionType type; 30 SubstitutionType type;
31 31
32 // When type_ == LITERAL, this specifies the literal. 32 // When type_ == LITERAL, this specifies the literal.
33 std::string literal; 33 std::string literal;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 bool empty() const { return ranges_.empty(); } 68 bool empty() const { return ranges_.empty(); }
69 69
70 private: 70 private:
71 std::vector<Subrange> ranges_; 71 std::vector<Subrange> ranges_;
72 const ParseNode* origin_; 72 const ParseNode* origin_;
73 73
74 std::vector<SubstitutionType> required_types_; 74 std::vector<SubstitutionType> required_types_;
75 }; 75 };
76 76
77 #endif // TOOLS_GN_SUBSTITUTION_PATTERN_H_ 77 #endif // TOOLS_GN_SUBSTITUTION_PATTERN_H_
OLDNEW
« no previous file with comments | « tools/gn/standard_out.cc ('k') | tools/gn/target_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698