[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Data types for KCodecs (Re: kdenetwork/kmail)
From:       Michael =?iso-8859-1?q?H=E4ckel?= <haeckel () kde ! org>
Date:       2001-12-27 19:42:31
[Download RAW message or body]

On Thursday 27 December 2001 20:10, Dirk Mueller wrote:
> On Mit, 26 Dez 2001, Michael Haeckel wrote:
> > Oops, seems I just broke decoding of binary base64 attachments.
> > Sorry, but these functions in KCodecs are really everything else than
> > consistent in what data types they use.
>
> You have the chance to improve them NOW ;-)

Ok, we currently have
KCodecs::quotedPrintableEncode
KCodecs::uuencode
KCodecs::base64Encode

and the same for decoding.

All these operations should probably have similar functions.

The binary data should always be in a QByteArray and not sometimes in a 
QCString or QString.
The encoded data should be either in a QByteArray of a QCString.

So functions like the following for all encoding types should be enough:

static QCString base64Encode(const QByteArray& in, bool insertLFs = false) 
static void base64Encode(const QByteArray& in, QByteArray& out, bool insertLFs 
= false)

static QByteArray base64Decode(const QCString& in) 
static void base64Decode(const QByteArray& in, QByteArray& out)

Everything with QString can leave totally.

Is this good?

Regards,
Michael Häckel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic