2012-11-29 09:50:40 +00:00
|
|
|
/*
|
|
|
|
* Base64 Encoding
|
|
|
|
*
|
|
|
|
* by WangLu
|
|
|
|
* 2012.11.29
|
|
|
|
*/
|
|
|
|
|
2012-12-11 12:17:36 +00:00
|
|
|
#ifndef BASE64STREAM_H__
|
|
|
|
#define BASE64STREAM_H__
|
2012-11-29 09:50:40 +00:00
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
2012-11-29 10:16:05 +00:00
|
|
|
namespace pdf2htmlEX {
|
|
|
|
|
2013-04-06 15:41:58 +00:00
|
|
|
class Base64Stream
|
2012-11-29 09:50:40 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-04-06 15:41:58 +00:00
|
|
|
Base64Stream(std::istream & in) : in(&in) { }
|
2012-11-29 09:50:40 +00:00
|
|
|
|
2012-11-29 11:38:57 +00:00
|
|
|
std::ostream & dumpto(std::ostream & out);
|
2012-11-29 09:50:40 +00:00
|
|
|
|
|
|
|
private:
|
2013-02-25 13:08:47 +00:00
|
|
|
std::istream * in;
|
2012-11-29 09:50:40 +00:00
|
|
|
static const char * base64_encoding;
|
|
|
|
};
|
|
|
|
|
2013-04-07 06:25:39 +00:00
|
|
|
inline
|
|
|
|
std::ostream & operator << (std::ostream & out, Base64Stream bs)
|
|
|
|
{
|
|
|
|
return bs.dumpto(out);
|
|
|
|
}
|
2012-11-29 09:50:40 +00:00
|
|
|
|
2012-11-29 10:16:05 +00:00
|
|
|
} //namespace pdf2htmlEX
|
2012-12-11 12:17:36 +00:00
|
|
|
#endif //BASE64STREAM_H__
|