24 #include <tqtextstream.h>
28 #include <tdeapplication.h>
29 #include <tdecmdlineargs.h>
31 #include <tdeaboutdata.h>
33 #include "tdeabc/vcardconverter.h"
39 {
"+inputfile",
I18N_NOOP(
"Input file"), 0},
43 int main(
int argc,
char **argv )
47 TDEAboutData 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 tqDebug(
"Unable to open file '%s' for reading!", file.name().latin1() );
72 TQTextStream s( &file );
73 s.setEncoding( TQTextStream::UnicodeUTF8 );
78 TDEABC::Addressee::List list = converter.
parseVCards( text );
80 if ( args->
isSet(
"vcard21" ) ) {
81 text = converter.
createVCards( list, TDEABC::VCardConverter::v2_1 );
86 std::cout << text.utf8();