Commit Graph

244 Commits

Author SHA1 Message Date
m-holger f0bc2f11ef Expose QPDFObjectHandle::writeJSON 2024-02-16 14:09:28 +00:00
m-holger e2737ab646 Add new writeJSON methods
Create an alternative to getJSON to allow an object handle to be written as JSON without the overhead of creating a JSON object.
2024-02-16 10:51:25 +00:00
Jay Berkenbilt 9db5d75b2b Update copyright to 2024 2024-01-01 10:56:06 -05:00
m-holger 9c65bb30c0 Fix doc typos 2023-12-17 13:43:53 +00:00
Jay Berkenbilt 8854143c7b Spell check 2023-10-07 17:52:35 -04:00
m-holger 4101596f1a Add QPDFObjectHandle move constructor and assignment operator for future build 2023-06-14 18:39:18 +01:00
m-holger 698a70e6a8 Code tidy - reflow comments and strings 2023-05-27 10:54:19 +01:00
Jay Berkenbilt 60965d5f4d Rerun clang-format 2023-05-21 13:35:09 -04:00
m-holger 05a49cecf1 Add new method QPDF::newReserved 2023-05-20 19:56:01 +01:00
Jay Berkenbilt a85635b839
Merge pull request #929 from m-holger/ogguard
Add new convenience class QPDFObjGen::Guard
2023-05-20 14:09:49 -04:00
m-holger d0682f0f60 Use nullptr instead of 0 or NULL 2023-05-20 15:41:36 +01:00
m-holger 8335b2833b Use QPDFObjGen::set in QPDFObjectHandle 2023-05-19 18:47:58 +01:00
m-holger a171ebb942 Refactor QPDF_Array::disconnect 2023-04-01 13:57:35 +01:00
m-holger 0db65e7912 Remove temporary OHArray::disconnect and setAt 2023-03-29 13:06:26 +01:00
m-holger ad2875a4aa Remove temporary OHArray::size, append and remove_last
Also, add const overload of QPDFObjectHandle::getObj
2023-03-29 12:34:07 +01:00
m-holger 38cf7c1628 Add separate sparse mode to QPDF_Array
Add temporary clone of SparseOHArray  to implement non-sparse mode.
2023-03-29 11:48:21 +01:00
Jay Berkenbilt 26606a37d3 Revert "Add QPDFObjectHandle operator bool"
This reverts commit 56c923d109.

This commit breaks pikepdf.
2023-02-25 16:19:42 -05:00
Jay Berkenbilt c99a1ecd4f Update copyright to 2023 2023-02-25 14:18:13 -05:00
m-holger 1326ff7f79 Inline QPDFObjectHandle::dereference 2023-01-02 14:15:16 -05:00
m-holger 56c923d109 Add QPDFObjectHandle operator bool 2022-12-31 19:16:38 -05:00
m-holger d7b470761b Remove QPDFObjectHandle::Factory and ObjAccessor 2022-12-31 19:16:38 -05:00
m-holger 432f417429 Add new methods QPDFObjectHandle::getObj and getObjectPtr
Also, make QPDFObjectHandle(std::shared_ptr<QPDFObject> const&) public.
2022-12-31 19:16:38 -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 008364a9a4 Remove redundant friend class statements 2022-12-04 14:05:16 -05:00
Jay Berkenbilt ddd889af9d Fix release notes and ChangeLog for 11.2 2022-11-20 15:33:13 -05:00
m-holger 4325e6e4a7 Refactor QPDFObjectHandle::copyObject and rename to makeDirect 2022-11-20 12:07:22 -05:00
m-holger 585ecf17c8 Remove redundant parameter cross_indirect from QPDFObjectHandle::copyObject 2022-11-20 12:07:22 -05:00
m-holger ebc15f4dd0 Remove redundant parameter first_level_only from QPDFObjectHandle::copyObject 2022-11-20 12:07:22 -05:00
m-holger 64059014c9 Refactor QPDFObjectHandle::shallowCopy 2022-11-20 12:07:22 -05:00
m-holger 3e3b79a774 Remove redundant parameter first_level_only from QPDFObjectHandle::shallowCopyInternal2 and copyObject2 2022-11-20 12:07:22 -05:00
m-holger 3efd665703 Remove redundant parameters cross_indirect and stop_atstreams from QPDFObjectHandle::copyObject1 2022-11-20 12:07:22 -05:00
m-holger d7b8525235 Refactor QPDFObjectHandle::unsafeShallowCopy 2022-11-20 12:07:22 -05:00
m-holger 0289b21c3b Remove redundant QPDFObjectHandle::copyObject2
copyObject2 repeats a second time what
new_obj = QPDFObjectHandle(obj->copy(true))
in shallowCopyInternal2 already did.
2022-11-20 12:07:22 -05:00
m-holger 15e8d3a763 Remove redundant parameter first_level_only from QPDFObjectHandle::shallowCopyInternal2 and copyObject2 2022-11-20 12:07:22 -05:00
m-holger 0827b1096e Remove redundant parameters cross_indirect and stop_atstreams from QPDFObjectHandle::copyObject2 2022-11-20 12:07:22 -05:00
m-holger 63d1dcb414 Split QPDFObjectHandle::shallowCopyInternal and copyObject
Have separate versions for unsafeShallowCopy, shallowCopy and makeDirect.
2022-11-20 12:07:22 -05:00
m-holger bf347dfb73 Remove QPDFObjectHandle::Factory::newStream 2022-11-19 14:10:42 -05:00
m-holger c63fb86c01 Inline call to QPDFObjectHandle::parse in QPDF::readObject 2022-10-01 11:17:39 -04:00
Jay Berkenbilt 9a9a7ab097 Comment about qpdf/PointerHolder.hh in public headers 2022-09-23 15:15:39 -04:00
Jay Berkenbilt 772c92227c Revert "Add default move constructor/assignment to QPDFObjectHandle"
This reverts commit 416d9668ee.

This commit causes numerous failures in the pikepdf test suite and
also causes a symbol to disappear from the public API. More
investigation will be required.
2022-09-14 15:44:17 -04:00
m-holger 416d9668ee Add default move constructor/assignment to QPDFObjectHandle 2022-09-12 13:18:56 -04:00
Jay Berkenbilt 8a3cdfd2af Change QPDFObjectHandle == to isSameObjectAs
Replace operator== and operator!=, which were testing for the same
underlying object, with isSameObjectAs. This change was motivated by
the fact that pikepdf internally had its own operator== method for
QPDFObjectHandle that did structural comparison. I backed out qpdf's
operator== as a courtesy to pikepdf (in my own testing) but also
because I think people might naturally assume that operator== does a
structural comparison, and isSameObjectAs is clearer in its intent.
2022-09-09 18:09:40 -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 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 0132261ee0 Revert getOwningQPDF, and add getQPDF that returns a reference 2022-09-07 17:26:39 -04:00
Jay Berkenbilt c1def4ead4 Implement QPDFObjectHandle equality 2022-09-06 18:34:23 -04:00
Jay Berkenbilt 259eec3a94 Clarify comments for QPDFObjectHandle::getOwningQPDF 2022-09-06 10:09:28 -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