1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 04:50:09 +00:00

get rid of boost::algorithm

This commit is contained in:
Lu Wang 2012-09-08 01:18:15 +08:00
parent 296e91c951
commit 94fe5f51a2
3 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -10,6 +10,7 @@
#include <iostream>
#include <algorithm>
#include <unordered_set>
#include <cctype>
#include <boost/algorithm/string.hpp>
#include <boost/filesystem.hpp>
@ -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());

View File

@ -13,7 +13,6 @@
#include <boost/program_options.hpp>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <goo/GooString.h>
@ -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";
}