24 #include <tqtextstream.h>
28 #include <kapplication.h>
29 #include <kcmdlineargs.h>
31 #include <kaboutdata.h>
33 #include "vcardconverter.h"
39 {
"+inputfile",
I18N_NOOP(
"Input file"), 0},
43 int main(
int argc,
char **argv )
47 KAboutData aboutData(
"testread",
"vCard test reader",
"0.1" );
48 aboutData.addAuthor(
"Cornelius Schumacher", 0,
"schumacher@kde.org" );
57 if ( args->
count() != 1 ) {
58 std::cerr <<
"Missing argument" <<
std::endl;
62 TQString inputFile( args->
arg( 0 ) );
64 TQFile file( inputFile );
65 if ( !file.open( IO_ReadOnly ) ) {
66 qDebug(
"Unable to open file '%s' for reading!", file.name().latin1() );
72 TQTextStream s( &file );
73 s.setEncoding( TQTextStream::Latin1 );
78 KABC::Addressee::List list = converter.
parseVCards( text );
80 if ( args->
isSet(
"vcard21" ) ) {
81 text = converter.
createVCards( list, KABC::VCardConverter::v2_1 );
86 std::cout << text.utf8();