diff options
Diffstat (limited to 'tools/util/ids_yaml_format.cpp')
-rw-r--r-- | tools/util/ids_yaml_format.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/util/ids_yaml_format.cpp b/tools/util/ids_yaml_format.cpp index 67c21d6..71bfd63 100644 --- a/tools/util/ids_yaml_format.cpp +++ b/tools/util/ids_yaml_format.cpp | |||
@@ -104,6 +104,13 @@ IdMappings ReadIdsFromYaml(const std::string& filename) { | |||
104 | } | 104 | } |
105 | } | 105 | } |
106 | 106 | ||
107 | if (document["door_groups"]) { | ||
108 | for (const auto& group_it : document["door_groups"]) { | ||
109 | (*result.mutable_door_groups())[group_it.first.as<std::string>()] = | ||
110 | group_it.second.as<uint64_t>(); | ||
111 | } | ||
112 | } | ||
113 | |||
107 | return result; | 114 | return result; |
108 | } | 115 | } |
109 | 116 | ||
@@ -171,6 +178,11 @@ void WriteIdsAsYaml(const IdMappings& ids, const std::string& filename) { | |||
171 | result["progressives"][prog_name] = prog_id; | 178 | result["progressives"][prog_name] = prog_id; |
172 | }); | 179 | }); |
173 | 180 | ||
181 | OperateOnSortedMap(ids.door_groups(), [&result](const std::string& group_name, | ||
182 | uint64_t group_id) { | ||
183 | result["door_groups"][group_name] = group_id; | ||
184 | }); | ||
185 | |||
174 | std::ofstream output_stream(filename); | 186 | std::ofstream output_stream(filename); |
175 | output_stream << result << std::endl; | 187 | output_stream << result << std::endl; |
176 | } | 188 | } |