aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF.cc
AgeCommit message (Collapse)Author
2022-05-04Make use of the new Pipeline methods in some placesJay Berkenbilt
2022-04-30Code clean up: use range-style for loops wherever possibleJay Berkenbilt
Where not possible, use "auto" to get the iterator type. Editorial note: I have avoid this change for a long time because of not wanting to make gratuitous changes to version history, which can obscure when certain changes were made, but with having recently touched every single file to apply automatic code formatting and with making several broad changes to the API, I decided it was time to take the plunge and get rid of the older (pre-C++11) verbose iterator syntax. The new code is just easier to read and understand, and in many cases, it will be more effecient as fewer temporary copies are being made. m-holger, if you're reading, you can see that I've finally come around. :-)
2022-04-30Formatting: remove space in range-style for loopsJay Berkenbilt
Change .clang-format and commit automated changes from a fresh run of format-code
2022-04-30Use fluent replaceKeyJay Berkenbilt
2022-04-24Add new QPDF::warn that takes most of QPDFExc's argumentsJay Berkenbilt
2022-04-16Use anonymous namespaces for file-private classesJay Berkenbilt
2022-04-16Use = default and = delete where possible in classesJay Berkenbilt
2022-04-09Replace PointerHolder with std::shared_ptr in library sources onlyJay Berkenbilt
(patrepl and cleanpatch are my own utilities) patrepl s/PointerHolder/std::shared_ptr/g {include,libqpdf}/qpdf/*.hh patrepl s/PointerHolder/std::shared_ptr/g libqpdf/*.cc patrepl s/make_pointer_holder/std::make_shared/g libqpdf/*.cc patrepl s/make_array_pointer_holder/QUtil::make_shared_array/g libqpdf/*.cc patrepl s,qpdf/std::shared_ptr,qpdf/PointerHolder, **/*.cc **/*.hh git restore include/qpdf/PointerHolder.hh cleanpatch ./format-code
2022-04-05Update some code manually to get better formatting resultsJay Berkenbilt
Add comments to force line breaks, parenthesize function arguments that are contatenated strings, etc. -- these kinds of changes improve clang-format's results and also cause emacs cc-mode to match clang-format. After this type of change, most of the time, when clang-format and emacs disagree, clang-format is better.
2022-04-04Programmatically apply new formatting to codeJay Berkenbilt
Run this: for i in **/*.cc **/*.c **/*.h **/*.hh; do clang-format < $i >| $i.new && mv $i.new $i done
2022-02-08Add QPDF::getVersionAsPDFVersionJay Berkenbilt
2022-02-08WHITESPACE ONLY -- expand tabs in source codeJay Berkenbilt
This comment expands all tabs using an 8-character tab-width. You should ignore this commit when using git blame or use git blame -w. In the early days, I used to use tabs where possible for indentation, since emacs did this automatically. In recent years, I have switched to only using spaces, which means qpdf source code has been a mixture of spaces and tabs. I have avoided cleaning this up because of not wanting gratuitous whitespaces change to cloud the output of git blame, but I changed my mind after discussing with users who view qpdf source code in editors/IDEs that have other tab widths by default and in light of the fact that I am planning to start applying automatic code formatting soon.
2022-02-07Update for clean compile with POINTERHOLDER_TRANSITION=2Jay Berkenbilt
2022-02-05API contract: qpdf_get_qpdf_version() returns a staticJay Berkenbilt
2022-02-04Add a blank line after the first header included in each sourceJay Berkenbilt
2022-02-04Add qpdf version macros to qpdf/DLL.hJay Berkenbilt
2022-02-04Replace containers of PointerHolder with containers of std::shared_ptrJay Berkenbilt
None of these are in the public API.
2022-02-04PointerHolder: deprecate getPointer() and getRefcount()Jay Berkenbilt
Use get() and use_count() instead. Add #define NO_POINTERHOLDER_DEPRECATION to remove deprecation markers for these only. This commit also removes all deprecated PointerHolder API calls from qpdf's code except in PointerHolder's test suite, which must continue to test the deprecated APIs.
2022-01-27Remove some if statements and simplify some boolean expressionsm-holger
Use QPDFObjectHandle::isNameAndEquals, isDictionaryOfType and isStreamOfType.
2021-12-20Prepare 10.5.0 releaseJay Berkenbilt
2021-11-29Improve testing and error handling around operating before processingJay Berkenbilt
2021-11-29Initialize QPDF::Members::file (fixes #584)Jay Berkenbilt
2021-11-16Prepare 10.4.0 releaserelease-qpdf-10.4.0Jay Berkenbilt
2021-11-07Make recovery logic flexible about where objects end (fixes #573)Jay Berkenbilt
Don't assume endobj is at the beginning of the line. This means we are looking at tokens for every line, but the odds of n n obj appearing in the middle of the object are likely much lower than endobj not being at the beginning of the line or missing entirely. This will probably have a negative impact on recovery time for very large files. Hopefully it will be worth it.
2021-05-08Prepare 10.3.2 releaserelease-qpdf-10.3.2Jay Berkenbilt
2021-03-11Prepare 10.3.1 releaserelease-qpdf-10.3.1Jay Berkenbilt
2021-03-05Prepare 10.3.0 releaserelease-qpdf-10.3.0Jay Berkenbilt
2021-03-03Add QPDF::numWarningsJay Berkenbilt
2021-02-25Have QPDFObjectHandle notice when replaceObject was calledJay Berkenbilt
This results in a performance penalty of 1% to 2% when replaceObject and swapObjects are never called and a somewhat larger penalty if they are called, but it's worth it to avoid very confusing behavior as discussed in depth in qpdf#507.
2021-02-23Prepare 10.2.0 releaserelease-qpdf-10.2.0Jay Berkenbilt
2021-02-21QPDFObjectHandle::copyStreamJay Berkenbilt
2021-02-21Refactor: separate copyStreamData from replaceForeignIndirectObjectsJay Berkenbilt
2021-02-06Remove erroneous handling of /EFF for stream decryptionJay Berkenbilt
I thought /EFF was supposed to be used as a default for decrypting embedded file streams, but actually it's supposed to be advice to a conforming writer about handling new ones. This makes sense since the findAttachmentStreams code, which is not actually needed, was never right.
2021-02-06Make wrong object stream type a warningJay Berkenbilt
2021-01-26NNTree: rework iterators to be more memory efficientJay Berkenbilt
Keep a std::pair internal to the iterators so that operator* can return a reference and operator-> can work, and each can work without copying pairs of objects around.
2021-01-24Use new QPDF{Name,Number}TreeObjectHelper APIJay Berkenbilt
2021-01-24Use QPDFNameTreeObjectHelper's iterator directlyJay Berkenbilt
2021-01-11Treat /EmbeddedFiles as a proper name treeJay Berkenbilt
If we ever had an encrypted file with different filters for attachments and either the /EmbeddedFiles name tree was deep or some of the file specs didn't have /Type, we would have overlooked those as attachment streams. The code now properly handles /EmbeddedFiles as a name tree.
2021-01-06Warn rather than segv on access after closing input source (fixes #495)Jay Berkenbilt
2021-01-04Prepare version 10.1.0release-qpdf-10.1.0Jay Berkenbilt
2020-12-28Implement user-provided stream filtersJay Berkenbilt
Refactor QPDF_Stream to use stream filter classes to handle supported stream filters as well.
2020-11-21Prepare 10.0.4 releaserelease-qpdf-10.0.4Jay Berkenbilt
2020-11-04Ignore unused field in xref entry, avoiding range error (fixes #482)Jay Berkenbilt
2020-10-31Prepare 10.0.3 releaserelease-qpdf-10.0.3Jay Berkenbilt
2020-10-31Add comments explaining the foreign object copying codeJay Berkenbilt
These are the comments I would have liked to have been able to read while fixing #449 and #478.
2020-10-31Fix foreign stream copying bug (fixes #478)Jay Berkenbilt
This reverts an incorrect fix to #449 and codes it properly. The real problem was that we were looking at the local dictionaries rather than the foreign dictionaries when saving the foreign stream data. In the case of direct objects, these happened to be the same, but in the case of indirect objects, the object references could be pointing anywhere since object numbers don't match up between the old and new files.
2020-10-27Prepare 10.0.2 releaserelease-qpdf-10.0.2Jay Berkenbilt
2020-10-27Revert removal of unreadCh change for performanceJay Berkenbilt
Turns out unreadCh is much more efficient than seek(-1, SEEK_CUR). Update comments and code to reflect this.
2020-10-22Avoid leak by resolving object streams more than once (fuzz issue 23642)Jay Berkenbilt
2020-10-22Minor code cleanupJay Berkenbilt
* Return rather than exiting from realmain in qpdf.cc * Remove extraneous blank line * Don't assign temporary to const reference