summaryrefslogtreecommitdiffabout
path: root/kabc/vcard/NValue.cpp
Unidiff
Diffstat (limited to 'kabc/vcard/NValue.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kabc/vcard/NValue.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/kabc/vcard/NValue.cpp b/kabc/vcard/NValue.cpp
index cdec621..6c0f365 100644
--- a/kabc/vcard/NValue.cpp
+++ b/kabc/vcard/NValue.cpp
@@ -12,72 +12,74 @@
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 <qstrlist.h> 24#include <q3strlist.h>
25//Added by qt3to4:
26#include <Q3CString>
25 27
26#include <VCardRToken.h> 28#include <VCardRToken.h>
27#include <VCardNValue.h> 29#include <VCardNValue.h>
28#include <VCardValue.h> 30#include <VCardValue.h>
29#include <VCardDefines.h> 31#include <VCardDefines.h>
30 32
31using namespace VCARD; 33using namespace VCARD;
32 34
33NValue::NValue() 35NValue::NValue()
34 :Value() 36 :Value()
35{ 37{
36 vDebug("ctor"); 38 vDebug("ctor");
37} 39}
38 40
39NValue::NValue(const NValue & x) 41NValue::NValue(const NValue & x)
40 :Value(x), 42 :Value(x),
41 family_(x.family_), 43 family_(x.family_),
42 given_(x.given_), 44 given_(x.given_),
43 middle_(x.middle_), 45 middle_(x.middle_),
44 prefix_(x.prefix_), 46 prefix_(x.prefix_),
45 suffix_(x.suffix_) 47 suffix_(x.suffix_)
46{ 48{
47} 49}
48 50
49NValue::NValue(const QCString & s) 51NValue::NValue(const Q3CString & s)
50 :Value(s) 52 :Value(s)
51{ 53{
52 vDebug("ctor"); 54 vDebug("ctor");
53} 55}
54 56
55 NValue & 57 NValue &
56NValue::operator = (NValue & x) 58NValue::operator = (NValue & x)
57{ 59{
58 if (*this == x) return *this; 60 if (*this == x) return *this;
59 61
60 family_= x.family_; 62 family_= x.family_;
61 given_= x.given_; 63 given_= x.given_;
62 middle_= x.middle_; 64 middle_= x.middle_;
63 prefix_= x.prefix_; 65 prefix_= x.prefix_;
64 suffix_= x.suffix_; 66 suffix_= x.suffix_;
65 67
66 Value::operator = (x); 68 Value::operator = (x);
67 return *this; 69 return *this;
68} 70}
69 71
70 NValue & 72 NValue &
71NValue::operator = (const QCString & s) 73NValue::operator = (const Q3CString & s)
72{ 74{
73 Value::operator = (s); 75 Value::operator = (s);
74 return *this; 76 return *this;
75} 77}
76 78
77 bool 79 bool
78NValue::operator == (NValue & x) 80NValue::operator == (NValue & x)
79{ 81{
80 x.parse(); 82 x.parse();
81 83
82 return ( 84 return (
83 family_ == x.family_&& 85 family_ == x.family_&&
@@ -91,25 +93,25 @@ NValue::~NValue()
91{ 93{
92} 94}
93 95
94 NValue * 96 NValue *
95NValue::clone() 97NValue::clone()
96{ 98{
97 return new NValue( *this ); 99 return new NValue( *this );
98} 100}
99 101
100 void 102 void
101NValue::_parse() 103NValue::_parse()
102{ 104{
103 QStrList l; 105 Q3StrList l;
104 RTokenise(strRep_, ";", l); 106 RTokenise(strRep_, ";", l);
105 107
106 for (unsigned int i = 0; i < l.count(); i++) { 108 for (unsigned int i = 0; i < l.count(); i++) {
107 109
108 switch (i) { 110 switch (i) {
109 case 0: family_ = l.at(0);break; 111 case 0: family_ = l.at(0);break;
110 case 1: given_ = l.at(1);break; 112 case 1: given_ = l.at(1);break;
111 case 2: middle_ = l.at(2);break; 113 case 2: middle_ = l.at(2);break;
112 case 3: prefix_ = l.at(3);break; 114 case 3: prefix_ = l.at(3);break;
113 case 4: suffix_ = l.at(4);break; 115 case 4: suffix_ = l.at(4);break;
114 default: break; 116 default: break;
115 } 117 }