2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-09-21 01:29:06 +00:00
Commit Graph

265 Commits

Author SHA1 Message Date
m-holger
d67a54ae93 Tune parsing of dictionaries in QPDFParser::parse
Use move semantics for dictionary creation.
2022-12-31 14:37:35 -05:00
m-holger
846504129f Remove redundant parameter qpdf from QPDFParser::warn 2022-12-31 14:37:35 -05:00
m-holger
b19e06fd8b Change QPDFParser::setDescription to take a shared_ptr<QPDFObject> parameter 2022-12-31 14:37:35 -05:00
m-holger
8391022416 Avoid inserting direct null objects into olist 2022-12-31 14:37:35 -05:00
m-holger
9da50ca360 Change olist variable in QPDFParser::parse to vector<shared_ptr<QPDFObject>> 2022-12-31 14:37:35 -05:00
m-holger
ec35156ab0 Refactor QPDFValue::getDescription
Remove parameters and return the description.
2022-12-31 10:23:59 -05:00
m-holger
0ef2def8ad Delay adding offsets to object descriptions until necessary 2022-12-31 10:23:59 -05:00
m-holger
c833c25499 Delay adding ObjGen to object descriptions until necessary 2022-12-31 10:23:59 -05:00
m-holger
e684d8169b Make QPDFValue::object_description a shared pointer 2022-12-31 10:23:59 -05:00
m-holger
218f069a69 Add new method QPDFObject::setDefaultDescription 2022-12-31 10:23:59 -05:00
m-holger
d03ca88275 Refactor QPDFParser::setDescriptionFromInput and rename to setDescription
Set parsed offset at the same time as setting description.
2022-12-31 10:23:59 -05:00
m-holger
6cbc55a5b5 Add new virtual method QPDFObject::getStringValue
Avoid dynamic casting.
2022-12-31 09:31:07 -05:00
m-holger
b1eb1a9584 Refactor QPDFObjectHandle::copyObject1 2022-11-20 12:07:22 -05:00
m-holger
dbc5f07b90 Rename QPDFObject::shallowCopy to copy
Add optional parameter shallow. Change logic errors to runtime errors.
2022-11-20 12:07:22 -05:00
m-holger
d79a823d66 Remove QPDF_Stream::getOffset and QPDF_Stream::setObjGen 2022-11-19 14:10:42 -05:00
m-holger
6350cf16e6 Remove QPDF_Stream::offset 2022-11-19 14:10:42 -05:00
m-holger
3a86b893f7 Remove redundant parameters from QPDF_Stream::warn 2022-11-19 14:10:42 -05:00
m-holger
69e67b45bb Remove QPDF_Stream qpdf and og data members 2022-11-19 14:10:42 -05:00
Jay Berkenbilt
2bc9121fa1 Fix major performance bug with openssl crypto (fixes #798)
Lazily load MD5 and RC4 once in the life of the program. Only load the
legacy provider if RC4 is actually being used.
2022-10-08 17:04:59 -04:00
m-holger
2e6869483b Replace calls to QUtil::int_to_string with std::to_string 2022-09-21 15:57:14 -04:00
Jay Berkenbilt
4963ce6a53 Remove obsolete LL_FMT check from build (fixes #768)
This was broken for cross-compilation and has probably been
unnecessary for several years now.

Also fix extraneous whitespace in related some tests.
2022-09-12 11:48:38 -04:00
Jay Berkenbilt
3dbab589e3 Add C API functions for using custom loggers
Expose functions to the C API to create new loggers and to setLogger
and getLogger for QPDF and QPDFJob.
2022-09-09 10:49:25 -04:00
Jay Berkenbilt
18a583e8d9 Rename QPDFValueProxy back to QPDFObject
QPDFValueProxy wasn't a good name for it. We decided the evil of
having the header file be named QPDFObject_private.hh was less than
the evil of having the class be named something other than what it
should have been named.
2022-09-08 11:29:23 -04:00
Jay Berkenbilt
25ccc7eae4 Rename QPDFValueProxy.hh and QPDFValueProxy.cc
Preparing to change the class name back to QPDFObject
2022-09-08 11:19:49 -04:00
Jay Berkenbilt
c7a4967d10 Change reset to disconnect and clarify comments
I decided that it's actually fine to copy a direct object to another
QPDF. Even if we eventually prevent a QPDFObject from having multiple
parents, this could happen if an object is moved.
2022-09-08 11:06:15 -04:00
Jay Berkenbilt
dba61da1bf Create a special "destroyed" type rather than using null
When a QPDF is destroyed, changing indirect objects to direct nulls
makes them effectively disappear silently when they sneak into other
places. Instead, we should treat this as an error. Adding a destroyed
object type makes this possible.
2022-09-08 10:36:39 -04:00
Jay Berkenbilt
264e25f391 Clear owning QPDF information for all objects, not just indirect 2022-09-08 10:19:38 -04:00
Jay Berkenbilt
4422588d7d Remove unneeded owning_qpdf from QPDFValue
The qpdf member was already sufficient. Removing this actually fixed a
few pre-existing issues around detecting foreign ownership and
allowing certain conditions to be warnings rather than exceptions.
2022-09-08 10:19:38 -04:00
Jay Berkenbilt
6c61be00e8 Rename QPDFObject -> QPDFValueProxy
This is in preparation for restoring a QPDFObject.hh to ease the
transition on qpdf_object_type_e.

This commit was created by
* Renaming QPDFObject.cc and QPDFObject.hh
* Replacing QPDFObject\b with QPDFValueProxy (where \b is word
  boundary)
* Running format-code
* Manually resorting files in libqpdf/CMakeLists.txt
* Manually refilling the comment in QPDF.hh near class Resolver
2022-09-05 18:52:59 -04:00
m-holger
9c86ba40d8 Fix commit 805c1ad : Reset QPDFValue::qpdf and QPDFValue::og when ...
On destruction of the QPDF object replace all indirect object references
with direct nulls.

Remove all existing code to release resolved references.

Fixes performance issue due to interaction of resetting QPDFValue::qpdf and
og members and prior code.
2022-09-04 10:41:18 +01:00
Jay Berkenbilt
2a1ae0b44c Remove remaining virtual functions from QPDFObject
This doesn't need an explicit destructor anymore.
2022-09-01 18:19:48 -04:00
Jay Berkenbilt
6d62662e2d Make QPDFObject::releaseResolved public
Now that QPDFObject.hh is out of the public API, we don't really need
QPDFObjAccessor. Also, the function didn't have to be virtual anymore.
2022-09-01 18:19:47 -04:00
Jay Berkenbilt
c510c01568 Remove copyright banner from newly private header files
We don't put specific copyright banners on files that aren't installed.
2022-09-01 18:19:47 -04:00
Jay Berkenbilt
1d57772b76 Remove QPDFObject and QPDFValue from public include directory 2022-09-01 18:19:47 -04:00
Jay Berkenbilt
ceeb25f3c8 Rename --report-mem-usage to --report-memory-usage
Avd xcsv brvtns.
2022-09-01 17:15:41 -04:00
m-holger
89061d5b33 Change QPDF_Unresolved::create method to take QPDF* and QPDFObjGen parameters 2022-09-01 17:09:07 +01:00
m-holger
c7005e8a6d Remove virtual methods QPDFValue::getTypeCode and getTypeName 2022-09-01 14:29:02 +01:00
m-holger
431bd666c0 Split QPDFObject into QPDFObject and QPDFValue 2022-09-01 14:19:34 +01:00
m-holger
7248cab71b Add class QPDF_Unresolved
Allow QPDFObjectHandle::obj to be set prior resolving object.

ot_unresolved has been appended to the list object types in order to
preserve the output of existing test cases.
2022-08-31 22:46:09 +01:00
Jay Berkenbilt
a078202c1b
Merge pull request #752 from jberkenbilt/report-mem-usage
Report mem usage
2022-08-31 15:50:17 -04:00
Jay Berkenbilt
433f1dae19 Add --report-mem-usage option for debugging/testing 2022-08-31 14:47:27 -04:00
Jay Berkenbilt
0a54247652 Add QUtil::get_max_memory_usage for testing 2022-08-31 14:47:27 -04:00
m-holger
6fc982b71a Move QPDFObjectHandle::setObjectDescriptionFromInput to QPDFParser
Part of #729
2022-08-30 06:42:46 +01:00
m-holger
8ad1ea34fe Add private methods QPDFParser::warn
Part of #729
2022-08-30 06:04:34 +01:00
m-holger
6670c685ab Move QPDFObjectHandle::parseInternal to new class QPDFParser
Part of #729
2022-08-30 05:56:23 +01:00
Jay Berkenbilt
5d63730b93 Clean up documentation 2022-07-31 16:26:02 -04:00
Jay Berkenbilt
5f4224f31a Simplify --json-output
Now --json-output just changes defaults. Allow output file with --json.
2022-07-31 16:23:17 -04:00
Jay Berkenbilt
80acfc3826 Fix --json-help to take a version parameter 2022-07-31 16:23:17 -04:00
Jay Berkenbilt
69820847af Change the output of --json to use "qpdf" instead of "objects" 2022-07-31 15:17:01 -04:00
Jay Berkenbilt
bb96499b61 Update docs and prepare QPDF::writeJSON for changes
Add additional parameters that will be needed to call QPDF::writeJSON
in partial mode.
2022-07-31 10:32:55 -04:00