summaryrefslogtreecommitdiffabout
path: root/kabc/vcard/testread.cpp
Unidiff
Diffstat (limited to 'kabc/vcard/testread.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/vcard/testread.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/kabc/vcard/testread.cpp b/kabc/vcard/testread.cpp
index 919c661..4d66aaf 100644
--- a/kabc/vcard/testread.cpp
+++ b/kabc/vcard/testread.cpp
@@ -1,40 +1,42 @@
1#include <iostream> 1#include <iostream>
2#include <stdlib.h> 2#include <stdlib.h>
3#include <assert.h> 3#include <assert.h>
4 4
5#include <qfile.h> 5#include <qfile.h>
6#include <qtextstream.h> 6#include <q3textstream.h>
7//Added by qt3to4:
8#include <Q3CString>
7 9
8#include <VCard.h> 10#include <VCard.h>
9 11
10using namespace std; 12using namespace std;
11 13
12int main(int argc, char * argv[]) 14int main(int argc, char * argv[])
13{ 15{
14 if (argc != 2) { 16 if (argc != 2) {
15 cerr << "Usage: " << argv[0] << " <filename>" << endl; 17 cerr << "Usage: " << argv[0] << " <filename>" << endl;
16 exit(1); 18 exit(1);
17 } 19 }
18 20
19 QFile f(argv[1]); 21 QFile f(argv[1]);
20 22
21 QCString str; 23 Q3CString str;
22 24
23 if (!f.open(IO_ReadOnly)) { 25 if (!f.open(QIODevice::ReadOnly)) {
24 cerr << "Couldn't open file \"" << argv[1] << endl; 26 cerr << "Couldn't open file \"" << argv[1] << endl;
25 exit(1); 27 exit(1);
26 } 28 }
27 29
28 QTextStream t(&f); 30 Q3TextStream t(&f);
29 31
30 while (!t.eof()) 32 while (!t.eof())
31 str += t.readLine().utf8() + '\n'; 33 str += t.readLine().utf8() + '\n';
32 34
33 using namespace VCARD; 35 using namespace VCARD;
34 36
35 // Iterate through all vCards in the file. 37 // Iterate through all vCards in the file.
36 38
37 cout << "--------- begin ----------" << endl; 39 cout << "--------- begin ----------" << endl;
38 cout << str.data(); 40 cout << str.data();
39 cout << "--------- end ----------" << endl; 41 cout << "--------- end ----------" << endl;
40 42
@@ -43,25 +45,25 @@ int main(int argc, char * argv[])
43 VCardListIterator it(e.cardList()); 45 VCardListIterator it(e.cardList());
44 46
45 for (; it.current(); ++it) { 47 for (; it.current(); ++it) {
46 48
47 cerr << "****************** VCARD ********************" << endl; 49 cerr << "****************** VCARD ********************" << endl;
48 50
49 // Create a vcard using the string representation. 51 // Create a vcard using the string representation.
50 VCard & v (*it.current()); 52 VCard & v (*it.current());
51 53
52 if (v.has(EntityEmail)) { 54 if (v.has(EntityEmail)) {
53 cerr << "Email parameter found" << endl; 55 cerr << "Email parameter found" << endl;
54 56
55 QCString s = v.contentLine(EntityEmail)->value()->asString(); 57 Q3CString s = v.contentLine(EntityEmail)->value()->asString();
56 58
57 cerr << "Email value == " << s << endl; 59 cerr << "Email value == " << s << endl;
58 } 60 }
59 61
60 if (v.has(EntityNickname)) { 62 if (v.has(EntityNickname)) {
61 cerr << "Nickname parameter found" << endl; 63 cerr << "Nickname parameter found" << endl;
62 64
63 cerr << "Nickname value == " << 65 cerr << "Nickname value == " <<
64 v.contentLine(EntityNickname)->value()->asString() << 66 v.contentLine(EntityNickname)->value()->asString() <<
65 endl; 67 endl;
66 } 68 }
67 69