summary refs log tree commit diff stats
path: root/tools/validator/validator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/validator/validator.cpp')
-rw-r--r--tools/validator/validator.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/validator/validator.cpp b/tools/validator/validator.cpp index ab1612e..4149caa 100644 --- a/tools/validator/validator.cpp +++ b/tools/validator/validator.cpp
@@ -48,6 +48,9 @@ class Validator {
48 for (const auto& [prog_name, prog_info] : info_.progressives) { 48 for (const auto& [prog_name, prog_info] : info_.progressives) {
49 ValidateProgressive(prog_name, prog_info); 49 ValidateProgressive(prog_name, prog_info);
50 } 50 }
51 for (const auto& [group_name, group_info] : info_.door_groups) {
52 ValidateDoorGroup(group_name, group_info);
53 }
51 } 54 }
52 55
53 private: 56 private:
@@ -173,6 +176,11 @@ class Validator {
173 std::cout << " PROGRESSIVE " << prog_name << std::endl; 176 std::cout << " PROGRESSIVE " << prog_name << std::endl;
174 } 177 }
175 178
179 for (const std::string& group_name :
180 door_info.door_groups_referenced_by) {
181 std::cout << " DOOR GROUP " << group_name << std::endl;
182 }
183
176 if (door_info.has_id) { 184 if (door_info.has_id) {
177 std::cout << " An AP ID is present." << std::endl; 185 std::cout << " An AP ID is present." << std::endl;
178 } 186 }
@@ -460,6 +468,26 @@ class Validator {
460 } 468 }
461 } 469 }
462 470
471 void ValidateDoorGroup(const std::string& group_name,
472 const DoorGroupInfo& group_info) const {
473 if (group_info.definitions.empty()) {
474 std::cout << "Door group \"" << group_name
475 << "\" has no definition, but was referenced:" << std::endl;
476
477 if (group_info.has_id) {
478 std::cout << " An AP ID is present." << std::endl;
479 }
480 } else if (group_info.definitions.size() > 1) {
481 std::cout << "Door group \"" << group_name
482 << "\" has multiple definitions." << std::endl;
483 }
484
485 if (!group_info.has_id) {
486 std::cout << "Door group \"" << group_name << "\" is missing an AP ID."
487 << std::endl;
488 }
489 }
490
463 const CollectedInfo& info_; 491 const CollectedInfo& info_;
464}; 492};
465 493