From 94fe5f51a23e7bfd77f69db798c4209a0c1c78bb Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sat, 8 Sep 2012 01:18:15 +0800 Subject: [PATCH] get rid of boost::algorithm --- README.md | 2 +- src/HTMLRenderer/text.cc | 5 +++-- src/pdf2htmlEX.cc | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d3c4e0f..93517a9 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Special thanks to Arthur Titeica for the [AUR Package](https://aur.archlinux.org * CMake * compilers support C++11 * libpoppler with xpdf header >= 0.20.2 (compile with --enable-xpdf-headers) -* boost c++ library (program options, gil, filesystem, serialization, system(which is actually required by filesystem)) +* boost c++ library (program options, gil, filesystem, system(which is actually required by filesystem)) * fontforge (with header files) #### Compiling diff --git a/src/HTMLRenderer/text.cc b/src/HTMLRenderer/text.cc index a228ce8..d59999f 100644 --- a/src/HTMLRenderer/text.cc +++ b/src/HTMLRenderer/text.cc @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -22,7 +23,6 @@ #include "namespace.h" #include "config.h" -using boost::algorithm::to_lower; using std::unordered_set; using std::min; using std::all_of; @@ -162,7 +162,8 @@ path HTMLRenderer::dump_embedded_font (GfxFont * font, long long fn_id) void HTMLRenderer::embed_font(const path & filepath, GfxFont * font, FontInfo & info, bool get_metric_only) { string suffix = filepath.extension().string(); - to_lower(suffix); + for(auto & c : suffix) + c = tolower(c); ff_load_font(filepath.c_str()); diff --git a/src/pdf2htmlEX.cc b/src/pdf2htmlEX.cc index dc707b1..7bca60c 100644 --- a/src/pdf2htmlEX.cc +++ b/src/pdf2htmlEX.cc @@ -13,7 +13,6 @@ #include #include -#include #include @@ -175,7 +174,7 @@ int main(int argc, char **argv) if(param.output_filename == "") { const string s = path(param.input_filename).filename().string(); - if(boost::algorithm::ends_with(s, ".pdf")) + if((s.size() >= 4) && (s.compare(s.size() - 4, 4, ".pdf") == 0)) { param.output_filename = s.substr(0, s.size() - 4) + ".html"; }