.TH "KCodecs" 3 "28 Jan 2004" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KCodecs \- A wrapper class for the most commonly used encoding and decoding algorithms. A collection of commonly used encoding and decoding algorithms.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kmdcodec.h>\fP
.PP
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "\fBQCString\fP \fBquotedPrintableEncode\fP (const  \fBQByteArray\fP &in, bool useCRLF=true)"
.br
.RI "\fIEncodes the given data using the quoted-printable algorithm. \fP"
.ti -1c
.RI "\fBQCString\fP \fBquotedPrintableEncode\fP (const  \fBQCString\fP &str, bool useCRLF=true)"
.br
.ti -1c
.RI "void \fBquotedPrintableEncode\fP (const  \fBQByteArray\fP &in, \fBQByteArray\fP &out, bool useCRLF)"
.br
.RI "\fIEncodes the given data using the quoted-printable algorithm. \fP"
.ti -1c
.RI "\fBQCString\fP \fBquotedPrintableDecode\fP (const  \fBQByteArray\fP &in)"
.br
.RI "\fIDecodes a quoted-printable encoded string. \fP"
.ti -1c
.RI "\fBQCString\fP \fBquotedPrintableDecode\fP (const  \fBQCString\fP &str)"
.br
.ti -1c
.RI "void \fBquotedPrintableDecode\fP (const  \fBQByteArray\fP &in, \fBQByteArray\fP &out)"
.br
.RI "\fIDecodes a quoted-printable encoded data. \fP"
.ti -1c
.RI "\fBQCString\fP \fBuuencode\fP (const  \fBQByteArray\fP &in)"
.br
.RI "\fIEncodes the given data using the uuencode algorithm. \fP"
.ti -1c
.RI "\fBQCString\fP \fBuuencode\fP (const  \fBQCString\fP &str)"
.br
.ti -1c
.RI "void \fBuuencode\fP (const  \fBQByteArray\fP &in, \fBQByteArray\fP &out)"
.br
.RI "\fIEncodes the given data using the uuencode algorithm. \fP"
.ti -1c
.RI "\fBQCString\fP \fBuudecode\fP (const  \fBQByteArray\fP &in)"
.br
.RI "\fIDecodes the given data using the uuencode algorithm. \fP"
.ti -1c
.RI "\fBQCString\fP \fBuudecode\fP (const  \fBQCString\fP &str)"
.br
.ti -1c
.RI "void \fBuudecode\fP (const  \fBQByteArray\fP &in, \fBQByteArray\fP &out)"
.br
.RI "\fIDecodes the given data using the uudecode algorithm. \fP"
.ti -1c
.RI "\fBQCString\fP \fBbase64Encode\fP (const  \fBQByteArray\fP &in, bool insertLFs=false)"
.br
.RI "\fIEncodes the given data using the base64 algorithm. \fP"
.ti -1c
.RI "\fBQCString\fP \fBbase64Encode\fP (const  \fBQCString\fP &str, bool insertLFs=false)"
.br
.ti -1c
.RI "void \fBbase64Encode\fP (const  \fBQByteArray\fP &in, \fBQByteArray\fP &out, bool insertLFs=false)"
.br
.RI "\fIEncodes the given data using the base64 algorithm. \fP"
.ti -1c
.RI "\fBQCString\fP \fBbase64Decode\fP (const  \fBQByteArray\fP &in)"
.br
.RI "\fIDecodes the given data that was encoded using the base64 algorithm. \fP"
.ti -1c
.RI "\fBQCString\fP \fBbase64Decode\fP (const  \fBQCString\fP &str)"
.br
.ti -1c
.RI "void \fBbase64Decode\fP (const  \fBQByteArray\fP &in, \fBQByteArray\fP &out)"
.br
.RI "\fIDecodes the given data that was encoded with the base64 algorithm. \fP"
.in -1c
.SH "Detailed Description"
.PP 
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.
.PP
\fB Usage:\fP
.PP
\fB 
.PP
.nf

 \fBQCString\fP input = 'Aladdin:open sesame';
 \fBQCString\fP result = KCodecs::base64Encode(input);
 cout << 'Result: ' << result.data() << endl;
.PP
\fP
.PP
\fB
.PP
.nf
 Output should be
 Result: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
 
.PP
\fP
.PP
\fB 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 \fBQByteArray\fP as arguments. These functions are specifically tailored for encoding and decoding binary data.\fP
.PP
\fB\fP
.PP
\fB
.PP
\fBAuthor:\fP
.RS 4
Dawit Alemayehu <adawit@kde.org> 
.PP
Rik Hemsley <rik@kde.org> 
.RE
.PP
\fP
.PP
Definition at line 71 of file kmdcodec.h.
.SH "Member Function Documentation"
.PP 
.SS "\fBQCString\fP KCodecs::quotedPrintableEncode (const \fBQByteArray\fP & in, bool useCRLF = true)\fC [static]\fP"
.PP
Encodes the given data using the quoted-printable algorithm. \fBParameters:\fP
.RS 4
\fIin\fP data to be encoded. 
.br
\fIuseCRLF\fP if true the input data is expected to have CRLF line breaks and the output will have CRLF line breaks, too. 
.RE
.PP
\fBReturns:\fP
.RS 4
quoted-printable encoded data. 
.RE
.PP
Definition at line 150 of file kmdcodec.cpp.
.PP
Referenced by quotedPrintableEncode().
.SS "\fBQCString\fP KCodecs::quotedPrintableEncode (const \fBQCString\fP & str, bool useCRLF = true)\fC [static]\fP"
.PP
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
.PP
Same as above except it accepts a null terminated string instead an array.
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP data to be encoded. 
.br
\fIuseCRLF\fP if true the input data is expected to have CRLF line breaks and the output will have CRLF line breaks, too. 
.RE
.PP
\fBReturns:\fP
.RS 4
quoted-printable encoded data. 
.RE
.PP
Definition at line 157 of file kmdcodec.cpp.
.PP
References QCString::isEmpty(), QCString::length(), and quotedPrintableEncode().
.SS "void KCodecs::quotedPrintableEncode (const \fBQByteArray\fP & in, \fBQByteArray\fP & out, bool useCRLF)\fC [static]\fP"
.PP
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.
.PP
NOTE: the output array is first reset and then resized appropriately before use, hence, all data stored in the output array will be lost.
.PP
\fBParameters:\fP
.RS 4
\fIin\fP data to be encoded. 
.br
\fIout\fP decoded data. 
.br
\fIuseCRLF\fP if true the input data is expected to have CRLF line breaks and the output will have CRLF line breaks, too. 
.RE
.PP
\fBReturns:\fP
.RS 4
quoted-printable encoded data. 
.RE
.PP
Definition at line 167 of file kmdcodec.cpp.
.PP
References KStdAccel::end().
.SS "\fBQCString\fP KCodecs::quotedPrintableDecode (const \fBQByteArray\fP & in)\fC [static]\fP"
.PP
Decodes a quoted-printable encoded string. Accepts data with CRLF or standard unix line breaks.
.PP
\fBParameters:\fP
.RS 4
\fIin\fP the data to be decoded. 
.RE
.PP
\fBReturns:\fP
.RS 4
decoded data. 
.RE
.PP
Definition at line 283 of file kmdcodec.cpp.
.PP
Referenced by quotedPrintableDecode().
.SS "\fBQCString\fP KCodecs::quotedPrintableDecode (const \fBQCString\fP & str)\fC [static]\fP"
.PP
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
.PP
Same as above except it accepts a null terminated string instead an array.
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP the data to be decoded. 
.RE
.PP
\fBReturns:\fP
.RS 4
decoded data. 
.RE
.PP
Definition at line 290 of file kmdcodec.cpp.
.PP
References QCString::isEmpty(), QCString::length(), and quotedPrintableDecode().
.SS "void KCodecs::quotedPrintableDecode (const \fBQByteArray\fP & in, \fBQByteArray\fP & out)\fC [static]\fP"
.PP
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.
.PP
NOTE: the output array is first reset and then resized appropriately before use, hence, all data stored in the output array will be lost.
.PP
\fBParameters:\fP
.RS 4
\fIin\fP data to be encoded. 
.br
\fIout\fP decoded data.
.RE
.PP
\fBReturns:\fP
.RS 4
quoted-printable encoded data. 
.RE
.PP
Definition at line 300 of file kmdcodec.cpp.
.SS "\fBQCString\fP KCodecs::uuencode (const \fBQByteArray\fP & in)\fC [static]\fP"
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIin\fP the data to be uuencoded 
.RE
.PP
\fBReturns:\fP
.RS 4
a uuencoded data. 
.RE
.PP
Definition at line 556 of file kmdcodec.cpp.
.PP
Referenced by uuencode().
.SS "\fBQCString\fP KCodecs::uuencode (const \fBQCString\fP & str)\fC [static]\fP"
.PP
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
.PP
Same as the above functions except it accepts a null terminated string instead an array.
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP the string to be uuencoded. 
.RE
.PP
\fBReturns:\fP
.RS 4
the encoded string. 
.RE
.PP
Definition at line 545 of file kmdcodec.cpp.
.PP
References QCString::isEmpty(), QCString::length(), and uuencode().
.SS "void KCodecs::uuencode (const \fBQByteArray\fP & in, \fBQByteArray\fP & out)\fC [static]\fP"
.PP
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.
.PP
NOTE: the output array is first reset and then resized appropriately before use, hence, all data stored in the output array will be lost.
.PP
\fBParameters:\fP
.RS 4
\fIin\fP the data to be uuencoded. 
.br
\fIout\fP the container for the uudecoded data. 
.RE
.PP
Definition at line 563 of file kmdcodec.cpp.
.PP
References KStdAccel::end().
.SS "\fBQCString\fP KCodecs::uudecode (const \fBQByteArray\fP & in)\fC [static]\fP"
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIin\fP the data uuencoded data to be decoded. 
.RE
.PP
\fBReturns:\fP
.RS 4
a decoded string. 
.RE
.PP
Definition at line 653 of file kmdcodec.cpp.
.PP
Referenced by uudecode().
.SS "\fBQCString\fP KCodecs::uudecode (const \fBQCString\fP & str)\fC [static]\fP"
.PP
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
.PP
Same as the above functions except it accepts a null terminated string instead an array.
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP the string to be decoded. 
.RE
.PP
\fBReturns:\fP
.RS 4
a uudecoded string. 
.RE
.PP
Definition at line 642 of file kmdcodec.cpp.
.PP
References QCString::isEmpty(), QCString::length(), and uudecode().
.SS "void KCodecs::uudecode (const \fBQByteArray\fP & in, \fBQByteArray\fP & out)\fC [static]\fP"
.PP
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.
.PP
Any 'begin' and 'end' lines like those generated by the utilities in unix and unix-like OS will be automatically ignored.
.PP
NOTE: the output array is first reset and then resized appropriately before use, hence, all data stored in the output array will be lost.
.PP
\fBParameters:\fP
.RS 4
\fIin\fP the uuencoded-data to be decoded. 
.br
\fIout\fP the container for the uudecoded data. 
.RE
.PP
Definition at line 660 of file kmdcodec.cpp.
.PP
References KStdAccel::end().
.SS "\fBQCString\fP KCodecs::base64Encode (const \fBQByteArray\fP & in, bool insertLFs = false)\fC [static]\fP"
.PP
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 \fCinsertLFs\fP is true, then there will be 76 characters or less per line.
.PP
\fBParameters:\fP
.RS 4
\fIin\fP the data to be encoded. 
.br
\fIinsertLFs\fP limit the number of characters per line.
.RE
.PP
\fBReturns:\fP
.RS 4
a base64 encoded string. 
.RE
.PP
Definition at line 368 of file kmdcodec.cpp.
.PP
Referenced by KMD5::base64Digest(), and base64Encode().
.SS "\fBQCString\fP KCodecs::base64Encode (const \fBQCString\fP & str, bool insertLFs = false)\fC [static]\fP"
.PP
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
.PP
Same as the above functions except it accepts a null terminated string instead an array.
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP the string to be encoded. 
.br
\fIinsertLFs\fP limit the number of characters per line. 
.RE
.PP
\fBReturns:\fP
.RS 4
the decoded string. 
.RE
.PP
Definition at line 358 of file kmdcodec.cpp.
.PP
References base64Encode(), QCString::isEmpty(), and QCString::length().
.SS "void KCodecs::base64Encode (const \fBQByteArray\fP & in, \fBQByteArray\fP & out, bool insertLFs = false)\fC [static]\fP"
.PP
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.
.PP
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 \fCinsertLFs\fP is true, then there will be 76 characters or less per line.
.PP
NOTE: the output array is first reset and then resized appropriately before use, hence, all data stored in the output array will be lost.
.PP
\fBParameters:\fP
.RS 4
\fIin\fP the data to be encoded using base64. 
.br
\fIout\fP the container for the encoded data. 
.br
\fIinsertLFs\fP limit the number of characters per line. 
.RE
.PP
Definition at line 375 of file kmdcodec.cpp.
.SS "\fBQCString\fP KCodecs::base64Decode (const \fBQByteArray\fP & in)\fC [static]\fP"
.PP
Decodes the given data that was encoded using the base64 algorithm. \fBParameters:\fP
.RS 4
\fIin\fP the base64-encoded data to be decoded. 
.RE
.PP
\fBReturns:\fP
.RS 4
the decoded data. 
.RE
.PP
Definition at line 457 of file kmdcodec.cpp.
.PP
Referenced by base64Decode().
.SS "\fBQCString\fP KCodecs::base64Decode (const \fBQCString\fP & str)\fC [static]\fP"
.PP
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
.PP
Same as the above functions except it accepts a null terminated string instead an array.
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP the base64-encoded string. 
.RE
.PP
\fBReturns:\fP
.RS 4
the decoded string. 
.RE
.PP
Definition at line 447 of file kmdcodec.cpp.
.PP
References base64Decode(), QCString::isEmpty(), and QCString::length().
.SS "void KCodecs::base64Decode (const \fBQByteArray\fP & in, \fBQByteArray\fP & out)\fC [static]\fP"
.PP
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.
.PP
NOTE: the output array is first reset and then resized appropriately before use, hence, all data stored in the output array will be lost.
.PP
\fBParameters:\fP
.RS 4
\fIin\fP the encoded data to be decoded. 
.br
\fIout\fP the container for the decoded data. 
.RE
.PP
Definition at line 464 of file kmdcodec.cpp.

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
