RegexExplorer.h 919 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef RegexExplorer_h
  4. #define RegexExplorer_h
  5. #include "cmsys/RegularExpression.hxx"
  6. #include <QDialog>
  7. #include <string>
  8. #include "ui_RegexExplorer.h"
  9. class QString;
  10. class QWidget;
  11. class RegexExplorer : public QDialog, public Ui::RegexExplorer
  12. {
  13. Q_OBJECT
  14. public:
  15. RegexExplorer(QWidget* p);
  16. private slots:
  17. void on_regularExpression_textChanged(const QString& text);
  18. void on_inputText_textChanged();
  19. void on_matchNumber_currentIndexChanged(int index);
  20. void on_matchAll_toggled(bool checked);
  21. private:
  22. static void setStatusColor(QWidget* widget, bool successful);
  23. static bool stripEscapes(std::string& regex);
  24. void clearMatch();
  25. cmsys::RegularExpression m_regexParser;
  26. std::string m_text;
  27. std::string m_regex;
  28. bool m_matched;
  29. };
  30. #endif