summaryrefslogtreecommitdiffstats
path: root/libkmime/kmime_headers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libkmime/kmime_headers.cpp')
-rw-r--r--libkmime/kmime_headers.cpp324
1 files changed, 162 insertions, 162 deletions
diff --git a/libkmime/kmime_headers.cpp b/libkmime/kmime_headers.cpp
index 7ae5b95bf..d4557c122 100644
--- a/libkmime/kmime_headers.cpp
+++ b/libkmime/kmime_headers.cpp
@@ -25,11 +25,11 @@
#include "kqcstringsplitter.h"
-#include <qtextcodec.h>
-#include <qstring.h>
-#include <qcstring.h>
-#include <qstringlist.h>
-#include <qvaluelist.h>
+#include <tqtextcodec.h>
+#include <tqstring.h>
+#include <tqcstring.h>
+#include <tqstringlist.h>
+#include <tqvaluelist.h>
#include <kglobal.h>
#include <kcharsets.h>
@@ -47,16 +47,16 @@ namespace KMime {
namespace Headers {
//-----<Base>----------------------------------
-QCString Base::rfc2047Charset()
+TQCString Base::rfc2047Charset()
{
if( (e_ncCS==0) || forceCS() )
return defaultCS();
else
- return QCString(e_ncCS);
+ return TQCString(e_ncCS);
}
-void Base::setRFC2047Charset(const QCString &cs)
+void Base::setRFC2047Charset(const TQCString &cs)
{
e_ncCS=cachedCharset(cs);
}
@@ -68,7 +68,7 @@ bool Base::forceCS()
}
-QCString Base::defaultCS()
+TQCString Base::defaultCS()
{
return ( p_arent!=0 ? p_arent->defaultCharset() : Latin1 );
}
@@ -80,14 +80,14 @@ namespace Generics {
//-----<GUnstructured>-------------------------
-void GUnstructured::from7BitString( const QCString & str )
+void GUnstructured::from7BitString( const TQCString & str )
{
d_ecoded = decodeRFC2047String( str, &e_ncCS, defaultCS(), forceCS() );
}
-QCString GUnstructured::as7BitString( bool withHeaderType )
+TQCString GUnstructured::as7BitString( bool withHeaderType )
{
- QCString result;
+ TQCString result;
if ( withHeaderType )
result = typeIntro();
result += encodeRFC2047String( d_ecoded, e_ncCS ) ;
@@ -95,14 +95,14 @@ QCString GUnstructured::as7BitString( bool withHeaderType )
return result;
}
-void GUnstructured::fromUnicodeString( const QString & str,
- const QCString & suggestedCharset )
+void GUnstructured::fromUnicodeString( const TQString & str,
+ const TQCString & suggestedCharset )
{
d_ecoded = str;
e_ncCS = cachedCharset( suggestedCharset );
}
-QString GUnstructured::asUnicodeString()
+TQString GUnstructured::asUnicodeString()
{
return d_ecoded;
}
@@ -134,14 +134,14 @@ bool MailboxList::parse( const char* & scursor, const char * const send,
// sender := "Sender:" mailbox CRLF
// parse an address-list:
- QValueList<Address> maybeAddressList;
+ TQValueList<Address> maybeAddressList;
if ( !parseAddressList( scursor, send, maybeAddressList, isCRLF ) )
return false;
mMailboxList.clear();
// extract the mailboxes and complain if there are groups:
- QValueList<Address>::Iterator it;
+ TQValueList<Address>::Iterator it;
for ( it = maybeAddressList.begin(); it != maybeAddressList.end() ; ++it ) {
if ( !(*it).displayName.isEmpty() ) {
KMIME_WARN << "mailbox groups in header disallowing them! Name: \""
@@ -178,7 +178,7 @@ bool SingleMailbox::parse( const char* & scursor, const char * const send,
bool AddressList::parse( const char* & scursor, const char * const send,
bool isCRLF ) {
- QValueList<Address> maybeAddressList;
+ TQValueList<Address> maybeAddressList;
if ( !parseAddressList( scursor, send, maybeAddressList, isCRLF ) )
return false;
@@ -202,7 +202,7 @@ bool GToken::parse( const char* & scursor, const char * const send,
QPair<const char*,int> maybeToken;
if ( !parseToken( scursor, send, maybeToken, false /* no 8bit chars */ ) )
return false;
- mToken = QCString( maybeToken.first, maybeToken.second );
+ mToken = TQCString( maybeToken.first, maybeToken.second );
// complain if trailing garbage is found:
eatCFWS( scursor, send, isCRLF );
@@ -231,7 +231,7 @@ bool GPhraseList::parse( const char* & scursor, const char * const send,
// empty entry: ignore.
if ( *scursor != ',' ) { scursor++; continue; }
- QString maybePhrase;
+ TQString maybePhrase;
if ( !parsePhrase( scursor, send, maybePhrase, isCRLF ) )
return false;
mPhraseList.append( maybePhrase );
@@ -254,7 +254,7 @@ bool GPhraseList::parse( const char* & scursor, const char * const send,
bool GDotAtom::parse( const char* & scursor, const char * const send,
bool isCRLF ) {
- QString maybeDotAtom;
+ TQString maybeDotAtom;
if ( !parseDotAtom( scursor, send, maybeDotAtom, isCRLF ) )
return false;
@@ -304,7 +304,7 @@ bool GContentType::parse( const char* & scursor, const char * const send,
if ( !parseToken( scursor, send, maybeMimeType, false /* no 8Bit */ ) )
return false;
- mMimeType = QCString( maybeMimeType.first, maybeMimeType.second ).lower();
+ mMimeType = TQCString( maybeMimeType.first, maybeMimeType.second ).lower();
//
// subtype
@@ -320,7 +320,7 @@ bool GContentType::parse( const char* & scursor, const char * const send,
if ( !parseToken( scursor, send, maybeSubType, false /* no 8bit */ ) )
return false;
- mMimeSubType = QCString( maybeSubType.first, maybeSubType.second ).lower();
+ mMimeSubType = TQCString( maybeSubType.first, maybeSubType.second ).lower();
//
// parameter list
@@ -361,7 +361,7 @@ bool GCISTokenWithParameterList::parse( const char* & scursor,
if ( !parseToken( scursor, send, maybeToken, false /* no 8Bit */ ) )
return false;
- mToken = QCString( maybeToken.first, maybeToken.second ).lower();
+ mToken = TQCString( maybeToken.first, maybeToken.second ).lower();
//
// parameter list
@@ -463,7 +463,7 @@ bool ReturnPath::parse( const char* & scursor, const char * const send, bool isC
// prepare a Null mailbox:
AddrSpec emptyAddrSpec;
- maybeMailbox.displayName = QString::null;
+ maybeMailbox.displayName = TQString::null;
maybeMailbox.addrSpec = emptyAddrSpec;
} else
// check that there was no display-name:
@@ -506,13 +506,13 @@ void Generic::setType(const char *type)
#if !defined(KMIME_NEW_STYLE_CLASSTREE)
//-----<MessageID>-----------------------------
-void MessageID::from7BitString(const QCString &s)
+void MessageID::from7BitString(const TQCString &s)
{
m_id=s;
}
-QCString MessageID::as7BitString(bool incType)
+TQCString MessageID::as7BitString(bool incType)
{
if(incType)
return ( typeIntro()+m_id );
@@ -521,19 +521,19 @@ QCString MessageID::as7BitString(bool incType)
}
-void MessageID::fromUnicodeString(const QString &s, const QCString&)
+void MessageID::fromUnicodeString(const TQString &s, const TQCString&)
{
m_id=s.latin1(); //Message-Ids can only contain us-ascii chars
}
-QString MessageID::asUnicodeString()
+TQString MessageID::asUnicodeString()
{
- return QString::fromLatin1(m_id);
+ return TQString::fromLatin1(m_id);
}
-void MessageID::generate(const QCString &fqdn)
+void MessageID::generate(const TQCString &fqdn)
{
m_id="<"+uniqueString()+"@"+fqdn+">";
}
@@ -544,13 +544,13 @@ void MessageID::generate(const QCString &fqdn)
//-----<Control>-------------------------------
-void Control::from7BitString(const QCString &s)
+void Control::from7BitString(const TQCString &s)
{
c_trlMsg=s;
}
-QCString Control::as7BitString(bool incType)
+TQCString Control::as7BitString(bool incType)
{
if(incType)
return ( typeIntro()+c_trlMsg );
@@ -559,15 +559,15 @@ QCString Control::as7BitString(bool incType)
}
-void Control::fromUnicodeString(const QString &s, const QCString&)
+void Control::fromUnicodeString(const TQString &s, const TQCString&)
{
c_trlMsg=s.latin1();
}
-QString Control::asUnicodeString()
+TQString Control::asUnicodeString()
{
- return QString::fromLatin1(c_trlMsg);
+ return TQString::fromLatin1(c_trlMsg);
}
//-----</Control>------------------------------
@@ -576,15 +576,15 @@ QString Control::asUnicodeString()
#if !defined(KMIME_NEW_STYLE_CLASSTREE)
//-----<AddressField>--------------------------
-void AddressField::from7BitString(const QCString &s)
+void AddressField::from7BitString(const TQCString &s)
{
int pos1=0, pos2=0, type=0;
- QCString n;
+ TQCString n;
//so what do we have here ?
- if(s.find( QRegExp("*@*(*)", false, true) )!=-1) type=2; // From: [email protected] (John Doe)
- else if(s.find( QRegExp("*<*@*>", false, true) )!=-1) type=1; // From: John Doe <[email protected]>
- else if(s.find( QRegExp("*@*", false, true) )!=-1) type=0; // From: [email protected]
+ if(s.find( TQRegExp("*@*(*)", false, true) )!=-1) type=2; // From: [email protected] (John Doe)
+ else if(s.find( TQRegExp("*<*@*>", false, true) )!=-1) type=1; // From: John Doe <[email protected]>
+ else if(s.find( TQRegExp("*@*", false, true) )!=-1) type=0; // From: [email protected]
else { //broken From header => just decode it
n_ame=decodeRFC2047String(s, &e_ncCS, defaultCS(), forceCS());
return;
@@ -631,9 +631,9 @@ void AddressField::from7BitString(const QCString &s)
}
-QCString AddressField::as7BitString(bool incType)
+TQCString AddressField::as7BitString(bool incType)
{
- QCString ret;
+ TQCString ret;
if(incType && type()[0]!='\0')
ret=typeIntro();
@@ -642,7 +642,7 @@ QCString AddressField::as7BitString(bool incType)
ret+=e_mail;
else {
if (isUsAscii(n_ame)) {
- QCString tmp(n_ame.latin1());
+ TQCString tmp(n_ame.latin1());
addQuotes(tmp, false);
ret+=tmp;
} else {
@@ -656,17 +656,17 @@ QCString AddressField::as7BitString(bool incType)
}
-void AddressField::fromUnicodeString(const QString &s, const QCString &cs)
+void AddressField::fromUnicodeString(const TQString &s, const TQCString &cs)
{
int pos1=0, pos2=0, type=0;
- QCString n;
+ TQCString n;
e_ncCS=cachedCharset(cs);
//so what do we have here ?
- if(s.find( QRegExp("*@*(*)", false, true) )!=-1) type=2; // From: [email protected] (John Doe)
- else if(s.find( QRegExp("*<*@*>", false, true) )!=-1) type=1; // From: John Doe <[email protected]>
- else if(s.find( QRegExp("*@*", false, true) )!=-1) type=0; // From: [email protected]
+ if(s.find( TQRegExp("*@*(*)", false, true) )!=-1) type=2; // From: [email protected] (John Doe)
+ else if(s.find( TQRegExp("*<*@*>", false, true) )!=-1) type=1; // From: John Doe <[email protected]>
+ else if(s.find( TQRegExp("*@*", false, true) )!=-1) type=0; // From: [email protected]
else { //broken From header => just copy it
n_ame=s;
return;
@@ -711,12 +711,12 @@ void AddressField::fromUnicodeString(const QString &s, const QCString &cs)
}
-QString AddressField::asUnicodeString()
+TQString AddressField::asUnicodeString()
{
if(n_ame.isEmpty())
- return QString(e_mail);
+ return TQString(e_mail);
else {
- QString s = n_ame;
+ TQString s = n_ame;
if (!e_mail.isEmpty())
s += " <"+e_mail+">";
return s;
@@ -724,13 +724,13 @@ QString AddressField::asUnicodeString()
}
-QCString AddressField::nameAs7Bit()
+TQCString AddressField::nameAs7Bit()
{
return encodeRFC2047String(n_ame, e_ncCS);
}
-void AddressField::setNameFrom7Bit(const QCString &s)
+void AddressField::setNameFrom7Bit(const TQCString &s)
{
n_ame=decodeRFC2047String(s, &e_ncCS, defaultCS(), forceCS());
}
@@ -774,36 +774,36 @@ bool MailCopiesTo::neverCopy()
//-----<Date>----------------------------------
-void Date::from7BitString(const QCString &s)
+void Date::from7BitString(const TQCString &s)
{
t_ime=KRFCDate::parseDate(s);
}
-QCString Date::as7BitString(bool incType)
+TQCString Date::as7BitString(bool incType)
{
if(incType)
return ( typeIntro()+KRFCDate::rfc2822DateString(t_ime) );
else
- return QCString(KRFCDate::rfc2822DateString(t_ime));
+ return TQCString(KRFCDate::rfc2822DateString(t_ime));
}
-void Date::fromUnicodeString(const QString &s, const QCString&)
+void Date::fromUnicodeString(const TQString &s, const TQCString&)
{
- from7BitString( QCString(s.latin1()) );
+ from7BitString( TQCString(s.latin1()) );
}
-QString Date::asUnicodeString()
+TQString Date::asUnicodeString()
{
- return QString::fromLatin1(as7BitString(false));
+ return TQString::fromLatin1(as7BitString(false));
}
-QDateTime Date::qdt()
+TQDateTime Date::qdt()
{
- QDateTime dt;
+ TQDateTime dt;
dt.setTime_t(t_ime);
return dt;
}
@@ -811,7 +811,7 @@ QDateTime Date::qdt()
int Date::ageInDays()
{
- QDate today=QDate::currentDate();
+ TQDate today=TQDate::currentDate();
return ( qdt().date().daysTo(today) );
}
@@ -822,12 +822,12 @@ int Date::ageInDays()
#if !defined(KMIME_NEW_STYLE_CLASSTREE)
//-----<To>------------------------------------
-void To::from7BitString(const QCString &s)
+void To::from7BitString(const TQCString &s)
{
if(a_ddrList)
a_ddrList->clear();
else {
- a_ddrList=new QPtrList<AddressField>;
+ a_ddrList=new TQPtrList<AddressField>;
a_ddrList->setAutoDelete(true);
}
@@ -846,9 +846,9 @@ void To::from7BitString(const QCString &s)
}
-QCString To::as7BitString(bool incType)
+TQCString To::as7BitString(bool incType)
{
- QCString ret;
+ TQCString ret;
if(incType)
ret+=typeIntro();
@@ -865,18 +865,18 @@ QCString To::as7BitString(bool incType)
}
-void To::fromUnicodeString(const QString &s, const QCString &cs)
+void To::fromUnicodeString(const TQString &s, const TQCString &cs)
{
if(a_ddrList)
a_ddrList->clear();
else {
- a_ddrList=new QPtrList<AddressField>;
+ a_ddrList=new TQPtrList<AddressField>;
a_ddrList->setAutoDelete(true);
}
- QStringList l=QStringList::split(",", s);
+ TQStringList l=TQStringList::split(",", s);
- QStringList::Iterator it=l.begin();
+ TQStringList::Iterator it=l.begin();
for(; it!=l.end(); ++it)
a_ddrList->append(new AddressField( p_arent, (*it), cs ));
@@ -884,12 +884,12 @@ void To::fromUnicodeString(const QString &s, const QCString &cs)
}
-QString To::asUnicodeString()
+TQString To::asUnicodeString()
{
if(!a_ddrList)
- return QString::null;
+ return TQString::null;
- QString ret;
+ TQString ret;
AddressField *it=a_ddrList->first();
if (it)
@@ -903,7 +903,7 @@ QString To::asUnicodeString()
void To::addAddress(const AddressField &a)
{
if(!a_ddrList) {
- a_ddrList=new QPtrList<AddressField>;
+ a_ddrList=new TQPtrList<AddressField>;
a_ddrList->setAutoDelete(true);
}
@@ -913,7 +913,7 @@ void To::addAddress(const AddressField &a)
}
-void To::emails(QStrList *l)
+void To::emails(TQStrList *l)
{
l->clear();
@@ -922,7 +922,7 @@ void To::emails(QStrList *l)
l->append( it->email() );
}
-void To::names(QStringList *l)
+void To::names(TQStringList *l)
{
l->clear();
@@ -931,7 +931,7 @@ void To::names(QStringList *l)
l->append( it->name() );
}
-void To::displayNames(QStringList *l)
+void To::displayNames(TQStringList *l)
{
l->clear();
@@ -945,14 +945,14 @@ void To::displayNames(QStringList *l)
//-----<Newsgroups>----------------------------
-void Newsgroups::from7BitString(const QCString &s)
+void Newsgroups::from7BitString(const TQCString &s)
{
g_roups=s;
e_ncCS=cachedCharset("UTF-8");
}
-QCString Newsgroups::as7BitString(bool incType)
+TQCString Newsgroups::as7BitString(bool incType)
{
if(incType)
return (typeIntro()+g_roups);
@@ -961,20 +961,20 @@ QCString Newsgroups::as7BitString(bool incType)
}
-void Newsgroups::fromUnicodeString(const QString &s, const QCString&)
+void Newsgroups::fromUnicodeString(const TQString &s, const TQCString&)
{
g_roups=s.utf8();
e_ncCS=cachedCharset("UTF-8");
}
-QString Newsgroups::asUnicodeString()
+TQString Newsgroups::asUnicodeString()
{
- return QString::fromUtf8(g_roups);
+ return TQString::fromUtf8(g_roups);
}
-QCString Newsgroups::firstGroup()
+TQCString Newsgroups::firstGroup()
{
int pos=0;
if(!g_roups.isEmpty()) {
@@ -985,17 +985,17 @@ QCString Newsgroups::firstGroup()
return g_roups.left(pos);
}
else
- return QCString();
+ return TQCString();
}
-QStringList Newsgroups::getGroups()
+TQStringList Newsgroups::getGroups()
{
- QStringList temp = QStringList::split(',', g_roups);
- QStringList ret;
- QString s;
+ TQStringList temp = TQStringList::split(',', g_roups);
+ TQStringList ret;
+ TQString s;
- for (QStringList::Iterator it = temp.begin(); it != temp.end(); ++it ) {
+ for (TQStringList::Iterator it = temp.begin(); it != temp.end(); ++it ) {
s = (*it).simplifyWhiteSpace();
ret.append(s);
}
@@ -1009,16 +1009,16 @@ QStringList Newsgroups::getGroups()
//-----<Lines>---------------------------------
-void Lines::from7BitString(const QCString &s)
+void Lines::from7BitString(const TQCString &s)
{
l_ines=s.toInt();
e_ncCS=cachedCharset(Latin1);
}
-QCString Lines::as7BitString(bool incType)
+TQCString Lines::as7BitString(bool incType)
{
- QCString num;
+ TQCString num;
num.setNum(l_ines);
if(incType)
@@ -1028,16 +1028,16 @@ QCString Lines::as7BitString(bool incType)
}
-void Lines::fromUnicodeString(const QString &s, const QCString&)
+void Lines::fromUnicodeString(const TQString &s, const TQCString&)
{
l_ines=s.toInt();
e_ncCS=cachedCharset(Latin1);
}
-QString Lines::asUnicodeString()
+TQString Lines::asUnicodeString()
{
- QString num;
+ TQString num;
num.setNum(l_ines);
return num;
@@ -1050,14 +1050,14 @@ QString Lines::asUnicodeString()
#if !defined(KMIME_NEW_STYLE_CLASSTREE)
//-----<References>----------------------------
-void References::from7BitString(const QCString &s)
+void References::from7BitString(const TQCString &s)
{
r_ef=s;
e_ncCS=cachedCharset(Latin1);
}
-QCString References::as7BitString(bool incType)
+TQCString References::as7BitString(bool incType)
{
if(incType)
return ( typeIntro()+r_ef );
@@ -1066,16 +1066,16 @@ QCString References::as7BitString(bool incType)
}
-void References::fromUnicodeString(const QString &s, const QCString&)
+void References::fromUnicodeString(const TQString &s, const TQCString&)
{
r_ef=s.latin1();
e_ncCS=cachedCharset(Latin1);
}
-QString References::asUnicodeString()
+TQString References::asUnicodeString()
{
- return QString::fromLatin1(r_ef);
+ return TQString::fromLatin1(r_ef);
}
@@ -1094,17 +1094,17 @@ int References::count()
}
-QCString References::first()
+TQCString References::first()
{
p_os=-1;
return next();
}
-QCString References::next()
+TQCString References::next()
{
int pos1=0, pos2=0;
- QCString ret;
+ TQCString ret;
if(p_os!=0) {
pos2=r_ef.findRev('>', p_os);
@@ -1121,9 +1121,9 @@ QCString References::next()
}
-QCString References::at(unsigned int i)
+TQCString References::at(unsigned int i)
{
- QCString ret;
+ TQCString ret;
int pos1=0, pos2=0;
unsigned int cnt=0;
@@ -1143,16 +1143,16 @@ QCString References::at(unsigned int i)
}
-void References::append(const QCString &s)
+void References::append(const TQCString &s)
{
- QString temp=r_ef.data();
+ TQString temp=r_ef.data();
temp += " ";
temp += s.data();
- QStringList lst=QStringList::split(' ',temp);
- QRegExp exp("^<.+@.+>$");
+ TQStringList lst=TQStringList::split(' ',temp);
+ TQRegExp exp("^<.+@.+>$");
// remove bogus references
- QStringList::Iterator it = lst.begin();
+ TQStringList::Iterator it = lst.begin();
while (it != lst.end()) {
if (-1==(*it).find(exp))
it = lst.remove(it);
@@ -1174,7 +1174,7 @@ void References::append(const QCString &s)
for (int i=1;i<=3;i++) { // include the last three ids
if (!lst.isEmpty()) {
temp = lst.last();
- r_ef.insert(insPos,(QString(" %1").arg(temp)).latin1());
+ r_ef.insert(insPos,(TQString(" %1").arg(temp)).latin1());
lst.remove(temp);
} else
break;
@@ -1183,7 +1183,7 @@ void References::append(const QCString &s)
while (!lst.isEmpty()) { // now insert the rest, up to 1000 characters
temp = lst.last();
if ((15+r_ef.length()+temp.length())<1000) {
- r_ef.insert(insPos,(QString(" %1").arg(temp)).latin1());
+ r_ef.insert(insPos,(TQString(" %1").arg(temp)).latin1());
lst.remove(temp);
} else
return;
@@ -1196,14 +1196,14 @@ void References::append(const QCString &s)
//-----<UserAgent>-----------------------------
-void UserAgent::from7BitString(const QCString &s)
+void UserAgent::from7BitString(const TQCString &s)
{
u_agent=s;
e_ncCS=cachedCharset(Latin1);
}
-QCString UserAgent::as7BitString(bool incType)
+TQCString UserAgent::as7BitString(bool incType)
{
if(incType)
return ( typeIntro()+u_agent );
@@ -1212,16 +1212,16 @@ QCString UserAgent::as7BitString(bool incType)
}
-void UserAgent::fromUnicodeString(const QString &s, const QCString&)
+void UserAgent::fromUnicodeString(const TQString &s, const TQCString&)
{
u_agent=s.latin1();
e_ncCS=cachedCharset(Latin1);
}
-QString UserAgent::asUnicodeString()
+TQString UserAgent::asUnicodeString()
{
- return QString::fromLatin1(u_agent);
+ return TQString::fromLatin1(u_agent);
}
//-----</UserAgent>----------------------------
@@ -1231,7 +1231,7 @@ QString UserAgent::asUnicodeString()
#if !defined(KMIME_NEW_STYLE_CLASSTREE)
//-----<Content-Type>--------------------------
-void ContentType::from7BitString(const QCString &s)
+void ContentType::from7BitString(const TQCString &s)
{
int pos=s.find(';');
@@ -1251,7 +1251,7 @@ void ContentType::from7BitString(const QCString &s)
}
-QCString ContentType::as7BitString(bool incType)
+TQCString ContentType::as7BitString(bool incType)
{
if(incType)
return (typeIntro()+m_imeType+p_arams);
@@ -1260,19 +1260,19 @@ QCString ContentType::as7BitString(bool incType)
}
-void ContentType::fromUnicodeString(const QString &s, const QCString&)
+void ContentType::fromUnicodeString(const TQString &s, const TQCString&)
{
- from7BitString( QCString(s.latin1()) );
+ from7BitString( TQCString(s.latin1()) );
}
-QString ContentType::asUnicodeString()
+TQString ContentType::asUnicodeString()
{
- return QString::fromLatin1(as7BitString(false));
+ return TQString::fromLatin1(as7BitString(false));
}
-QCString ContentType::mediaType()
+TQCString ContentType::mediaType()
{
int pos=m_imeType.find('/');
if(pos==-1)
@@ -1282,17 +1282,17 @@ QCString ContentType::mediaType()
}
-QCString ContentType::subType()
+TQCString ContentType::subType()
{
int pos=m_imeType.find('/');
if(pos==-1)
- return QCString();
+ return TQCString();
else
return m_imeType.mid(pos, m_imeType.length()-pos);
}
-void ContentType::setMimeType(const QCString &s)
+void ContentType::setMimeType(const TQCString &s)
{
p_arams.resize(0);
m_imeType=s;
@@ -1357,9 +1357,9 @@ bool ContentType::isPartial()
}
-QCString ContentType::charset()
+TQCString ContentType::charset()
{
- QCString ret=getParameter("charset");
+ TQCString ret=getParameter("charset");
if( ret.isEmpty() || forceCS() ) { //we return the default-charset if necessary
ret=defaultCS();
}
@@ -1367,37 +1367,37 @@ QCString ContentType::charset()
}
-void ContentType::setCharset(const QCString &s)
+void ContentType::setCharset(const TQCString &s)
{
setParameter("charset", s);
}
-QCString ContentType::boundary()
+TQCString ContentType::boundary()
{
return getParameter("boundary");
}
-void ContentType::setBoundary(const QCString &s)
+void ContentType::setBoundary(const TQCString &s)
{
setParameter("boundary", s, true);
}
-QString ContentType::name()
+TQString ContentType::name()
{
const char *dummy=0;
return ( decodeRFC2047String(getParameter("name"), &dummy, defaultCS(), forceCS()) );
}
-void ContentType::setName(const QString &s, const QCString &cs)
+void ContentType::setName(const TQString &s, const TQCString &cs)
{
e_ncCS=cs;
if (isUsAscii(s)) {
- QCString tmp(s.latin1());
+ TQCString tmp(s.latin1());
addQuotes(tmp, true);
setParameter("name", tmp, false);
} else {
@@ -1407,13 +1407,13 @@ void ContentType::setName(const QString &s, const QCString &cs)
}
-QCString ContentType::id()
+TQCString ContentType::id()
{
return (getParameter("id"));
}
-void ContentType::setId(const QCString &s)
+void ContentType::setId(const TQCString &s)
{
setParameter("id", s, true);
}
@@ -1421,7 +1421,7 @@ void ContentType::setId(const QCString &s)
int ContentType::partialNumber()
{
- QCString p=getParameter("number");
+ TQCString p=getParameter("number");
if(!p.isEmpty())
return p.toInt();
else
@@ -1431,7 +1431,7 @@ int ContentType::partialNumber()
int ContentType::partialCount()
{
- QCString p=getParameter("total");
+ TQCString p=getParameter("total");
if(!p.isEmpty())
return p.toInt();
else
@@ -1441,7 +1441,7 @@ int ContentType::partialCount()
void ContentType::setPartialParams(int total, int number)
{
- QCString num;
+ TQCString num;
num.setNum(number);
setParameter("number", num);
num.setNum(total);
@@ -1449,9 +1449,9 @@ void ContentType::setPartialParams(int total, int number)
}
-QCString ContentType::getParameter(const char *name)
+TQCString ContentType::getParameter(const char *name)
{
- QCString ret;
+ TQCString ret;
int pos1=0, pos2=0;
pos1=p_arams.find(name, 0, false);
if(pos1!=-1) {
@@ -1465,10 +1465,10 @@ QCString ContentType::getParameter(const char *name)
}
-void ContentType::setParameter(const QCString &name, const QCString &value, bool doubleQuotes)
+void ContentType::setParameter(const TQCString &name, const TQCString &value, bool doubleQuotes)
{
int pos1=0, pos2=0;
- QCString param;
+ TQCString param;
if(doubleQuotes)
param=name+"=\""+value+"\"";
@@ -1505,9 +1505,9 @@ static const encTableType encTable[] = { { "7Bit", CE7Bit },
{ 0, 0} };
-void CTEncoding::from7BitString(const QCString &s)
+void CTEncoding::from7BitString(const TQCString &s)
{
- QCString stripped(s.simplifyWhiteSpace());
+ TQCString stripped(s.simplifyWhiteSpace());
c_te=CE7Bit;
for(int i=0; encTable[i].s!=0; i++)
if(strcasecmp(stripped.data(), encTable[i].s)==0) {
@@ -1520,9 +1520,9 @@ void CTEncoding::from7BitString(const QCString &s)
}
-QCString CTEncoding::as7BitString(bool incType)
+TQCString CTEncoding::as7BitString(bool incType)
{
- QCString str;
+ TQCString str;
for(int i=0; encTable[i].s!=0; i++)
if(c_te==encTable[i].e) {
str=encTable[i].s;
@@ -1536,15 +1536,15 @@ QCString CTEncoding::as7BitString(bool incType)
}
-void CTEncoding::fromUnicodeString(const QString &s, const QCString&)
+void CTEncoding::fromUnicodeString(const TQString &s, const TQCString&)
{
- from7BitString( QCString(s.latin1()) );
+ from7BitString( TQCString(s.latin1()) );
}
-QString CTEncoding::asUnicodeString()
+TQString CTEncoding::asUnicodeString()
{
- return QString::fromLatin1(as7BitString(false));
+ return TQString::fromLatin1(as7BitString(false));
}
//-----</CTEncoding>---------------------------
@@ -1553,14 +1553,14 @@ QString CTEncoding::asUnicodeString()
//-----<CDisposition>--------------------------
-void CDisposition::from7BitString(const QCString &s)
+void CDisposition::from7BitString(const TQCString &s)
{
if(strncasecmp(s.data(), "attachment", 10)==0)
d_isp=CDattachment;
else d_isp=CDinline;
int pos=s.find("filename=", 0, false);
- QCString fn;
+ TQCString fn;
if(pos>-1) {
pos+=9;
fn=s.mid(pos, s.length()-pos);
@@ -1570,9 +1570,9 @@ void CDisposition::from7BitString(const QCString &s)
}
-QCString CDisposition::as7BitString(bool incType)
+TQCString CDisposition::as7BitString(bool incType)
{
- QCString ret;
+ TQCString ret;
if(d_isp==CDattachment)
ret="attachment";
else
@@ -1580,7 +1580,7 @@ QCString CDisposition::as7BitString(bool incType)
if(!f_ilename.isEmpty()) {
if (isUsAscii(f_ilename)) {
- QCString tmp(f_ilename.latin1());
+ TQCString tmp(f_ilename.latin1());
addQuotes(tmp, true);
ret+="; filename="+tmp;
} else {
@@ -1596,7 +1596,7 @@ QCString CDisposition::as7BitString(bool incType)
}
-void CDisposition::fromUnicodeString(const QString &s, const QCString &cs)
+void CDisposition::fromUnicodeString(const TQString &s, const TQCString &cs)
{
if(strncasecmp(s.latin1(), "attachment", 10)==0)
d_isp=CDattachment;
@@ -1613,9 +1613,9 @@ void CDisposition::fromUnicodeString(const QString &s, const QCString &cs)
}
-QString CDisposition::asUnicodeString()
+TQString CDisposition::asUnicodeString()
{
- QString ret;
+ TQString ret;
if(d_isp==CDattachment)
ret="attachment";
else