aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/FileInputSource.cc
AgeCommit message (Collapse)Author
2023-06-02Code tidy - reflow comments and stringsm-holger
2023-05-21Rerun clang-formatJay Berkenbilt
2023-05-20Replace deprecated C++ includesm-holger
2022-09-21Replace calls to QUtil::int_to_string with std::to_stringm-holger
2022-08-25Avoid virtual method call in FileInputSource::readm-holger
2022-08-25Refactor FileInputSource::seek and FileInputSource::unreadChm-holger
Avoid building error message each call "just in case".
2022-08-25Remove FileInputSource::Membersm-holger
2022-07-26Code tidy : replace 0 with nullptr or truem-holger
2022-05-04Add new FileInputSource constructorsJay 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-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-04Add a blank line after the first header included in each sourceJay 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-18Stop using InputSource::unreadChJay Berkenbilt
2019-06-22Convert remaining public classes to use Members patternJay Berkenbilt
Have classes contain only a single private member of type PointerHolder<Members>. This makes it safe to change the structure of the Members class without breaking binary compatibility. Many of the classes already follow this pattern quite successfully. This brings in the rest of the class that are part of the public API.
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.
2018-02-19Lexer enhancements: EOF, comment, spaceJay Berkenbilt
Significant enhancements to the lexer to improve EOF handling and to support comments and spaces as tokens. Various other minor issues were fixed as well.
2013-11-29Include <algorithm> for std::min, std::maxJay Berkenbilt
2013-03-05Call QUtil::safe_fopen in place of fopenJay Berkenbilt
fopen was previuosly called wrapped by QUtil::fopen_wrapper, but QUtil::safe_fopen does this itself, which is less cumbersome.
2013-03-05Mark secure CRT warnings with commentJay Berkenbilt
Put a specific comment marker next to every piece of code that MSVC gives warning 4996 for. This warning is generated for calls to functions that Microsoft considers insecure or deprecated. This change is in preparation for fixing all these cases even though none of them are actually incorrect or insecure as used in qpdf. The comment marker makes them easier to find so they can be fixed in subsequent commits.
2013-03-04Remove all old-style casts from C++ codeJay Berkenbilt
2012-07-21Refactor: pull *InputSource out of QPDFJay Berkenbilt
InputSource, FileInputSource, and BufferInputSource are now top-level classes instead of privately nested inside QPDF.