diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /libkmime/tests/test_kmime_codec.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-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_codec.cpp')
-rw-r--r-- | libkmime/tests/test_kmime_codec.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/libkmime/tests/test_kmime_codec.cpp b/libkmime/tests/test_kmime_codec.cpp index f13b2b434..e30a89ac9 100644 --- a/libkmime/tests/test_kmime_codec.cpp +++ b/libkmime/tests/test_kmime_codec.cpp @@ -24,8 +24,8 @@ #include <getopt.h> #include <cassert> -#include <qfile.h> -#include <qcstring.h> // QByteArray +#include <tqfile.h> +#include <tqcstring.h> // QByteArray using namespace KMime; using namespace std; @@ -81,19 +81,19 @@ static bool withCRLF = false; static bool withFinish = true; static bool verbose = false; -void encode_decode_kio( bool, const Codec *, const QByteArray &, QFile & ); +void encode_decode_kio( bool, const Codec *, const TQByteArray &, TQFile & ); void encode_decode_chunkwise( bool, const Codec *, - const QByteArray &, QFile & ); -void encode_decode_convenience_qba( bool, const Codec *, const QByteArray &, - QFile & ); + const TQByteArray &, TQFile & ); +void encode_decode_convenience_qba( bool, const Codec *, const TQByteArray &, + TQFile & ); int main( int argc, char * argv[] ) { int iterations = 1; bool encode = false; bool decode = false; - QCString outfilename, infilename; - QCString encodingName; + TQCString outfilename, infilename; + TQCString encodingName; // options parsing: while( 1 ) { @@ -104,12 +104,12 @@ int main( int argc, char * argv[] ) { case 0: // encode if ( !optarg || !*optarg ) missingParameterTo( "--encode." ); encode = true; - encodingName = QCString(optarg); + encodingName = TQCString(optarg); break; case 1: // decode if ( !optarg || !*optarg ) missingParameterTo( "--decode" ); decode = true; - encodingName = QCString(optarg); + encodingName = TQCString(optarg); break; case 2: // output-buffer-size if ( !optarg || (outbufsize = atoi( optarg )) < 1 ) @@ -121,7 +121,7 @@ int main( int argc, char * argv[] ) { break; case 4: // outfile if ( !optarg || !*optarg ) missingParameterTo( "--outfile" ); - outfilename = QCString(optarg); + outfilename = TQCString(optarg); writing = true; break; case 5: // with-crlf @@ -167,7 +167,7 @@ int main( int argc, char * argv[] ) { if ( optind != argc - 1 ) usage(); - QFile infile( argv[ optind ] ); + TQFile infile( argv[ optind ] ); if (!infile.exists()) { kdDebug() << "infile \"" << infile.name() << "\" does not exist!" << endl; return INFILE_READ_ERR; @@ -178,7 +178,7 @@ int main( int argc, char * argv[] ) { return INFILE_READ_ERR; } - QFile outfile( outfilename ); + TQFile outfile( outfilename ); if ( !outfilename.isEmpty() ) { if (!outfile.open( IO_WriteOnly|IO_Truncate )) { kdDebug() << "cannot open " << outfile.name() << " for writing!" @@ -206,7 +206,7 @@ int main( int argc, char * argv[] ) { return UNKNOWN_CODEC; } - QByteArray infile_buffer = infile.readAll(); + TQByteArray infile_buffer = infile.readAll(); for ( int i = 0 ; i < iterations ; ++i ) { kdDebug( verbose ) << "starting iteration " << i+1 @@ -230,10 +230,10 @@ int main( int argc, char * argv[] ) { } void encode_decode_convenience_qba( bool encode, const Codec * codec, - const QByteArray & infile_buffer, - QFile & outfile ) + const TQByteArray & infile_buffer, + TQFile & outfile ) { - QByteArray out; + TQByteArray out; if ( encode ) out = codec->encode( infile_buffer, withCRLF ); else @@ -244,13 +244,13 @@ void encode_decode_convenience_qba( bool encode, const Codec * codec, } } -void encode_kio_internal( Encoder * enc, QByteArray::ConstIterator & iit, - QByteArray::ConstIterator & iend, - QByteArray & out ) +void encode_kio_internal( Encoder * enc, TQByteArray::ConstIterator & iit, + TQByteArray::ConstIterator & iend, + TQByteArray & out ) { out.resize( outbufsize ); - QByteArray::Iterator oit = out.begin(); - QByteArray::ConstIterator oend = out.end(); + TQByteArray::Iterator oit = out.begin(); + TQByteArray::ConstIterator oend = out.end(); while ( !enc->encode( iit, iend, oit, oend ) ) if ( oit == oend ) return; @@ -261,12 +261,12 @@ void encode_kio_internal( Encoder * enc, QByteArray::ConstIterator & iit, out.truncate( oit - out.begin() ); } -void decode_kio_internal( Decoder * dec, QByteArray::ConstIterator & iit, - QByteArray::ConstIterator & iend, - QByteArray & out ) { +void decode_kio_internal( Decoder * dec, TQByteArray::ConstIterator & iit, + TQByteArray::ConstIterator & iend, + TQByteArray & out ) { out.resize( outbufsize ); - QByteArray::Iterator oit = out.begin(); - QByteArray::ConstIterator oend = out.end(); + TQByteArray::Iterator oit = out.begin(); + TQByteArray::ConstIterator oend = out.end(); while ( !dec->decode( iit, iend, oit, oend ) ) if ( oit == oend ) return; @@ -278,7 +278,7 @@ void decode_kio_internal( Decoder * dec, QByteArray::ConstIterator & iit, } void encode_decode_kio( bool encode, const Codec * codec, - const QByteArray & infile_buffer, QFile & outfile ) + const TQByteArray & infile_buffer, TQFile & outfile ) { Encoder * enc = 0; @@ -293,12 +293,12 @@ void encode_decode_kio( bool encode, const Codec * codec, assert( dec ); } - QByteArray::ConstIterator iit = infile_buffer.begin(); - QByteArray::ConstIterator iend = infile_buffer.end(); + TQByteArray::ConstIterator iit = infile_buffer.begin(); + TQByteArray::ConstIterator iend = infile_buffer.end(); - QByteArray out; + TQByteArray out; do { - out = QByteArray(); + out = TQByteArray(); if ( encode ) encode_kio_internal( enc, iit, iend, out ); else @@ -316,14 +316,14 @@ void encode_decode_kio( bool encode, const Codec * codec, } void encode_decode_chunkwise( bool encode, const Codec * codec, - const QByteArray & infile_buffer, QFile & outfile ) + const TQByteArray & infile_buffer, TQFile & outfile ) { Encoder * enc = 0; Decoder * dec = 0; - QByteArray indata( inbufsize ); - QByteArray outdata( outbufsize ); + TQByteArray indata( inbufsize ); + TQByteArray outdata( outbufsize ); // we're going to need this below: #define write_full_outdata_then_reset do { \ @@ -354,8 +354,8 @@ void encode_decode_chunkwise( bool encode, const Codec * codec, // Initialize the output iterators: - QByteArray::Iterator oit = outdata.begin(); - QByteArray::Iterator oend = outdata.end(); + TQByteArray::Iterator oit = outdata.begin(); + TQByteArray::Iterator oend = outdata.end(); // Get an encoder. This one you have to delete! if ( encode ) { @@ -379,8 +379,8 @@ void encode_decode_chunkwise( bool encode, const Codec * codec, << indata.size() << ") from input." << endl; // setup input iterators: - QByteArray::ConstIterator iit = indata.begin(); - QByteArray::ConstIterator iend = indata.begin() + reallyRead; + TQByteArray::ConstIterator iit = indata.begin(); + TQByteArray::ConstIterator iend = indata.begin() + reallyRead; if ( encode ) { // |