00001
00002
00003
00004
00005
00006
00007
#ifndef __WVBASE64_H
00008
#define __WVBASE64_H
00009
00010
#include "wvencoder.h"
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 class WvBase64Encoder :
public WvEncoder
00021 {
00022
enum State {
00023 ATBIT0, ATBIT2, ATBIT4
00024 };
00025 State state;
00026
unsigned int bits;
00027
00028
public:
00029
00030
WvBase64Encoder();
00031 virtual ~WvBase64Encoder() { }
00032
00033
protected:
00034
00035
virtual bool _encode(
WvBuf &in,
WvBuf &out,
bool flush);
00036
virtual bool _finish(
WvBuf &out);
00037
virtual bool _reset();
00038 };
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 class WvBase64Decoder :
public WvEncoder
00050 {
00051
enum State {
00052 ATBIT0, ATBIT2, ATBIT4, ATBIT6, PAD
00053 };
00054 State state;
00055
unsigned int bits;
00056
00057
public:
00058
00059
WvBase64Decoder();
00060 virtual ~WvBase64Decoder() { }
00061
00062
protected:
00063
virtual bool _encode(
WvBuf &in,
WvBuf &out,
bool flush);
00064
virtual bool _reset();
00065 };
00066
00067
#endif // __WVBASE64_H