summaryrefslogtreecommitdiffstats
path: root/kbabel/common/regexpextractor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kbabel/common/regexpextractor.cpp')
-rw-r--r--kbabel/common/regexpextractor.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/kbabel/common/regexpextractor.cpp b/kbabel/common/regexpextractor.cpp
index b69398c6..058834ea 100644
--- a/kbabel/common/regexpextractor.cpp
+++ b/kbabel/common/regexpextractor.cpp
@@ -35,18 +35,18 @@
#include "regexpextractor.h"
#include <kdebug.h>
-#include <qregexp.h>
+#include <tqregexp.h>
using namespace KBabel;
-RegExpExtractor::RegExpExtractor(const QStringList& regexps) :
+RegExpExtractor::RegExpExtractor(const TQStringList& regexps) :
_regExpList( regexps )
{
- _string=QString::null;
+ _string=TQString::null;
_matches.setAutoDelete(true);
}
-void RegExpExtractor::setString(QString string)
+void RegExpExtractor::setString(TQString string)
{
_string=string;
processString();
@@ -57,17 +57,17 @@ uint RegExpExtractor::countMatches()
return _matches.count();
}
-QString RegExpExtractor::firstMatch()
+TQString RegExpExtractor::firstMatch()
{
MatchedEntryInfo *ti = _matches.first();
if(ti)
return ti->extracted;
- return QString::null;
+ return TQString::null;
}
-QString RegExpExtractor::nextMatch()
+TQString RegExpExtractor::nextMatch()
{
MatchedEntryInfo *ti=_matches.next();
if(!ti)
@@ -76,16 +76,16 @@ QString RegExpExtractor::nextMatch()
if(ti)
return ti->extracted;
- return QString::null;
+ return TQString::null;
}
-QString RegExpExtractor::match(uint tagnumber)
+TQString RegExpExtractor::match(uint tagnumber)
{
MatchedEntryInfo *ti=_matches.at(tagnumber);
if(ti)
return ti->extracted;
- return QString::null;
+ return TQString::null;
}
int RegExpExtractor::matchIndex(uint tagnumber)
@@ -97,27 +97,27 @@ int RegExpExtractor::matchIndex(uint tagnumber)
return -1;
}
-QString RegExpExtractor::prevMatch()
+TQString RegExpExtractor::prevMatch()
{
MatchedEntryInfo *ti=_matches.prev();
if(ti)
return ti->extracted;
- return QString::null;
+ return TQString::null;
}
-QString RegExpExtractor::lastMatch()
+TQString RegExpExtractor::lastMatch()
{
MatchedEntryInfo *ti=_matches.last();
if(ti)
return ti->extracted;
- return QString::null;
+ return TQString::null;
}
-QStringList RegExpExtractor::matches()
+TQStringList RegExpExtractor::matches()
{
- QStringList list;
+ TQStringList list;
MatchedEntryInfo *ti;
for(ti=_matches.first(); ti!=0; ti = _matches.next())
{
@@ -127,15 +127,15 @@ QStringList RegExpExtractor::matches()
return list;
}
-QString RegExpExtractor::plainString(bool keepPos)
+TQString RegExpExtractor::plainString(bool keepPos)
{
- QString tmp=_string;
+ TQString tmp=_string;
MatchedEntryInfo *ti;
for(ti=_matches.first(); ti != 0; ti=_matches.next())
{
uint len=ti->extracted.length();
- QString s;
+ TQString s;
for(uint i=0; i<len; i++)
{
s+=' ';
@@ -151,9 +151,9 @@ QString RegExpExtractor::plainString(bool keepPos)
return tmp;
}
-QString RegExpExtractor::matchesReplaced(const QString& replace)
+TQString RegExpExtractor::matchesReplaced(const TQString& replace)
{
- QString tmp=_string;
+ TQString tmp=_string;
int posCorrection=0;
int replaceLen=replace.length();
@@ -177,20 +177,20 @@ void RegExpExtractor::processString()
// if there is no regexp to be matched, quit
if( regExpList().empty() ) return;
- QValueList<MatchedEntryInfo> tmpList;
+ TQValueList<MatchedEntryInfo> tmpList;
bool found=false;
- QString tmp=_string;
+ TQString tmp=_string;
do
{
found=false;
- QStringList::Iterator it;
+ TQStringList::Iterator it;
for(it=_regExpList.begin();it!=_regExpList.end();++it)
{
int pos=-1;
- QString tag;
+ TQString tag;
- QRegExp reg = QRegExp((*it));
+ TQRegExp reg = TQRegExp((*it));
pos = reg.search(tmp);
int len=reg.matchedLength();
@@ -208,7 +208,7 @@ void RegExpExtractor::processString()
ti.extracted=tag;
tmpList.append(ti);
- QString s;
+ TQString s;
for(uint i=0; i<tag.length(); i++)
{
s+=' ';
@@ -228,7 +228,7 @@ void RegExpExtractor::processString()
uint n= 0;
uint min=_string.length();
uint counter=0;
- QValueList<MatchedEntryInfo>::Iterator it;
+ TQValueList<MatchedEntryInfo>::Iterator it;
for(it=tmpList.begin();it!=tmpList.end();++it)
{
if((*it).index < min)
@@ -249,22 +249,22 @@ void RegExpExtractor::processString()
}
}
-QStringList RegExpExtractor::regExpList()
+TQStringList RegExpExtractor::regExpList()
{
return _regExpList;
}
-void RegExpExtractor::setRegExpList( const QStringList& regexps )
+void RegExpExtractor::setRegExpList( const TQStringList& regexps )
{
_regExpList = regexps;
}
-void RegExpExtractor::addRegExpIdentifier(QString regExp)
+void RegExpExtractor::addRegExpIdentifier(TQString regExp)
{
_regExpList.append(regExp);
}
-void RegExpExtractor::deleteRegExpIdentifier(QString regExp)
+void RegExpExtractor::deleteRegExpIdentifier(TQString regExp)
{
_regExpList.remove(regExp);
}