aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_Stream.cc
AgeCommit message (Collapse)Author
2022-09-21Replace calls to QUtil::int_to_string with std::to_stringm-holger
2022-09-08Rename QPDFValueProxy back to QPDFObjectJay Berkenbilt
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-08Change reset to disconnect and clarify commentsJay Berkenbilt
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-08Clear owning QPDF information for all objects, not just indirectJay Berkenbilt
2022-09-06Rename QPDFObject -> QPDFValueProxyJay Berkenbilt
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-04Fix commit 805c1ad : Reset QPDFValue::qpdf and QPDFValue::og when ...m-holger
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-01Remove virtual methods QPDFValue::getTypeCode and getTypeNamem-holger
2022-09-01Split QPDFObject into QPDFObject and QPDFValuem-holger
2022-07-26Code tidy : replace 0 with nullptr or truem-holger
2022-07-24Overload StreamDataProvider::provideStreamDatam-holger
Use 'QPDFObjGen const&' instead of 'int, int' in signature.
2022-07-24QPDFObjGen : tidy QPDF_Streamm-holger
Change method signatures to use QPDFObjGen. Replace QPDF_Stream::objid and generation with QPDF_Stream::og.
2022-07-24QPDFObjGen : tidy QPDF private methodsm-holger
Change method signatures to use QPDFObjGen. Use QPDFObjGen methods where possible. Remove redundant QPDF::objGenToIndirect.
2022-07-24Add optional parameter separator to QPDFObjGen::unparsem-holger
Also, revert inlining of unparse and operator << from commit 4c6640c in order to avoid exposing QUtil.
2022-06-27Run format-codeJay Berkenbilt
2022-06-27Refactor QPDFObject creation and cloningm-holger
Move responsibility for creating shared pointers to objects and cloning from QPDFObjectHandle to QPDFObject.
2022-06-25Remove QPDF_Stream::setStreamDescriptionm-holger
2022-05-20Bug fix: don't clobber stream length with replaceDictJay Berkenbilt
2022-05-20replaceStreamData: accept uninitialized filter/decode_parmsJay Berkenbilt
These mean to leave the original values alone. This is needed for reconstructing streams from JSON given that the stream data and stream dictionary may appear in any order in the JSON.
2022-05-20Back out fluent QPDFObjectHandle methods. Keep the andGet methods.Jay Berkenbilt
I decided these were confusing and inconsistent with how JSON works. They muddle the API rather than improving it.
2022-05-08Implement JSON v2 outputJay Berkenbilt
2022-05-08Implement JSON v2 for StreamJay Berkenbilt
Not fully exercised in this commit
2022-05-07Prepare code for JSON v2Jay Berkenbilt
Update getJSON() methods and calls to them
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-24Deprecate replaceOrRemoveKey -- it's the same as replaceKeyJay Berkenbilt
2022-04-24Have dictionary/streams mutators take const& where possibleJay 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-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-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-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-11-03Detect recoverable but invalid zlib data streams (fixes #562)Jay Berkenbilt
2021-02-14Add functional versions of QPDFObjectHandle::replaceStreamDataJay Berkenbilt
Also fix a bug in checking consistency of length for stream data providers. Length should not be checked or recorded if the provider says it failed to generate the data.
2021-01-17Add warn() to QPDF's public APIJay Berkenbilt
2020-12-28Add QPDFObjectHandle::setFilterOnWriteJay 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-04-16Fix warnings reported by -Wshadow=local (fixes #431)Jay Berkenbilt
2020-04-09Bug fix: getStreamData should on unfilterable stream (fixes #425)Jay Berkenbilt
2020-04-06Allow propagation of errors and retry through StreamDataProviderJay Berkenbilt
StreamDataProvider::provideStreamData now has a rich enough API for it to effectively proxy to pipeStreamData.
2019-08-28Detect stream in object stream, fixing fuzz 16214Jay Berkenbilt
It's detected in QPDFWriter instead of at parse time because I can't figure out how to construct a test case in a reasonable time. This commit moves the fuzz file into the regular test suite for a QTC coverage case.
2019-06-21Fix sign and conversion warnings (major)Jay Berkenbilt
This makes all integer type conversions that have potential data loss explicit with calls that do range checks and raise an exception. After this commit, qpdf builds with no warnings when -Wsign-conversion -Wconversion is used with gcc or clang or when -W3 -Wd4800 is used with MSVC. This significantly reduces the likelihood of potential crashes from bogus integer values. There are some parts of the code that take int when they should take size_t or an offset. Such places would make qpdf not support files with more than 2^31 of something that usually wouldn't be so large. In the event that such a file shows up and is valid, at least qpdf would raise an error in the right spot so the issue could be legitimately addressed rather than failing in some weird way because of a silent overflow condition.
2019-06-21Change QPDFObjectHandle::pipeStreamData's encode_flags typeJay Berkenbilt
Change from unsigned long to int since we pass enumerated type values to this field.
2019-06-09Handle empty DecodeParams array for (fixes #331)Jay Berkenbilt
On read, ignore /DecodeParms when empty list; on write, delete it. Some files have been found that include an empty list for /DecodeParms, but this is not technically compliant with the spec, and the only sensible interpretation is to treat it as if there are no decode parameters.
2019-01-07Mostly don't require original QPDF for copyForeignObject (fixes #219)Jay Berkenbilt
The original QPDF is only required now when the source QPDFObjectHandle is a stream that gets its stream data from a QPDFObjectHandle::StreamDataProvider.
2018-12-22Add QPDFObjectHandle::getJSON()Jay Berkenbilt