Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Source/QtDialog/RegexExplorer.h
4998 views
1
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
file LICENSE.rst or https://cmake.org/licensing for details. */
3
#pragma once
4
5
#include <string>
6
7
#include <QDialog>
8
9
#include "cmsys/RegularExpression.hxx"
10
11
#include "ui_RegexExplorer.h"
12
13
class QString;
14
class QWidget;
15
16
class RegexExplorer
17
: public QDialog
18
, public Ui::RegexExplorer
19
{
20
Q_OBJECT
21
public:
22
RegexExplorer(QWidget* p);
23
24
private slots:
25
void on_regularExpression_textChanged(QString const& text);
26
void on_inputText_textChanged();
27
void on_matchNumber_currentIndexChanged(int index);
28
void on_matchAll_toggled(bool checked);
29
30
private:
31
static void setStatusColor(QWidget* widget, bool successful);
32
static bool stripEscapes(std::string& regex);
33
34
void clearMatch();
35
36
cmsys::RegularExpression m_regexParser;
37
std::string m_text;
38
std::string m_regex;
39
bool m_matched;
40
};
41
42