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_list.h" | 5 #include "tools/gn/substitution_list.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include "tools/gn/value.h" | 10 #include "tools/gn/value.h" |
11 | 11 |
12 SubstitutionList::SubstitutionList() { | 12 SubstitutionList::SubstitutionList() { |
13 } | 13 } |
14 | 14 |
| 15 SubstitutionList::SubstitutionList(const SubstitutionList& other) = default; |
| 16 |
15 SubstitutionList::~SubstitutionList() { | 17 SubstitutionList::~SubstitutionList() { |
16 } | 18 } |
17 | 19 |
18 bool SubstitutionList::Parse(const Value& value, Err* err) { | 20 bool SubstitutionList::Parse(const Value& value, Err* err) { |
19 if (!value.VerifyTypeIs(Value::LIST, err)) | 21 if (!value.VerifyTypeIs(Value::LIST, err)) |
20 return false; | 22 return false; |
21 | 23 |
22 const std::vector<Value>& input_list = value.list_value(); | 24 const std::vector<Value>& input_list = value.list_value(); |
23 list_.resize(input_list.size()); | 25 list_.resize(input_list.size()); |
24 for (size_t i = 0; i < input_list.size(); i++) { | 26 for (size_t i = 0; i < input_list.size(); i++) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 Err err; | 63 Err err; |
62 SubstitutionList result; | 64 SubstitutionList result; |
63 result.Parse(input_strings, nullptr, &err); | 65 result.Parse(input_strings, nullptr, &err); |
64 return result; | 66 return result; |
65 } | 67 } |
66 | 68 |
67 void SubstitutionList::FillRequiredTypes(SubstitutionBits* bits) const { | 69 void SubstitutionList::FillRequiredTypes(SubstitutionBits* bits) const { |
68 for (const auto& item : list_) | 70 for (const auto& item : list_) |
69 item.FillRequiredTypes(bits); | 71 item.FillRequiredTypes(bits); |
70 } | 72 } |
OLD | NEW |