summaryrefslogtreecommitdiffstats
path: root/libkmime/tests/test_kmime_header_parsing.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /libkmime/tests/test_kmime_header_parsing.cpp
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkmime/tests/test_kmime_header_parsing.cpp')
-rw-r--r--libkmime/tests/test_kmime_header_parsing.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/libkmime/tests/test_kmime_header_parsing.cpp b/libkmime/tests/test_kmime_header_parsing.cpp
index 3839bff7e..93c447ebd 100644
--- a/libkmime/tests/test_kmime_header_parsing.cpp
+++ b/libkmime/tests/test_kmime_header_parsing.cpp
@@ -4,9 +4,9 @@
#include <kinstance.h>
-#include <qfile.h>
-#include <qcstring.h>
-//#include <qstring.h>
+#include <tqfile.h>
+#include <tqcstring.h>
+//#include <tqstring.h>
//#include <stdio.h>
#include <iostream>
@@ -65,7 +65,7 @@ void usage( const char * msg=0 ) {
exit(1);
}
-ostream & operator<<( ostream & stream, const QString & str ) {
+ostream & operator<<( ostream & stream, const TQString & str ) {
return stream << str.utf8().data();
}
@@ -122,18 +122,18 @@ int main( int argc, char * argv[] ) {
KInstance instance( "test_kmime_header_parsing" );
- QFile stdIn;
+ TQFile stdIn;
stdIn.open( IO_ReadOnly, stdin );
- const QByteArray indata = stdIn.readAll();
+ const TQByteArray indata = stdIn.readAll();
stdIn.close();
- QByteArray::ConstIterator iit = indata.begin();
- const QByteArray::ConstIterator iend = indata.end();
+ TQByteArray::ConstIterator iit = indata.begin();
+ const TQByteArray::ConstIterator iend = indata.end();
switch ( index ) {
case 0:
{ // encoded-word
- QString result;
- QCString language;
+ TQString result;
+ TQCString language;
// must have checked for initial '=' already:
bool ok = indata.size() >= 1 && *iit++ == '=' &&
parseEncodedWord( iit, iend, result, language );
@@ -145,7 +145,7 @@ int main( int argc, char * argv[] ) {
break;
case 1:
{ // atom
- QString result = "with 8bit: ";
+ TQString result = "with 8bit: ";
bool ok = parseAtom( iit, iend, result, true );
cout << ( ok ? "OK" : "BAD" ) << endl
@@ -165,7 +165,7 @@ int main( int argc, char * argv[] ) {
break;
case 2:
{ // token
- QString result = "with 8bit: ";
+ TQString result = "with 8bit: ";
bool ok = parseToken( iit, iend, result, true );
cout << ( ok ? "OK" : "BAD" ) << endl
@@ -185,7 +185,7 @@ int main( int argc, char * argv[] ) {
break;
case 3:
{ // quoted-string
- QString result;
+ TQString result;
// must have checked for initial '"' already:
bool ok = *iit++ == '"' &&
parseGenericQuotedString( iit, iend, result, withCRLF, '"', '"' );
@@ -196,7 +196,7 @@ int main( int argc, char * argv[] ) {
break;
case 4:
{ // domain-literal
- QString result;
+ TQString result;
// must have checked for initial '[' already:
bool ok = *iit++ == '[' &&
parseGenericQuotedString( iit, iend, result, withCRLF, '[', ']' );
@@ -207,7 +207,7 @@ int main( int argc, char * argv[] ) {
break;
case 5:
{ // comment
- QString result;
+ TQString result;
// must have checked for initial '(' already:
bool ok = *iit++ == '(' &&
parseComment( iit, iend, result, withCRLF, true );
@@ -218,7 +218,7 @@ int main( int argc, char * argv[] ) {
break;
case 6:
{ // phrase
- QString result;
+ TQString result;
bool ok = parsePhrase( iit, iend, result, withCRLF );
cout << ( ok ? "OK" : "BAD" ) << endl
@@ -227,7 +227,7 @@ int main( int argc, char * argv[] ) {
break;
case 7:
{ // dot-atom
- QString result;
+ TQString result;
bool ok = parseDotAtom( iit, iend, result, withCRLF );
cout << ( ok ? "OK" : "BAD" ) << endl
@@ -236,7 +236,7 @@ int main( int argc, char * argv[] ) {
break;
case 8:
{ // domain
- QString result;
+ TQString result;
bool ok = parseDomain( iit, iend, result, withCRLF );
cout << ( ok ? "OK" : "BAD" ) << endl
@@ -245,12 +245,12 @@ int main( int argc, char * argv[] ) {
break;
case 9:
{ // obs-route
- QStringList result;
+ TQStringList result;
bool ok = parseObsRoute( iit, iend, result, withCRLF, true /*save*/ );
cout << ( ok ? "OK" : "BAD" ) << endl
<< "result: " << result.count() << " domains:" << endl;
- for ( QStringList::ConstIterator it = result.begin() ;
+ for ( TQStringList::ConstIterator it = result.begin() ;
it != result.end() ; ++it )
cout << (*it) << endl;
}
@@ -294,7 +294,7 @@ int main( int argc, char * argv[] ) {
cout << ( ok ? "OK" : "BAD" ) << endl
<< "result.displayName:\n" << result.displayName << endl;
int i = 0;
- for ( QValueList<KMime::Types::Mailbox>::ConstIterator
+ for ( TQValueList<KMime::Types::Mailbox>::ConstIterator
it = result.mailboxList.begin();
it != result.mailboxList.end() ; ++it, ++i )
cout << "result.mailboxList[" << i << "].displayName:\n"
@@ -313,7 +313,7 @@ int main( int argc, char * argv[] ) {
cout << ( ok ? "OK" : "BAD" ) << endl
<< "result.displayName:\n" << endl;
int i = 0;
- for ( QValueList<KMime::Types::Mailbox>::ConstIterator
+ for ( TQValueList<KMime::Types::Mailbox>::ConstIterator
it = result.mailboxList.begin();
it != result.mailboxList.end() ; ++it, ++i )
cout << "result.mailboxList[" << i << "].displayName:\n"
@@ -326,17 +326,17 @@ int main( int argc, char * argv[] ) {
break;
case 15:
{ // address-list
- QValueList<KMime::Types::Address> result;
+ TQValueList<KMime::Types::Address> result;
bool ok = parseAddressList( iit, iend, result, withCRLF );
cout << ( ok ? "OK" : "BAD" ) << endl;
int j = 0;
- for ( QValueList<KMime::Types::Address>::ConstIterator
+ for ( TQValueList<KMime::Types::Address>::ConstIterator
jt = result.begin() ; jt != result.end() ; ++jt, ++j ) {
cout << "result[" << j << "].displayName:\n"
<< (*jt).displayName << endl;
int i = 0;
- for ( QValueList<KMime::Types::Mailbox>::ConstIterator
+ for ( TQValueList<KMime::Types::Mailbox>::ConstIterator
it = (*jt).mailboxList.begin();
it != (*jt).mailboxList.end() ; ++it, ++i )
cout << "result[" << j << "].mailboxList[" << i << "].displayName:\n"
@@ -350,45 +350,45 @@ int main( int argc, char * argv[] ) {
break;
case 16:
{ // parameter
- QPair<QString,KMime::Types::QStringOrQPair> result;
+ QPair<TQString,KMime::Types::QStringOrQPair> result;
bool ok = parseParameter( iit, iend, result, withCRLF );
cout << ( ok ? "OK" : "BAD" ) << endl
<< "result.first (attribute):\n" << result.first << endl
<< "result.second.qstring (value):\n" << result.second.qstring << endl
<< "result.second.qpair (value):\n"
- << QCString( result.second.qpair.first,
+ << TQCString( result.second.qpair.first,
result.second.qpair.second+1 ).data() << endl;
}
break;
case 17:
{ // raw-parameter-list
- QMap<QString,KMime::Types::QStringOrQPair> result;
+ TQMap<TQString,KMime::Types::QStringOrQPair> result;
bool ok = parseRawParameterList( iit, iend, result, withCRLF );
cout << ( ok ? "OK" : "BAD" ) << endl
<< "result: " << result.count() << " raw parameters:" << endl;
int i = 0;
- for ( QMap<QString,KMime::Types::QStringOrQPair>::ConstIterator
+ for ( TQMap<TQString,KMime::Types::QStringOrQPair>::ConstIterator
it = result.begin() ; it != result.end() ; ++it, ++i )
cout << "result[" << i << "].key() (attribute):\n"
<< it.key() << endl
<< "result[" << i << "].data().qstring (value):\n"
<< it.data().qstring << endl
<< "result[" << i << "].data().qpair (value):\n"
- << QCString( it.data().qpair.first,
+ << TQCString( it.data().qpair.first,
it.data().qpair.second+1 ).data() << endl;
}
break;
case 18:
{ // parameter-list
- QMap<QString,QString> result;
+ TQMap<TQString,TQString> result;
bool ok = parseParameterList( iit, iend, result, withCRLF );
cout << ( ok ? "OK" : "BAD" ) << endl
<< "result: " << result.count() << " parameters:" << endl;
int i = 0;
- for ( QMap<QString,QString>::Iterator it = result.begin() ;
+ for ( TQMap<TQString,TQString>::Iterator it = result.begin() ;
it != result.end() ; ++it, ++i )
cout << "result[" << i << "].key() (attribute):\n"
<< it.key() << endl