RegexExplorer.h 924 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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
  12. : public QDialog
  13. , public Ui::RegexExplorer
  14. {
  15. Q_OBJECT
  16. public:
  17. RegexExplorer(QWidget* p);
  18. private slots:
  19. void on_regularExpression_textChanged(const QString& text);
  20. void on_inputText_textChanged();
  21. void on_matchNumber_currentIndexChanged(int index);
  22. void on_matchAll_toggled(bool checked);
  23. private:
  24. static void setStatusColor(QWidget* widget, bool successful);
  25. static bool stripEscapes(std::string& regex);
  26. void clearMatch();
  27. cmsys::RegularExpression m_regexParser;
  28. std::string m_text;
  29. std::string m_regex;
  30. bool m_matched;
  31. };
  32. #endif