aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/generichighlighter
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2018-09-20 01:16:01 +0300
committerOrgad Shaneh <orgads@gmail.com>2018-09-20 08:48:49 +0000
commit41dee83becb19aa5fadae8ef9469216bcab1440c (patch)
tree2fd37b0111d0e3b78976fa8f8fbaefff30f49003 /src/plugins/texteditor/generichighlighter
parent439bc225e1c0f3d964c8a3da6e9757a821a5944c (diff)
TextEditor: Modernize
override, auto, nullptr, member initializers. Change-Id: I04c6ebb683849568973bd7782fb5a3279267141e Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/texteditor/generichighlighter')
-rw-r--r--src/plugins/texteditor/generichighlighter/dynamicrule.cpp2
-rw-r--r--src/plugins/texteditor/generichighlighter/dynamicrule.h2
-rw-r--r--src/plugins/texteditor/generichighlighter/highlightdefinitionhandler.cpp16
-rw-r--r--src/plugins/texteditor/generichighlighter/highlightdefinitionhandler.h13
-rw-r--r--src/plugins/texteditor/generichighlighter/highlighter.cpp14
-rw-r--r--src/plugins/texteditor/generichighlighter/highlighter.h12
-rw-r--r--src/plugins/texteditor/generichighlighter/highlightersettingspage.cpp2
-rw-r--r--src/plugins/texteditor/generichighlighter/managedefinitionsdialog.cpp2
-rw-r--r--src/plugins/texteditor/generichighlighter/managedefinitionsdialog.h2
-rw-r--r--src/plugins/texteditor/generichighlighter/manager.cpp14
-rw-r--r--src/plugins/texteditor/generichighlighter/manager.h4
-rw-r--r--src/plugins/texteditor/generichighlighter/specificrules.h144
12 files changed, 93 insertions, 134 deletions
diff --git a/src/plugins/texteditor/generichighlighter/dynamicrule.cpp b/src/plugins/texteditor/generichighlighter/dynamicrule.cpp
index 16d95c6b36..9dcaf359be 100644
--- a/src/plugins/texteditor/generichighlighter/dynamicrule.cpp
+++ b/src/plugins/texteditor/generichighlighter/dynamicrule.cpp
@@ -53,7 +53,7 @@ namespace Internal {
void updateDynamicRules(const QList<QSharedPointer<Rule> > &rules, const QStringList &captures)
{
foreach (QSharedPointer<Rule> rule, rules) {
- DynamicRule *dynamicRule = dynamic_cast<DynamicRule *>(rule.data());
+ auto dynamicRule = dynamic_cast<DynamicRule *>(rule.data());
if (dynamicRule && dynamicRule->isActive())
dynamicRule->replaceExpressions(captures);
}
diff --git a/src/plugins/texteditor/generichighlighter/dynamicrule.h b/src/plugins/texteditor/generichighlighter/dynamicrule.h
index c78b06f544..2c3d46bd8d 100644
--- a/src/plugins/texteditor/generichighlighter/dynamicrule.h
+++ b/src/plugins/texteditor/generichighlighter/dynamicrule.h
@@ -38,7 +38,7 @@ class DynamicRule : public Rule
{
public:
DynamicRule();
- virtual ~DynamicRule();
+ ~DynamicRule() override;
void setActive(const QString &active);
bool isActive() const;
diff --git a/src/plugins/texteditor/generichighlighter/highlightdefinitionhandler.cpp b/src/plugins/texteditor/generichighlighter/highlightdefinitionhandler.cpp
index 794247b220..76c55f7cab 100644
--- a/src/plugins/texteditor/generichighlighter/highlightdefinitionhandler.cpp
+++ b/src/plugins/texteditor/generichighlighter/highlightdefinitionhandler.cpp
@@ -306,7 +306,7 @@ void HighlightDefinitionHandler::foldingElementStarted(const QXmlAttributes &att
void HighlightDefinitionHandler::detectCharStarted(const QXmlAttributes &atts)
{
- DetectCharRule *rule = new DetectCharRule;
+ auto rule = new DetectCharRule;
rule->setChar(atts.value(kChar));
rule->setActive(atts.value(kDynamic));
ruleElementStarted(atts, QSharedPointer<Rule>(rule));
@@ -314,7 +314,7 @@ void HighlightDefinitionHandler::detectCharStarted(const QXmlAttributes &atts)
void HighlightDefinitionHandler::detect2CharsStarted(const QXmlAttributes &atts)
{
- Detect2CharsRule *rule = new Detect2CharsRule;
+ auto rule = new Detect2CharsRule;
rule->setChar(atts.value(kChar));
rule->setChar1(atts.value(kChar1));
rule->setActive(atts.value(kDynamic));
@@ -323,14 +323,14 @@ void HighlightDefinitionHandler::detect2CharsStarted(const QXmlAttributes &atts)
void HighlightDefinitionHandler::anyCharStarted(const QXmlAttributes &atts)
{
- AnyCharRule *rule = new AnyCharRule;
+ auto rule = new AnyCharRule;
rule->setCharacterSet(atts.value(kString));
ruleElementStarted(atts, QSharedPointer<Rule>(rule));
}
void HighlightDefinitionHandler::stringDetectedStarted(const QXmlAttributes &atts)
{
- StringDetectRule *rule = new StringDetectRule;
+ auto rule = new StringDetectRule;
rule->setString(atts.value(kString));
rule->setInsensitive(atts.value(kInsensitive));
rule->setActive(atts.value(kDynamic));
@@ -339,7 +339,7 @@ void HighlightDefinitionHandler::stringDetectedStarted(const QXmlAttributes &att
void HighlightDefinitionHandler::wordDetectStarted(const QXmlAttributes &atts)
{
- WordDetectRule *rule = new WordDetectRule;
+ auto rule = new WordDetectRule;
rule->setString(atts.value(kString));
rule->setInsensitive(atts.value(kInsensitive));
rule->setActive(atts.value(kDynamic));
@@ -348,7 +348,7 @@ void HighlightDefinitionHandler::wordDetectStarted(const QXmlAttributes &atts)
void HighlightDefinitionHandler::regExprStarted(const QXmlAttributes &atts)
{
- RegExprRule *rule = new RegExprRule;
+ auto rule = new RegExprRule;
rule->setPattern(atts.value(kString));
rule->setMinimal(atts.value(kMinimal));
rule->setInsensitive(atts.value(kInsensitive));
@@ -358,7 +358,7 @@ void HighlightDefinitionHandler::regExprStarted(const QXmlAttributes &atts)
void HighlightDefinitionHandler::keywordStarted(const QXmlAttributes &atts)
{
- KeywordRule *rule = new KeywordRule(m_definition);
+ auto rule = new KeywordRule(m_definition);
try {
rule->setList(atts.value(kString));
} catch (const HighlighterException &e) {
@@ -404,7 +404,7 @@ void HighlightDefinitionHandler::hlCCharStarted(const QXmlAttributes &atts)
void HighlightDefinitionHandler::rangeDetectStarted(const QXmlAttributes &atts)
{
- RangeDetectRule *rule = new RangeDetectRule;
+ auto rule = new RangeDetectRule;
rule->setChar(atts.value(kChar));
rule->setChar1(atts.value(kChar1));
ruleElementStarted(atts, QSharedPointer<Rule>(rule));
diff --git a/src/plugins/texteditor/generichighlighter/highlightdefinitionhandler.h b/src/plugins/texteditor/generichighlighter/highlightdefinitionhandler.h
index db3d97704b..bb7317ec51 100644
--- a/src/plugins/texteditor/generichighlighter/highlightdefinitionhandler.h
+++ b/src/plugins/texteditor/generichighlighter/highlightdefinitionhandler.h
@@ -43,14 +43,15 @@ class HighlightDefinitionHandler : public QXmlDefaultHandler
{
public:
HighlightDefinitionHandler(const QSharedPointer<HighlightDefinition> &definition);
- ~HighlightDefinitionHandler();
+ ~HighlightDefinitionHandler() override;
- bool startDocument();
- bool endDocument();
+ bool startDocument() override;
+ bool endDocument() override;
bool startElement(const QString &namespaceURI, const QString &localName,
- const QString &qName, const QXmlAttributes &atts);
- bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName);
- bool characters(const QString &ch);
+ const QString &qName, const QXmlAttributes &atts) override;
+ bool endElement(const QString &namespaceURI, const QString &localName,
+ const QString &qName) override;
+ bool characters(const QString &ch) override;
private:
void listElementStarted(const QXmlAttributes &atts);
diff --git a/src/plugins/texteditor/generichighlighter/highlighter.cpp b/src/plugins/texteditor/generichighlighter/highlighter.cpp
index 3476a637b2..f7004e878c 100644
--- a/src/plugins/texteditor/generichighlighter/highlighter.cpp
+++ b/src/plugins/texteditor/generichighlighter/highlighter.cpp
@@ -62,7 +62,7 @@ public:
m_continueObservableState(-1)
{}
- ~HighlighterCodeFormatterData() {}
+ ~HighlighterCodeFormatterData() override {}
int m_foldingIndentDelta;
int m_originalObservableState;
QStack<QString> m_foldingRegions;
@@ -71,7 +71,7 @@ public:
HighlighterCodeFormatterData *formatterData(const QTextBlock &block)
{
- HighlighterCodeFormatterData *data = 0;
+ HighlighterCodeFormatterData *data = nullptr;
if (TextBlockUserData *userData = TextDocumentLayout::userData(block)) {
data = static_cast<HighlighterCodeFormatterData *>(userData->codeFormatterData());
if (!data) {
@@ -127,13 +127,7 @@ static TextStyle styleForFormat(int format)
}
Highlighter::Highlighter(QTextDocument *parent) :
- SyntaxHighlighter(parent),
- m_regionDepth(0),
- m_indentationBasedFolding(false),
- m_tabSettings(0),
- m_persistentObservableStatesCounter(PersistentsStart),
- m_dynamicContextsCounter(0),
- m_isBroken(false)
+ SyntaxHighlighter(parent)
{
setTextFormatCategories(TextFormatIdCount, styleForFormat);
}
@@ -217,7 +211,7 @@ void Highlighter::highlightBlock(const QString &text)
handleContextChange(m_currentContext->lineBeginContext(),
m_currentContext->definition());
- ProgressData *progress = new ProgressData;
+ auto progress = new ProgressData;
const int length = text.length();
while (progress->offset() < length)
iterateThroughRules(text, length, progress, false, m_currentContext->rules());
diff --git a/src/plugins/texteditor/generichighlighter/highlighter.h b/src/plugins/texteditor/generichighlighter/highlighter.h
index 7e925f9e48..f814496600 100644
--- a/src/plugins/texteditor/generichighlighter/highlighter.h
+++ b/src/plugins/texteditor/generichighlighter/highlighter.h
@@ -172,14 +172,14 @@ private:
static int extractRegionDepth(const int state);
static int extractObservableState(const int state);
- int m_regionDepth;
- bool m_indentationBasedFolding;
- const TabSettings *m_tabSettings;
+ int m_regionDepth = 0;
+ bool m_indentationBasedFolding = false;
+ const TabSettings *m_tabSettings = nullptr;
- int m_persistentObservableStatesCounter;
- int m_dynamicContextsCounter;
+ int m_persistentObservableStatesCounter = PersistentsStart;
+ int m_dynamicContextsCounter = 0;
- bool m_isBroken;
+ bool m_isBroken = false;
QSharedPointer<Internal::Context> m_defaultContext;
QSharedPointer<Internal::Context> m_currentContext;
diff --git a/src/plugins/texteditor/generichighlighter/highlightersettingspage.cpp b/src/plugins/texteditor/generichighlighter/highlightersettingspage.cpp
index 67df7ac53d..d43c528e08 100644
--- a/src/plugins/texteditor/generichighlighter/highlightersettingspage.cpp
+++ b/src/plugins/texteditor/generichighlighter/highlightersettingspage.cpp
@@ -130,7 +130,7 @@ void HighlighterSettingsPage::finish()
if (!m_d->m_page) // page was not shown
return;
delete m_d->m_page;
- m_d->m_page = 0;
+ m_d->m_page = nullptr;
}
const HighlighterSettings &HighlighterSettingsPage::highlighterSettings() const
diff --git a/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.cpp b/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.cpp
index 4b555ad0c1..1a6aa42ce0 100644
--- a/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.cpp
+++ b/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.cpp
@@ -77,7 +77,7 @@ void ManageDefinitionsDialog::populateDefinitionsWidget(const QList<DefinitionMe
}
for (int j = 0; j < 3; ++j) {
- QTableWidgetItem *item = new QTableWidgetItem;
+ auto item = new QTableWidgetItem;
if (j == 0) {
item->setText(downloadData.name);
item->setData(Qt::UserRole, downloadData.url);
diff --git a/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.h b/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.h
index 2a6d1c0308..3a5512dcec 100644
--- a/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.h
+++ b/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.h
@@ -38,7 +38,7 @@ class ManageDefinitionsDialog : public QDialog
public:
explicit ManageDefinitionsDialog(const QList<DefinitionMetaDataPtr> &metaDataList,
const QString &path,
- QWidget *parent = 0);
+ QWidget *parent = nullptr);
private:
void downloadDefinitions();
diff --git a/src/plugins/texteditor/generichighlighter/manager.cpp b/src/plugins/texteditor/generichighlighter/manager.cpp
index d6fdc002b2..32da7ca4e5 100644
--- a/src/plugins/texteditor/generichighlighter/manager.cpp
+++ b/src/plugins/texteditor/generichighlighter/manager.cpp
@@ -85,7 +85,7 @@ public:
this, &MultiDefinitionDownloader::downloadDefinitionsFinished);
}
- ~MultiDefinitionDownloader()
+ ~MultiDefinitionDownloader() override
{
if (m_downloadWatcher.isRunning())
m_downloadWatcher.cancel();
@@ -107,9 +107,7 @@ private:
QString m_downloadPath;
};
-Manager::Manager() :
- m_multiDownloader(0),
- m_hasQueuedRegistration(false)
+Manager::Manager()
{
connect(&m_registeringWatcher, &QFutureWatcherBase::finished,
this, &Manager::registerHighlightingFilesFinished);
@@ -404,7 +402,7 @@ void Manager::downloadAvailableDefinitionsMetaData()
void Manager::downloadAvailableDefinitionsListFinished()
{
- if (QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender())) {
+ if (auto reply = qobject_cast<QNetworkReply *>(sender())) {
if (reply->error() == QNetworkReply::NoError)
emit definitionsMetaDataReady(parseAvailableDefinitionsList(reply));
else
@@ -425,7 +423,7 @@ void MultiDefinitionDownloader::downloadDefinitions(const QList<QUrl> &urls)
{
m_downloaders.clear();
foreach (const QUrl &url, urls) {
- DefinitionDownloader *downloader = new DefinitionDownloader(url, m_downloadPath);
+ auto downloader = new DefinitionDownloader(url, m_downloadPath);
connect(downloader, &DefinitionDownloader::foundReferencedDefinition,
this, &MultiDefinitionDownloader::downloadReferencedDefinition);
m_downloaders.append(downloader);
@@ -479,7 +477,7 @@ void MultiDefinitionDownloader::downloadDefinitionsFinished()
void Manager::downloadDefinitionsFinished()
{
delete m_multiDownloader;
- m_multiDownloader = 0;
+ m_multiDownloader = nullptr;
}
void MultiDefinitionDownloader::downloadReferencedDefinition(const QString &name)
@@ -492,7 +490,7 @@ void MultiDefinitionDownloader::downloadReferencedDefinition(const QString &name
bool Manager::isDownloadingDefinitions() const
{
- return m_multiDownloader != 0;
+ return m_multiDownloader != nullptr;
}
void Manager::clear()
diff --git a/src/plugins/texteditor/generichighlighter/manager.h b/src/plugins/texteditor/generichighlighter/manager.h
index 133c612efc..18a6c3016f 100644
--- a/src/plugins/texteditor/generichighlighter/manager.h
+++ b/src/plugins/texteditor/generichighlighter/manager.h
@@ -97,7 +97,7 @@ private:
void clear();
- MultiDefinitionDownloader *m_multiDownloader;
+ MultiDefinitionDownloader *m_multiDownloader = nullptr;
QList<DefinitionMetaDataPtr> parseAvailableDefinitionsList(QIODevice *device);
QSet<QString> m_isBuildingDefinition;
@@ -105,7 +105,7 @@ private:
QHash<QString, DefinitionMetaDataPtr> m_availableDefinitions;
RegisterData m_register;
- bool m_hasQueuedRegistration;
+ bool m_hasQueuedRegistration = false;
QFutureWatcher<RegisterData> m_registeringWatcher;
friend class ManagerProcessor;
diff --git a/src/plugins/texteditor/generichighlighter/specificrules.h b/src/plugins/texteditor/generichighlighter/specificrules.h
index c4a76e0771..aa9178a596 100644
--- a/src/plugins/texteditor/generichighlighter/specificrules.h
+++ b/src/plugins/texteditor/generichighlighter/specificrules.h
@@ -42,16 +42,14 @@ class HighlightDefinition;
class DetectCharRule : public DynamicRule
{
public:
- virtual ~DetectCharRule() {}
+ ~DetectCharRule() override {}
void setChar(const QString &character);
private:
- virtual bool doMatchSucceed(const QString &text,
- const int length,
- ProgressData *progress);
- virtual DetectCharRule *doClone() const { return new DetectCharRule(*this); }
- virtual void doReplaceExpressions(const QStringList &captures);
+ bool doMatchSucceed(const QString &text, const int length, ProgressData *progress) override;
+ DetectCharRule *doClone() const override { return new DetectCharRule(*this); }
+ void doReplaceExpressions(const QStringList &captures) override;
QChar m_char;
};
@@ -59,17 +57,15 @@ private:
class Detect2CharsRule : public DynamicRule
{
public:
- virtual ~Detect2CharsRule() {}
+ ~Detect2CharsRule() override {}
void setChar(const QString &character);
void setChar1(const QString &character);
private:
- virtual bool doMatchSucceed(const QString &text,
- const int length,
- ProgressData *progress);
- virtual Detect2CharsRule *doClone() const { return new Detect2CharsRule(*this); }
- virtual void doReplaceExpressions(const QStringList &captures);
+ bool doMatchSucceed(const QString &text, const int length, ProgressData *progress) override;
+ Detect2CharsRule *doClone() const override { return new Detect2CharsRule(*this); }
+ void doReplaceExpressions(const QStringList &captures) override;
QChar m_char;
QChar m_char1;
@@ -78,15 +74,13 @@ private:
class AnyCharRule : public Rule
{
public:
- virtual ~AnyCharRule() {}
+ ~AnyCharRule() override {}
void setCharacterSet(const QString &s);
private:
- virtual bool doMatchSucceed(const QString &text,
- const int length,
- ProgressData *progress);
- virtual AnyCharRule *doClone() const { return new AnyCharRule(*this); }
+ bool doMatchSucceed(const QString &text, const int length, ProgressData *progress) override;
+ AnyCharRule *doClone() const override { return new AnyCharRule(*this); }
QString m_characterSet;
};
@@ -94,17 +88,15 @@ private:
class StringDetectRule : public DynamicRule
{
public:
- virtual ~StringDetectRule() {}
+ ~StringDetectRule() override {}
void setString(const QString &s);
void setInsensitive(const QString &insensitive);
protected:
- virtual bool doMatchSucceed(const QString &text,
- const int length,
- ProgressData *progress);
- virtual StringDetectRule *doClone() const { return new StringDetectRule(*this); }
- virtual void doReplaceExpressions(const QStringList &captures);
+ bool doMatchSucceed(const QString &text, const int length, ProgressData *progress) override;
+ StringDetectRule *doClone() const override { return new StringDetectRule(*this); }
+ void doReplaceExpressions(const QStringList &captures) override;
QString m_string;
int m_length = 0;
@@ -114,28 +106,24 @@ protected:
class WordDetectRule : public StringDetectRule
{
private:
- virtual bool doMatchSucceed(const QString &text,
- const int length,
- ProgressData *progress);
- virtual WordDetectRule *doClone() const { return new WordDetectRule(*this); }
+ bool doMatchSucceed(const QString &text, const int length, ProgressData *progress) override;
+ WordDetectRule *doClone() const override { return new WordDetectRule(*this); }
};
class RegExprRule : public DynamicRule
{
public:
- virtual ~RegExprRule();
+ ~RegExprRule() override;
void setPattern(const QString &pattern);
void setInsensitive(const QString &insensitive);
void setMinimal(const QString &minimal);
private:
- virtual bool doMatchSucceed(const QString &text,
- const int length,
- ProgressData *progress);
- virtual RegExprRule *doClone() const;
- virtual void doReplaceExpressions(const QStringList &captures);
- virtual void doProgressFinished();
+ bool doMatchSucceed(const QString &text, const int length, ProgressData *progress) override;
+ RegExprRule *doClone() const override;
+ void doReplaceExpressions(const QStringList &captures) override;
+ void doProgressFinished() override;
bool isExactMatch(ProgressData *progress);
@@ -152,16 +140,14 @@ class KeywordRule : public Rule
{
public:
KeywordRule(const QSharedPointer<HighlightDefinition> &definition);
- virtual ~KeywordRule();
+ ~KeywordRule() override;
void setInsensitive(const QString &insensitive);
void setList(const QString &listName);
private:
- virtual bool doMatchSucceed(const QString &text,
- const int length,
- ProgressData *progress);
- virtual KeywordRule *doClone() const { return new KeywordRule(*this); }
+ bool doMatchSucceed(const QString &text, const int length, ProgressData *progress) override;
+ KeywordRule *doClone() const override { return new KeywordRule(*this); }
bool m_overrideGlobal;
Qt::CaseSensitivity m_localCaseSensitivity;
@@ -171,88 +157,74 @@ private:
class IntRule : public Rule
{
public:
- virtual ~IntRule() {}
+ ~IntRule() override {}
private:
- virtual bool doMatchSucceed(const QString &text,
- const int length,
- ProgressData *progress);
- virtual IntRule *doClone() const { return new IntRule(*this); }
+ bool doMatchSucceed(const QString &text, const int length, ProgressData *progress) override;
+ IntRule *doClone() const override { return new IntRule(*this); }
};
class FloatRule : public Rule
{
public:
- virtual ~FloatRule() {}
+ ~FloatRule() override {}
private:
- virtual bool doMatchSucceed(const QString &text,
- const int length,
- ProgressData *progress);
- virtual FloatRule *doClone() const { return new FloatRule(*this); }
+ bool doMatchSucceed(const QString &text, const int length, ProgressData *progress) override;
+ FloatRule *doClone() const override { return new FloatRule(*this); }
};
class HlCOctRule : public Rule
{
public:
- virtual ~HlCOctRule() {}
+ ~HlCOctRule() override {}
private:
- virtual bool doMatchSucceed(const QString &text,
- const int length,
- ProgressData *progress);
- virtual HlCOctRule *doClone() const { return new HlCOctRule(*this); }
+ bool doMatchSucceed(const QString &text, const int length, ProgressData *progress) override;
+ HlCOctRule *doClone() const override { return new HlCOctRule(*this); }
};
class HlCHexRule : public Rule
{
public:
- virtual ~HlCHexRule() {}
+ ~HlCHexRule() override {}
private:
- virtual bool doMatchSucceed(const QString &text,
- const int length,
- ProgressData *progress);
- virtual HlCHexRule *doClone() const { return new HlCHexRule(*this); }
+ bool doMatchSucceed(const QString &text, const int length, ProgressData *progress) override;
+ HlCHexRule *doClone() const override { return new HlCHexRule(*this); }
};
class HlCStringCharRule : public Rule
{
public:
- virtual ~HlCStringCharRule() {}
+ ~HlCStringCharRule() override {}
private:
- virtual bool doMatchSucceed(const QString &text,
- const int length,
- ProgressData *progress);
- virtual HlCStringCharRule *doClone() const { return new HlCStringCharRule(*this); }
+ bool doMatchSucceed(const QString &text, const int length, ProgressData *progress) override;
+ HlCStringCharRule *doClone() const override { return new HlCStringCharRule(*this); }
};
class HlCCharRule : public Rule
{
public:
- virtual ~HlCCharRule() {}
+ ~HlCCharRule() override {}
private:
- virtual bool doMatchSucceed(const QString &text,
- const int length,
- ProgressData *progress);
- virtual HlCCharRule *doClone() const { return new HlCCharRule(*this); }
+ bool doMatchSucceed(const QString &text, const int length, ProgressData *progress) override;
+ HlCCharRule *doClone() const override { return new HlCCharRule(*this); }
};
class RangeDetectRule : public Rule
{
public:
- virtual ~RangeDetectRule() {}
+ ~RangeDetectRule() override {}
void setChar(const QString &character);
void setChar1(const QString &character);
private:
- virtual bool doMatchSucceed(const QString &text,
- const int length,
- ProgressData *progress);
- virtual RangeDetectRule *doClone() const { return new RangeDetectRule(*this); }
+ bool doMatchSucceed(const QString &text, const int length, ProgressData *progress) override;
+ RangeDetectRule *doClone() const override { return new RangeDetectRule(*this); }
QChar m_char;
QChar m_char1;
@@ -261,38 +233,32 @@ private:
class LineContinueRule : public Rule
{
public:
- virtual ~LineContinueRule() {}
+ ~LineContinueRule() override {}
private:
- virtual bool doMatchSucceed(const QString &text,
- const int length,
- ProgressData *progress);
- virtual LineContinueRule *doClone() const { return new LineContinueRule(*this); }
+ bool doMatchSucceed(const QString &text, const int length, ProgressData *progress) override;
+ LineContinueRule *doClone() const override { return new LineContinueRule(*this); }
};
class DetectSpacesRule : public Rule
{
public:
DetectSpacesRule();
- virtual ~DetectSpacesRule() {}
+ ~DetectSpacesRule() override {}
private:
- virtual bool doMatchSucceed(const QString &text,
- const int length,
- ProgressData *progress);
- virtual DetectSpacesRule *doClone() const { return new DetectSpacesRule(*this); }
+ bool doMatchSucceed(const QString &text, const int length, ProgressData *progress) override;
+ DetectSpacesRule *doClone() const override { return new DetectSpacesRule(*this); }
};
class DetectIdentifierRule : public Rule
{
public:
- virtual ~DetectIdentifierRule() {}
+ ~DetectIdentifierRule() override {}
private:
- virtual bool doMatchSucceed(const QString &text,
- const int length,
- ProgressData *progress);
- virtual DetectIdentifierRule *doClone() const { return new DetectIdentifierRule(*this); }
+ bool doMatchSucceed(const QString &text, const int length, ProgressData *progress) override;
+ DetectIdentifierRule *doClone() const override { return new DetectIdentifierRule(*this); }
};
} // namespace Internal