22 #ifndef BASE64STREAM_H_
23 #define BASE64STREAM_H_
33 class Base64Stream :
public std::basic_streambuf<char, std::char_traits<char> >,
public std::ostream
36 Base64Stream(std::ostream &stream,
bool decode =
false,
const size_t linebreak = 0,
const size_t buffer = 2048);
41 virtual std::char_traits<char>::int_type
overflow(std::char_traits<char>::int_type = std::char_traits<char>::eof());
44 void set_b64(
char val);
45 void set_byte(
char val);
47 void __flush_encoder__();
51 std::ostream &_stream;
54 std::vector<char> data_buf_;
59 uint8_t _base64_state;
66 const size_t _linebreak;