summary refs log tree commit diff stats
path: root/tools/util/ids_yaml_format.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/util/ids_yaml_format.cpp')
-rw-r--r--tools/util/ids_yaml_format.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/util/ids_yaml_format.cpp b/tools/util/ids_yaml_format.cpp index f72f60e..ae62073 100644 --- a/tools/util/ids_yaml_format.cpp +++ b/tools/util/ids_yaml_format.cpp
@@ -89,6 +89,13 @@ IdMappings ReadIdsFromYaml(const std::string& filename) {
89 } 89 }
90 } 90 }
91 91
92 if (document["progressives"]) {
93 for (const auto& prog_it : document["progressives"]) {
94 (*result.mutable_progressives())[prog_it.first.as<std::string>()] =
95 prog_it.second.as<uint64_t>();
96 }
97 }
98
92 return result; 99 return result;
93} 100}
94 101
@@ -144,6 +151,11 @@ void WriteIdsAsYaml(const IdMappings& ids, const std::string& filename) {
144 result["special"][special_name] = special_id; 151 result["special"][special_name] = special_id;
145 }); 152 });
146 153
154 OperateOnSortedMap(ids.progressives(),
155 [&result](const std::string& prog_name, uint64_t prog_id) {
156 result["progressives"][prog_name] = prog_id;
157 });
158
147 std::ofstream output_stream(filename); 159 std::ofstream output_stream(filename);
148 output_stream << result << std::endl; 160 output_stream << result << std::endl;
149} 161}