Diffstat (limited to 'kabc/vcard/TextListValue.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kabc/vcard/TextListValue.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/kabc/vcard/TextListValue.cpp b/kabc/vcard/TextListValue.cpp index c4ac1e3..919f4f7 100644 --- a/kabc/vcard/TextListValue.cpp +++ b/kabc/vcard/TextListValue.cpp | |||
@@ -1,107 +1,109 @@ | |||
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) 1998 Rik Hemsley rik@kde.org | 4 | Copyright (C) 1998 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 <VCardRToken.h> | 24 | #include <VCardRToken.h> |
25 | 25 | ||
26 | #include <VCardTextListValue.h> | 26 | #include <VCardTextListValue.h> |
27 | 27 | ||
28 | #include <VCardValue.h> | 28 | #include <VCardValue.h> |
29 | //Added by qt3to4: | ||
30 | #include <Q3CString> | ||
29 | 31 | ||
30 | using namespace VCARD; | 32 | using namespace VCARD; |
31 | 33 | ||
32 | TextListValue::TextListValue() | 34 | TextListValue::TextListValue() |
33 | :Value() | 35 | :Value() |
34 | { | 36 | { |
35 | } | 37 | } |
36 | 38 | ||
37 | TextListValue::TextListValue(const TextListValue & x) | 39 | TextListValue::TextListValue(const TextListValue & x) |
38 | :Value(x) | 40 | :Value(x) |
39 | { | 41 | { |
40 | } | 42 | } |
41 | 43 | ||
42 | TextListValue::TextListValue(const QCString & s) | 44 | TextListValue::TextListValue(const Q3CString & s) |
43 | :Value(s) | 45 | :Value(s) |
44 | { | 46 | { |
45 | } | 47 | } |
46 | 48 | ||
47 | TextListValue & | 49 | TextListValue & |
48 | TextListValue::operator = (TextListValue & x) | 50 | TextListValue::operator = (TextListValue & x) |
49 | { | 51 | { |
50 | if (*this == x) return *this; | 52 | if (*this == x) return *this; |
51 | 53 | ||
52 | Value::operator = (x); | 54 | Value::operator = (x); |
53 | return *this; | 55 | return *this; |
54 | } | 56 | } |
55 | 57 | ||
56 | TextListValue & | 58 | TextListValue & |
57 | TextListValue::operator = (const QCString & s) | 59 | TextListValue::operator = (const Q3CString & s) |
58 | { | 60 | { |
59 | Value::operator = (s); | 61 | Value::operator = (s); |
60 | return *this; | 62 | return *this; |
61 | } | 63 | } |
62 | 64 | ||
63 | bool | 65 | bool |
64 | TextListValue::operator == (TextListValue & x) | 66 | TextListValue::operator == (TextListValue & x) |
65 | { | 67 | { |
66 | x.parse(); | 68 | x.parse(); |
67 | return false; | 69 | return false; |
68 | } | 70 | } |
69 | 71 | ||
70 | TextListValue::~TextListValue() | 72 | TextListValue::~TextListValue() |
71 | { | 73 | { |
72 | } | 74 | } |
73 | 75 | ||
74 | void | 76 | void |
75 | TextListValue::_parse() | 77 | TextListValue::_parse() |
76 | { | 78 | { |
77 | RTokenise(strRep_, ";", valueList_); | 79 | RTokenise(strRep_, ";", valueList_); |
78 | } | 80 | } |
79 | 81 | ||
80 | void | 82 | void |
81 | TextListValue::_assemble() | 83 | TextListValue::_assemble() |
82 | { | 84 | { |
83 | bool first(true); | 85 | bool first(true); |
84 | 86 | ||
85 | QStrListIterator it(valueList_); | 87 | Q3StrListIterator it(valueList_); |
86 | 88 | ||
87 | for (; it.current(); ++it) { | 89 | for (; it.current(); ++it) { |
88 | if (!first) strRep_ += ';'; | 90 | if (!first) strRep_ += ';'; |
89 | strRep_ += it.current(); | 91 | strRep_ += it.current(); |
90 | first = false; | 92 | first = false; |
91 | } | 93 | } |
92 | } | 94 | } |
93 | 95 | ||
94 | unsigned int | 96 | unsigned int |
95 | TextListValue::numValues() | 97 | TextListValue::numValues() |
96 | { | 98 | { |
97 | parse(); | 99 | parse(); |
98 | return valueList_.count(); | 100 | return valueList_.count(); |
99 | } | 101 | } |
100 | 102 | ||
101 | QCString | 103 | Q3CString |
102 | TextListValue::value(unsigned int i) | 104 | TextListValue::value(unsigned int i) |
103 | { | 105 | { |
104 | parse(); | 106 | parse(); |
105 | return valueList_.at(i); | 107 | return valueList_.at(i); |
106 | } | 108 | } |
107 | 109 | ||