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_CONFIG_VALUES_EXTRACTORS_H_ | 5 #ifndef TOOLS_GN_CONFIG_VALUES_EXTRACTORS_H_ |
6 #define TOOLS_GN_CONFIG_VALUES_EXTRACTORS_H_ | 6 #define TOOLS_GN_CONFIG_VALUES_EXTRACTORS_H_ |
7 | 7 |
8 #include <ostream> | 8 #include <ostream> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 22 matching lines...) Expand all Loading... |
33 cur_index_(-1) { | 33 cur_index_(-1) { |
34 } | 34 } |
35 | 35 |
36 bool done() const { | 36 bool done() const { |
37 return cur_index_ >= static_cast<int>(target_->configs().size()); | 37 return cur_index_ >= static_cast<int>(target_->configs().size()); |
38 } | 38 } |
39 | 39 |
40 const ConfigValues& cur() const { | 40 const ConfigValues& cur() const { |
41 if (cur_index_ == -1) | 41 if (cur_index_ == -1) |
42 return target_->config_values(); | 42 return target_->config_values(); |
43 return target_->configs()[cur_index_].ptr->config_values(); | 43 return target_->configs()[cur_index_].ptr->resolved_values(); |
44 } | 44 } |
45 | 45 |
46 // Returns the origin of who added this config, if any. This will always be | 46 // Returns the origin of who added this config, if any. This will always be |
47 // null for the config values of a target itself. | 47 // null for the config values of a target itself. |
48 const ParseNode* origin() const { | 48 const ParseNode* origin() const { |
49 if (cur_index_ == -1) | 49 if (cur_index_ == -1) |
50 return nullptr; | 50 return nullptr; |
51 return target_->configs()[cur_index_].origin; | 51 return target_->configs()[cur_index_].origin; |
52 } | 52 } |
53 | 53 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 96 } |
97 | 97 |
98 // Writes the values out as strings with no transformation. | 98 // Writes the values out as strings with no transformation. |
99 void RecursiveTargetConfigStringsToStream( | 99 void RecursiveTargetConfigStringsToStream( |
100 const Target* target, | 100 const Target* target, |
101 const std::vector<std::string>& (ConfigValues::* getter)() const, | 101 const std::vector<std::string>& (ConfigValues::* getter)() const, |
102 const EscapeOptions& escape_options, | 102 const EscapeOptions& escape_options, |
103 std::ostream& out); | 103 std::ostream& out); |
104 | 104 |
105 #endif // TOOLS_GN_CONFIG_VALUES_EXTRACTORS_H_ | 105 #endif // TOOLS_GN_CONFIG_VALUES_EXTRACTORS_H_ |
OLD | NEW |