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/TextBinValue.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | kabc/vcard/TextBinValue.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kabc/vcard/TextBinValue.cpp b/kabc/vcard/TextBinValue.cpp index c584009..a3a96ae 100644 --- a/kabc/vcard/TextBinValue.cpp +++ b/kabc/vcard/TextBinValue.cpp | |||
@@ -1,104 +1,106 @@ | |||
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 <kmdcodec.h> | 24 | #include <kmdcodec.h> |
25 | 25 | ||
26 | #include <VCardTextBinValue.h> | 26 | #include <VCardTextBinValue.h> |
27 | #include <VCardValue.h> | 27 | #include <VCardValue.h> |
28 | //Added by qt3to4: | ||
29 | #include <Q3CString> | ||
28 | 30 | ||
29 | using namespace VCARD; | 31 | using namespace VCARD; |
30 | 32 | ||
31 | TextBinValue::TextBinValue() | 33 | TextBinValue::TextBinValue() |
32 | :Value() | 34 | :Value() |
33 | { | 35 | { |
34 | } | 36 | } |
35 | 37 | ||
36 | TextBinValue::TextBinValue(const TextBinValue & x) | 38 | TextBinValue::TextBinValue(const TextBinValue & x) |
37 | :Value(x) | 39 | :Value(x) |
38 | { | 40 | { |
39 | mIsBinary_ = x.mIsBinary_; | 41 | mIsBinary_ = x.mIsBinary_; |
40 | mData_ = x.mData_; | 42 | mData_ = x.mData_; |
41 | mUrl_ = x.mUrl_; | 43 | mUrl_ = x.mUrl_; |
42 | } | 44 | } |
43 | 45 | ||
44 | TextBinValue::TextBinValue(const QCString & s) | 46 | TextBinValue::TextBinValue(const Q3CString & s) |
45 | :Value(s) | 47 | :Value(s) |
46 | { | 48 | { |
47 | } | 49 | } |
48 | 50 | ||
49 | TextBinValue & | 51 | TextBinValue & |
50 | TextBinValue::operator = (TextBinValue & x) | 52 | TextBinValue::operator = (TextBinValue & x) |
51 | { | 53 | { |
52 | if (*this == x) return *this; | 54 | if (*this == x) return *this; |
53 | 55 | ||
54 | mIsBinary_ = x.mIsBinary_; | 56 | mIsBinary_ = x.mIsBinary_; |
55 | mData_ = x.mData_; | 57 | mData_ = x.mData_; |
56 | mUrl_ = x.mUrl_; | 58 | mUrl_ = x.mUrl_; |
57 | 59 | ||
58 | Value::operator = (x); | 60 | Value::operator = (x); |
59 | return *this; | 61 | return *this; |
60 | } | 62 | } |
61 | 63 | ||
62 | TextBinValue & | 64 | TextBinValue & |
63 | TextBinValue::operator = (const QCString & s) | 65 | TextBinValue::operator = (const Q3CString & s) |
64 | { | 66 | { |
65 | Value::operator = (s); | 67 | Value::operator = (s); |
66 | return *this; | 68 | return *this; |
67 | } | 69 | } |
68 | 70 | ||
69 | bool | 71 | bool |
70 | TextBinValue::operator == (TextBinValue & x) | 72 | TextBinValue::operator == (TextBinValue & x) |
71 | { | 73 | { |
72 | x.parse(); | 74 | x.parse(); |
73 | 75 | ||
74 | if ( mIsBinary_ != x.mIsBinary_ ) return false; | 76 | if ( mIsBinary_ != x.mIsBinary_ ) return false; |
75 | if ( mData_ != x.mData_ ) return false; | 77 | if ( mData_ != x.mData_ ) return false; |
76 | if ( mUrl_ != x.mUrl_ ) return false; | 78 | if ( mUrl_ != x.mUrl_ ) return false; |
77 | 79 | ||
78 | return true; | 80 | return true; |
79 | } | 81 | } |
80 | 82 | ||
81 | TextBinValue::~TextBinValue() | 83 | TextBinValue::~TextBinValue() |
82 | { | 84 | { |
83 | } | 85 | } |
84 | 86 | ||
85 | TextBinValue * | 87 | TextBinValue * |
86 | TextBinValue::clone() | 88 | TextBinValue::clone() |
87 | { | 89 | { |
88 | return new TextBinValue( *this ); | 90 | return new TextBinValue( *this ); |
89 | } | 91 | } |
90 | 92 | ||
91 | void | 93 | void |
92 | TextBinValue::_parse() | 94 | TextBinValue::_parse() |
93 | { | 95 | { |
94 | } | 96 | } |
95 | 97 | ||
96 | void | 98 | void |
97 | TextBinValue::_assemble() | 99 | TextBinValue::_assemble() |
98 | { | 100 | { |
99 | if ( mIsBinary_ ) { | 101 | if ( mIsBinary_ ) { |
100 | strRep_ = KCodecs::base64Encode( mData_ ); | 102 | strRep_ = KCodecs::base64Encode( mData_ ); |
101 | } else | 103 | } else |
102 | strRep_ = mUrl_.utf8(); | 104 | strRep_ = mUrl_.utf8(); |
103 | } | 105 | } |
104 | 106 | ||