.TH "KCodecs" kde3 "11 Jun 2005" "Version Version 3.4.1" "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 "static \fBQCString\fP \fBquotedPrintableEncode\fP (const \fBQByteArray\fP &in, bool useCRLF=true)"
.br
.ti -1c
.RI "static \fBQCString\fP \fBquotedPrintableEncode\fP (const \fBQCString\fP &str, bool useCRLF=true)"
.br
.ti -1c
.RI "static void \fBquotedPrintableEncode\fP (const \fBQByteArray\fP &in, \fBQByteArray\fP &out, bool useCRLF)"
.br
.ti -1c
.RI "static \fBQCString\fP \fBquotedPrintableDecode\fP (const \fBQByteArray\fP &in)"
.br
.ti -1c
.RI "static \fBQCString\fP \fBquotedPrintableDecode\fP (const \fBQCString\fP &str)"
.br
.ti -1c
.RI "static void \fBquotedPrintableDecode\fP (const \fBQByteArray\fP &in, \fBQByteArray\fP &out)"
.br
.ti -1c
.RI "static \fBQCString\fP \fBuuencode\fP (const \fBQByteArray\fP &in)"
.br
.ti -1c
.RI "static \fBQCString\fP \fBuuencode\fP (const \fBQCString\fP &str)"
.br
.ti -1c
.RI "static void \fBuuencode\fP (const \fBQByteArray\fP &in, \fBQByteArray\fP &out)"
.br
.ti -1c
.RI "static \fBQCString\fP \fBuudecode\fP (const \fBQByteArray\fP &in)"
.br
.ti -1c
.RI "static \fBQCString\fP \fBuudecode\fP (const \fBQCString\fP &str)"
.br
.ti -1c
.RI "static void \fBuudecode\fP (const \fBQByteArray\fP &in, \fBQByteArray\fP &out)"
.br
.ti -1c
.RI "static \fBQCString\fP \fBbase64Encode\fP (const \fBQByteArray\fP &in, bool insertLFs=false)"
.br
.ti -1c
.RI "static \fBQCString\fP \fBbase64Encode\fP (const \fBQCString\fP &str, bool insertLFs=false)"
.br
.ti -1c
.RI "static void \fBbase64Encode\fP (const \fBQByteArray\fP &in, \fBQByteArray\fP &out, bool insertLFs=false)"
.br
.ti -1c
.RI "static \fBQCString\fP \fBbase64Decode\fP (const \fBQByteArray\fP &in)"
.br
.ti -1c
.RI "static \fBQCString\fP \fBbase64Decode\fP (const \fBQCString\fP &str)"
.br
.ti -1c
.RI "static void \fBbase64Decode\fP (const \fBQByteArray\fP &in, \fBQByteArray\fP &out)"
.br
.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
\fBUsage:\fP 
.PP
.PP
.nf
 QCString input = 'Aladdin:open sesame';
 QCString result = KCodecs::base64Encode(input);
 cout << 'Result: ' << result.data() << endl;
.fi
.PP
.PP
.PP
.nf

 Output should be
 Result: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
 
.fi
.PP
.PP
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.
.PP
\fBAuthor:\fP
.RS 4
Dawit Alemayehu <adawit@kde.org> 
.PP
Rik Hemsley <rik@kde.org> 
.RE
.PP

.PP
Definition at line 74 of file kmdcodec.h.
.SH "Member Function Documentation"
.PP 
.SS "\fBQCString\fP KCodecs::quotedPrintableEncode (const \fBQByteArray\fP & in, bool useCRLF = \fCtrue\fP)\fC [static]\fP"
.PP
Encodes the given data using the quoted-printable algorithm. 
.PP
\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 string. 
.RE
.PP

.PP
Definition at line 154 of file kmdcodec.cpp.
.PP
Referenced by quotedPrintableEncode().
.SS "\fBQCString\fP KCodecs::quotedPrintableEncode (const \fBQCString\fP & str, bool useCRLF = \fCtrue\fP)\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 string 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 string. 
.RE
.PP

.PP
Definition at line 161 of file kmdcodec.cpp.
.PP
References 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. 
.PP
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 encoded 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

.PP
Definition at line 171 of file kmdcodec.cpp.
.PP
References QCString::resize().
.SS "\fBQCString\fP KCodecs::quotedPrintableDecode (const \fBQByteArray\fP & in)\fC [static]\fP"
.PP
Decodes a quoted-printable encoded data. 
.PP
Accepts data with CRLF or standard unix line breaks.
.PP
\fBParameters:\fP
.RS 4
\fIin\fP data to be decoded. 
.RE
.PP
\fBReturns:\fP
.RS 4
decoded string. 
.RE
.PP

.PP
Definition at line 287 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 string to be decoded. 
.RE
.PP
\fBReturns:\fP
.RS 4
decoded string. 
.RE
.PP

.PP
Definition at line 294 of file kmdcodec.cpp.
.PP
References quotedPrintableDecode().
.SS "void KCodecs::quotedPrintableDecode (const \fBQByteArray\fP & in, \fBQByteArray\fP & out)\fC [static]\fP"
.PP
Decodes a quoted-printable encoded data. 
.PP
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 decoded. 
.br
\fIout\fP decoded data. 
.RE
.PP

.PP
Definition at line 304 of file kmdcodec.cpp.
.PP
References QCString::resize(), and QCString::truncate().
.SS "\fBQCString\fP KCodecs::uuencode (const \fBQByteArray\fP & in)\fC [static]\fP"
.PP
Encodes the given data using the uuencode algorithm. 
.PP
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 data to be uuencoded 
.RE
.PP
\fBReturns:\fP
.RS 4
uuencoded string. 
.RE
.PP

.PP
Definition at line 560 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 string to be uuencoded. 
.RE
.PP
\fBReturns:\fP
.RS 4
encoded string. 
.RE
.PP

.PP
Definition at line 549 of file kmdcodec.cpp.
.PP
References uuencode().
.SS "void KCodecs::uuencode (const \fBQByteArray\fP & in, \fBQByteArray\fP & out)\fC [static]\fP"
.PP
Encodes the given data using the uuencode algorithm. 
.PP
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 data to be uuencoded. 
.br
\fIout\fP uudecoded data. 
.RE
.PP

.PP
Definition at line 567 of file kmdcodec.cpp.
.PP
References QCString::resize().
.SS "\fBQCString\fP KCodecs::uudecode (const \fBQByteArray\fP & in)\fC [static]\fP"
.PP
Decodes the given data using the uudecode algorithm. 
.PP
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 data to be decoded. 
.RE
.PP
\fBReturns:\fP
.RS 4
decoded string. 
.RE
.PP

.PP
Definition at line 657 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 string to be decoded. 
.RE
.PP
\fBReturns:\fP
.RS 4
uudecoded string. 
.RE
.PP

.PP
Definition at line 646 of file kmdcodec.cpp.
.PP
References uudecode().
.SS "void KCodecs::uudecode (const \fBQByteArray\fP & in, \fBQByteArray\fP & out)\fC [static]\fP"
.PP
Decodes the given data using the uudecode algorithm. 
.PP
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 data to be decoded. 
.br
\fIout\fP uudecoded data. 
.RE
.PP

.PP
Definition at line 664 of file kmdcodec.cpp.
.PP
References QCString::resize().
.SS "\fBQCString\fP KCodecs::base64Encode (const \fBQByteArray\fP & in, bool insertLFs = \fCfalse\fP)\fC [static]\fP"
.PP
Encodes the given data using the base64 algorithm. 
.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
\fBParameters:\fP
.RS 4
\fIin\fP data to be encoded. 
.br
\fIinsertLFs\fP limit the number of characters per line.
.RE
.PP
\fBReturns:\fP
.RS 4
base64 encoded string. 
.RE
.PP

.PP
Definition at line 372 of file kmdcodec.cpp.
.PP
Referenced by KMD4::base64Digest(), KMD5::base64Digest(), and base64Encode().
.SS "\fBQCString\fP KCodecs::base64Encode (const \fBQCString\fP & str, bool insertLFs = \fCfalse\fP)\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 string to be encoded. 
.br
\fIinsertLFs\fP limit the number of characters per line. 
.RE
.PP
\fBReturns:\fP
.RS 4
decoded string. 
.RE
.PP

.PP
Definition at line 362 of file kmdcodec.cpp.
.PP
References base64Encode().
.SS "void KCodecs::base64Encode (const \fBQByteArray\fP & in, \fBQByteArray\fP & out, bool insertLFs = \fCfalse\fP)\fC [static]\fP"
.PP
Encodes the given data using the base64 algorithm. 
.PP
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 data to be encoded. 
.br
\fIout\fP encoded data. 
.br
\fIinsertLFs\fP limit the number of characters per line. 
.RE
.PP

.PP
Definition at line 379 of file kmdcodec.cpp.
.PP
References QCString::resize().
.SS "\fBQCString\fP KCodecs::base64Decode (const \fBQByteArray\fP & in)\fC [static]\fP"
.PP
Decodes the given data that was encoded using the base64 algorithm. 
.PP
\fBParameters:\fP
.RS 4
\fIin\fP data to be decoded. 
.RE
.PP
\fBReturns:\fP
.RS 4
decoded string. 
.RE
.PP

.PP
Definition at line 461 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 string to be decoded. 
.RE
.PP
\fBReturns:\fP
.RS 4
decoded string. 
.RE
.PP

.PP
Definition at line 451 of file kmdcodec.cpp.
.PP
References base64Decode().
.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. 
.PP
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 decoded. 
.br
\fIout\fP decoded data. 
.RE
.PP

.PP
Definition at line 468 of file kmdcodec.cpp.
.PP
References QCString::resize().

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