From 25b70bb1e1d13950b589a398160c8f080bc97f83 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Fri, 18 Oct 2013 16:31:59 +0800 Subject: [PATCH] output* -> write* --- src/HTMLRenderer/general.cc | 4 ++-- src/HTMLRenderer/link.cc | 2 +- src/HTMLRenderer/outline.cc | 4 ++-- src/HTMLTextLine.cc | 4 ++-- src/util/encoding.cc | 12 ++++++------ src/util/encoding.h | 8 ++++---- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/HTMLRenderer/general.cc b/src/HTMLRenderer/general.cc index 871987f..2a41348 100644 --- a/src/HTMLRenderer/general.cc +++ b/src/HTMLRenderer/general.cc @@ -212,7 +212,7 @@ void HTMLRenderer::startPage(int pageNum, GfxState *state, XRef * xref) << "\" data-page-no=\"" << pageNum << "\" data-page-url=\""; - outputAttribute(f_pages.fs, cur_page_filename); + writeAttribute(f_pages.fs, cur_page_filename); f_pages.fs << "\">"; } @@ -555,7 +555,7 @@ void HTMLRenderer::embed_file(ostream & out, const string & path, const string & else { out << entry.prefix_external; - outputAttribute(out, fn); + writeAttribute(out, fn); out << entry.suffix_external << endl; if(copy) diff --git a/src/HTMLRenderer/link.cc b/src/HTMLRenderer/link.cc index a703e7f..c7e84f6 100644 --- a/src/HTMLRenderer/link.cc +++ b/src/HTMLRenderer/link.cc @@ -195,7 +195,7 @@ void HTMLRenderer::processLink(AnnotLink * al) if(!dest_str.empty()) { (*f_curpage) << "" << ""; - outputUnicodes(f_outline.fs, item->getTitle(), item->getTitleLength()); + writeUnicodes(f_outline.fs, item->getTitle(), item->getTitleLength()); f_outline.fs << ""; diff --git a/src/HTMLTextLine.cc b/src/HTMLTextLine.cc index 5a0ab2d..29b5be1 100644 --- a/src/HTMLTextLine.cc +++ b/src/HTMLTextLine.cc @@ -179,7 +179,7 @@ void HTMLTextLine::dump_text(ostream & out) if(abs(target - space_off) <= param.h_eps) { Unicode u = ' '; - outputUnicodes(out, &u, 1); + writeUnicodes(out, &u, 1); actual_offset = space_off; done = true; } @@ -213,7 +213,7 @@ void HTMLTextLine::dump_text(ostream & out) size_t next_text_idx = text_idx2; if((cur_offset_iter != offsets.end()) && (cur_offset_iter->start_idx) < next_text_idx) next_text_idx = cur_offset_iter->start_idx; - outputUnicodes(out, (&text.front()) + cur_text_idx, next_text_idx - cur_text_idx); + writeUnicodes(out, (&text.front()) + cur_text_idx, next_text_idx - cur_text_idx); cur_text_idx = next_text_idx; } } diff --git a/src/util/encoding.cc b/src/util/encoding.cc index c73d114..78ce8b0 100644 --- a/src/util/encoding.cc +++ b/src/util/encoding.cc @@ -55,7 +55,7 @@ static int mapUTF8(Unicode u, char *buf, int bufSize) } } -void outputUnicodes(ostream & out, const Unicode * u, int uLen) +void writeUnicodes(ostream & out, const Unicode * u, int uLen) { for(int i = 0; i < uLen; ++i) { @@ -87,13 +87,13 @@ void outputUnicodes(ostream & out, const Unicode * u, int uLen) } /* -static void outputHEX(ostream & out, char c) +static void writeHEX(ostream & out, char c) { static const char * hexchars = "0123456789abcdef"; out << hexchars[(c>>4)&0xf] << hexchars[c&0xf]; } -void outputURL(ostream & out, const string & s) +void writeURL(ostream & out, const string & s) { static char * dont_escape = nullptr; if(!dont_escape) @@ -123,13 +123,13 @@ void outputURL(ostream & out, const string & s) else { out << '%'; - outputHEX(out, c); + writeHEX(out, c); } } } */ -void outputJSON(ostream & out, const string & s) +void writeJSON(ostream & out, const string & s) { for(auto iter = s.begin(); iter != s.end(); ++iter) { @@ -149,7 +149,7 @@ void outputJSON(ostream & out, const string & s) } } -void outputAttribute(std::ostream & out, const std::string & s) +void writeAttribute(std::ostream & out, const std::string & s) { for (auto iter = s.begin(); iter != s.end(); ++iter) { diff --git a/src/util/encoding.h b/src/util/encoding.h index cb84b3b..c4d7732 100644 --- a/src/util/encoding.h +++ b/src/util/encoding.h @@ -18,23 +18,23 @@ namespace pdf2htmlEX { /* * Escape necessary characters, and map Unicode to UTF-8 */ -void outputUnicodes(std::ostream & out, const Unicode * u, int uLen); +void writeUnicodes(std::ostream & out, const Unicode * u, int uLen); /* * URL escaping */ -//void outputURL(std::ostream & out, const std::string & s); +//void writeURL(std::ostream & out, const std::string & s); /* * JSON escaping */ -void outputJSON(std::ostream & out, const std::string & s); +void writeJSON(std::ostream & out, const std::string & s); /* * HTML tag attribute escaping */ -void outputAttribute(std::ostream & out, const std::string & s); +void writeAttribute(std::ostream & out, const std::string & s); } // namespace pdf2htmlEX