org.kde.koala
public class KCodecs extends Object implements QtSupport
String input = "Aladdin:open sesame"; String 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 byte[] as arguments. These functions are specifically tailored for encoding and decoding binary data.
UNKNOWN: A collection of commonly used encoding and decoding algorithms.
Constructor Summary | |
---|---|
protected | KCodecs(Class dummy) |
Method Summary | |
---|---|
static String | base64Decode(byte[] in)
Decodes the given data that was encoded using the
base64 algorithm. |
static String | base64Decode(String str) |
static void | base64Decode(byte[] in, byte[] out)
Decodes the given data that was encoded with the base64
algorithm.
|
static String | base64Encode(byte[] in, boolean insertLFs)
Encodes the given data using the base64 algorithm.
|
static String | base64Encode(byte[] in) |
static String | base64Encode(String str, boolean insertLFs) |
static String | base64Encode(String str) |
static void | base64Encode(byte[] in, byte[] out, boolean insertLFs)
Encodes the given data using the base64 algorithm.
|
static void | base64Encode(byte[] in, byte[] out) |
static String | quotedPrintableDecode(byte[] in)
Decodes a quoted-printable encoded data.
|
static String | quotedPrintableDecode(String str) |
static void | quotedPrintableDecode(byte[] in, byte[] out)
Decodes a quoted-printable encoded data.
|
static String | quotedPrintableEncode(byte[] in, boolean useCRLF)
Encodes the given data using the quoted-printable algorithm. |
static String | quotedPrintableEncode(byte[] in) |
static String | quotedPrintableEncode(String str, boolean useCRLF) |
static String | quotedPrintableEncode(String str) |
static void | quotedPrintableEncode(byte[] in, byte[] out, boolean useCRLF)
Encodes the given data using the quoted-printable algorithm.
|
static String | uudecode(byte[] in)
Decodes the given data using the uudecode algorithm.
|
static String | uudecode(String str) |
static void | uudecode(byte[] in, byte[] out)
Decodes the given data using the uudecode algorithm.
|
static String | uuencode(byte[] in)
Encodes the given data using the uuencode algorithm.
|
static String | uuencode(String str) |
static void | uuencode(byte[] in, byte[] out)
Encodes the given data using the uuencode algorithm.
|
Parameters: in data to be decoded.
Returns: decoded string.
UNKNOWN: Decodes the given data that was encoded using the base64 algorithm.
Parameters: str string to be decoded.
Returns: decoded string.
UNKNOWN: Same as the above functions except it accepts a null terminated string instead an array. @overload
Parameters: in data to be decoded. out decoded data.
UNKNOWN: Decodes the given data that was encoded with the base64 algorithm.
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.
UNKNOWN: Encodes the given data using the base64 algorithm.
Parameters: str string to be encoded. insertLFs limit the number of characters per line.
Returns: decoded string.
UNKNOWN: Same as the above functions except it accepts a null terminated string instead an array. @overload
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.
UNKNOWN: Encodes the given data using the base64 algorithm.
Parameters: in data to be decoded.
Returns: decoded string.
UNKNOWN: Decodes a quoted-printable encoded data.
Parameters: str string to be decoded.
Returns: decoded string.
UNKNOWN: Same as above except it accepts a null terminated string instead an array. @overload
Parameters: in data to be decoded. out decoded data.
UNKNOWN: Decodes a quoted-printable encoded data.
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.
UNKNOWN: Encodes the given data using the quoted-printable algorithm.
Parameters: str string 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.
UNKNOWN: Same as above except it accepts a null terminated string instead an array. @overload
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.
UNKNOWN: Encodes the given data using the quoted-printable algorithm.
Parameters: in data to be decoded.
Returns: decoded string.
UNKNOWN: Decodes the given data using the uudecode algorithm.
Parameters: str string to be decoded.
Returns: uudecoded string.
UNKNOWN: Same as the above functions except it accepts a null terminated string instead an array. @overload
Parameters: in data to be decoded. out uudecoded data.
UNKNOWN: Decodes the given data using the uudecode algorithm.
Parameters: in data to be uuencoded
Returns: uuencoded string.
UNKNOWN: Encodes the given data using the uuencode algorithm.
Parameters: str string to be uuencoded.
Returns: encoded string.
UNKNOWN: Same as the above functions except it accepts a null terminated string instead an array. @overload
Parameters: in data to be uuencoded. out uudecoded data.
UNKNOWN: Encodes the given data using the uuencode algorithm.