|
|
A wrapper class for the most commonly used encoding and decoding algorithms. Currently it provides encoding and decoding facilities for the base64, uuencode/uudecode and quoted-printable algorithms.
@section Useage:
QCString input = "Aladdin:open sesame"; QCString result = KCodecs::base64Encode( input ); printf ( "Result: %c", result.data() );
Output should be Result: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
<u>NOTE:</u> A unit test program is available under the tests
directory that exercises all the codecs provided here. You
can compile the unit test program under kdelibs/kdecore/tests
by doing @p "make kmdcodectest".
| QCString |
[static]
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.
<u>NOTE:</u> data should be just the actual data. Any
'begin' and 'end' lines such as those generated by a *nix
uuencode utility must not be included.
Parameters:
| in | the data to be uuencoded |
Returns: a uuencoded data.
| void |
[static]
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 opertation that have to be performed in the process.
<u>NOTE:</u> the output array is first reset and then resized to the appropriate size.
Parameters:
| in | the data to be uuencoded. |
| out | the container for the uudecoded data. |
| QCString |
[static]
Encodes the given string using the uuencode algorithm.
Parameters:
| str | the string to be uuencoded. |
Returns: a uuencoded string.
| QCString |
[static]
Decodes the given data using the uuencode algorithm.
<u>NOTE:</u> data should be just the actual data.
Any 'begin' and 'end' lines such as those generated by
*nix utilities must NOT be included.
Parameters:
| in | the data uuencoded data to be decoded. |
Returns: the decoded data.
| void |
[static]
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 and cut down the number of copy opertation that have to be performed in the process.
<u>NOTE:</u> the output array is first reset and then resized to the appropriate size.
Parameters:
| in | the uuencoded-data to be decoded. |
| out | the container for the uudecoded data. |
| QCString |
[static]
Decodes a uuencoded string.
Parameters:
| str | the string to be decoded. |
Returns: a uudecoded string.
| QCString |
[static]
Encodes the given data using the quoted-printable algorithm.
Parameters:
| in | data to be encoded. |
Returns: quoted-printable encoded data.
| QCString |
[static]
Encodes the given data using the quoted-printable algorithm. Use this if your data has UNIX line ends instead of \r\n.
Parameters:
| in | data to be encoded. |
Returns: quoted-printable encoded data.
| QByteArray |
[static]
Decodes a quoted-printable encoded string.
Parameters:
| in | the data to be decoded. |
Returns: decoded data.
| QCString |
[static]
Encodes the given data using the base64 algorithm.
Parameters:
| in | the data to be encoded. |
Returns: a base64 encoded data.
| void |
[static]
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 and cut down the number of copy opertation that have to be performed in the process.
<u>NOTE:</u> the output array is first reset and then resized to the appropriate size.
Parameters:
| in | the data to be encoded using base64. |
| out | the container for the encoded data. |
| QCString |
[static]
Encodes the given string using the base64 algorithm.
Parameters:
| str | the string to be encoded. |
Returns: the decoded string.
| QCString |
[static]
Decodes the given data that was encoded using the base64 algorithm.
Parameters:
| in | the base64-encoded data to be decoded. |
Returns: the decoded data.
| void |
[static]
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 and cut down the number of copy opertation that have to be performed in the process.
<u>NOTE:</u> the output array is first reset and then resized to the appropriate size.
Parameters:
| in | the encoded data to be decoded. |
| out | the container for the decoded data. |
| QCString |
[static]
Decodes a string encoded with the base64 algorithm.
Parameters:
| str | the base64-encoded string. |
Returns: the decoded string.
| QString |
[static]
Encodes the QString data using the base64 algorithm.
<u>IMPORTANT:</u> This function is ONLY provided for convenience and backward compatability! Using it can result in an incorrectly encoded data since the conversion of the QString input to latin-1 can and will result in data loss if the input data contains non- latin1 characters. As such it is highly recommended that you avoid this function unless you are absolutely certain that your input does not contain any non-latin1 character!!
| QString |
[static]
Decodes the encoded QString data using the base64 algorithm.
<u>IMPORTANT:</u> This function is ONLY provided for convenience and backward compatability! Using it can result in an incorrectly decoded data since the conversion of the QString input to latin-1 can and will result in data loss if the input data contains non- latin1 characters. As such it is highly recommended that you avoid this function unless you are absolutely certain that your input does not contain any non-latin1 character!!
| QString |
[static]
Encodes the QString data using the uuencode algorithm.
<u>IMPORTANT:</u> This function is ONLY provided for convenience and backward compatability! Using it can result in an incorrectly encoded data since the conversion of the QString input to latin-1 can and will result in data loss if the input data contains non- latin1 characters. As such it is highly recommended that you avoid this function unless you are absolutely certain that your input does not contain any non-latin1 character!!
| QString |
[static]
Decodes the QString data using the uuencode algorithm.
<u>IMPORTANT:</u> This function is ONLY provided for convenience and backward compatability! Using it can result in an incorrectly decoded data since the conversion of the QString input to latin-1 can and will result in data loss if the input data contains non- latin1 characters. As such it is highly recommended that you avoid this function unless you are absolutely certain that your input does not contain any non-latin1 character!!
| QString |
[static]
| QString |
[static]