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 #include "tools/gn/substitution_pattern.h" | 5 #include "tools/gn/substitution_pattern.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "tools/gn/build_settings.h" | 10 #include "tools/gn/build_settings.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 : type(t), | 21 : type(t), |
22 literal(l) { | 22 literal(l) { |
23 } | 23 } |
24 | 24 |
25 SubstitutionPattern::Subrange::~Subrange() { | 25 SubstitutionPattern::Subrange::~Subrange() { |
26 } | 26 } |
27 | 27 |
28 SubstitutionPattern::SubstitutionPattern() : origin_(nullptr) { | 28 SubstitutionPattern::SubstitutionPattern() : origin_(nullptr) { |
29 } | 29 } |
30 | 30 |
| 31 SubstitutionPattern::SubstitutionPattern(const SubstitutionPattern& other) = |
| 32 default; |
| 33 |
31 SubstitutionPattern::~SubstitutionPattern() { | 34 SubstitutionPattern::~SubstitutionPattern() { |
32 } | 35 } |
33 | 36 |
34 bool SubstitutionPattern::Parse(const Value& value, Err* err) { | 37 bool SubstitutionPattern::Parse(const Value& value, Err* err) { |
35 if (!value.VerifyTypeIs(Value::STRING, err)) | 38 if (!value.VerifyTypeIs(Value::STRING, err)) |
36 return false; | 39 return false; |
37 return Parse(value.string_value(), value.origin(), err); | 40 return Parse(value.string_value(), value.origin(), err); |
38 } | 41 } |
39 | 42 |
40 bool SubstitutionPattern::Parse(const std::string& str, | 43 bool SubstitutionPattern::Parse(const std::string& str, |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 "File is not inside output directory.", | 143 "File is not inside output directory.", |
141 "The given file should be in the output directory. Normally you\n" | 144 "The given file should be in the output directory. Normally you\n" |
142 "would specify\n\"$target_out_dir/foo\" or " | 145 "would specify\n\"$target_out_dir/foo\" or " |
143 "\"{{source_gen_dir}}/foo\"."); | 146 "\"{{source_gen_dir}}/foo\"."); |
144 return false; | 147 return false; |
145 } | 148 } |
146 } | 149 } |
147 | 150 |
148 return true; | 151 return true; |
149 } | 152 } |
OLD | NEW |