author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kabc/vcard/Entity.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | kabc/vcard/Entity.cpp | 12 |
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,126 +1,128 @@ | |||
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 | ||
26 | using namespace VCARD; | 28 | using namespace VCARD; |
27 | 29 | ||
28 | Entity::Entity() | 30 | Entity::Entity() |
29 | : parsed_ (false), | 31 | : parsed_ (false), |
30 | assembled_(true) | 32 | assembled_(true) |
31 | { | 33 | { |
32 | // empty | 34 | // empty |
33 | } | 35 | } |
34 | 36 | ||
35 | Entity::Entity(const Entity & e) | 37 | Entity::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 | ||
43 | Entity::Entity(const QCString & s) | 45 | Entity::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 & |
52 | Entity::operator = (const Entity & e) | 54 | Entity::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 & |
64 | Entity::operator = (const QCString & s) | 66 | Entity::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 |
74 | Entity::operator == (Entity & e) | 76 | Entity::operator == (Entity & e) |
75 | { | 77 | { |
76 | return asString() == e.asString(); | 78 | return asString() == e.asString(); |
77 | } | 79 | } |
78 | 80 | ||
79 | bool | 81 | bool |
80 | Entity::operator != (Entity & e) | 82 | Entity::operator != (Entity & e) |
81 | { | 83 | { |
82 | return !(*this == e); | 84 | return !(*this == e); |
83 | } | 85 | } |
84 | 86 | ||
85 | bool | 87 | bool |
86 | Entity::operator == (const QCString & s) | 88 | Entity::operator == (const Q3CString & s) |
87 | { | 89 | { |
88 | return asString() == s; | 90 | return asString() == s; |
89 | } | 91 | } |
90 | 92 | ||
91 | bool | 93 | bool |
92 | Entity::operator != (const QCString & s) | 94 | Entity::operator != (const Q3CString & s) |
93 | { | 95 | { |
94 | return !(*this == s); | 96 | return !(*this == s); |
95 | } | 97 | } |
96 | 98 | ||
97 | Entity::~Entity() | 99 | Entity::~Entity() |
98 | { | 100 | { |
99 | // empty | 101 | // empty |
100 | } | 102 | } |
101 | 103 | ||
102 | QCString | 104 | Q3CString |
103 | Entity::asString() | 105 | Entity::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 |
112 | Entity::parse() | 114 | Entity::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 |
123 | Entity::assemble() | 125 | Entity::assemble() |
124 | { | 126 | { |
125 | //vDebug( "Entity::assemble()" ); | 127 | //vDebug( "Entity::assemble()" ); |
126 | 128 | ||