summaryrefslogtreecommitdiffabout
path: root/microkde/kdecore/kmdcodec.h
Unidiff
Diffstat (limited to 'microkde/kdecore/kmdcodec.h') (more/less context) (show whitespace changes)
-rw-r--r--microkde/kdecore/kmdcodec.h38
1 files changed, 20 insertions, 18 deletions
diff --git a/microkde/kdecore/kmdcodec.h b/microkde/kdecore/kmdcodec.h
index 2c4d611..616b683 100644
--- a/microkde/kdecore/kmdcodec.h
+++ b/microkde/kdecore/kmdcodec.h
@@ -36,12 +36,14 @@
36 36
37#define KBase64 KCodecs 37#define KBase64 KCodecs
38 38
39#include <qglobal.h> 39#include <qglobal.h>
40#include <qstring.h> 40#include <qstring.h>
41#include <qiodevice.h> 41#include <qiodevice.h>
42//Added by qt3to4:
43#include <Q3CString>
42 44
43/** 45/**
44 * A wrapper class for the most commonly used encoding and 46 * A wrapper class for the most commonly used encoding and
45 * decoding algorithms. Currently there is support for encoding 47 * decoding algorithms. Currently there is support for encoding
46 * and decoding input using base64, uu and the quoted-printable 48 * and decoding input using base64, uu and the quoted-printable
47 * specifications. 49 * specifications.
@@ -78,13 +80,13 @@ public:
78 * @param in data to be encoded. 80 * @param in data to be encoded.
79 * @param useCRLF if true the input data is expected to have 81 * @param useCRLF if true the input data is expected to have
80 * CRLF line breaks and the output will have CRLF line 82 * CRLF line breaks and the output will have CRLF line
81 * breaks, too. 83 * breaks, too.
82 * @return quoted-printable encoded data. 84 * @return quoted-printable encoded data.
83 */ 85 */
84 static QCString quotedPrintableEncode(const QByteArray & in, 86 static Q3CString quotedPrintableEncode(const QByteArray & in,
85 bool useCRLF = true); 87 bool useCRLF = true);
86 88
87 /** 89 /**
88 * @overload 90 * @overload
89 * 91 *
90 * Same as above except it accepts a null terminated 92 * Same as above except it accepts a null terminated
@@ -93,13 +95,13 @@ public:
93 * @param str data to be encoded. 95 * @param str data to be encoded.
94 * @param useCRLF if true the input data is expected to have 96 * @param useCRLF if true the input data is expected to have
95 * CRLF line breaks and the output will have CRLF line 97 * CRLF line breaks and the output will have CRLF line
96 * breaks, too. 98 * breaks, too.
97 * @return quoted-printable encoded data. 99 * @return quoted-printable encoded data.
98 */ 100 */
99 static QCString quotedPrintableEncode(const QCString & str, 101 static Q3CString quotedPrintableEncode(const Q3CString & str,
100 bool useCRLF = true); 102 bool useCRLF = true);
101 103
102 /** 104 /**
103 * Encodes the given data using the quoted-printable algorithm. 105 * Encodes the given data using the quoted-printable algorithm.
104 * 106 *
105 * Use this function if you want the result of the encoding 107 * Use this function if you want the result of the encoding
@@ -126,24 +128,24 @@ public:
126 * 128 *
127 * Accepts data with CRLF or standard unix line breaks. 129 * Accepts data with CRLF or standard unix line breaks.
128 * 130 *
129 * @param in the data to be decoded. 131 * @param in the data to be decoded.
130 * @return decoded data. 132 * @return decoded data.
131 */ 133 */
132 static QCString quotedPrintableDecode(const QByteArray & in); 134 static Q3CString quotedPrintableDecode(const QByteArray & in);
133 135
134 /** 136 /**
135 * @overload 137 * @overload
136 * 138 *
137 * Same as above except it accepts a null terminated 139 * Same as above except it accepts a null terminated
138 * string instead an array. 140 * string instead an array.
139 * 141 *
140 * @param str the data to be decoded. 142 * @param str the data to be decoded.
141 * @return decoded data. 143 * @return decoded data.
142 */ 144 */
143 static QCString quotedPrintableDecode(const QCString & str); 145 static Q3CString quotedPrintableDecode(const Q3CString & str);
144 146
145 /** 147 /**
146 * Decodes a quoted-printable encoded data. 148 * Decodes a quoted-printable encoded data.
147 * 149 *
148 * Accepts data with CRLF or standard unix line breaks. 150 * Accepts data with CRLF or standard unix line breaks.
149 * Use this function if you want the result of the decoding 151 * Use this function if you want the result of the decoding
@@ -172,24 +174,24 @@ public:
172 * line is longer than 45 octets (60 characters), excluding the 174 * line is longer than 45 octets (60 characters), excluding the
173 * line terminator. 175 * line terminator.
174 * 176 *
175 * @param in the data to be uuencoded 177 * @param in the data to be uuencoded
176 * @return a uuencoded data. 178 * @return a uuencoded data.
177 */ 179 */
178 static QCString uuencode( const QByteArray& in ); 180 static Q3CString uuencode( const QByteArray& in );
179 181
180 /** 182 /**
181 * @overload 183 * @overload
182 * 184 *
183 * Same as the above functions except it accepts 185 * Same as the above functions except it accepts
184 * a null terminated string instead an array. 186 * a null terminated string instead an array.
185 * 187 *
186 * @param str the string to be uuencoded. 188 * @param str the string to be uuencoded.
187 * @return the encoded string. 189 * @return the encoded string.
188 */ 190 */
189 static QCString uuencode( const QCString& str ); 191 static Q3CString uuencode( const Q3CString& str );
190 192
191 /** 193 /**
192 * Encodes the given data using the uuencode algorithm. 194 * Encodes the given data using the uuencode algorithm.
193 * 195 *
194 * Use this function if you want the result of the encoding 196 * Use this function if you want the result of the encoding
195 * to be placed in another array and cut down the number of 197 * to be placed in another array and cut down the number of
@@ -212,24 +214,24 @@ public:
212 * the utilities in unix and unix-like OS will be 214 * the utilities in unix and unix-like OS will be
213 * automatically ignored. 215 * automatically ignored.
214 * 216 *
215 * @param in the data uuencoded data to be decoded. 217 * @param in the data uuencoded data to be decoded.
216 * @return a decoded string. 218 * @return a decoded string.
217 */ 219 */
218 static QCString uudecode( const QByteArray& in ); 220 static Q3CString uudecode( const QByteArray& in );
219 221
220 /** 222 /**
221 * @overload 223 * @overload
222 * 224 *
223 * Same as the above functions except it accepts 225 * Same as the above functions except it accepts
224 * a null terminated string instead an array. 226 * a null terminated string instead an array.
225 * 227 *
226 * @param str the string to be decoded. 228 * @param str the string to be decoded.
227 * @return a uudecoded string. 229 * @return a uudecoded string.
228 */ 230 */
229 static QCString uudecode( const QCString& str ); 231 static Q3CString uudecode( const Q3CString& str );
230 232
231 /** 233 /**
232 * Decodes the given data using the uudecode algorithm. 234 * Decodes the given data using the uudecode algorithm.
233 * 235 *
234 * Use this function if you want the result of the decoding 236 * Use this function if you want the result of the decoding
235 * to be placed in another array which cuts down the number 237 * to be placed in another array which cuts down the number
@@ -260,25 +262,25 @@ public:
260 * 262 *
261 * @param in the data to be encoded. 263 * @param in the data to be encoded.
262 * @param insertLFs limit the number of characters per line. 264 * @param insertLFs limit the number of characters per line.
263 * 265 *
264 * @return a base64 encoded string. 266 * @return a base64 encoded string.
265 */ 267 */
266 static QCString base64Encode( const QByteArray& in, bool insertLFs = false); 268 static Q3CString base64Encode( const QByteArray& in, bool insertLFs = false);
267 269
268 /** 270 /**
269 * @overload 271 * @overload
270 * 272 *
271 * Same as the above functions except it accepts 273 * Same as the above functions except it accepts
272 * a null terminated string instead an array. 274 * a null terminated string instead an array.
273 * 275 *
274 * @param str the string to be encoded. 276 * @param str the string to be encoded.
275 * @param insertLFs limit the number of characters per line. 277 * @param insertLFs limit the number of characters per line.
276 * @return the decoded string. 278 * @return the decoded string.
277 */ 279 */
278 static QCString base64Encode( const QCString& str, bool insertLFs = false ); 280 static Q3CString base64Encode( const Q3CString& str, bool insertLFs = false );
279 281
280 /** 282 /**
281 * Encodes the given data using the base64 algorithm. 283 * Encodes the given data using the base64 algorithm.
282 * 284 *
283 * Use this function if you want the result of the encoding 285 * Use this function if you want the result of the encoding
284 * to be placed in another array which cuts down the number 286 * to be placed in another array which cuts down the number
@@ -305,24 +307,24 @@ public:
305 * Decodes the given data that was encoded using the 307 * Decodes the given data that was encoded using the
306 * base64 algorithm. 308 * base64 algorithm.
307 * 309 *
308 * @param in the base64-encoded data to be decoded. 310 * @param in the base64-encoded data to be decoded.
309 * @return the decoded data. 311 * @return the decoded data.
310 */ 312 */
311 static QCString base64Decode( const QByteArray& in ); 313 static Q3CString base64Decode( const QByteArray& in );
312 314
313 /** 315 /**
314 * @overload 316 * @overload
315 * 317 *
316 * Same as the above functions except it accepts 318 * Same as the above functions except it accepts
317 * a null terminated string instead an array. 319 * a null terminated string instead an array.
318 * 320 *
319 * @param str the base64-encoded string. 321 * @param str the base64-encoded string.
320 * @return the decoded string. 322 * @return the decoded string.
321 */ 323 */
322 static QCString base64Decode( const QCString& str ); 324 static Q3CString base64Decode( const Q3CString& str );
323 325
324 /** 326 /**
325 * Decodes the given data that was encoded with the base64 327 * Decodes the given data that was encoded with the base64
326 * algorithm. 328 * algorithm.
327 * 329 *
328 * Use this function if you want the result of the decoding 330 * Use this function if you want the result of the decoding
@@ -428,13 +430,13 @@ public:
428 430
429 /** 431 /**
430 * @overload 432 * @overload
431 * 433 *
432 * Same as above except it accepts a QByteArray as its argument. 434 * Same as above except it accepts a QByteArray as its argument.
433 */ 435 */
434 KMD5(const QCString& a ); 436 KMD5(const Q3CString& a );
435 437
436 /** 438 /**
437 * Updates the message to be digested. Be sure to add all data 439 * Updates the message to be digested. Be sure to add all data
438 * before you read the digest. After reading the digest, you 440 * before you read the digest. After reading the digest, you
439 * can <b>not</b> add more data! 441 * can <b>not</b> add more data!
440 * 442 *
@@ -457,13 +459,13 @@ public:
457 459
458 /** 460 /**
459 * @overload 461 * @overload
460 * 462 *
461 * @param in message to be added to the digest (QByteArray). 463 * @param in message to be added to the digest (QByteArray).
462 */ 464 */
463 void update(const QCString& in ); 465 void update(const Q3CString& in );
464 466
465 /** 467 /**
466 * @overload 468 * @overload
467 * 469 *
468 * reads the data from an I/O device, i.e. from a file (QFile). 470 * reads the data from an I/O device, i.e. from a file (QFile).
469 * 471 *
@@ -499,35 +501,35 @@ public:
499 void rawDigest( KMD5::Digest& bin ); 501 void rawDigest( KMD5::Digest& bin );
500 502
501 /** 503 /**
502 * Returns the value of the calculated message digest in 504 * Returns the value of the calculated message digest in
503 * a hexadecimal representation. 505 * a hexadecimal representation.
504 */ 506 */
505 QCString hexDigest (); 507 Q3CString hexDigest ();
506 508
507 /** 509 /**
508 * @overload 510 * @overload
509 */ 511 */
510 void hexDigest(QCString&); 512 void hexDigest(Q3CString&);
511 513
512 /** 514 /**
513 * Returns the value of the calculated message digest in 515 * Returns the value of the calculated message digest in
514 * a base64-encoded representation. 516 * a base64-encoded representation.
515 */ 517 */
516 QCString base64Digest (); 518 Q3CString base64Digest ();
517 519
518 /** 520 /**
519 * returns true if the calculated digest for the given 521 * returns true if the calculated digest for the given
520 * message matches the given one. 522 * message matches the given one.
521 */ 523 */
522 bool verify( const KMD5::Digest& digest); 524 bool verify( const KMD5::Digest& digest);
523 525
524 /** 526 /**
525 * @overload 527 * @overload
526 */ 528 */
527 bool verify(const QCString&); 529 bool verify(const Q3CString&);
528 530
529protected: 531protected:
530 /** 532 /**
531 * Performs the real update work. Note 533 * Performs the real update work. Note
532 * that length is implied to be 64. 534 * that length is implied to be 64.
533 */ 535 */