Added initializer
This commit is contained in:
parent
f2704e0bf3
commit
1d7f75c490
@ -46,6 +46,14 @@ namespace osgDB
|
||||
int stepcount;
|
||||
} base64_encodestate;
|
||||
|
||||
inline void base64_init_encodestate(base64_encodestate* state_in)
|
||||
{
|
||||
state_in->step = step_A;
|
||||
state_in->result = 0;
|
||||
state_in->stepcount = 0;
|
||||
}
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
base64_decodestep step;
|
||||
@ -61,9 +69,11 @@ namespace osgDB
|
||||
class OSGDB_EXPORT Base64encoder
|
||||
{
|
||||
public:
|
||||
Base64encoder(int buffersize_in = BUFFERSIZE)
|
||||
: _buffersize(buffersize_in)
|
||||
{}
|
||||
Base64encoder(int buffersize_in = BUFFERSIZE):
|
||||
_buffersize(buffersize_in)
|
||||
{
|
||||
base64_init_encodestate(&_state);
|
||||
}
|
||||
|
||||
int encode(char value_in);
|
||||
|
||||
@ -83,9 +93,11 @@ namespace osgDB
|
||||
class OSGDB_EXPORT Base64decoder
|
||||
{
|
||||
public:
|
||||
Base64decoder(int buffersize_in = BUFFERSIZE)
|
||||
: _buffersize(buffersize_in)
|
||||
{}
|
||||
Base64decoder(int buffersize_in = BUFFERSIZE):
|
||||
_buffersize(buffersize_in)
|
||||
{
|
||||
base64_init_decodestate(&_state);
|
||||
}
|
||||
|
||||
int decode(char value_in);
|
||||
|
||||
|
@ -99,13 +99,6 @@ namespace osgDB
|
||||
return plainchar - plaintext_out;
|
||||
}
|
||||
|
||||
void base64_init_encodestate(base64_encodestate* state_in)
|
||||
{
|
||||
state_in->step = step_A;
|
||||
state_in->result = 0;
|
||||
state_in->stepcount = 0;
|
||||
}
|
||||
|
||||
char base64_encode_value(char value_in)
|
||||
{
|
||||
static const char* encoding = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
Loading…
Reference in New Issue
Block a user