aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QUtil.cc
AgeCommit message (Collapse)Author
2022-09-26Fix edge case in character encoding (fixes #778)Jay Berkenbilt
Avoid representing as PDF Doc encoding any string whose PDF Doc encoding representation starts with a UTF-16 or UTF-8 marker.
2022-09-23Tune QUtil::hex_encodem-holger
2022-08-31Add QUtil::get_max_memory_usage for testingJay Berkenbilt
2022-08-18Inline QUtil functions used by QPDFTokenizerm-holger
2022-07-26Code tidy : replace 0 with nullptr or truem-holger
2022-05-31Add conversions to ISO-8601 date formatJay Berkenbilt
2022-05-20Add QUtil::FileCloser to the public APIJay Berkenbilt
2022-05-16Add QUtil::is_long_longJay 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-24Expose QUtil::get_next_utf8_codepointJay Berkenbilt
2022-04-24Replace switch statements with static map initializersJay Berkenbilt
Character transcoding from Unicode to single-byte characters used hard-coded switch statements because the code predated our adoption of C++11. Now we have thread-safe, static initialization of map literals, so use that instead.
2022-04-16Use anonymous namespaces for file-private classesJay Berkenbilt
2022-04-16Make ABI-breaking changes that don't modify API at allJay Berkenbilt
* Merge overloaded functions by adding default values * Remove non-const methods that are identical to const methods
2022-04-09Remove PointerHolder.hh from other than public header filesJay Berkenbilt
Increase to POINTERHOLDER_TRANSITION=4
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-16Remove special case for 0xad for 10.6.2.release-qpdf-10.6.2Jay Berkenbilt
2022-02-15Silently/transparently recognize UTF-16LE as UTF-16 (fixes #649)Jay Berkenbilt
The PDF spec only allows UTF-16BE, but most readers seem to accept UTF-16LE as well, so now qpdf does too.
2022-02-15Handle odd PDFDoc codepoints in UTF-8 during transcoding (fixes #650)Jay Berkenbilt
There are codepoints in PDFDoc that are not valid UTF-8 but map to valid UTF-8. We were handling those correctly with bidirectional mapping. However, if those same code points appeared in UTF-8, where they have no meaning, they were left as fixed points when converting to PDFDoc, where they do have meaning. This change recognizes them as errors.
2022-02-09Fix one more PDF doc encoding error for 10.6 release (fixes #637)release-qpdf-10.6.0Jay 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-07Use make_array_pointer_holderJay Berkenbilt
This will be able to be replaced with QUtil::make_shared_array
2022-02-07Add QUtil::make_shared_array to help with PointerHolder transitionJay Berkenbilt
2022-02-05Improve use of std::unique_ptrJay Berkenbilt
* Use unique_ptr in place of shared_ptr in some cases * unique_ptr for arrays does not require a custom deleter * use std::make_unique (c++14) where possible
2022-02-04Add a blank line after the first header included in each sourceJay Berkenbilt
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-02-01Make QPDFArgParser accept const argvJay Berkenbilt
This makes it much more convention to use the initializeFromArgv functions since you can use string literals.
2022-01-30Add QUtil::make_shared_cstrJay Berkenbilt
Replace most of the calls to QUtil::copy_string with this instead.
2022-01-11Add missing characters from PDF doc encoding (fixes #606)Jay Berkenbilt
2021-12-29Add QUtil::file_can_be_openedJay Berkenbilt
2021-04-18Fix timezone portability issue (fixes #515)Jay Berkenbilt
2021-02-18Add QUtil::path_basenameJay Berkenbilt
2021-02-13QUtil::double_to_string: trim trailing zeroes with option to disableJay Berkenbilt
2021-02-11Allow zone information to be omitted from timestamp stringsJay Berkenbilt
2021-02-11Add autoconf test for localtime_rJay Berkenbilt
2021-02-10Minor clean up of Windows headersJay Berkenbilt
2021-02-09Add QUtil methods for dealing with PDF timestamp stringsJay Berkenbilt
2021-02-08Add QUtil::pipe_file and QUtil::file_providerJay Berkenbilt
2020-10-27Improve efficiency of number to string conversionJay Berkenbilt
2020-10-21Protect numeric conversion against user's locale (fixes #459)Jay Berkenbilt
2020-04-16Fix warnings reported by -Wshadow=local (fixes #431)Jay Berkenbilt
2020-04-06Don't include <cwchar> if not building with wcharJay Berkenbilt
2020-04-06Delegate random number generation to crypto provider (fixes #418)Jay Berkenbilt
2020-04-06Make random data provider code thread-safeJay Berkenbilt
This uses C++-11 thread-safe static initializers now.
2020-04-06Remove QUtil::srandomJay Berkenbilt
2020-04-04Allow qpdf to be built on systems without wchar_t (fixes #406)Jay Berkenbilt
2020-04-03Remove redundant methods in QUtilJay Berkenbilt
This was being saved until we had to break ABI.
2020-02-29Include header for wcslen (fixes #405)Jay Berkenbilt
2020-01-14Pull wmain -> main code from qpdf.cc into QUtil.ccJay Berkenbilt
2020-01-14Add error detection for read_lines_from_file(FILE*)Jay Berkenbilt