Board index » cppbuilder » Re: to Gambit Base64

Re: to Gambit Base64


2003-07-21 01:58:54 AM
cppbuilder46
To be more precise, I had found 2 small bug, and 1 problem I can not face
with it :
1., In the code you use : Encode, Decode routine, what I had to rename to
Base64Encode, Base64Decode. And after it was compiled if I simple put into
the main.cpp. Thats why I guess it is ok, but could you confirm ?
2., I would like to place this great piece of your code into a separate
file, and when I include thisinto the header I got the linker errors I had
mentioned in the previos message. Can you help me, what am I doing wrong ?
The code I placed into the header file :
//--------------------------------------------------------------------------
-
bool Base64Encode (TStream *Src, TStream *Dest, bool LineBreaks, int
Columns);
AnsiString Base64EncodeStream(TStream *Src, bool LineBreaks, int Columns);
bool Base64Decode(TStream *Src, TStream *Dest);
bool Base64DecodeStringToStream(const AnsiString &Src, TStream *Dest);
//--------------------------------------------------------------------------
-
Thank you in advance,
Moore
"D.Moore" < XXXX@XXXXX.COM >wrote in message
Quote
Hi !

Sorry to address this issue to you, but you had informed me earlier, that
you had written a fully working code for Base64 implementation. Can be
found
here :


groups.google.com/groups&lr=&ie=UTF-8&oe=UTF-8&selm=3ed7b8da%241%40newsgroups.borland.com&rnum=4

I had placed into a new Project , but when i try to compile it, the linker
gaves follwing errors :

TStream can not start a parameter declaration.
Type name expected.

I did not modified anything, just new project , insert, and add things
needed to the Header.

Can you help me what could be the problem ?

THANK YOU A LOT,

Moore


 
 

Re:Re: to Gambit Base64

Thank you !
Can I have an other question as well regarding to this issue ?
Am I right that if I use Base64 coding or 7to8bit a picture size should be :
7to8bit : double size of the original.
Base64 : half size of the original.
If yes, how it is possble that the code you created for Bas64 is create even
3 times bigger file than the original ?
Thank you a lot in advance,
Moore
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"D.Moore" < XXXX@XXXXX.COM >wrote in message
news:3f1ac521$ XXXX@XXXXX.COM ...

>I had placed into a new Project , but when i try to
>compile it, the linker gaves follwing errors :
>
>TStream can not start a parameter declaration.
>Type name expected.

Those errors suggest that you placed the code into a unit that is not
including the VCL at all. Since TStream is a VCL class, the unit in
question must include the appropriate VCL header file(s) as well, such as
Classes.hpp

>I did not modified anything, just new project ,
>insert, and add things needed to the Header.

It sounds like you did not create a VCL project.


Gambit


 

Re:Re: to Gambit Base64

"D.Moore" < XXXX@XXXXX.COM >wrote in message
Quote
7to8bit : double size of the original.
I don't know anything about 7to8bit, but if it is doing what I think it is
doing, then it shouldn't have to grow much larger than the original at all.
For every 7 bits of source data, 1 byte will be stored in the encoded data.
1 Byte is 8 bits, so there is not much growth at all. At least, that is the
way I see it. Like I said, I have no experience with 7to8bit encoding at
all.
Quote
Base64 : half size of the original.
That is not true. Base64 grows by a ratio of 4/3. In other words, for
every 3 bytes of source data, there will be 4 bytes stored in the encoded
data. Where did you get the idea that Base64 was half the size of the
original?
Gambit
 

{smallsort}

Re:Re: to Gambit Base64

I had read on a website, but I see I was wrong....
THANK YOU VERY MUCH,
Moore
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"D.Moore" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...

>7to8bit : double size of the original.

I don't know anything about 7to8bit, but if it is doing what I think it is
doing, then it shouldn't have to grow much larger than the original at
all.
For every 7 bits of source data, 1 byte will be stored in the encoded
data.
1 Byte is 8 bits, so there is not much growth at all. At least, that is
the
way I see it. Like I said, I have no experience with 7to8bit encoding at
all.

>Base64 : half size of the original.

That is not true. Base64 grows by a ratio of 4/3. In other words, for
every 3 bytes of source data, there will be 4 bytes stored in the encoded
data. Where did you get the idea that Base64 was half the size of the
original?


Gambit