00001
00002
00003
00004
00005
00006 #include "wvbase64.h"
00007 #include "wvstream.h"
00008 #include "wvistreamlist.h"
00009 #include "wvencoderstream.h"
00010 #include "wvbufbase.h"
00011
00012 int main()
00013 {
00014 WvEncoder *enc;
00015 enc = new WvBase64Encoder();
00016
00017 WvInPlaceBuf to_encode(100);
00018 WvInPlaceBuf encoded(100);
00019
00020 to_encode.put("123",3);
00021
00022
00023 if (enc->encode(to_encode, encoded, true,true))
00024 printf ("This is the result: %s\n", (char *) encoded.get(1));
00025
00026
00027
00028
00029
00030 WvEncoder *dec;
00031 dec = new WvBase64Decoder();
00032
00033 WvInPlaceBuf to_decode(100);
00034 WvInPlaceBuf decoded(100);
00035
00036 to_decode.put("MTIz",4);
00037
00038
00039 if (dec->encode(to_decode, decoded, true))
00040 printf ("This is the result: %s\n", (char *) decoded.get(1));
00041
00042
00043
00044
00045 return 0;
00046 }