2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 10:58:58 +00:00

do DLL_EXPORT only in header files and only at the class or top-level function level

git-svn-id: svn+q:///qpdf/trunk@796 71b93d88-0707-0410-a8cf-f5a4172ac649
This commit is contained in:
Jay Berkenbilt 2009-10-12 01:15:55 +00:00
parent 3444a5a52a
commit 44cbd3d4b4
52 changed files with 24 additions and 463 deletions

View File

@ -10,24 +10,17 @@
#include <qpdf/DLL.hh>
DLL_EXPORT
class Buffer
{
public:
DLL_EXPORT
Buffer();
DLL_EXPORT
Buffer(unsigned long size);
DLL_EXPORT
Buffer(Buffer const&);
DLL_EXPORT
Buffer& operator=(Buffer const&);
DLL_EXPORT
~Buffer();
DLL_EXPORT
unsigned long getSize() const;
DLL_EXPORT
unsigned char const* getBuffer() const;
DLL_EXPORT
unsigned char* getBuffer();
private:

View File

@ -33,21 +33,18 @@
#include <qpdf/DLL.hh>
#include <string>
DLL_EXPORT
class Pipeline
{
public:
DLL_EXPORT
Pipeline(char const* identifier, Pipeline* next);
DLL_EXPORT
virtual ~Pipeline();
// Subclasses should implement write and finish to do their jobs
// and then, if they are not end-of-line pipelines, call
// getNext()->write or getNext()->finish.
DLL_EXPORT
virtual void write(unsigned char* data, int len) = 0;
DLL_EXPORT
virtual void finish() = 0;
protected:

View File

@ -24,22 +24,18 @@
#include <qpdf/Buffer.hh>
#include <list>
DLL_EXPORT
class Pl_Buffer: public Pipeline
{
public:
DLL_EXPORT
Pl_Buffer(char const* identifier, Pipeline* next = 0);
DLL_EXPORT
virtual ~Pl_Buffer();
DLL_EXPORT
virtual void write(unsigned char*, int);
DLL_EXPORT
virtual void finish();
// Each call to getBuffer() resets this object -- see notes above.
// The caller is responsible for deleting the returned Buffer
// object.
DLL_EXPORT
Buffer* getBuffer();
private:

View File

@ -13,23 +13,18 @@
#include <qpdf/Pipeline.hh>
DLL_EXPORT
class Pl_Count: public Pipeline
{
public:
DLL_EXPORT
Pl_Count(char const* identifier, Pipeline* next);
DLL_EXPORT
virtual ~Pl_Count();
DLL_EXPORT
virtual void write(unsigned char*, int);
DLL_EXPORT
virtual void finish();
// Returns the number of bytes written
DLL_EXPORT
int getCount() const;
// Returns the last character written, or '\0' if no characters
// have been written (in which case getCount() returns 0)
DLL_EXPORT
unsigned char getLastChar() const;
private:

View File

@ -16,16 +16,13 @@
#include <qpdf/Pipeline.hh>
DLL_EXPORT
class Pl_Discard: public Pipeline
{
public:
DLL_EXPORT
Pl_Discard();
DLL_EXPORT
virtual ~Pl_Discard();
DLL_EXPORT
virtual void write(unsigned char*, int);
DLL_EXPORT
virtual void finish();
};

View File

@ -12,6 +12,7 @@
#include <zlib.h>
DLL_EXPORT
class Pl_Flate: public Pipeline
{
public:
@ -19,15 +20,11 @@ class Pl_Flate: public Pipeline
enum action_e { a_inflate, a_deflate };
DLL_EXPORT
Pl_Flate(char const* identifier, Pipeline* next,
action_e action, int out_bufsize = def_bufsize);
DLL_EXPORT
virtual ~Pl_Flate();
DLL_EXPORT
virtual void write(unsigned char* data, int len);
DLL_EXPORT
virtual void finish();
private:

View File

@ -18,19 +18,16 @@
// This pipeline is reusable.
//
DLL_EXPORT
class Pl_StdioFile: public Pipeline
{
public:
// f is externally maintained; this class just writes to and
// flushes it. It does not close it.
DLL_EXPORT
Pl_StdioFile(char const* identifier, FILE* f);
DLL_EXPORT
virtual ~Pl_StdioFile();
DLL_EXPORT
virtual void write(unsigned char* buf, int len);
DLL_EXPORT
virtual void finish();
private:

View File

@ -25,12 +25,11 @@ class BitStream;
class BitWriter;
class QPDFExc;
DLL_EXPORT
class QPDF
{
public:
DLL_EXPORT
QPDF();
DLL_EXPORT
~QPDF();
// Associate a file with a QPDF object and do initial parsing of
@ -43,7 +42,6 @@ class QPDF
// encrypted,either a null password or an empty password can be
// used. If the file is encrypted, either the user password or
// the owner password may be supplied.
DLL_EXPORT
void processFile(char const* filename, char const* password = 0);
// Parameter settings
@ -52,21 +50,18 @@ class QPDF
// (one that contains both cross-reference streams and
// cross-reference tables). This can be useful for testing to
// ensure that a hybrid file would work with an older reader.
DLL_EXPORT
void setIgnoreXRefStreams(bool);
// By default, any warnings are issued to stderr as they are
// encountered. If this is called with a true value, reporting of
// warnings is suppressed. You may still retrieve warnings by
// calling getWarnings.
DLL_EXPORT
void setSuppressWarnings(bool);
// By default, QPDF will try to recover if it finds certain types
// of errors in PDF files. If turned off, it will throw an
// exception on the first such problem it finds without attempting
// recovery.
DLL_EXPORT
void setAttemptRecovery(bool);
// Other public methods
@ -76,26 +71,19 @@ class QPDF
// throws an exception. Note that if setSuppressWarnings was not
// called or was called with a false value, any warnings retrieved
// here will have already been issued to stderr.
DLL_EXPORT
std::vector<std::string> getWarnings();
DLL_EXPORT
std::string getFilename() const;
DLL_EXPORT
std::string getPDFVersion() const;
DLL_EXPORT
QPDFObjectHandle getTrailer();
DLL_EXPORT
QPDFObjectHandle getRoot();
// Install this object handle as an indirect object and return an
// indirect reference to it.
DLL_EXPORT
QPDFObjectHandle makeIndirectObject(QPDFObjectHandle);
// Retrieve an object by object ID and generation. Returns an
// indirect reference to it.
DLL_EXPORT
QPDFObjectHandle getObjectByID(int objid, int generation);
// Encryption support
@ -125,45 +113,30 @@ class QPDF
std::string id1;
};
DLL_EXPORT
bool isEncrypted() const;
DLL_EXPORT
bool isEncrypted(int& R, int& P);
// Encryption permissions -- not enforced by QPDF
DLL_EXPORT
bool allowAccessibility();
DLL_EXPORT
bool allowExtractAll();
DLL_EXPORT
bool allowPrintLowRes();
DLL_EXPORT
bool allowPrintHighRes();
DLL_EXPORT
bool allowModifyAssembly();
DLL_EXPORT
bool allowModifyForm();
DLL_EXPORT
bool allowModifyAnnotation();
DLL_EXPORT
bool allowModifyOther();
DLL_EXPORT
bool allowModifyAll();
// Helper function to trim padding from user password. Calling
// trim_user_password on the result of getPaddedUserPassword gives
// getTrimmedUserPassword's result.
DLL_EXPORT
static void trim_user_password(std::string& user_password);
DLL_EXPORT
static std::string compute_data_key(
std::string const& encryption_key, int objid, int generation);
DLL_EXPORT
static std::string compute_encryption_key(
std::string const& password, EncryptionData const& data);
DLL_EXPORT
static void compute_encryption_O_U(
char const* user_password, char const* owner_password,
int V, int R, int key_len, int P,
@ -172,23 +145,19 @@ class QPDF
// Return the full user password as stored in the PDF file. If
// you are attempting to recover the user password in a
// user-presentable form, call getTrimmedUserPassword() instead.
DLL_EXPORT
std::string const& getPaddedUserPassword() const;
// Return human-readable form of user password.
DLL_EXPORT
std::string getTrimmedUserPassword() const;
// Linearization support
// Returns true iff the file starts with a linearization parameter
// dictionary. Does no additional validation.
DLL_EXPORT
bool isLinearized();
// Performs various sanity checks on a linearized file. Return
// true if no errors or warnings. Otherwise, return false and
// output errors and warnings to stdout.
DLL_EXPORT
bool checkLinearization();
// Calls checkLinearization() and, if possible, prints normalized
@ -196,11 +165,9 @@ class QPDF
// includes adding min values to delta values and adjusting
// offsets based on the location and size of the primary hint
// stream.
DLL_EXPORT
void showLinearizationData();
// Shows the contents of the cross-reference table
DLL_EXPORT
void showXRefTable();
// Optimization support -- see doc/optimization. Implemented in
@ -214,31 +181,26 @@ class QPDF
// This is available so that the test suite can make sure that a
// linearized file is already optimized. When called in this way,
// optimize() still populates the object <-> user maps
DLL_EXPORT
void optimize(std::map<int, int> const& object_stream_data,
bool allow_changes = true);
// Replace all references to indirect objects that are "scalars"
// (i.e., things that don't have children: not arrays, streams, or
// dictionaries) with direct objects.
DLL_EXPORT
void flattenScalarReferences();
// Decode all streams, discarding the output. Used to check
// correctness of stream encoding.
DLL_EXPORT
void decodeStreams();
// For QPDFWriter:
// Remove /ID, /Encrypt, and /Prev keys from the trailer
// dictionary since these are regenerated during write.
DLL_EXPORT
void trimTrailerForWrite();
// Get lists of all objects in order according to the part of a
// linearized file that they belong to.
DLL_EXPORT
void getLinearizedParts(
std::map<int, int> const& object_stream_data,
std::vector<QPDFObjectHandle>& part4,
@ -247,7 +209,6 @@ class QPDF
std::vector<QPDFObjectHandle>& part8,
std::vector<QPDFObjectHandle>& part9);
DLL_EXPORT
void generateHintStream(std::map<int, QPDFXRefEntry> const& xref,
std::map<int, size_t> const& lengths,
std::map<int, int> const& obj_renumber,
@ -255,18 +216,15 @@ class QPDF
int& S, int& O);
// Map object to object stream that contains it
DLL_EXPORT
void getObjectStreamData(std::map<int, int>&);
// Get a list of objects that would be permitted in an object
// stream
DLL_EXPORT
std::vector<int> getCompressibleObjects();
// Convenience routines for common functions. See also
// QPDFObjectHandle.hh for additional convenience routines.
// Traverse page tree return all /Page objects.
DLL_EXPORT
std::vector<QPDFObjectHandle> const& getAllPages();
// Resolver class is restricted to QPDFObjectHandle so that only

View File

@ -11,15 +11,13 @@
#include <qpdf/DLL.hh>
#include <stdexcept>
DLL_EXPORT
class QPDFExc: public std::runtime_error
{
public:
DLL_EXPORT
QPDFExc(std::string const& message);
DLL_EXPORT
QPDFExc(std::string const& filename, int offset,
std::string const& message);
DLL_EXPORT
virtual ~QPDFExc() throw ();
};

View File

@ -12,11 +12,11 @@
#include <string>
DLL_EXPORT
class QPDFObject
{
public:
virtual ~QPDFObject() {}
DLL_EXPORT
virtual std::string unparse() = 0;
};

View File

@ -23,61 +23,41 @@
class Pipeline;
class QPDF;
DLL_EXPORT
class QPDFObjectHandle
{
public:
DLL_EXPORT
QPDFObjectHandle();
DLL_EXPORT
bool isInitialized() const;
// Exactly one of these will return true for any object.
DLL_EXPORT
bool isBool();
DLL_EXPORT
bool isNull();
DLL_EXPORT
bool isInteger();
DLL_EXPORT
bool isReal();
DLL_EXPORT
bool isName();
DLL_EXPORT
bool isString();
DLL_EXPORT
bool isArray();
DLL_EXPORT
bool isDictionary();
DLL_EXPORT
bool isStream();
// This returns true in addition to the query for the specific
// type for indirect objects.
DLL_EXPORT
bool isIndirect();
// True for everything except array, dictionary, and stream
DLL_EXPORT
bool isScalar();
// Public factory methods
DLL_EXPORT
static QPDFObjectHandle newNull();
DLL_EXPORT
static QPDFObjectHandle newBool(bool value);
DLL_EXPORT
static QPDFObjectHandle newInteger(int value);
DLL_EXPORT
static QPDFObjectHandle newReal(std::string const& value);
DLL_EXPORT
static QPDFObjectHandle newName(std::string const& name);
DLL_EXPORT
static QPDFObjectHandle newString(std::string const& str);
DLL_EXPORT
static QPDFObjectHandle newArray(
std::vector<QPDFObjectHandle> const& items);
DLL_EXPORT
static QPDFObjectHandle newDictionary(
std::map<std::string, QPDFObjectHandle> const& items);
@ -86,74 +66,55 @@ class QPDFObjectHandle
// type, an exception is thrown.
// Methods for bool objects
DLL_EXPORT
bool getBoolValue();
// Methods for integer objects
DLL_EXPORT
int getIntValue();
// Methods for real objects
DLL_EXPORT
std::string getRealValue();
// Methods that work for both integer and real objects
DLL_EXPORT
bool isNumber();
DLL_EXPORT
double getNumericValue();
// Methods for name objects
DLL_EXPORT
std::string getName();
// Methods for string objects
DLL_EXPORT
std::string getStringValue();
DLL_EXPORT
std::string getUTF8Value();
// Methods for array objects
DLL_EXPORT
int getArrayNItems();
DLL_EXPORT
QPDFObjectHandle getArrayItem(int n);
// Methods for dictionary objects
DLL_EXPORT
bool hasKey(std::string const&);
DLL_EXPORT
QPDFObjectHandle getKey(std::string const&);
DLL_EXPORT
std::set<std::string> getKeys();
// Mutator methods. Use with caution.
// Recursively copy this object, making it direct. Throws an
// exception if a loop is detected or any sub-object is a stream.
DLL_EXPORT
void makeDirect();
// Mutator methods for array objects
DLL_EXPORT
void setArrayItem(int, QPDFObjectHandle const&);
// Mutator methods for dictionary objects
// Replace value of key, adding it if it does not exist
DLL_EXPORT
void replaceKey(std::string const& key, QPDFObjectHandle const&);
// Remove key, doing nothing if key does not exist
DLL_EXPORT
void removeKey(std::string const& key);
// Methods for stream objects
DLL_EXPORT
QPDFObjectHandle getDict();
// Returns filtered (uncompressed) stream data. Throws an
// exception if the stream is filtered and we can't decode it.
DLL_EXPORT
PointerHolder<Buffer> getStreamData();
// Write stream data through the given pipeline. A null pipeline
@ -173,19 +134,14 @@ class QPDFObjectHandle
// value of this function to determine whether or not the /Filter
// and /DecodeParms keys in the stream dictionary should be
// replaced if writing a new stream object.
DLL_EXPORT
bool pipeStreamData(Pipeline*, bool filter,
bool normalize, bool compress);
// return 0 for direct objects
DLL_EXPORT
int getObjectID() const;
DLL_EXPORT
int getGeneration() const;
DLL_EXPORT
std::string unparse();
DLL_EXPORT
std::string unparseResolved();
// Convenience routines for commonly performed functions
@ -195,7 +151,6 @@ class QPDFObjectHandle
// function does not presently support inherited resources. See
// comment in the source for details. Return value is a map from
// XObject name to the image object, which is always a stream.
DLL_EXPORT
std::map<std::string, QPDFObjectHandle> getPageImages();
// Throws an exception if this is not a Page object. Returns a
@ -203,7 +158,6 @@ class QPDFObjectHandle
// the given page. This routine allows the caller to not care
// whether there are one or more than one content streams for a
// page.
DLL_EXPORT
std::vector<QPDFObjectHandle> getPageContents();
// Initializers for objects. This Factory class gives the QPDF

View File

@ -13,6 +13,7 @@
#include <string>
#include <stdio.h>
DLL_EXPORT
class QPDFTokenizer
{
public:
@ -84,7 +85,6 @@ class QPDFTokenizer
std::string error_message;
};
DLL_EXPORT
QPDFTokenizer();
// PDF files with version < 1.2 allowed the pound character
@ -92,7 +92,6 @@ class QPDFTokenizer
// character was allowed only when followed by two hexadecimal
// digits. This method should be called when parsing a PDF file
// whose version is older than 1.2.
DLL_EXPORT
void allowPoundAnywhereInName();
// Mode of operation:
@ -103,23 +102,19 @@ class QPDFTokenizer
// It these are called when a token is available, an exception
// will be thrown.
DLL_EXPORT
void presentCharacter(char ch);
DLL_EXPORT
void presentEOF();
// If a token is available, return true and initialize token with
// the token, unread_char with whether or not we have to unread
// the last character, and if unread_char, ch with the character
// to unread.
DLL_EXPORT
bool getToken(Token& token, bool& unread_char, char& ch);
// This function returns true of the current character is between
// tokens (i.e., white space that is not part of a string) or is
// part of a comment. A tokenizing filter can call this to
// determine whether to output the character.
DLL_EXPORT
bool betweenTokens();
private:

View File

@ -31,6 +31,7 @@ class QPDF;
class QPDFObjectHandle;
class Pl_Count;
DLL_EXPORT
class QPDFWriter
{
public:
@ -41,9 +42,7 @@ class QPDFWriter
// useful for tracking down problems. If your application doesn't
// want the partially written file to be left behind, you should
// delete it the eventual call to write fails.
DLL_EXPORT
QPDFWriter(QPDF& pdf, char const* filename);
DLL_EXPORT
~QPDFWriter();
// Set the value of object stream mode. In disable mode, we never
@ -54,7 +53,6 @@ class QPDFWriter
// object streams and a cross-reference stream if there are object
// streams. The default is o_preserve.
enum object_stream_e { o_disable, o_preserve, o_generate };
DLL_EXPORT
void setObjectStreamMode(object_stream_e);
// Set value of stream data mode. In uncompress mode, we attempt
@ -63,7 +61,6 @@ class QPDFWriter
// if we can apply all filters and the stream is not already
// optimally compressed, recompress the stream.
enum stream_data_e { s_uncompress, s_preserve, s_compress };
DLL_EXPORT
void setStreamDataMode(stream_data_e);
// Set value of content stream normalization. The default is
@ -73,7 +70,6 @@ class QPDFWriter
// damage the content stream. This flag should be used only for
// debugging and experimenting with PDF content streams. Never
// use it for production files.
DLL_EXPORT
void setContentNormalization(bool);
// Set QDF mode. QDF mode causes special "pretty printing" of
@ -81,7 +77,6 @@ class QPDFWriter
// Resulting PDF files can be edited in a text editor and then run
// through fix-qdf to update cross reference tables and stream
// lengths.
DLL_EXPORT
void setQDFMode(bool);
// Set the minimum PDF version. If the PDF version of the input
@ -93,7 +88,6 @@ class QPDFWriter
// QPDFWriter automatically sets the minimum version to 1.4 when
// R3 encryption parameters are used, and to 1.5 when object
// streams are used.
DLL_EXPORT
void setMinimumPDFVersion(std::string const&);
// Force the PDF version of the output file to be a given version.
@ -105,26 +99,22 @@ class QPDFWriter
// you are sure the PDF file in question has no features of newer
// versions of PDF or if you are willing to create files that old
// viewers may try to open but not be able to properly interpret.
DLL_EXPORT
void forcePDFVersion(std::string const&);
// Cause a static /ID value to be generated. Use only in test
// suites.
DLL_EXPORT
void setStaticID(bool);
// Suppress inclusion of comments indicating original object IDs
// when writing QDF files. This can also be useful for testing,
// particularly when using comparison of two qdf files to
// determine whether two PDF files have identical content.
DLL_EXPORT
void setSuppressOriginalObjectIDs(bool);
// Preserve encryption. The default is true unless prefilering,
// content normalization, or qdf mode has been selected in which
// case encryption is never preserved. Encryption is also not
// preserved if we explicitly set encryption parameters.
DLL_EXPORT
void setPreserveEncryption(bool);
// Set up for encrypted output. Disables stream prefiltering and
@ -132,7 +122,6 @@ class QPDFWriter
// parameters sets the PDF version to at least 1.3, and setting R3
// encryption parameters pushes the PDF version number to at least
// 1.4.
DLL_EXPORT
void setR2EncryptionParameters(
char const* user_password, char const* owner_password,
bool allow_print, bool allow_modify,
@ -151,7 +140,6 @@ class QPDFWriter
r3m_assembly, // allow only document assembly
r3m_none // allow no modification
};
DLL_EXPORT
void setR3EncryptionParameters(
char const* user_password, char const* owner_password,
bool allow_accessibility, bool allow_extract,
@ -159,10 +147,8 @@ class QPDFWriter
// Create linearized output. Disables qdf mode, content
// normalization, and stream prefiltering.
DLL_EXPORT
void setLinearization(bool);
DLL_EXPORT
void write();
private:

View File

@ -10,6 +10,7 @@
#include <qpdf/DLL.hh>
DLL_EXPORT
class QPDFXRefEntry
{
public:
@ -19,18 +20,12 @@ class QPDFXRefEntry
// 1 = "uncompressed"; field 1 = offset
// 2 = "compressed"; field 1 = object stream number, field 2 = index
DLL_EXPORT
QPDFXRefEntry();
DLL_EXPORT
QPDFXRefEntry(int type, int field1, int field2);
DLL_EXPORT
int getType() const;
DLL_EXPORT
int getOffset() const; // only for type 1
DLL_EXPORT
int getObjStreamNumber() const; // only for type 2
DLL_EXPORT
int getObjStreamIndex() const; // only for type 2
private:

View File

@ -4,7 +4,6 @@
#define BITS_READ 1
#include "bits.icc"
DLL_EXPORT
BitStream::BitStream(unsigned char const* p, int nbytes) :
start(p),
nbytes(nbytes)
@ -12,7 +11,6 @@ BitStream::BitStream(unsigned char const* p, int nbytes) :
reset();
}
DLL_EXPORT
void
BitStream::reset()
{
@ -21,7 +19,6 @@ BitStream::reset()
bits_available = 8 * nbytes;
}
DLL_EXPORT
unsigned long
BitStream::getBits(int nbits)
{
@ -29,7 +26,6 @@ BitStream::getBits(int nbits)
this->bits_available, nbits);
}
DLL_EXPORT
void
BitStream::skipToNextByte()
{

View File

@ -4,7 +4,6 @@
#define BITS_WRITE 1
#include "bits.icc"
DLL_EXPORT
BitWriter::BitWriter(Pipeline* pl) :
pl(pl),
ch(0),
@ -12,14 +11,12 @@ BitWriter::BitWriter(Pipeline* pl) :
{
}
DLL_EXPORT
void
BitWriter::writeBits(unsigned long val, int bits)
{
write_bits(this->ch, this->bit_offset, val, bits, this->pl);
}
DLL_EXPORT
void
BitWriter::flush()
{

View File

@ -2,26 +2,22 @@
#include <string.h>
DLL_EXPORT
Buffer::Buffer()
{
init(0);
}
DLL_EXPORT
Buffer::Buffer(unsigned long size)
{
init(size);
}
DLL_EXPORT
Buffer::Buffer(Buffer const& rhs)
{
init(0);
copy(rhs);
}
DLL_EXPORT
Buffer&
Buffer::operator=(Buffer const& rhs)
{
@ -29,7 +25,6 @@ Buffer::operator=(Buffer const& rhs)
return *this;
}
DLL_EXPORT
Buffer::~Buffer()
{
destroy();
@ -64,21 +59,18 @@ Buffer::destroy()
this->buf = 0;
}
DLL_EXPORT
unsigned long
Buffer::getSize() const
{
return this->size;
}
DLL_EXPORT
unsigned char const*
Buffer::getBuffer() const
{
return this->buf;
}
DLL_EXPORT
unsigned char*
Buffer::getBuffer()
{

View File

@ -296,19 +296,16 @@ void MD5::decode(UINT4 *output, unsigned char *input, unsigned int len)
// Public functions
DLL_EXPORT
MD5::MD5()
{
init();
}
DLL_EXPORT
void MD5::reset()
{
init();
}
DLL_EXPORT
void MD5::encodeString(char const* str)
{
unsigned int len = strlen(str);
@ -317,19 +314,16 @@ void MD5::encodeString(char const* str)
final();
}
DLL_EXPORT
void MD5::appendString(char const* input_string)
{
update((unsigned char *)input_string, strlen(input_string));
}
DLL_EXPORT
void MD5::encodeDataIncrementally(char const* data, int len)
{
update((unsigned char *)data, len);
}
DLL_EXPORT
void MD5::encodeFile(char const *filename, int up_to_size)
{
unsigned char buffer[1024];
@ -371,14 +365,12 @@ void MD5::encodeFile(char const *filename, int up_to_size)
final();
}
DLL_EXPORT
void MD5::digest(Digest result)
{
final();
memcpy(result, digest_val, sizeof(digest_val));
}
DLL_EXPORT
void MD5::print()
{
final();
@ -391,7 +383,6 @@ void MD5::print()
printf("\n");
}
DLL_EXPORT
std::string MD5::unparse()
{
final();
@ -407,7 +398,6 @@ std::string MD5::unparse()
return result;
}
DLL_EXPORT
std::string
MD5::getDataChecksum(char const* buf, int len)
{
@ -416,7 +406,6 @@ MD5::getDataChecksum(char const* buf, int len)
return m.unparse();
}
DLL_EXPORT
std::string
MD5::getFileChecksum(char const* filename, int up_to_size)
{
@ -425,7 +414,6 @@ MD5::getFileChecksum(char const* filename, int up_to_size)
return m.unparse();
}
DLL_EXPORT
bool
MD5::checkDataChecksum(char const* const checksum,
char const* buf, int len)
@ -434,7 +422,6 @@ MD5::checkDataChecksum(char const* const checksum,
return (checksum == actual_checksum);
}
DLL_EXPORT
bool
MD5::checkFileChecksum(char const* const checksum,
char const* filename, int up_to_size)

View File

@ -5,31 +5,26 @@
#include <iostream>
#include <string.h>
DLL_EXPORT
PCRE::NoBackref::NoBackref() :
std::logic_error("PCRE error: no match")
{
}
DLL_EXPORT
PCRE::Match::Match(int nbackrefs, char const* subject)
{
this->init(-1, nbackrefs, subject);
}
DLL_EXPORT
PCRE::Match::~Match()
{
this->destroy();
}
DLL_EXPORT
PCRE::Match::Match(Match const& rhs)
{
this->copy(rhs);
}
DLL_EXPORT
PCRE::Match&
PCRE::Match::operator=(Match const& rhs)
{
@ -72,13 +67,11 @@ PCRE::Match::destroy()
delete [] this->ovector;
}
DLL_EXPORT
PCRE::Match::operator bool()
{
return (this->nmatches >= 0);
}
DLL_EXPORT
std::string
PCRE::Match::getMatch(int n, int flags)
{
@ -107,7 +100,6 @@ PCRE::Match::getMatch(int n, int flags)
return std::string(this->subject).substr(offset, length);
}
DLL_EXPORT
void
PCRE::Match::getOffsetLength(int n, int& offset, int& length)
{
@ -121,7 +113,6 @@ PCRE::Match::getOffsetLength(int n, int& offset, int& length)
length = this->ovector[n * 2 + 1] - offset;
}
DLL_EXPORT
int
PCRE::Match::getOffset(int n)
{
@ -131,7 +122,6 @@ PCRE::Match::getOffset(int n)
return offset;
}
DLL_EXPORT
int
PCRE::Match::getLength(int n)
{
@ -141,14 +131,12 @@ PCRE::Match::getLength(int n)
return length;
}
DLL_EXPORT
int
PCRE::Match::nMatches() const
{
return this->nmatches;
}
DLL_EXPORT
PCRE::PCRE(char const* pattern, int options)
{
char const *errptr;
@ -168,13 +156,11 @@ PCRE::PCRE(char const* pattern, int options)
}
}
DLL_EXPORT
PCRE::~PCRE()
{
pcre_free(this->code);
}
DLL_EXPORT
PCRE::Match
PCRE::match(char const* subject, int options, int startoffset, int size)
{
@ -222,7 +208,6 @@ PCRE::match(char const* subject, int options, int startoffset, int size)
return result;
}
DLL_EXPORT
void
PCRE::test(int n)
{

View File

@ -1,14 +1,12 @@
#include <qpdf/Pipeline.hh>
#include <stdexcept>
DLL_EXPORT
Pipeline::Pipeline(char const* identifier, Pipeline* next) :
identifier(identifier),
next(next)
{
}
DLL_EXPORT
Pipeline::~Pipeline()
{
}

View File

@ -3,7 +3,6 @@
#include <stdexcept>
#include <string.h>
DLL_EXPORT
Pl_ASCII85Decoder::Pl_ASCII85Decoder(char const* identifier, Pipeline* next) :
Pipeline(identifier, next),
pos(0),
@ -12,12 +11,10 @@ Pl_ASCII85Decoder::Pl_ASCII85Decoder(char const* identifier, Pipeline* next) :
memset(this->inbuf, 117, 5);
}
DLL_EXPORT
Pl_ASCII85Decoder::~Pl_ASCII85Decoder()
{
}
DLL_EXPORT
void
Pl_ASCII85Decoder::write(unsigned char* buf, int len)
{
@ -126,7 +123,6 @@ Pl_ASCII85Decoder::flush()
memset(this->inbuf, 117, 5);
}
DLL_EXPORT
void
Pl_ASCII85Decoder::finish()
{

View File

@ -4,7 +4,6 @@
#include <string.h>
#include <ctype.h>
DLL_EXPORT
Pl_ASCIIHexDecoder::Pl_ASCIIHexDecoder(char const* identifier, Pipeline* next) :
Pipeline(identifier, next),
pos(0),
@ -13,12 +12,10 @@ Pl_ASCIIHexDecoder::Pl_ASCIIHexDecoder(char const* identifier, Pipeline* next) :
strcpy(this->inbuf, "00");
}
DLL_EXPORT
Pl_ASCIIHexDecoder::~Pl_ASCIIHexDecoder()
{
}
DLL_EXPORT
void
Pl_ASCIIHexDecoder::write(unsigned char* buf, int len)
{
@ -104,7 +101,6 @@ Pl_ASCIIHexDecoder::flush()
strcpy(this->inbuf, "00");
}
DLL_EXPORT
void
Pl_ASCIIHexDecoder::finish()
{

View File

@ -3,7 +3,6 @@
#include <assert.h>
#include <string.h>
DLL_EXPORT
Pl_Buffer::Pl_Buffer(char const* identifier, Pipeline* next) :
Pipeline(identifier, next),
ready(false),
@ -11,12 +10,10 @@ Pl_Buffer::Pl_Buffer(char const* identifier, Pipeline* next) :
{
}
DLL_EXPORT
Pl_Buffer::~Pl_Buffer()
{
}
DLL_EXPORT
void
Pl_Buffer::write(unsigned char* buf, int len)
{
@ -32,7 +29,6 @@ Pl_Buffer::write(unsigned char* buf, int len)
}
}
DLL_EXPORT
void
Pl_Buffer::finish()
{
@ -43,7 +39,6 @@ Pl_Buffer::finish()
}
}
DLL_EXPORT
Buffer*
Pl_Buffer::getBuffer()
{

View File

@ -1,6 +1,5 @@
#include <qpdf/Pl_Count.hh>
DLL_EXPORT
Pl_Count::Pl_Count(char const* identifier, Pipeline* next) :
Pipeline(identifier, next),
count(0),
@ -8,12 +7,10 @@ Pl_Count::Pl_Count(char const* identifier, Pipeline* next) :
{
}
DLL_EXPORT
Pl_Count::~Pl_Count()
{
}
DLL_EXPORT
void
Pl_Count::write(unsigned char* buf, int len)
{
@ -25,21 +22,18 @@ Pl_Count::write(unsigned char* buf, int len)
}
}
DLL_EXPORT
void
Pl_Count::finish()
{
getNext()->finish();
}
DLL_EXPORT
int
Pl_Count::getCount() const
{
return this->count;
}
DLL_EXPORT
unsigned char
Pl_Count::getLastChar() const
{

View File

@ -2,24 +2,20 @@
// Exercised in md5 test suite
DLL_EXPORT
Pl_Discard::Pl_Discard() :
Pipeline("discard", 0)
{
}
DLL_EXPORT
Pl_Discard::~Pl_Discard()
{
}
DLL_EXPORT
void
Pl_Discard::write(unsigned char* buf, int len)
{
}
DLL_EXPORT
void
Pl_Discard::finish()
{

View File

@ -2,7 +2,6 @@
#include <qpdf/QUtil.hh>
DLL_EXPORT
Pl_Flate::Pl_Flate(char const* identifier, Pipeline* next,
action_e action, int out_bufsize) :
Pipeline(identifier, next),
@ -21,7 +20,6 @@ Pl_Flate::Pl_Flate(char const* identifier, Pipeline* next,
zstream.avail_out = out_bufsize;
}
DLL_EXPORT
Pl_Flate::~Pl_Flate()
{
if (this->outbuf)
@ -31,7 +29,6 @@ Pl_Flate::~Pl_Flate()
}
}
DLL_EXPORT
void
Pl_Flate::write(unsigned char* data, int len)
{
@ -119,7 +116,6 @@ Pl_Flate::handleData(unsigned char* data, int len, int flush)
}
}
DLL_EXPORT
void
Pl_Flate::finish()
{

View File

@ -5,7 +5,6 @@
#include <string.h>
#include <assert.h>
DLL_EXPORT
Pl_LZWDecoder::Pl_LZWDecoder(char const* identifier, Pipeline* next,
bool early_code_change) :
Pipeline(identifier, next),
@ -21,12 +20,10 @@ Pl_LZWDecoder::Pl_LZWDecoder(char const* identifier, Pipeline* next,
memset(buf, 0, 3);
}
DLL_EXPORT
Pl_LZWDecoder::~Pl_LZWDecoder()
{
}
DLL_EXPORT
void
Pl_LZWDecoder::write(unsigned char* bytes, int len)
{
@ -45,7 +42,6 @@ Pl_LZWDecoder::write(unsigned char* bytes, int len)
}
}
DLL_EXPORT
void
Pl_LZWDecoder::finish()
{

View File

@ -1,19 +1,16 @@
#include <qpdf/Pl_MD5.hh>
#include <stdexcept>
DLL_EXPORT
Pl_MD5::Pl_MD5(char const* identifier, Pipeline* next) :
Pipeline(identifier, next),
in_progress(false)
{
}
DLL_EXPORT
Pl_MD5::~Pl_MD5()
{
}
DLL_EXPORT
void
Pl_MD5::write(unsigned char* buf, int len)
{
@ -26,7 +23,6 @@ Pl_MD5::write(unsigned char* buf, int len)
this->getNext()->write(buf, len);
}
DLL_EXPORT
void
Pl_MD5::finish()
{
@ -34,7 +30,6 @@ Pl_MD5::finish()
this->in_progress = false;
}
DLL_EXPORT
std::string
Pl_MD5::getHexDigest()
{

View File

@ -2,7 +2,6 @@
#include <stdexcept>
#include <string.h>
DLL_EXPORT
Pl_PNGFilter::Pl_PNGFilter(char const* identifier, Pipeline* next,
action_e action, unsigned int columns,
unsigned int bytes_per_pixel) :
@ -23,14 +22,12 @@ Pl_PNGFilter::Pl_PNGFilter(char const* identifier, Pipeline* next,
this->incoming = (action == a_encode ? columns : columns + 1);
}
DLL_EXPORT
Pl_PNGFilter::~Pl_PNGFilter()
{
delete [] buf1;
delete [] buf2;
}
DLL_EXPORT
void
Pl_PNGFilter::write(unsigned char* data, int len)
{
@ -132,7 +129,6 @@ Pl_PNGFilter::encodeRow()
}
}
DLL_EXPORT
void
Pl_PNGFilter::finish()
{

View File

@ -1,7 +1,6 @@
#include <qpdf/Pl_RC4.hh>
#include <qpdf/QUtil.hh>
DLL_EXPORT
Pl_RC4::Pl_RC4(char const* identifier, Pipeline* next,
unsigned char const* key_data, int key_len,
int out_bufsize) :
@ -12,7 +11,6 @@ Pl_RC4::Pl_RC4(char const* identifier, Pipeline* next,
this->outbuf = new unsigned char[out_bufsize];
}
DLL_EXPORT
Pl_RC4::~Pl_RC4()
{
if (this->outbuf)
@ -22,7 +20,6 @@ Pl_RC4::~Pl_RC4()
}
}
DLL_EXPORT
void
Pl_RC4::write(unsigned char* data, int len)
{
@ -46,7 +43,6 @@ Pl_RC4::write(unsigned char* data, int len)
}
}
DLL_EXPORT
void
Pl_RC4::finish()
{

View File

@ -3,19 +3,16 @@
#include <stdexcept>
#include <errno.h>
DLL_EXPORT
Pl_StdioFile::Pl_StdioFile(char const* identifier, FILE* f) :
Pipeline(identifier, 0),
file(f)
{
}
DLL_EXPORT
Pl_StdioFile::~Pl_StdioFile()
{
}
DLL_EXPORT
void
Pl_StdioFile::write(unsigned char* buf, int len)
{
@ -36,7 +33,6 @@ Pl_StdioFile::write(unsigned char* buf, int len)
}
}
DLL_EXPORT
void
Pl_StdioFile::finish()
{

View File

@ -247,7 +247,6 @@ QPDF::ObjGen::operator<(ObjGen const& rhs) const
((this->obj == rhs.obj) && (this->gen < rhs.gen)));
}
DLL_EXPORT
QPDF::QPDF() :
encrypted(false),
encryption_initialized(false),
@ -261,12 +260,10 @@ QPDF::QPDF() :
{
}
DLL_EXPORT
QPDF::~QPDF()
{
}
DLL_EXPORT
void
QPDF::processFile(char const* filename, char const* password)
{
@ -278,28 +275,24 @@ QPDF::processFile(char const* filename, char const* password)
parse();
}
DLL_EXPORT
void
QPDF::setIgnoreXRefStreams(bool val)
{
this->ignore_xref_streams = val;
}
DLL_EXPORT
void
QPDF::setSuppressWarnings(bool val)
{
this->suppress_warnings = val;
}
DLL_EXPORT
void
QPDF::setAttemptRecovery(bool val)
{
this->attempt_recovery = val;
}
DLL_EXPORT
std::vector<std::string>
QPDF::getWarnings()
{
@ -944,7 +937,6 @@ QPDF::insertXrefEntry(int obj, int f0, int f1, int f2, bool overwrite)
}
}
DLL_EXPORT
void
QPDF::showXRefTable()
{
@ -1631,7 +1623,6 @@ QPDF::resolveObjectsInStream(int obj_stream_number)
}
}
DLL_EXPORT
QPDFObjectHandle
QPDF::makeIndirectObject(QPDFObjectHandle oh)
{
@ -1646,14 +1637,12 @@ QPDF::makeIndirectObject(QPDFObjectHandle oh)
return QPDFObjectHandle::Factory::newIndirect(this, next.obj, next.gen);
}
DLL_EXPORT
QPDFObjectHandle
QPDF::getObjectByID(int objid, int generation)
{
return QPDFObjectHandle::Factory::newIndirect(this, objid, generation);
}
DLL_EXPORT
void
QPDF::trimTrailerForWrite()
{
@ -1676,35 +1665,30 @@ QPDF::trimTrailerForWrite()
this->trailer.removeKey("/XRefStm");
}
DLL_EXPORT
std::string
QPDF::getFilename() const
{
return this->file.getName();
}
DLL_EXPORT
std::string
QPDF::getPDFVersion() const
{
return this->pdf_version;
}
DLL_EXPORT
QPDFObjectHandle
QPDF::getTrailer()
{
return this->trailer;
}
DLL_EXPORT
QPDFObjectHandle
QPDF::getRoot()
{
return this->trailer.getKey("/Root");
}
DLL_EXPORT
void
QPDF::getObjectStreamData(std::map<int, int>& omap)
{
@ -1721,7 +1705,6 @@ QPDF::getObjectStreamData(std::map<int, int>& omap)
}
}
DLL_EXPORT
std::vector<int>
QPDF::getCompressibleObjects()
{
@ -1870,7 +1853,6 @@ QPDF::pipeStreamData(int objid, int generation,
pipeline->finish();
}
DLL_EXPORT
void
QPDF::decodeStreams()
{
@ -1888,7 +1870,6 @@ QPDF::decodeStreams()
}
}
DLL_EXPORT
std::vector<QPDFObjectHandle> const&
QPDF::getAllPages()
{

View File

@ -1,13 +1,11 @@
#include <qpdf/QPDFExc.hh>
#include <qpdf/QUtil.hh>
DLL_EXPORT
QPDFExc::QPDFExc(std::string const& message) :
std::runtime_error(message)
{
}
DLL_EXPORT
QPDFExc::QPDFExc(std::string const& filename, int offset,
std::string const& message) :
std::runtime_error(filename + ": offset " + QUtil::int_to_string(offset) +
@ -15,7 +13,6 @@ QPDFExc::QPDFExc(std::string const& filename, int offset,
{
}
DLL_EXPORT
QPDFExc::~QPDFExc() throw ()
{
}

View File

@ -17,7 +17,6 @@
#include <stdexcept>
#include <stdlib.h>
DLL_EXPORT
QPDFObjectHandle::QPDFObjectHandle() :
initialized(false),
objid(0),
@ -42,7 +41,6 @@ QPDFObjectHandle::QPDFObjectHandle(QPDFObject* data) :
{
}
DLL_EXPORT
bool
QPDFObjectHandle::isInitialized() const
{
@ -59,7 +57,6 @@ class QPDFObjectTypeAccessor
}
};
DLL_EXPORT
bool
QPDFObjectHandle::isBool()
{
@ -67,7 +64,6 @@ QPDFObjectHandle::isBool()
return QPDFObjectTypeAccessor<QPDF_Bool>::check(obj.getPointer());
}
DLL_EXPORT
bool
QPDFObjectHandle::isNull()
{
@ -75,7 +71,6 @@ QPDFObjectHandle::isNull()
return QPDFObjectTypeAccessor<QPDF_Null>::check(obj.getPointer());
}
DLL_EXPORT
bool
QPDFObjectHandle::isInteger()
{
@ -83,7 +78,6 @@ QPDFObjectHandle::isInteger()
return QPDFObjectTypeAccessor<QPDF_Integer>::check(obj.getPointer());
}
DLL_EXPORT
bool
QPDFObjectHandle::isReal()
{
@ -91,14 +85,12 @@ QPDFObjectHandle::isReal()
return QPDFObjectTypeAccessor<QPDF_Real>::check(obj.getPointer());
}
DLL_EXPORT
bool
QPDFObjectHandle::isNumber()
{
return (isInteger() || isReal());
}
DLL_EXPORT
double
QPDFObjectHandle::getNumericValue()
{
@ -118,7 +110,6 @@ QPDFObjectHandle::getNumericValue()
return result;
}
DLL_EXPORT
bool
QPDFObjectHandle::isName()
{
@ -126,7 +117,6 @@ QPDFObjectHandle::isName()
return QPDFObjectTypeAccessor<QPDF_Name>::check(obj.getPointer());
}
DLL_EXPORT
bool
QPDFObjectHandle::isString()
{
@ -134,7 +124,6 @@ QPDFObjectHandle::isString()
return QPDFObjectTypeAccessor<QPDF_String>::check(obj.getPointer());
}
DLL_EXPORT
bool
QPDFObjectHandle::isArray()
{
@ -142,7 +131,6 @@ QPDFObjectHandle::isArray()
return QPDFObjectTypeAccessor<QPDF_Array>::check(obj.getPointer());
}
DLL_EXPORT
bool
QPDFObjectHandle::isDictionary()
{
@ -150,7 +138,6 @@ QPDFObjectHandle::isDictionary()
return QPDFObjectTypeAccessor<QPDF_Dictionary>::check(obj.getPointer());
}
DLL_EXPORT
bool
QPDFObjectHandle::isStream()
{
@ -158,7 +145,6 @@ QPDFObjectHandle::isStream()
return QPDFObjectTypeAccessor<QPDF_Stream>::check(obj.getPointer());
}
DLL_EXPORT
bool
QPDFObjectHandle::isIndirect()
{
@ -166,7 +152,6 @@ QPDFObjectHandle::isIndirect()
return (this->objid != 0);
}
DLL_EXPORT
bool
QPDFObjectHandle::isScalar()
{
@ -175,7 +160,6 @@ QPDFObjectHandle::isScalar()
// Bool accessors
DLL_EXPORT
bool
QPDFObjectHandle::getBoolValue()
{
@ -185,7 +169,6 @@ QPDFObjectHandle::getBoolValue()
// Integer accessors
DLL_EXPORT
int
QPDFObjectHandle::getIntValue()
{
@ -195,7 +178,6 @@ QPDFObjectHandle::getIntValue()
// Real accessors
DLL_EXPORT
std::string
QPDFObjectHandle::getRealValue()
{
@ -205,7 +187,6 @@ QPDFObjectHandle::getRealValue()
// Name accessors
DLL_EXPORT
std::string
QPDFObjectHandle::getName()
{
@ -215,7 +196,6 @@ QPDFObjectHandle::getName()
// String accessors
DLL_EXPORT
std::string
QPDFObjectHandle::getStringValue()
{
@ -223,7 +203,6 @@ QPDFObjectHandle::getStringValue()
return dynamic_cast<QPDF_String*>(obj.getPointer())->getVal();
}
DLL_EXPORT
std::string
QPDFObjectHandle::getUTF8Value()
{
@ -233,7 +212,6 @@ QPDFObjectHandle::getUTF8Value()
// Array accessors
DLL_EXPORT
int
QPDFObjectHandle::getArrayNItems()
{
@ -241,7 +219,6 @@ QPDFObjectHandle::getArrayNItems()
return dynamic_cast<QPDF_Array*>(obj.getPointer())->getNItems();
}
DLL_EXPORT
QPDFObjectHandle
QPDFObjectHandle::getArrayItem(int n)
{
@ -251,7 +228,6 @@ QPDFObjectHandle::getArrayItem(int n)
// Array mutators
DLL_EXPORT
void
QPDFObjectHandle::setArrayItem(int n, QPDFObjectHandle const& item)
{
@ -261,7 +237,6 @@ QPDFObjectHandle::setArrayItem(int n, QPDFObjectHandle const& item)
// Dictionary accessors
DLL_EXPORT
bool
QPDFObjectHandle::hasKey(std::string const& key)
{
@ -269,7 +244,6 @@ QPDFObjectHandle::hasKey(std::string const& key)
return dynamic_cast<QPDF_Dictionary*>(obj.getPointer())->hasKey(key);
}
DLL_EXPORT
QPDFObjectHandle
QPDFObjectHandle::getKey(std::string const& key)
{
@ -277,7 +251,6 @@ QPDFObjectHandle::getKey(std::string const& key)
return dynamic_cast<QPDF_Dictionary*>(obj.getPointer())->getKey(key);
}
DLL_EXPORT
std::set<std::string>
QPDFObjectHandle::getKeys()
{
@ -287,7 +260,6 @@ QPDFObjectHandle::getKeys()
// Dictionary mutators
DLL_EXPORT
void
QPDFObjectHandle::replaceKey(std::string const& key,
QPDFObjectHandle const& value)
@ -297,7 +269,6 @@ QPDFObjectHandle::replaceKey(std::string const& key,
obj.getPointer())->replaceKey(key, value);
}
DLL_EXPORT
void
QPDFObjectHandle::removeKey(std::string const& key)
{
@ -306,7 +277,6 @@ QPDFObjectHandle::removeKey(std::string const& key)
}
// Stream accessors
DLL_EXPORT
QPDFObjectHandle
QPDFObjectHandle::getDict()
{
@ -314,7 +284,6 @@ QPDFObjectHandle::getDict()
return dynamic_cast<QPDF_Stream*>(obj.getPointer())->getDict();
}
DLL_EXPORT
PointerHolder<Buffer>
QPDFObjectHandle::getStreamData()
{
@ -322,7 +291,6 @@ QPDFObjectHandle::getStreamData()
return dynamic_cast<QPDF_Stream*>(obj.getPointer())->getStreamData();
}
DLL_EXPORT
bool
QPDFObjectHandle::pipeStreamData(Pipeline* p, bool filter,
bool normalize, bool compress)
@ -332,21 +300,18 @@ QPDFObjectHandle::pipeStreamData(Pipeline* p, bool filter,
p, filter, normalize, compress);
}
DLL_EXPORT
int
QPDFObjectHandle::getObjectID() const
{
return this->objid;
}
DLL_EXPORT
int
QPDFObjectHandle::getGeneration() const
{
return this->generation;
}
DLL_EXPORT
std::map<std::string, QPDFObjectHandle>
QPDFObjectHandle::getPageImages()
{
@ -395,7 +360,6 @@ QPDFObjectHandle::getPageImages()
return result;
}
DLL_EXPORT
std::vector<QPDFObjectHandle>
QPDFObjectHandle::getPageContents()
{
@ -435,7 +399,6 @@ QPDFObjectHandle::getPageContents()
return result;
}
DLL_EXPORT
std::string
QPDFObjectHandle::unparse()
{
@ -452,7 +415,6 @@ QPDFObjectHandle::unparse()
return result;
}
DLL_EXPORT
std::string
QPDFObjectHandle::unparseResolved()
{
@ -466,56 +428,48 @@ QPDFObjectHandle::newIndirect(QPDF* qpdf, int objid, int generation)
return QPDFObjectHandle(qpdf, objid, generation);
}
DLL_EXPORT
QPDFObjectHandle
QPDFObjectHandle::newBool(bool value)
{
return QPDFObjectHandle(new QPDF_Bool(value));
}
DLL_EXPORT
QPDFObjectHandle
QPDFObjectHandle::newNull()
{
return QPDFObjectHandle(new QPDF_Null());
}
DLL_EXPORT
QPDFObjectHandle
QPDFObjectHandle::newInteger(int value)
{
return QPDFObjectHandle(new QPDF_Integer(value));
}
DLL_EXPORT
QPDFObjectHandle
QPDFObjectHandle::newReal(std::string const& value)
{
return QPDFObjectHandle(new QPDF_Real(value));
}
DLL_EXPORT
QPDFObjectHandle
QPDFObjectHandle::newName(std::string const& name)
{
return QPDFObjectHandle(new QPDF_Name(name));
}
DLL_EXPORT
QPDFObjectHandle
QPDFObjectHandle::newString(std::string const& str)
{
return QPDFObjectHandle(new QPDF_String(str));
}
DLL_EXPORT
QPDFObjectHandle
QPDFObjectHandle::newArray(std::vector<QPDFObjectHandle> const& items)
{
return QPDFObjectHandle(new QPDF_Array(items));
}
DLL_EXPORT
QPDFObjectHandle
QPDFObjectHandle::newDictionary(
std::map<std::string, QPDFObjectHandle> const& items)

View File

@ -16,14 +16,12 @@ static bool is_hex_digit(char ch)
return (strchr("0123456789abcdefABCDEF", ch) != 0);
}
DLL_EXPORT
QPDFTokenizer::QPDFTokenizer() :
pound_special_in_name(true)
{
reset();
}
DLL_EXPORT
void
QPDFTokenizer::allowPoundAnywhereInName()
{
@ -46,7 +44,6 @@ QPDFTokenizer::reset()
last_char_was_bs = false;
}
DLL_EXPORT
void
QPDFTokenizer::presentCharacter(char ch)
{
@ -423,7 +420,6 @@ QPDFTokenizer::presentCharacter(char ch)
}
}
DLL_EXPORT
void
QPDFTokenizer::presentEOF()
{
@ -445,7 +441,6 @@ QPDFTokenizer::presentEOF()
}
}
DLL_EXPORT
bool
QPDFTokenizer::getToken(Token& token, bool& unread_char, char& ch)
{
@ -460,7 +455,6 @@ QPDFTokenizer::getToken(Token& token, bool& unread_char, char& ch)
return ready;
}
DLL_EXPORT
bool
QPDFTokenizer::betweenTokens()
{

View File

@ -2,7 +2,6 @@
#include <qpdf/QPDFExc.hh>
#include <qpdf/QUtil.hh>
DLL_EXPORT
QPDFXRefEntry::QPDFXRefEntry() :
type(0),
field1(0),
@ -10,7 +9,6 @@ QPDFXRefEntry::QPDFXRefEntry() :
{
}
DLL_EXPORT
QPDFXRefEntry::QPDFXRefEntry(int type, int field1, int field2) :
type(type),
field1(field1),
@ -22,14 +20,12 @@ QPDFXRefEntry::QPDFXRefEntry(int type, int field1, int field2) :
}
}
DLL_EXPORT
int
QPDFXRefEntry::getType() const
{
return this->type;
}
DLL_EXPORT
int
QPDFXRefEntry::getOffset() const
{
@ -41,7 +37,6 @@ QPDFXRefEntry::getOffset() const
return this->field1;
}
DLL_EXPORT
int
QPDFXRefEntry::getObjStreamNumber() const
{
@ -53,7 +48,6 @@ QPDFXRefEntry::getObjStreamNumber() const
return this->field1;
}
DLL_EXPORT
int
QPDFXRefEntry::getObjStreamIndex() const
{

View File

@ -32,7 +32,6 @@ pad_or_truncate_password(std::string const& password, char k1[key_bytes])
memcpy(k1 + password_bytes, padding_string, pad_bytes);
}
DLL_EXPORT
void
QPDF::trim_user_password(std::string& user_password)
{
@ -98,7 +97,6 @@ iterate_rc4(unsigned char* data, int data_len,
delete [] key;
}
DLL_EXPORT
std::string
QPDF::compute_data_key(std::string const& encryption_key,
int objid, int generation)
@ -122,7 +120,6 @@ QPDF::compute_data_key(std::string const& encryption_key,
std::min(result.length(), (size_t) 16));
}
DLL_EXPORT
std::string
QPDF::compute_encryption_key(
std::string const& password, EncryptionData const& data)
@ -432,7 +429,6 @@ QPDF::decryptStream(Pipeline*& pipeline, int objid, int generation,
heap.push_back(pipeline);
}
DLL_EXPORT
void
QPDF::compute_encryption_O_U(
char const* user_password, char const* owner_password,
@ -445,14 +441,12 @@ QPDF::compute_encryption_O_U(
U = compute_U_value(user_password, data);
}
DLL_EXPORT
std::string const&
QPDF::getPaddedUserPassword() const
{
return this->user_password;
}
DLL_EXPORT
std::string
QPDF::getTrimmedUserPassword() const
{
@ -461,14 +455,12 @@ QPDF::getTrimmedUserPassword() const
return result;
}
DLL_EXPORT
bool
QPDF::isEncrypted() const
{
return this->encrypted;
}
DLL_EXPORT
bool
QPDF::isEncrypted(int& R, int& P)
{
@ -495,7 +487,6 @@ is_bit_set(int P, int bit)
return (P & (1 << (bit - 1)));
}
DLL_EXPORT
bool
QPDF::allowAccessibility()
{
@ -516,7 +507,6 @@ QPDF::allowAccessibility()
return status;
}
DLL_EXPORT
bool
QPDF::allowExtractAll()
{
@ -530,7 +520,6 @@ QPDF::allowExtractAll()
return status;
}
DLL_EXPORT
bool
QPDF::allowPrintLowRes()
{
@ -544,7 +533,6 @@ QPDF::allowPrintLowRes()
return status;
}
DLL_EXPORT
bool
QPDF::allowPrintHighRes()
{
@ -562,7 +550,6 @@ QPDF::allowPrintHighRes()
return status;
}
DLL_EXPORT
bool
QPDF::allowModifyAssembly()
{
@ -583,7 +570,6 @@ QPDF::allowModifyAssembly()
return status;
}
DLL_EXPORT
bool
QPDF::allowModifyForm()
{
@ -604,7 +590,6 @@ QPDF::allowModifyForm()
return status;
}
DLL_EXPORT
bool
QPDF::allowModifyAnnotation()
{
@ -618,7 +603,6 @@ QPDF::allowModifyAnnotation()
return status;
}
DLL_EXPORT
bool
QPDF::allowModifyOther()
{
@ -632,7 +616,6 @@ QPDF::allowModifyOther()
return status;
}
DLL_EXPORT
bool
QPDF::allowModifyAll()
{

View File

@ -53,7 +53,6 @@ load_vector_vector(BitStream& bit_stream,
bit_stream.skipToNextByte();
}
DLL_EXPORT
bool
QPDF::checkLinearization()
{
@ -70,7 +69,6 @@ QPDF::checkLinearization()
return result;
}
DLL_EXPORT
bool
QPDF::isLinearized()
{
@ -982,7 +980,6 @@ QPDF::checkHOutlines(std::list<std::string>& warnings)
}
}
DLL_EXPORT
void
QPDF::showLinearizationData()
{
@ -1747,7 +1744,6 @@ QPDF::pushOutlinesToPart(
}
}
DLL_EXPORT
void
QPDF::getLinearizedParts(
std::map<int, int> const& object_stream_data,
@ -2079,7 +2075,6 @@ QPDF::writeHGeneric(BitWriter& w, HGeneric& t)
w.writeBits(t.group_length, 32); // 4
}
DLL_EXPORT
void
QPDF::generateHintStream(std::map<int, QPDFXRefEntry> const& xref,
std::map<int, size_t> const& lengths,

View File

@ -58,7 +58,6 @@ QPDF::ObjUser::operator<(ObjUser const& rhs) const
return false;
}
DLL_EXPORT
void
QPDF::flattenScalarReferences()
{
@ -143,7 +142,6 @@ QPDF::flattenScalarReferences()
}
}
DLL_EXPORT
void
QPDF::optimize(std::map<int, int> const& object_stream_data,
bool allow_changes)

View File

@ -10,7 +10,6 @@ static bool tc_active(char const* const scope)
return (QUtil::get_env("TC_SCOPE", &value) && (value == scope));
}
DLL_EXPORT
void QTC::TC(char const* const scope, char const* const ccase, int n)
{
static std::set<std::pair<std::string, int> > cache;

View File

@ -14,7 +14,6 @@
#include <unistd.h>
#endif
DLL_EXPORT
std::string
QUtil::int_to_string(int num, int fullpad)
{
@ -42,7 +41,6 @@ QUtil::int_to_string(int num, int fullpad)
return std::string(t);
}
DLL_EXPORT
std::string
QUtil::double_to_string(double num, int decimal_places)
{
@ -78,14 +76,12 @@ QUtil::double_to_string(double num, int decimal_places)
return std::string(t);
}
DLL_EXPORT
void
QUtil::throw_system_error(std::string const& description)
{
throw std::runtime_error(description + ": " + strerror(errno));
}
DLL_EXPORT
int
QUtil::os_wrapper(std::string const& description, int status)
{
@ -96,7 +92,6 @@ QUtil::os_wrapper(std::string const& description, int status)
return status;
}
DLL_EXPORT
FILE*
QUtil::fopen_wrapper(std::string const& description, FILE* f)
{
@ -107,7 +102,6 @@ QUtil::fopen_wrapper(std::string const& description, FILE* f)
return f;
}
DLL_EXPORT
char*
QUtil::copy_string(std::string const& str)
{
@ -118,7 +112,6 @@ QUtil::copy_string(std::string const& str)
return result;
}
DLL_EXPORT
void
QUtil::binary_stdout()
{
@ -127,7 +120,6 @@ QUtil::binary_stdout()
#endif
}
DLL_EXPORT
void
QUtil::binary_stdin()
{
@ -136,7 +128,6 @@ QUtil::binary_stdin()
#endif
}
DLL_EXPORT
char*
QUtil::getWhoami(char* argv0)
{
@ -164,7 +155,6 @@ QUtil::getWhoami(char* argv0)
return whoami;
}
DLL_EXPORT
bool
QUtil::get_env(std::string const& var, std::string* value)
{
@ -202,7 +192,6 @@ QUtil::get_env(std::string const& var, std::string* value)
#endif
}
DLL_EXPORT
time_t
QUtil::get_current_time()
{
@ -229,7 +218,6 @@ QUtil::get_current_time()
#endif
}
DLL_EXPORT
std::string
QUtil::toUTF8(unsigned long uval)
{

View File

@ -33,7 +33,6 @@ _qpdf_data::~_qpdf_data()
delete qpdf;
}
DLL_EXPORT
qpdf_data qpdf_init()
{
QTC::TC("qpdf", "qpdf-c called qpdf_init");
@ -42,7 +41,6 @@ qpdf_data qpdf_init()
return qpdf;
}
DLL_EXPORT
void qpdf_cleanup(qpdf_data* qpdf)
{
QTC::TC("qpdf", "qpdf-c called qpdf_cleanup");
@ -50,14 +48,12 @@ void qpdf_cleanup(qpdf_data* qpdf)
*qpdf = 0;
}
DLL_EXPORT
QPDF_BOOL qpdf_more_errors(qpdf_data qpdf)
{
QTC::TC("qpdf", "qpdf-c called qpdf_more_errors");
return (qpdf->error.empty() ? QPDF_FALSE : QPDF_TRUE);
}
DLL_EXPORT
QPDF_BOOL qpdf_more_warnings(qpdf_data qpdf)
{
QTC::TC("qpdf", "qpdf-c called qpdf_more_warnings");
@ -80,7 +76,6 @@ QPDF_BOOL qpdf_more_warnings(qpdf_data qpdf)
}
}
DLL_EXPORT
char const* qpdf_next_error(qpdf_data qpdf)
{
if (qpdf_more_errors(qpdf))
@ -96,7 +91,6 @@ char const* qpdf_next_error(qpdf_data qpdf)
}
}
DLL_EXPORT
char const* qpdf_next_warning(qpdf_data qpdf)
{
if (qpdf_more_warnings(qpdf))
@ -112,28 +106,24 @@ char const* qpdf_next_warning(qpdf_data qpdf)
}
}
DLL_EXPORT
void qpdf_set_suppress_warnings(qpdf_data qpdf, QPDF_BOOL value)
{
QTC::TC("qpdf", "qpdf-c called qpdf_set_suppress_warnings");
qpdf->qpdf->setSuppressWarnings(value);
}
DLL_EXPORT
void qpdf_set_ignore_xref_streams(qpdf_data qpdf, QPDF_BOOL value)
{
QTC::TC("qpdf", "qpdf-c called qpdf_set_ignore_xref_streams");
qpdf->qpdf->setIgnoreXRefStreams(value);
}
DLL_EXPORT
void qpdf_set_attempt_recovery(qpdf_data qpdf, QPDF_BOOL value)
{
QTC::TC("qpdf", "qpdf-c called qpdf_set_attempt_recovery");
qpdf->qpdf->setAttemptRecovery(value);
}
DLL_EXPORT
QPDF_ERROR_CODE qpdf_read(qpdf_data qpdf, char const* filename,
char const* password)
{
@ -155,7 +145,6 @@ QPDF_ERROR_CODE qpdf_read(qpdf_data qpdf, char const* filename,
return status;
}
DLL_EXPORT
char const* qpdf_get_pdf_version(qpdf_data qpdf)
{
QTC::TC("qpdf", "qpdf-c called qpdf_get_pdf_version");
@ -163,7 +152,6 @@ char const* qpdf_get_pdf_version(qpdf_data qpdf)
return qpdf->tmp_string.c_str();
}
DLL_EXPORT
char const* qpdf_get_user_password(qpdf_data qpdf)
{
QTC::TC("qpdf", "qpdf-c called qpdf_get_user_password");
@ -171,84 +159,72 @@ char const* qpdf_get_user_password(qpdf_data qpdf)
return qpdf->tmp_string.c_str();
}
DLL_EXPORT
QPDF_BOOL qpdf_is_linearized(qpdf_data qpdf)
{
QTC::TC("qpdf", "qpdf-c called qpdf_is_linearized");
return (qpdf->qpdf->isLinearized() ? QPDF_TRUE : QPDF_FALSE);
}
DLL_EXPORT
QPDF_BOOL qpdf_is_encrypted(qpdf_data qpdf)
{
QTC::TC("qpdf", "qpdf-c called qpdf_is_encrypted");
return (qpdf->qpdf->isEncrypted() ? QPDF_TRUE : QPDF_FALSE);
}
DLL_EXPORT
QPDF_BOOL qpdf_allow_accessibility(qpdf_data qpdf)
{
QTC::TC("qpdf", "qpdf-c called qpdf_allow_accessibility");
return qpdf->qpdf->allowAccessibility();
}
DLL_EXPORT
QPDF_BOOL qpdf_allow_extract_all(qpdf_data qpdf)
{
QTC::TC("qpdf", "qpdf-c called qpdf_allow_extract_all");
return qpdf->qpdf->allowExtractAll();
}
DLL_EXPORT
QPDF_BOOL qpdf_allow_print_low_res(qpdf_data qpdf)
{
QTC::TC("qpdf", "qpdf-c called qpdf_allow_print_low_res");
return qpdf->qpdf->allowPrintLowRes();
}
DLL_EXPORT
QPDF_BOOL qpdf_allow_print_high_res(qpdf_data qpdf)
{
QTC::TC("qpdf", "qpdf-c called qpdf_allow_print_high_res");
return qpdf->qpdf->allowPrintHighRes();
}
DLL_EXPORT
QPDF_BOOL qpdf_allow_modify_assembly(qpdf_data qpdf)
{
QTC::TC("qpdf", "qpdf-c called qpdf_allow_modify_assembly");
return qpdf->qpdf->allowModifyAssembly();
}
DLL_EXPORT
QPDF_BOOL qpdf_allow_modify_form(qpdf_data qpdf)
{
QTC::TC("qpdf", "qpdf-c called qpdf_allow_modify_form");
return qpdf->qpdf->allowModifyForm();
}
DLL_EXPORT
QPDF_BOOL qpdf_allow_modify_annotation(qpdf_data qpdf)
{
QTC::TC("qpdf", "qpdf-c called qpdf_allow_modify_annotation");
return qpdf->qpdf->allowModifyAnnotation();
}
DLL_EXPORT
QPDF_BOOL qpdf_allow_modify_other(qpdf_data qpdf)
{
QTC::TC("qpdf", "qpdf-c called qpdf_allow_modify_other");
return qpdf->qpdf->allowModifyOther();
}
DLL_EXPORT
QPDF_BOOL qpdf_allow_modify_all(qpdf_data qpdf)
{
QTC::TC("qpdf", "qpdf-c called qpdf_allow_modify_all");
return qpdf->qpdf->allowModifyAll();
}
DLL_EXPORT
QPDF_ERROR_CODE qpdf_init_write(qpdf_data qpdf, char const* filename)
{
QPDF_ERROR_CODE status = QPDF_SUCCESS;
@ -275,7 +251,6 @@ QPDF_ERROR_CODE qpdf_init_write(qpdf_data qpdf, char const* filename)
return status;
}
DLL_EXPORT
void qpdf_set_object_stream_mode(qpdf_data qpdf, int mode)
{
QTC::TC("qpdf", "qpdf-c called qpdf_set_object_stream_mode");
@ -299,7 +274,6 @@ void qpdf_set_object_stream_mode(qpdf_data qpdf, int mode)
qpdf->qpdf_writer->setObjectStreamMode(omode);
}
DLL_EXPORT
void qpdf_set_stream_data_mode(qpdf_data qpdf, int mode)
{
QTC::TC("qpdf", "qpdf-c called qpdf_set_stream_data_mode");
@ -321,28 +295,24 @@ void qpdf_set_stream_data_mode(qpdf_data qpdf, int mode)
qpdf->qpdf_writer->setStreamDataMode(smode);
}
DLL_EXPORT
void qpdf_set_content_normalization(qpdf_data qpdf, QPDF_BOOL value)
{
QTC::TC("qpdf", "qpdf-c called qpdf_set_content_normalization");
qpdf->qpdf_writer->setContentNormalization(value);
}
DLL_EXPORT
void qpdf_set_qdf_mode(qpdf_data qpdf, QPDF_BOOL value)
{
QTC::TC("qpdf", "qpdf-c called qpdf_set_qdf_mode");
qpdf->qpdf_writer->setQDFMode(value);
}
DLL_EXPORT
void qpdf_set_static_ID(qpdf_data qpdf, QPDF_BOOL value)
{
QTC::TC("qpdf", "qpdf-c called qpdf_set_static_ID");
qpdf->qpdf_writer->setStaticID(value);
}
DLL_EXPORT
void qpdf_set_suppress_original_object_IDs(
qpdf_data qpdf, QPDF_BOOL value)
{
@ -350,14 +320,12 @@ void qpdf_set_suppress_original_object_IDs(
qpdf->qpdf_writer->setSuppressOriginalObjectIDs(value);
}
DLL_EXPORT
void qpdf_set_preserve_encryption(qpdf_data qpdf, QPDF_BOOL value)
{
QTC::TC("qpdf", "qpdf-c called qpdf_set_preserve_encryption");
qpdf->qpdf_writer->setPreserveEncryption(value);
}
DLL_EXPORT
void qpdf_set_r2_encryption_parameters(
qpdf_data qpdf, char const* user_password, char const* owner_password,
QPDF_BOOL allow_print, QPDF_BOOL allow_modify,
@ -369,7 +337,6 @@ void qpdf_set_r2_encryption_parameters(
allow_print, allow_modify, allow_extract, allow_annotate);
}
DLL_EXPORT
void qpdf_set_r3_encryption_parameters(
qpdf_data qpdf, char const* user_password, char const* owner_password,
QPDF_BOOL allow_accessibility, QPDF_BOOL allow_extract,
@ -389,28 +356,24 @@ void qpdf_set_r3_encryption_parameters(
QPDFWriter::r3m_all));
}
DLL_EXPORT
void qpdf_set_linearization(qpdf_data qpdf, QPDF_BOOL value)
{
QTC::TC("qpdf", "qpdf-c called qpdf_set_linearization");
qpdf->qpdf_writer->setLinearization(value);
}
DLL_EXPORT
void qpdf_set_minimum_pdf_version(qpdf_data qpdf, char const* version)
{
QTC::TC("qpdf", "qpdf-c called qpdf_set_minimum_pdf_version");
qpdf->qpdf_writer->setMinimumPDFVersion(version);
}
DLL_EXPORT
void qpdf_force_pdf_version(qpdf_data qpdf, char const* version)
{
QTC::TC("qpdf", "qpdf-c called qpdf_force_pdf_version");
qpdf->qpdf_writer->forcePDFVersion(version);
}
DLL_EXPORT
QPDF_ERROR_CODE qpdf_write(qpdf_data qpdf)
{
QPDF_ERROR_CODE status = QPDF_SUCCESS;

View File

@ -5,16 +5,13 @@
#include <qpdf/DLL.hh>
DLL_EXPORT
class BitStream
{
public:
DLL_EXPORT
BitStream(unsigned char const* p, int nbytes);
DLL_EXPORT
void reset();
DLL_EXPORT
unsigned long getBits(int nbits);
DLL_EXPORT
void skipToNextByte();
private:

View File

@ -7,17 +7,15 @@
class Pipeline;
DLL_EXPORT
class BitWriter
{
public:
// Write bits to the pipeline. It is the caller's responsibility
// to eventually call finish on the pipeline.
DLL_EXPORT
BitWriter(Pipeline* pl);
DLL_EXPORT
void writeBits(unsigned long val, int bits);
// Force any partial byte to be written to the pipeline.
DLL_EXPORT
void flush();
private:

View File

@ -8,54 +8,42 @@
# include <inttypes.h>
#endif
DLL_EXPORT
class MD5
{
public:
typedef unsigned char Digest[16];
DLL_EXPORT
MD5();
DLL_EXPORT
void reset();
// encodes string and finalizes
DLL_EXPORT
void encodeString(char const* input_string);
// encodes file and finalizes
DLL_EXPORT
void encodeFile(char const* filename, int up_to_size = -1);
// appends string to current md5 object
DLL_EXPORT
void appendString(char const* input_string);
// appends arbitrary data to current md5 object
DLL_EXPORT
void encodeDataIncrementally(char const* input_data, int len);
// computes a raw digest
DLL_EXPORT
void digest(Digest);
// prints the digest to stdout terminated with \r\n (primarily for
// testing)
DLL_EXPORT
void print();
// returns the digest as a hexadecimal string
DLL_EXPORT
std::string unparse();
// Convenience functions
DLL_EXPORT
static std::string getDataChecksum(char const* buf, int len);
DLL_EXPORT
static std::string getFileChecksum(char const* filename, int up_to_size = -1);
DLL_EXPORT
static bool checkDataChecksum(char const* const checksum,
char const* buf, int len);
DLL_EXPORT
static bool checkFileChecksum(char const* const checksum,
char const* filename, int up_to_size = -1);

View File

@ -17,6 +17,7 @@
// Note: this class does not encapsulate all features of the PCRE
// package -- only those that I actually need right now are here.
DLL_EXPORT
class PCRE
{
public:
@ -25,7 +26,6 @@ class PCRE
class NoBackref: public std::logic_error
{
public:
DLL_EXPORT
NoBackref();
virtual ~NoBackref() throw() {}
};
@ -34,15 +34,10 @@ class PCRE
{
friend class PCRE;
public:
DLL_EXPORT
Match(int nbackrefs, char const* subject);
DLL_EXPORT
Match(Match const&);
DLL_EXPORT
Match& operator=(Match const&);
DLL_EXPORT
~Match();
DLL_EXPORT
operator bool();
// All the back reference accessing routines may throw the
@ -54,13 +49,9 @@ class PCRE
// and not matching at all.
// see getMatch flags below
DLL_EXPORT
std::string getMatch(int n, int flags = 0);
DLL_EXPORT
void getOffsetLength(int n, int& offset, int& length);
DLL_EXPORT
int getOffset(int n);
DLL_EXPORT
int getLength(int n);
// nMatches returns the number of available matches including
@ -70,7 +61,6 @@ class PCRE
// will return the whole string, getMatch(1) will return the
// text that matched the backreference, and getMatch(2) will
// throw an exception because it is out of range.
DLL_EXPORT
int nMatches() const;
// Flags for getMatch
@ -93,16 +83,12 @@ class PCRE
// The value passed in as options is passed to pcre_exec. See man
// pcreapi for details.
DLL_EXPORT
PCRE(char const* pattern, int options = 0);
DLL_EXPORT
~PCRE();
DLL_EXPORT
Match match(char const* subject, int options = 0, int startoffset = 0,
int size = -1);
DLL_EXPORT
static void test(int n = 0);
private:

View File

@ -3,16 +3,13 @@
#include <qpdf/Pipeline.hh>
DLL_EXPORT
class Pl_ASCII85Decoder: public Pipeline
{
public:
DLL_EXPORT
Pl_ASCII85Decoder(char const* identifier, Pipeline* next);
DLL_EXPORT
virtual ~Pl_ASCII85Decoder();
DLL_EXPORT
virtual void write(unsigned char* buf, int len);
DLL_EXPORT
virtual void finish();
private:

View File

@ -3,16 +3,13 @@
#include <qpdf/Pipeline.hh>
DLL_EXPORT
class Pl_ASCIIHexDecoder: public Pipeline
{
public:
DLL_EXPORT
Pl_ASCIIHexDecoder(char const* identifier, Pipeline* next);
DLL_EXPORT
virtual ~Pl_ASCIIHexDecoder();
DLL_EXPORT
virtual void write(unsigned char* buf, int len);
DLL_EXPORT
virtual void finish();
private:

View File

@ -6,17 +6,14 @@
#include <qpdf/Buffer.hh>
#include <vector>
DLL_EXPORT
class Pl_LZWDecoder: public Pipeline
{
public:
DLL_EXPORT
Pl_LZWDecoder(char const* identifier, Pipeline* next,
bool early_code_change);
DLL_EXPORT
virtual ~Pl_LZWDecoder();
DLL_EXPORT
virtual void write(unsigned char* buf, int len);
DLL_EXPORT
virtual void finish();
private:

View File

@ -12,18 +12,14 @@
#include <qpdf/Pipeline.hh>
#include <qpdf/MD5.hh>
DLL_EXPORT
class Pl_MD5: public Pipeline
{
public:
DLL_EXPORT
Pl_MD5(char const* identifier, Pipeline* next);
DLL_EXPORT
virtual ~Pl_MD5();
DLL_EXPORT
virtual void write(unsigned char*, int);
DLL_EXPORT
virtual void finish();
DLL_EXPORT
std::string getHexDigest();
private:

View File

@ -16,22 +16,19 @@
#include <qpdf/Pipeline.hh>
DLL_EXPORT
class Pl_PNGFilter: public Pipeline
{
public:
// Encoding is not presently supported
enum action_e { a_encode, a_decode };
DLL_EXPORT
Pl_PNGFilter(char const* identifier, Pipeline* next,
action_e action, unsigned int columns,
unsigned int bytes_per_pixel);
DLL_EXPORT
virtual ~Pl_PNGFilter();
DLL_EXPORT
virtual void write(unsigned char* data, int len);
DLL_EXPORT
virtual void finish();
private:

View File

@ -5,22 +5,19 @@
#include <qpdf/RC4.hh>
DLL_EXPORT
class Pl_RC4: public Pipeline
{
public:
static int const def_bufsize = 65536;
// key_len of -1 means treat key_data as a null-terminated string
DLL_EXPORT
Pl_RC4(char const* identifier, Pipeline* next,
unsigned char const* key_data, int key_len = -1,
int out_bufsize = def_bufsize);
DLL_EXPORT
virtual ~Pl_RC4();
DLL_EXPORT
virtual void write(unsigned char* data, int len);
DLL_EXPORT
virtual void finish();
private: