8 #ifndef BASE64_ENCODE_H 9 #define BASE64_ENCODE_H 26 : _buffersize(buffersize_in)
36 int encode(
const char* code_in,
const int length_in,
char* plaintext_out)
46 void encode(std::istream& istream_in, std::ostream& ostream_in)
51 char* plaintext =
new char[N];
52 char* code =
new char[2*N];
58 istream_in.read(plaintext, N);
59 plainlength = istream_in.gcount();
61 codelength =
encode(plaintext, plainlength, code);
62 ostream_in.write(code, codelength);
64 while (istream_in.good() && plainlength > 0);
67 ostream_in.write(code, codelength);
78 #endif // BASE64_ENCODE_H void base64_init_encodestate(base64_encodestate *state_in)
int encode_end(char *plaintext_out)
char base64_encode_value(char value_in)
base64_encodestate _state
encoder(int buffersize_in=512)
int encode(const char *code_in, const int length_in, char *plaintext_out)
int encode(char value_in)
void encode(std::istream &istream_in, std::ostream &ostream_in)
int base64_encode_block(const char *plaintext_in, int length_in, char *code_out, base64_encodestate *state_in)
int base64_encode_blockend(char *code_out, base64_encodestate *state_in)