validator.h 814 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * validator.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include <QDialog>
  12. #include <set>
  13. VCMI_LIB_NAMESPACE_BEGIN
  14. class CMap;
  15. VCMI_LIB_NAMESPACE_END
  16. namespace Ui {
  17. class Validator;
  18. }
  19. class Validator : public QDialog
  20. {
  21. Q_OBJECT
  22. public:
  23. struct Issue
  24. {
  25. QString message;
  26. bool critical;
  27. Issue(const QString & m, bool c): message(m), critical(c) {}
  28. bool operator <(const Issue & other) const
  29. {
  30. return message < other.message;
  31. }
  32. };
  33. public:
  34. explicit Validator(const CMap * map, QWidget *parent = nullptr);
  35. ~Validator();
  36. static std::set<Issue> validate(const CMap * map);
  37. private:
  38. Ui::Validator *ui;
  39. };