mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 04:50:09 +00:00
reorganize coce
This commit is contained in:
parent
59a571ac8a
commit
804f86b127
@ -155,8 +155,6 @@ add_executable(pdf2htmlEX
|
||||
src/HTMLRenderer/link.cc
|
||||
src/HTMLRenderer/state.cc
|
||||
src/HTMLRenderer/text.cc
|
||||
src/HTMLRenderer/Preprocessor.h
|
||||
src/HTMLRenderer/Preprocessor.cc
|
||||
src/BackgroundRenderer/BackgroundRenderer.h
|
||||
src/BackgroundRenderer/SplashBackgroundRenderer.h
|
||||
src/BackgroundRenderer/SplashBackgroundRenderer.cc
|
||||
@ -164,8 +162,8 @@ add_executable(pdf2htmlEX
|
||||
src/BackgroundRenderer/CairoBackgroundRenderer.cc
|
||||
src/util/ArgParser.h
|
||||
src/util/ArgParser.cc
|
||||
src/util/base64.h
|
||||
src/util/base64.cc
|
||||
src/util/base64stream.h
|
||||
src/util/base64stream.cc
|
||||
src/util/const.h
|
||||
src/util/const.cc
|
||||
src/util/ffw.h
|
||||
@ -177,7 +175,10 @@ add_executable(pdf2htmlEX
|
||||
src/util/namespace.h
|
||||
src/util/path.h
|
||||
src/util/path.cc
|
||||
src/util/Preprocessor.h
|
||||
src/util/Preprocessor.cc
|
||||
src/util/StringFormatter.h
|
||||
src/util/StringFormatter.cc
|
||||
src/util/TmpFiles.h
|
||||
src/util/TmpFiles.cc
|
||||
src/util/unicode.h
|
||||
|
@ -1,5 +1,10 @@
|
||||
Latest v0.6
|
||||
|
||||
* New parameter: --use-cropbox
|
||||
* Progress indicator
|
||||
* Create a glyph for ' ' when missing
|
||||
* Code refining
|
||||
|
||||
v0.5
|
||||
2012.10.06
|
||||
|
||||
|
6
debian/changelog
vendored
6
debian/changelog
vendored
@ -1,3 +1,9 @@
|
||||
pdf2htmlex (0.6-1~git201212111844rd76af-0ubuntu1) quantal; urgency=low
|
||||
|
||||
* Package for quantal
|
||||
|
||||
-- WANG Lu <coolwanglu@gmail.com> Tue, 11 Dec 2012 18:44:44 +0800
|
||||
|
||||
pdf2htmlex (0.6-1~git201210070052rcb9a8-0ubuntu1) precise; urgency=low
|
||||
|
||||
* New version
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include <Annot.h>
|
||||
|
||||
#include "Param.h"
|
||||
#include "Preprocessor.h"
|
||||
#include "util/Preprocessor.h"
|
||||
#include "util/const.h"
|
||||
#include "util/StringFormatter.h"
|
||||
#include "util/TmpFiles.h"
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "HTMLRenderer.h"
|
||||
#include "util/namespace.h"
|
||||
#include "util/base64.h"
|
||||
#include "util/base64stream.h"
|
||||
#include "util/math.h"
|
||||
#include "util/misc.h"
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "BackgroundRenderer/BackgroundRenderer.h"
|
||||
#include "util/namespace.h"
|
||||
#include "util/ffw.h"
|
||||
#include "util/base64.h"
|
||||
#include "util/base64stream.h"
|
||||
#include "util/math.h"
|
||||
#include "util/path.h"
|
||||
|
||||
|
28
src/util/StringFormatter.cc
Normal file
28
src/util/StringFormatter.cc
Normal file
@ -0,0 +1,28 @@
|
||||
#include <cstdarg>
|
||||
|
||||
#include "StringFormatter.h"
|
||||
|
||||
namespace pdf2htmlEX {
|
||||
|
||||
StringFormatter::GuardedPointer StringFormatter::operator () (const char * format, ...)
|
||||
{
|
||||
assert((buf_cnt == 0) && "StringFormatter: buffer is reused!");
|
||||
|
||||
va_list vlist;
|
||||
va_start(vlist, format);
|
||||
int l = vsnprintf(&buf.front(), buf.capacity(), format, vlist);
|
||||
va_end(vlist);
|
||||
if(l >= (int)buf.capacity())
|
||||
{
|
||||
buf.reserve(std::max<long>((long)(l+1), (long)buf.capacity() * 2));
|
||||
va_start(vlist, format);
|
||||
l = vsnprintf(&buf.front(), buf.capacity(), format, vlist);
|
||||
va_end(vlist);
|
||||
}
|
||||
assert(l >= 0); // we should fail when vsnprintf fail
|
||||
assert(l < (int)buf.capacity());
|
||||
return GuardedPointer(this);
|
||||
}
|
||||
|
||||
} //namespace pdf2htmlEX
|
||||
|
@ -29,24 +29,8 @@ public:
|
||||
* Important:
|
||||
* there is only one buffer, so new strings will replace old ones
|
||||
*/
|
||||
GuardedPointer operator () (const char * format, ...) {
|
||||
assert((buf_cnt == 0) && "StringFormatter: buffer is reused!");
|
||||
GuardedPointer operator () (const char * format, ...);
|
||||
|
||||
va_list vlist;
|
||||
va_start(vlist, format);
|
||||
int l = vsnprintf(&buf.front(), buf.capacity(), format, vlist);
|
||||
va_end(vlist);
|
||||
if(l >= (int)buf.capacity())
|
||||
{
|
||||
buf.reserve(std::max<long>((long)(l+1), (long)buf.capacity() * 2));
|
||||
va_start(vlist, format);
|
||||
l = vsnprintf(&buf.front(), buf.capacity(), format, vlist);
|
||||
va_end(vlist);
|
||||
}
|
||||
assert(l >= 0); // we should fail when vsnprintf fail
|
||||
assert(l < (int)buf.capacity());
|
||||
return GuardedPointer(this);
|
||||
}
|
||||
private:
|
||||
friend class GuardedPointer;
|
||||
std::vector<char> buf;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "base64.h"
|
||||
#include "base64stream.h"
|
||||
|
||||
namespace pdf2htmlEX {
|
||||
|
@ -5,8 +5,8 @@
|
||||
* 2012.11.29
|
||||
*/
|
||||
|
||||
#ifndef BASE64_H__
|
||||
#define BASE64_H__
|
||||
#ifndef BASE64STREAM_H__
|
||||
#define BASE64STREAM_H__
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@ -30,4 +30,4 @@ std::ostream & operator << (std::ostream & out, base64stream & bf);
|
||||
std::ostream & operator << (std::ostream & out, base64stream && bf);
|
||||
|
||||
} //namespace pdf2htmlEX
|
||||
#endif //BASE64_H__
|
||||
#endif //BASE64STREAM_H__
|
Loading…
Reference in New Issue
Block a user