diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2021-02-13 19:34:13 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2021-02-20 19:17:51 (GMT) |
commit | 7974279bd1da213244a527db16f0504355c1e074 (patch) | |
tree | 02365050579023b5b56edd8339678ec7e91004f4 /src | |
parent | bb25ca2abcce26688af658c088a6f4c73b030089 (diff) | |
download | Doxygen-7974279bd1da213244a527db16f0504355c1e074.zip Doxygen-7974279bd1da213244a527db16f0504355c1e074.tar.gz Doxygen-7974279bd1da213244a527db16f0504355c1e074.tar.bz2 |
Refactoring: replace QRegExp by std::regex in groupdef.cpp
Diffstat (limited to 'src')
-rw-r--r-- | src/groupdef.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/groupdef.cpp b/src/groupdef.cpp index b900148..3fdb9fb 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -17,9 +17,9 @@ #include <algorithm> #include <vector> +#include <regex> #include <ctype.h> -#include <qregexp.h> #include "groupdef.h" #include "classdef.h" @@ -1090,12 +1090,15 @@ void GroupDefImpl::writeDocumentation(OutputList &ol) if (Doxygen::searchIndex) { Doxygen::searchIndex->setCurrentDoc(this,anchor(),FALSE); - static QRegExp we("[a-zA-Z_][-a-zA-Z_0-9]*"); - int i=0,p=0,l=0; - while ((i=we.match(m_title,p,&l))!=-1) // foreach word in the title + static std::regex we("[[:alpha:]_][[:alnum:]_\\-]*"); + std::string title = m_title.str(); + std::sregex_iterator it(title.begin(),title.end(),we); + std::sregex_iterator end; + for (; it!=end ; ++it) { - Doxygen::searchIndex->addWord(m_title.mid(i,l),TRUE); - p=i+l; + const auto &match = *it; + std::string matchStr = match.str(); + Doxygen::searchIndex->addWord(matchStr.c_str(),TRUE); } } |