1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00

base64stream -> Base64Stream

This commit is contained in:
Lu Wang 2013-04-06 23:41:58 +08:00
parent 842101d75c
commit fcb61a8fc4
5 changed files with 13 additions and 13 deletions

View File

@ -184,8 +184,8 @@ add_executable(pdf2htmlEX
src/HTMLState.h
src/ArgParser.h
src/ArgParser.cc
src/base64stream.h
src/base64stream.cc
src/Base64Stream.h
src/Base64Stream.cc
src/Color.h
src/Color.cc
src/Preprocessor.h

View File

@ -1,10 +1,10 @@
#include "base64stream.h"
#include "Base64Stream.h"
namespace pdf2htmlEX {
using std::ostream;
ostream & base64stream::dumpto(ostream & out)
ostream & Base64Stream::dumpto(ostream & out)
{
unsigned char buf[3];
while(in->read((char*)buf, 3))
@ -37,8 +37,8 @@ ostream & base64stream::dumpto(ostream & out)
return out;
}
const char * base64stream::base64_encoding = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
const char * Base64Stream::base64_encoding = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
ostream & operator << (ostream & out, base64stream bf) { return bf.dumpto(out); }
ostream & operator << (ostream & out, Base64Stream bf) { return bf.dumpto(out); }
} //namespace pdf2htmlEX

View File

@ -12,10 +12,10 @@
namespace pdf2htmlEX {
class base64stream
class Base64Stream
{
public:
base64stream(std::istream & in) : in(&in) { }
Base64Stream(std::istream & in) : in(&in) { }
std::ostream & dumpto(std::ostream & out);
@ -24,7 +24,7 @@ private:
static const char * base64_encoding;
};
std::ostream & operator << (std::ostream & out, base64stream bf);
std::ostream & operator << (std::ostream & out, Base64Stream bf);
} //namespace pdf2htmlEX
#endif //BASE64STREAM_H__

View File

@ -19,7 +19,7 @@
#include "Param.h"
#include "HTMLRenderer.h"
#include "base64stream.h"
#include "Base64Stream.h"
#include "util/namespace.h"
#include "util/math.h"
@ -753,7 +753,7 @@ void HTMLRenderer::export_remote_font(const FontInfo & info, const string & suff
ifstream fin(path, ifstream::binary);
if(!fin)
throw "Cannot locate font file: " + path;
f_css.fs << "'data:" + mime_type + ";base64," << base64stream(fin) << "'";
f_css.fs << "'data:" + mime_type + ";base64," << Base64Stream(fin) << "'";
}
else
{

View File

@ -18,7 +18,7 @@
#include "HTMLRenderer.h"
#include "TextLineBuffer.h"
#include "BackgroundRenderer/BackgroundRenderer.h"
#include "base64stream.h"
#include "Base64Stream.h"
#include "util/namespace.h"
#include "util/ffw.h"
@ -197,7 +197,7 @@ void HTMLRenderer::startPage(int pageNum, GfxState *state, XRef * xref)
ifstream fin((char*)path, ifstream::binary);
if(!fin)
throw string("Cannot read background image ") + (char*)path;
f_pages.fs << "data:image/png;base64," << base64stream(fin);
f_pages.fs << "data:image/png;base64," << Base64Stream(fin);
}
else
{