summaryrefslogtreecommitdiffstats
path: root/libkmime/kmime_parsers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libkmime/kmime_parsers.cpp')
-rw-r--r--libkmime/kmime_parsers.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/libkmime/kmime_parsers.cpp b/libkmime/kmime_parsers.cpp
index a7f758bf0..bd07c2375 100644
--- a/libkmime/kmime_parsers.cpp
+++ b/libkmime/kmime_parsers.cpp
@@ -39,7 +39,7 @@ bool MultiPart::parse()
//find the first valid boundary
while(1) {
- if( (pos1=s_rc.tqfind(b.data(), pos1))==-1 || pos1==0 || s_rc[pos1-1]=='\n' ) //valid boundary found or no boundary at all
+ if( (pos1=s_rc.find(b.data(), pos1))==-1 || pos1==0 || s_rc[pos1-1]=='\n' ) //valid boundary found or no boundary at all
break;
pos1+=blen; //boundary found but not valid => skip it;
}
@@ -56,11 +56,11 @@ bool MultiPart::parse()
while(pos1>-1 && pos2>-1) {
//skip the rest of the line for the first boundary - the message-part starts here
- if( (pos1=s_rc.tqfind('\n', pos1))>-1 ) { //now search the next linebreak
+ if( (pos1=s_rc.find('\n', pos1))>-1 ) { //now search the next linebreak
//now find the next valid boundary
pos2=++pos1; //pos1 and pos2 point now to the beginning of the next line after the boundary
while(1) {
- if( (pos2=s_rc.tqfind(b.data(), pos2))==-1 || s_rc[pos2-1]=='\n' ) //valid boundary or no more boundaries found
+ if( (pos2=s_rc.find(b.data(), pos2))==-1 || s_rc[pos2-1]=='\n' ) //valid boundary or no more boundaries found
break;
pos2+=blen; //boundary is invalid => skip it;
}
@@ -77,7 +77,7 @@ bool MultiPart::parse()
pos2+=blen; //pos2 points now to the first charakter after the boundary
if(s_rc[pos2]=='-' && s_rc[pos2+1]=='-') { //end-boundary
pos1=pos2+2; //pos1 points now to the character directly after the end-boundary
- if( (pos1=s_rc.tqfind('\n', pos1))>-1 ) //skipt the rest of this line
+ if( (pos1=s_rc.find('\n', pos1))>-1 ) //skipt the rest of this line
e_pilouge=s_rc.mid(pos1+1, s_rc.length()-pos1-1); //everything after the end-boundary is considered as the epilouge
pos1=-1;
pos2=-1; //break
@@ -108,7 +108,7 @@ TQCString NonMimeParser::guessMimeType(const TQCString& fileName)
int pos;
if(!fileName.isEmpty()) {
- pos=fileName.tqfindRev('.');
+ pos=fileName.findRev('.');
if(pos++ != -1) {
tmp=fileName.mid(pos, fileName.length()-pos).upper();
if(tmp=="JPG" || tmp=="JPEG") mimeType="image/jpeg";
@@ -152,9 +152,9 @@ bool UUEncoded::parse()
bool containsBegin=false, containsEnd=false;
TQCString tmp,fileName;
- if( (beginPos=s_rc.tqfind(TQRegExp("begin [0-9][0-9][0-9]"),currentPos))>-1 && (beginPos==0 || s_rc.at(beginPos-1)=='\n') ) {
+ if( (beginPos=s_rc.find(TQRegExp("begin [0-9][0-9][0-9]"),currentPos))>-1 && (beginPos==0 || s_rc.at(beginPos-1)=='\n') ) {
containsBegin=true;
- uuStart=s_rc.tqfind('\n', beginPos);
+ uuStart=s_rc.find('\n', beginPos);
if(uuStart==-1) {//no more line breaks found, we give up
success = false;
break;
@@ -163,7 +163,7 @@ bool UUEncoded::parse()
}
else beginPos=currentPos;
- if ( (endPos=s_rc.tqfind("\nend",(uuStart>0)? uuStart-1:0))==-1 )
+ if ( (endPos=s_rc.find("\nend",(uuStart>0)? uuStart-1:0))==-1 )
endPos=s_rc.length(); //no end found
else
containsEnd=true;
@@ -194,7 +194,7 @@ bool UUEncoded::parse()
len=rx.matchedLength();
if(pos!=-1) {
tmp=s_ubject.mid(pos, len);
- pos=tmp.tqfind('/');
+ pos=tmp.find('/');
p_artNr=tmp.left(pos).toInt();
t_otalNr=tmp.right(tmp.length()-pos-1).toInt();
} else {
@@ -216,7 +216,7 @@ bool UUEncoded::parse()
m_imeTypes.append(guessMimeType(fileName));
firstIteration=false;
- int next = s_rc.tqfind('\n', endPos+1);
+ int next = s_rc.find('\n', endPos+1);
if(next==-1) { //no more line breaks found, we give up
success = false;
break;
@@ -249,19 +249,19 @@ bool YENCEncoded::yencMeta(TQCString& src, const TQCString& name, int* value)
bool found = false;
TQCString sought=name + "=";
- int iPos=src.tqfind( sought.data() );
+ int iPos=src.find( sought.data() );
if (iPos>-1) {
- int pos1=src.tqfind(' ', iPos);
- int pos2=src.tqfind('\r', iPos);
- int pos3=src.tqfind('\t', iPos);
- int pos4=src.tqfind('\n', iPos);
+ int pos1=src.find(' ', iPos);
+ int pos2=src.find('\r', iPos);
+ int pos3=src.find('\t', iPos);
+ int pos4=src.find('\n', iPos);
if (pos2>=0 && (pos1<0 || pos1>pos2))
pos1=pos2;
if (pos3>=0 && (pos1<0 || pos1>pos3))
pos1=pos3;
if (pos4>=0 && (pos1<0 || pos1>pos4))
pos1=pos4;
- iPos=src.tqfindRev( '=', pos1)+1;
+ iPos=src.findRev( '=', pos1)+1;
if (iPos<pos1) {
char c=src.at( iPos);
if ( c>='0' && c<='9') {
@@ -284,16 +284,16 @@ bool YENCEncoded::parse()
bool containsPart=false;
TQCString fileName,mimeType;
- if ((beginPos=s_rc.tqfind("=ybegin ", currentPos))>-1 && ( beginPos==0 || s_rc.at( beginPos-1)=='\n') ) {
- yencStart=s_rc.tqfind( '\n', beginPos);
+ if ((beginPos=s_rc.find("=ybegin ", currentPos))>-1 && ( beginPos==0 || s_rc.at( beginPos-1)=='\n') ) {
+ yencStart=s_rc.find( '\n', beginPos);
if (yencStart==-1) { // no more line breaks found, give up
success = false;
break;
} else {
yencStart++;
- if (s_rc.tqfind("=ypart", yencStart)==yencStart) {
+ if (s_rc.find("=ypart", yencStart)==yencStart) {
containsPart=true;
- yencStart=s_rc.tqfind( '\n', yencStart);
+ yencStart=s_rc.find( '\n', yencStart);
if ( yencStart== -1) {
success=false;
break;
@@ -305,14 +305,14 @@ bool YENCEncoded::parse()
// Filenames can contain any embedded chars until end of line
TQCString meta=s_rc.mid(beginPos, yencStart-beginPos);
- int namePos=meta.tqfind("name=");
+ int namePos=meta.find("name=");
if (namePos== -1) {
success=false;
break;
}
- int eolPos=meta.tqfind('\r', namePos);
+ int eolPos=meta.find('\r', namePos);
if (eolPos== -1)
- eolPos=meta.tqfind('\n', namePos);
+ eolPos=meta.find('\n', namePos);
if (eolPos== -1) {
success=false;
break;
@@ -424,7 +424,7 @@ bool YENCEncoded::parse()
}
// pos now points to =yend; get end data
- eolPos=s_rc.tqfind('\n', pos);
+ eolPos=s_rc.find('\n', pos);
if (eolPos== -1)
{
success=false;