KCodecs Class Reference
A wrapper class for the most commonly used encoding and decoding algorithms. A collection of commonly used encoding and decoding algorithms. More...
#include <kmdcodec.h>
Static Public Methods | |
QCString | quotedPrintableEncode (const QByteArray &in, bool useCRLF=true) |
Encodes the given data using the quoted-printable algorithm. | |
QCString | quotedPrintableEncode (const QCString &str, bool useCRLF=true) |
Same as above except it accepts a null terminated string instead an array. | |
void | quotedPrintableEncode (const QByteArray &in, QByteArray &out, bool useCRLF) |
Encodes the given data using the quoted-printable algorithm. | |
QCString | quotedPrintableDecode (const QByteArray &in) |
Decodes a quoted-printable encoded string. | |
QCString | quotedPrintableDecode (const QCString &str) |
Same as above except it accepts a null terminated string instead an array. | |
void | quotedPrintableDecode (const QByteArray &in, QByteArray &out) |
Decodes a quoted-printable encoded data. | |
QCString | uuencode (const QByteArray &in) |
Encodes the given data using the uuencode algorithm. | |
QCString | uuencode (const QCString &str) |
Same as the above functions except it accepts a null terminated string instead an array. | |
void | uuencode (const QByteArray &in, QByteArray &out) |
Encodes the given data using the uuencode algorithm. | |
QCString | uudecode (const QByteArray &in) |
Decodes the given data using the uuencode algorithm. | |
QCString | uudecode (const QCString &str) |
Same as the above functions except it accepts a null terminated string instead an array. | |
void | uudecode (const QByteArray &in, QByteArray &out) |
Decodes the given data using the uudecode algorithm. | |
QCString | base64Encode (const QByteArray &in, bool insertLFs=false) |
Encodes the given data using the base64 algorithm. | |
QCString | base64Encode (const QCString &str, bool insertLFs=false) |
Same as the above functions except it accepts a null terminated string instead an array. | |
void | base64Encode (const QByteArray &in, QByteArray &out, bool insertLFs=false) |
Encodes the given data using the base64 algorithm. | |
QCString | base64Decode (const QByteArray &in) |
Decodes the given data that was encoded using the base64 algorithm. | |
QCString | base64Decode (const QCString &str) |
Same as the above functions except it accepts a null terminated string instead an array. | |
void | base64Decode (const QByteArray &in, QByteArray &out) |
Decodes the given data that was encoded with the base64 algorithm. |
Detailed Description
A wrapper class for the most commonly used encoding and decoding algorithms. A collection of commonly used encoding and decoding algorithms.Currently there is support for encoding and decoding input using base64, uu and the quoted-printable specifications.
Usage:
QCString input = "Aladdin:open sesame"; QCString result = KCodecs::base64Encode(input); cout << "Result: " << result.data() << endl; Output should be Result: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
The above example makes use of the convenience functions (ones that accept/return null-terminated strings) to encode/decode a string. If what you need is to encode or decode binary data, then it is highly recommended that you use the functions that take an input and output QByteArray as arguments. These functions are specifically tailored for encoding and decoding binary data.
- Author:
- Dawit Alemayehu <adawit@kde.org> , Rik Hemsley <rik@kde.org>
Definition at line 71 of file kmdcodec.h.
Member Function Documentation
|
Encodes the given data using the quoted-printable algorithm.
Definition at line 150 of file kmdcodec.cpp. Referenced by quotedPrintableEncode(). |
|
Same as above except it accepts a null terminated string instead an array. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 157 of file kmdcodec.cpp. References QCString::isEmpty(), QCString::length(), and quotedPrintableEncode(). |
|
Encodes the given data using the quoted-printable algorithm. Use this function if you want the result of the encoding to be placed in another array which cuts down the number of copy operation that have to be performed in the process. This is also the preferred method for encoding binary data. NOTE: the output array is first reset and then resized appropriately before use, hence, all data stored in the output array will be lost.
Definition at line 167 of file kmdcodec.cpp. References KStdAccel::end(). |
|
Decodes a quoted-printable encoded string. Accepts data with CRLF or standard unix line breaks.
Definition at line 283 of file kmdcodec.cpp. Referenced by quotedPrintableDecode(). |
|
Same as above except it accepts a null terminated string instead an array. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 290 of file kmdcodec.cpp. References QCString::isEmpty(), QCString::length(), and quotedPrintableDecode(). |
|
Decodes a quoted-printable encoded data. Accepts data with CRLF or standard unix line breaks. Use this function if you want the result of the decoding to be placed in another array which cuts down the number of copy operation that have to be performed in the process. This is also the preferred method for decoding an encoded binary data. NOTE: the output array is first reset and then resized appropriately before use, hence, all data stored in the output array will be lost.
Definition at line 300 of file kmdcodec.cpp. |
|
Encodes the given data using the uuencode algorithm. The output is split into lines starting with the number of encoded octets in the line and ending with a newline. No line is longer than 45 octets (60 characters), excluding the line terminator.
Definition at line 556 of file kmdcodec.cpp. Referenced by uuencode(). |
|
Same as the above functions except it accepts a null terminated string instead an array. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 545 of file kmdcodec.cpp. References QCString::isEmpty(), QCString::length(), and uuencode(). |
|
Encodes the given data using the uuencode algorithm. Use this function if you want the result of the encoding to be placed in another array and cut down the number of copy operation that have to be performed in the process. This is the preffered method for encoding binary data. NOTE: the output array is first reset and then resized appropriately before use, hence, all data stored in the output array will be lost.
Definition at line 563 of file kmdcodec.cpp. References KStdAccel::end(). |
|
Decodes the given data using the uuencode algorithm. Any 'begin' and 'end' lines like those generated by the utilities in unix and unix-like OS will be automatically ignored.
Definition at line 653 of file kmdcodec.cpp. Referenced by uudecode(). |
|
Same as the above functions except it accepts a null terminated string instead an array. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 642 of file kmdcodec.cpp. References QCString::isEmpty(), QCString::length(), and uudecode(). |
|
Decodes the given data using the uudecode algorithm. Use this function if you want the result of the decoding to be placed in another array which cuts down the number of copy operation that have to be performed in the process. This is the preferred method for decoding binary data. Any 'begin' and 'end' lines like those generated by the utilities in unix and unix-like OS will be automatically ignored. NOTE: the output array is first reset and then resized appropriately before use, hence, all data stored in the output array will be lost.
Definition at line 660 of file kmdcodec.cpp. References KStdAccel::end(). |
|
Encodes the given data using the base64 algorithm.
The boolean argument determines if the encoded data is going to be restricted to 76 characters or less per line as specified by RFC 2045. If
Definition at line 368 of file kmdcodec.cpp. Referenced by KMD5::base64Digest(), and base64Encode(). |
|
Same as the above functions except it accepts a null terminated string instead an array. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 358 of file kmdcodec.cpp. References base64Encode(), QCString::isEmpty(), and QCString::length(). |
|
Encodes the given data using the base64 algorithm. Use this function if you want the result of the encoding to be placed in another array which cuts down the number of copy operation that have to be performed in the process. This is also the preferred method for encoding binary data.
The boolean argument determines if the encoded data is going to be restricted to 76 characters or less per line as specified by RFC 2045. If NOTE: the output array is first reset and then resized appropriately before use, hence, all data stored in the output array will be lost.
Definition at line 375 of file kmdcodec.cpp. |
|
Decodes the given data that was encoded using the base64 algorithm.
Definition at line 457 of file kmdcodec.cpp. Referenced by base64Decode(). |
|
Same as the above functions except it accepts a null terminated string instead an array. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 447 of file kmdcodec.cpp. References base64Decode(), QCString::isEmpty(), and QCString::length(). |
|
Decodes the given data that was encoded with the base64 algorithm. Use this function if you want the result of the decoding to be placed in another array which cuts down the number of copy operation that have to be performed in the process. This is also the preferred method for decoding an encoded binary data. NOTE: the output array is first reset and then resized appropriately before use, hence, all data stored in the output array will be lost.
Definition at line 464 of file kmdcodec.cpp. |
The documentation for this class was generated from the following files: