6 #include <tqtextstream.h>
12 int main(
int argc,
char * argv[])
15 cerr <<
"Usage: " << argv[0] <<
" <filename>" <<
endl;
23 if (!f.open(IO_ReadOnly)) {
24 cerr <<
"Couldn't open file \"" << argv[1] <<
endl;
31 str += t.readLine().utf8() +
'\n';
33 using namespace VCARD;
37 cout <<
"--------- begin ----------" <<
endl;
39 cout <<
"--------- end ----------" <<
endl;
43 VCardListIterator it(e.cardList());
45 for (; it.current(); ++it) {
47 cerr <<
"****************** VCARD ********************" <<
endl;
50 VCard & v (*it.current());
52 if (v.has(EntityEmail)) {
53 cerr <<
"Email parameter found" <<
endl;
55 TQCString s = v.contentLine(EntityEmail)->value()->asString();
57 cerr <<
"Email value == " << s <<
endl;
60 if (v.has(EntityNickname)) {
61 cerr <<
"Nickname parameter found" <<
endl;
63 cerr <<
"Nickname value == " <<
64 v.contentLine(EntityNickname)->value()->asString() <<
68 if (v.has(EntityRevision)) {
70 cerr <<
"Revision parameter found" <<
endl;
74 v.contentLine(EntityRevision)->value();
78 cerr <<
"Revision date: " <<
endl;
79 cerr <<
"Day : " << d->day() <<
endl;
80 cerr <<
"Month : " << d->month() <<
endl;
81 cerr <<
"Year : " << d->year() <<
endl;
84 cerr <<
"Revision date has a time component" <<
endl;
85 cerr <<
"Revision time: " <<
endl;
86 cerr <<
"Hour : " << d->hour() <<
endl;
87 cerr <<
"Minute : " << d->minute() <<
endl;
88 cerr <<
"Second : " << d->second() <<
endl;
91 else cerr <<
"Revision date does NOT have a time component" <<
endl;
94 if (v.has(EntityURL)) {
95 cerr <<
"URL Parameter found" <<
endl;
97 cerr <<
"URL Value == " <<
98 v.contentLine(EntityURL)->value()->asString() <<
102 (URIValue *)v.contentLine(EntityURL)->value();
106 cerr <<
"URL scheme == " <<
107 urlVal->scheme() <<
endl;
109 cerr <<
"URL scheme specific part == " <<
110 urlVal->schemeSpecificPart() <<
endl;
113 if (v.has(EntityN)) {
114 cerr <<
"N Parameter found" <<
endl;
117 (NValue *)(v.contentLine(EntityN)->value());
119 cerr <<
"Family name == " << n->family() <<
endl;
120 cerr <<
"Given name == " << n->given() <<
endl;
121 cerr <<
"Middle name == " << n->middle() <<
endl;
122 cerr <<
"Prefix == " << n->prefix() <<
endl;
123 cerr <<
"Suffix == " << n->suffix() <<
endl;
126 cerr <<
"***************** END VCARD ******************" <<
endl;
kndbgstream & endl(kndbgstream &s)