summaryrefslogtreecommitdiffabout
path: root/kabc/vcard/Entity.cpp
Unidiff
Diffstat (limited to 'kabc/vcard/Entity.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/vcard/Entity.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/kabc/vcard/Entity.cpp b/kabc/vcard/Entity.cpp
index b7d09e0..e38fa11 100644
--- a/kabc/vcard/Entity.cpp
+++ b/kabc/vcard/Entity.cpp
@@ -1,134 +1,136 @@
1/* 1/*
2 libvcard - vCard parsing library for vCard version 3.0 2 libvcard - vCard parsing library for vCard version 3.0
3 3
4 Copyright (C) 1999 Rik Hemsley rik@kde.org 4 Copyright (C) 1999 Rik Hemsley rik@kde.org
5 5
6 Permission is hereby granted, free of charge, to any person obtaining a copy 6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to 7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the 8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is 10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions: 11 furnished to do so, subject to the following conditions:
12 12
13 The above copyright notice and this permission notice shall be included in 13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software. 14 all copies or substantial portions of the Software.
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#include <VCardEntity.h> 24#include <VCardEntity.h>
25//Added by qt3to4:
26#include <Q3CString>
25 27
26using namespace VCARD; 28using namespace VCARD;
27 29
28Entity::Entity() 30Entity::Entity()
29 : parsed_ (false), 31 : parsed_ (false),
30 assembled_(true) 32 assembled_(true)
31{ 33{
32 // empty 34 // empty
33} 35}
34 36
35Entity::Entity(const Entity & e) 37Entity::Entity(const Entity & e)
36 : strRep_ (e.strRep_), 38 : strRep_ (e.strRep_),
37 parsed_ (e.parsed_), 39 parsed_ (e.parsed_),
38 assembled_(e.assembled_) 40 assembled_(e.assembled_)
39{ 41{
40 // empty 42 // empty
41} 43}
42 44
43Entity::Entity(const QCString & s) 45Entity::Entity(const Q3CString & s)
44 : strRep_ (s), 46 : strRep_ (s),
45 parsed_ (false), 47 parsed_ (false),
46 assembled_(true) 48 assembled_(true)
47{ 49{
48 // empty 50 // empty
49} 51}
50 52
51 Entity & 53 Entity &
52Entity::operator = (const Entity & e) 54Entity::operator = (const Entity & e)
53{ 55{
54 if (this == &e) return *this; 56 if (this == &e) return *this;
55 57
56 strRep_ = e.strRep_; 58 strRep_ = e.strRep_;
57 parsed_ = e.parsed_; 59 parsed_ = e.parsed_;
58 assembled_= e.assembled_; 60 assembled_= e.assembled_;
59 61
60 return *this; 62 return *this;
61} 63}
62 64
63 Entity & 65 Entity &
64Entity::operator = (const QCString & s) 66Entity::operator = (const Q3CString & s)
65{ 67{
66 strRep_ = s; 68 strRep_ = s;
67 parsed_ = false; 69 parsed_ = false;
68 assembled_= true; 70 assembled_= true;
69 71
70 return *this; 72 return *this;
71} 73}
72 74
73 bool 75 bool
74Entity::operator == (Entity & e) 76Entity::operator == (Entity & e)
75{ 77{
76 return asString() == e.asString(); 78 return asString() == e.asString();
77} 79}
78 80
79 bool 81 bool
80Entity::operator != (Entity & e) 82Entity::operator != (Entity & e)
81{ 83{
82 return !(*this == e); 84 return !(*this == e);
83} 85}
84 86
85 bool 87 bool
86Entity::operator == (const QCString & s) 88Entity::operator == (const Q3CString & s)
87{ 89{
88 return asString() == s; 90 return asString() == s;
89} 91}
90 92
91 bool 93 bool
92Entity::operator != (const QCString & s) 94Entity::operator != (const Q3CString & s)
93{ 95{
94 return !(*this == s); 96 return !(*this == s);
95} 97}
96 98
97Entity::~Entity() 99Entity::~Entity()
98{ 100{
99 // empty 101 // empty
100} 102}
101 103
102 QCString 104 Q3CString
103Entity::asString() 105Entity::asString()
104{ 106{
105 //vDebug("Entity::asString()"); 107 //vDebug("Entity::asString()");
106 assemble(); 108 assemble();
107 109
108 return strRep_; 110 return strRep_;
109} 111}
110 112
111 void 113 void
112Entity::parse() 114Entity::parse()
113{ 115{
114 //vDebug( "Entity::parse()" ); 116 //vDebug( "Entity::parse()" );
115 117
116 if (!parsed_) _parse(); 118 if (!parsed_) _parse();
117 119
118 parsed_ = true; 120 parsed_ = true;
119 assembled_= false; 121 assembled_= false;
120} 122}
121 123
122 void 124 void
123Entity::assemble() 125Entity::assemble()
124{ 126{
125 //vDebug( "Entity::assemble()" ); 127 //vDebug( "Entity::assemble()" );
126 128
127 if (assembled_) return; 129 if (assembled_) return;
128 130
129 parse(); 131 parse();
130 _assemble(); 132 _assemble();
131 133
132 assembled_= true; 134 assembled_= true;
133} 135}
134 136