KDECore
Functions | |
QByteArray | base64Decode (const QByteArray &in) |
void | base64Decode (const QByteArray &in, QByteArray &out) |
QByteArray | base64Encode (const QByteArray &in, bool insertLFs=false) |
void | base64Encode (const QByteArray &in, QByteArray &out, bool insertLFs=false) |
QString | decodeRFC2047String (const QString &text) |
QByteArray | quotedPrintableDecode (const QByteArray &in) |
void | quotedPrintableDecode (const QByteArray &in, QByteArray &out) |
QByteArray | quotedPrintableEncode (const QByteArray &in, bool useCRLF=true) |
void | quotedPrintableEncode (const QByteArray &in, QByteArray &out, bool useCRLF) |
QByteArray | uudecode (const QByteArray &in) |
void | uudecode (const QByteArray &in, QByteArray &out) |
QByteArray | uuencode (const QByteArray &in) |
void | uuencode (const QByteArray &in, QByteArray &out) |
Variables | |
static const char | Base64DecMap [128] |
static const char | Base64EncMap [64] |
static const char | hexChars [16] |
static const unsigned int | maxQPLineLength = 70 |
static const char | UUDecMap [128] |
static const char | UUEncMap [64] |
Detailed Description
A wrapper class for the most commonly used encoding and decoding algorithms.
Currently there is support for encoding and decoding input using base64, uu and the quoted-printable specifications.
Usage:
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.
A collection of commonly used encoding and decoding algorithms.
Function Documentation
QByteArray KCodecs::base64Decode | ( | const QByteArray & | in | ) |
Decodes the given data that was encoded using the base64 algorithm.
- Parameters
-
in data to be decoded.
- Returns
- decoded string.
Definition at line 424 of file kcodecs.cpp.
void KCodecs::base64Decode | ( | const QByteArray & | in, |
QByteArray & | out | ||
) |
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.
- Parameters
-
in data to be decoded. out decoded data.
Definition at line 431 of file kcodecs.cpp.
QByteArray KCodecs::base64Encode | ( | const QByteArray & | in, |
bool | insertLFs = false |
||
) |
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 insertLFs
is true, then there will be 76 characters or less per line.
- Parameters
-
in data to be encoded. insertLFs limit the number of characters per line.
- Returns
- base64 encoded string.
Definition at line 345 of file kcodecs.cpp.
void KCodecs::base64Encode | ( | const QByteArray & | in, |
QByteArray & | out, | ||
bool | insertLFs = false |
||
) |
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 insertLFs
is true, then there will be 76 characters or less per line.
NOTE: the output array is first reset and then resized appropriately before use, hence, all data stored in the output array will be lost.
- Parameters
-
in data to be encoded. out encoded data. insertLFs limit the number of characters per line.
Definition at line 352 of file kcodecs.cpp.
Decodes string text
according to RFC2047, i.e., the construct =?charset?[qb]?encoded?=.
Note: a more rubust version of this function is included in kdepimlibs/libkmime
- Parameters
-
text source string
- Returns
- the decoded string
Definition at line 693 of file kcodecs.cpp.
QByteArray KCodecs::quotedPrintableDecode | ( | const QByteArray & | in | ) |
Decodes a quoted-printable encoded data.
Accepts data with CRLF or standard unix line breaks.
- Parameters
-
in data to be decoded.
- Returns
- decoded string.
Definition at line 279 of file kcodecs.cpp.
void KCodecs::quotedPrintableDecode | ( | const QByteArray & | in, |
QByteArray & | out | ||
) |
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.
- Parameters
-
in data to be decoded. out decoded data.
Definition at line 287 of file kcodecs.cpp.
QByteArray KCodecs::quotedPrintableEncode | ( | const QByteArray & | in, |
bool | useCRLF = true |
||
) |
Encodes the given data using the quoted-printable algorithm.
- Parameters
-
in data to be encoded. useCRLF if true the input data is expected to have CRLF line breaks and the output will have CRLF line breaks, too.
- Returns
- quoted-printable encoded string.
Definition at line 156 of file kcodecs.cpp.
void KCodecs::quotedPrintableEncode | ( | const QByteArray & | in, |
QByteArray & | out, | ||
bool | useCRLF | ||
) |
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.
- Parameters
-
in data to be encoded. out encoded data. useCRLF if true the input data is expected to have CRLF line breaks and the output will have CRLF line breaks, too.
Definition at line 163 of file kcodecs.cpp.
QByteArray KCodecs::uudecode | ( | const QByteArray & | in | ) |
Decodes the given data using the uudecode algorithm.
Any 'begin' and 'end' lines like those generated by the utilities in unix and unix-like OS will be automatically ignored.
- Parameters
-
in data to be decoded.
- Returns
- decoded string.
Definition at line 598 of file kcodecs.cpp.
void KCodecs::uudecode | ( | const QByteArray & | in, |
QByteArray & | out | ||
) |
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.
- Parameters
-
in data to be decoded. out uudecoded data.
Definition at line 605 of file kcodecs.cpp.
QByteArray KCodecs::uuencode | ( | const QByteArray & | in | ) |
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.
- Parameters
-
in data to be uuencoded
- Returns
- uuencoded string.
Definition at line 512 of file kcodecs.cpp.
void KCodecs::uuencode | ( | const QByteArray & | in, |
QByteArray & | out | ||
) |
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.
- Parameters
-
in data to be uuencoded. out uudecoded data.
Definition at line 519 of file kcodecs.cpp.
Variable Documentation
|
static |
Definition at line 76 of file kcodecs.cpp.
|
static |
Definition at line 64 of file kcodecs.cpp.
|
static |
Definition at line 128 of file kcodecs.cpp.
|
static |
Definition at line 134 of file kcodecs.cpp.
|
static |
Definition at line 108 of file kcodecs.cpp.
|
static |
Definition at line 96 of file kcodecs.cpp.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:13 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.