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/URIValue.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/URIValue.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/kabc/vcard/URIValue.cpp b/kabc/vcard/URIValue.cpp index c1d1022..26da7f4 100644 --- a/kabc/vcard/URIValue.cpp +++ b/kabc/vcard/URIValue.cpp | |||
@@ -1,133 +1,135 @@ | |||
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 <VCardURIValue.h> | 24 | #include <VCardURIValue.h> |
25 | 25 | ||
26 | #include <VCardValue.h> | 26 | #include <VCardValue.h> |
27 | //Added by qt3to4: | ||
28 | #include <Q3CString> | ||
27 | 29 | ||
28 | using namespace VCARD; | 30 | using namespace VCARD; |
29 | 31 | ||
30 | URIValue::URIValue() | 32 | URIValue::URIValue() |
31 | :Value() | 33 | :Value() |
32 | { | 34 | { |
33 | } | 35 | } |
34 | 36 | ||
35 | URIValue::URIValue(const QCString & scheme, const QCString & schemeSpecificPart) | 37 | URIValue::URIValue(const Q3CString & scheme, const Q3CString & schemeSpecificPart) |
36 | :Value(), | 38 | :Value(), |
37 | scheme_ (scheme), | 39 | scheme_ (scheme), |
38 | schemeSpecificPart_(schemeSpecificPart) | 40 | schemeSpecificPart_(schemeSpecificPart) |
39 | { | 41 | { |
40 | parsed_ = true; | 42 | parsed_ = true; |
41 | } | 43 | } |
42 | 44 | ||
43 | URIValue::URIValue(const URIValue & x) | 45 | URIValue::URIValue(const URIValue & x) |
44 | : Value (x), | 46 | : Value (x), |
45 | scheme_ (x.scheme_), | 47 | scheme_ (x.scheme_), |
46 | schemeSpecificPart_(x.schemeSpecificPart_) | 48 | schemeSpecificPart_(x.schemeSpecificPart_) |
47 | { | 49 | { |
48 | } | 50 | } |
49 | 51 | ||
50 | URIValue::URIValue(const QCString & s) | 52 | URIValue::URIValue(const Q3CString & s) |
51 | :Value(s) | 53 | :Value(s) |
52 | { | 54 | { |
53 | } | 55 | } |
54 | 56 | ||
55 | URIValue & | 57 | URIValue & |
56 | URIValue::operator = (URIValue & x) | 58 | URIValue::operator = (URIValue & x) |
57 | { | 59 | { |
58 | if (*this == x) return *this; | 60 | if (*this == x) return *this; |
59 | 61 | ||
60 | scheme_ = x.scheme_; | 62 | scheme_ = x.scheme_; |
61 | schemeSpecificPart_= x.schemeSpecificPart_; | 63 | schemeSpecificPart_= x.schemeSpecificPart_; |
62 | 64 | ||
63 | Value::operator = (x); | 65 | Value::operator = (x); |
64 | return *this; | 66 | return *this; |
65 | } | 67 | } |
66 | 68 | ||
67 | URIValue & | 69 | URIValue & |
68 | URIValue::operator = (const QCString & s) | 70 | URIValue::operator = (const Q3CString & s) |
69 | { | 71 | { |
70 | Value::operator = (s); | 72 | Value::operator = (s); |
71 | return *this; | 73 | return *this; |
72 | } | 74 | } |
73 | 75 | ||
74 | bool | 76 | bool |
75 | URIValue::operator == (URIValue & x) | 77 | URIValue::operator == (URIValue & x) |
76 | { | 78 | { |
77 | x.parse(); | 79 | x.parse(); |
78 | return ( | 80 | return ( |
79 | (scheme_ == x.scheme_) && | 81 | (scheme_ == x.scheme_) && |
80 | (schemeSpecificPart_== x.schemeSpecificPart_)); | 82 | (schemeSpecificPart_== x.schemeSpecificPart_)); |
81 | 83 | ||
82 | return false; | 84 | return false; |
83 | } | 85 | } |
84 | 86 | ||
85 | URIValue::~URIValue() | 87 | URIValue::~URIValue() |
86 | { | 88 | { |
87 | } | 89 | } |
88 | 90 | ||
89 | void | 91 | void |
90 | URIValue::_parse() | 92 | URIValue::_parse() |
91 | { | 93 | { |
92 | int split = strRep_.find(':'); | 94 | int split = strRep_.find(':'); |
93 | if (split == -1) | 95 | if (split == -1) |
94 | return; | 96 | return; |
95 | 97 | ||
96 | scheme_ = strRep_.left(split); | 98 | scheme_ = strRep_.left(split); |
97 | schemeSpecificPart_ = strRep_.mid(split + 1); | 99 | schemeSpecificPart_ = strRep_.mid(split + 1); |
98 | } | 100 | } |
99 | 101 | ||
100 | void | 102 | void |
101 | URIValue::_assemble() | 103 | URIValue::_assemble() |
102 | { | 104 | { |
103 | strRep_ = scheme_ + ':' + schemeSpecificPart_; | 105 | strRep_ = scheme_ + ':' + schemeSpecificPart_; |
104 | } | 106 | } |
105 | 107 | ||
106 | QCString | 108 | Q3CString |
107 | URIValue::scheme() | 109 | URIValue::scheme() |
108 | { | 110 | { |
109 | parse(); | 111 | parse(); |
110 | return scheme_; | 112 | return scheme_; |
111 | } | 113 | } |
112 | 114 | ||
113 | QCString | 115 | Q3CString |
114 | URIValue::schemeSpecificPart() | 116 | URIValue::schemeSpecificPart() |
115 | { | 117 | { |
116 | parse(); | 118 | parse(); |
117 | return schemeSpecificPart_; | 119 | return schemeSpecificPart_; |
118 | } | 120 | } |
119 | 121 | ||
120 | void | 122 | void |
121 | URIValue::setScheme(const QCString & s) | 123 | URIValue::setScheme(const Q3CString & s) |
122 | { | 124 | { |
123 | parse(); | 125 | parse(); |
124 | scheme_ = s; | 126 | scheme_ = s; |
125 | } | 127 | } |
126 | 128 | ||
127 | void | 129 | void |
128 | URIValue::setSchemeSpecificPart(const QCString & s) | 130 | URIValue::setSchemeSpecificPart(const Q3CString & s) |
129 | { | 131 | { |
130 | parse(); | 132 | parse(); |
131 | schemeSpecificPart_ = s; | 133 | schemeSpecificPart_ = s; |
132 | } | 134 | } |
133 | 135 | ||