WvStreams
Main Page
Modules
Classes
Files
File List
File Members
include
wvbase64.h
1
/* -*- Mode: C++ -*-
2
* Worldvisions Weaver Software:
3
* Copyright (C) 1997-2002 Net Integration Technologies, Inc.
4
*
5
* Base64 encoder and decoder implementations.
6
*/
7
#ifndef __WVBASE64_H
8
#define __WVBASE64_H
9
10
#include "wvencoder.h"
11
20
class
WvBase64Encoder
:
public
WvEncoder
21
{
22
enum
State {
23
ATBIT0, ATBIT2, ATBIT4
24
};
25
State state;
26
unsigned
int
bits;
// remaining bits shifted left 8 bits
27
28
public
:
30
WvBase64Encoder
();
31
virtual
~
WvBase64Encoder
() { }
32
33
protected
:
34
// on flush, outputs any needed pad characters
35
virtual
bool
_encode
(
WvBuf
&in,
WvBuf
&out,
bool
flush
);
36
virtual
bool
_finish
(
WvBuf
&out);
37
virtual
bool
_reset
();
// supported
38
};
39
40
49
class
WvBase64Decoder
:
public
WvEncoder
50
{
51
enum
State {
52
ATBIT0, ATBIT2, ATBIT4, ATBIT6, PAD
53
};
54
State state;
55
unsigned
int
bits;
// remaining bits shifted left 6 bits
56
57
public
:
59
WvBase64Decoder
();
60
virtual
~
WvBase64Decoder
() { }
61
62
protected
:
63
virtual
bool
_encode
(
WvBuf
&in,
WvBuf
&out,
bool
flush
);
64
virtual
bool
_reset
();
// supported
65
};
66
67
#endif // __WVBASE64_H
Generated on Fri Mar 15 2013 00:01:36 for WvStreams by
1.8.3.1