James R. Barlow
12967bdf8a
Take advantage of unique_ptr and move construction for Buffer
...
Since Buffer has always implemented its copy constructor with a deep
copy, its Members object will never have multiple owners. Change to unique_ptr.
Also implement move constructors for Buffer, since there may be cases
where a deep copy is not needed.
2022-09-05 13:29:56 -07: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
6d2db68f2e
Update comments in Constants.h
2022-09-02 14:43:29 -04:00
Jay Berkenbilt
a59e7ac7ec
Disable copying/assigning to QPDF objects, add QPDF::create()
2022-09-02 08:53:27 -04:00
Jay Berkenbilt
da0b0e405d
Fix outdated comment
2022-09-02 08:30:11 -04:00
Jay Berkenbilt
1d57772b76
Remove QPDFObject and QPDFValue from public include directory
2022-09-01 18:19:47 -04:00
Jay Berkenbilt
f772c43de8
Stop including QPDFObject.hh from other than private files
...
This required moving some newly inlined functions back to the cc file,
but that seems to have had no measurable performance impact.
2022-09-01 18:19:47 -04:00
Jay Berkenbilt
b663926538
Remove QPDFObject::object_type_e as alias for qpdf_object_type_e
2022-09-01 18:11:22 -04:00
Jay Berkenbilt
ceeb25f3c8
Rename --report-mem-usage to --report-memory-usage
...
Avd xcsv brvtns.
2022-09-01 17:15:41 -04:00
Jay Berkenbilt
3d029fb17e
Merge pull request #730 from m-holger/allpages
...
Tidy QPDF::getAllPagesInternal and QPDF::pushInheritedAttributesToPageInternal
2022-09-01 15:28:32 -04:00
m-holger
2b7e9ba2f5
Remove methods and parameters obsoleted by the last two commits
2022-09-01 17:20:02 +01:00
m-holger
1bb40238e0
Add method QPDFObject::getObjGen and remove QPDFObjectHandle::og
2022-09-01 17:19:40 +01:00
m-holger
5033e3b215
Add method QPDFObject::getQPDF and remove QPDFObjectHandle::qpdf
2022-09-01 17:19:31 +01:00
m-holger
4a8515912c
Add method QPDFObject::resolve
2022-09-01 17:19:06 +01:00
m-holger
56e9bcabe9
Add methods QPDFObject::setObjGen and QPDFObject::resetObjGen
...
Also, modify QPDFObject::swapWith to update the ObjGens of the swapped
objects.
Modify QPDF::newIndirect and QPDF::updateCache to keep object ObjGens
up to date.
2022-09-01 17:09:48 +01: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
ae6e484e23
Change return type of QPDF::resolve to void
2022-09-01 17:08:45 +01:00
m-holger
356b582cec
Remove QPDFObjectHandle::newIndirect
...
Modify QPDFParser::parse to call QPDF::getObject instead.
2022-09-01 16:59:01 +01:00
m-holger
556c34f0f2
Add private method QPDF::ObjCache::update
...
Add a new obj_cache entry or update an existing entry in place.
2022-09-01 14:30:26 +01:00
m-holger
c0cd72a3ee
Add private methods QPDF::isCached and QPDF::isUnresolved
2022-09-01 14:29:53 +01:00
m-holger
23d50a2f14
Remove QPDFObjectHandle::initialized
2022-09-01 14:29:38 +01:00
m-holger
c7005e8a6d
Remove virtual methods QPDFValue::getTypeCode and getTypeName
2022-09-01 14:29:02 +01:00
m-holger
27fae2b55e
Remove QPDF::ObjectChanged
...
Also change QPDF::replaceObject and QPDF::swapObjects such that the
QPDFObject assigned to an og in the obj_cache is never replaced; only
QPDFObject::value is updated.
2022-09-01 14:27:46 +01:00
m-holger
431bd666c0
Split QPDFObject into QPDFObject and QPDFValue
2022-09-01 14:19:34 +01:00
m-holger
114bffa089
Add private methods QPDFObjectHandle::asArray etc
...
Centralise casting of QPDFObjects and reduce repeated dereferencing.
2022-09-01 00:10:04 +01:00
m-holger
2a2eebcaea
Modify newIndirect to set QPDFObjectHandle::obj
2022-08-31 22:47:11 +01:00
m-holger
16841bec32
Remove QPDFObjectHandle::makeReserved
2022-08-31 22:46:55 +01:00
m-holger
07b66eb0b6
Remove QPDFObjectHandle::reserved
2022-08-31 22:46:25 +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
9532dca3a5
Inline QPDFObjectHandle::setParsedOffset
...
Part of #729
2022-08-30 14:55:45 +01:00
m-holger
6fc982b71a
Move QPDFObjectHandle::setObjectDescriptionFromInput to QPDFParser
...
Part of #729
2022-08-30 06:42:46 +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
0adfd74f8b
Merge pull request #747 from m-holger/new_stream
...
Add optional parameter allow_nullptr to QPDFObjectHandle::getOwningQPDF
2022-08-29 16:33:19 -04:00
m-holger
c53d54b13d
Add optional parameter allow_nullptr to QPDFObjectHandle::getOwningQPDF
...
Also, inline method and add optional parameter error_msg.
2022-08-28 22:15:59 +01:00
m-holger
fc4feb6f1a
Remove BufferInputSource::Members
2022-08-27 12:19:51 +01:00
m-holger
d6a447b654
Remove ClosedFileInputSource::Members
2022-08-27 12:13:39 +01:00
m-holger
69a5fb7047
Add methods InputSource::fastRead, fastUnRead and fastTell
...
Provide buffered input for QPDFTokenizer.
2022-08-26 23:55:56 +01:00
m-holger
dc5c8b82eb
Remove FileInputSource::Members
2022-08-25 12:42:14 +01:00
m-holger
b45420a980
Remove QPDFTokenizer::unread_char
2022-08-25 11:30:49 +01:00
m-holger
706106dabb
Refactor QPDFTokenizer::betweenTokens()
2022-08-25 11:30:35 +01:00
m-holger
42ed58e446
Integrate booleans and null into state machine in QPDFTokenizer
2022-08-25 11:30:13 +01:00
m-holger
fe33b7ca18
Integrate numbers into state machine in QPDFTokenizer
2022-08-25 11:26:46 +01:00
m-holger
931fbb6156
Integrate names into state machine in QPDFTokenizer
2022-08-25 11:26:38 +01:00
m-holger
a3f3238f37
Split QPDFTokenizer::handleCharacter into individual methods
2022-08-25 11:26:05 +01:00
m-holger
6111a6a424
Refactor QPDFTokenizer::inCharCode
2022-08-25 10:55:45 +01:00
m-holger
e4fe0d5cf5
Refactor QPDFTokenizer::inHexstring
2022-08-25 10:50:06 +01:00
m-holger
7c32f6cc2e
Add state st_string_escape in QPDFTokenizer
2022-08-25 10:41:36 +01:00