Commit Graph

99 Commits

Author SHA1 Message Date
Jay Berkenbilt 9db5d75b2b Update copyright to 2024 2024-01-01 10:56:06 -05:00
Jay Berkenbilt 070ee710eb Support excluding values from numeric ranges (fixes #564, #790) 2024-01-01 10:48:14 -05:00
m-holger acd0acf169 Fix doc typos 2023-06-02 19:24:12 +01:00
m-holger 3c5700c255 Code tidy - reflow comments and strings 2023-06-02 16:00:40 +01:00
Jay Berkenbilt 60965d5f4d Rerun clang-format 2023-05-21 13:35:09 -04:00
Jay Berkenbilt d740c6ccce Rerun format_code (after merging clang-tidy PR) 2023-05-20 14:52:19 -04:00
m-holger d0682f0f60 Use nullptr instead of 0 or NULL 2023-05-20 15:41:36 +01:00
m-holger e28f4efb00 Replace deprecated C++ includes 2023-05-20 15:41:25 +01:00
m-holger 0795b6952b Add new function QUtil::hex_decode_char 2023-03-23 20:23:37 +00:00
m-holger 4ee6ff0a73 Add new procedure QUtil::read_file_into_string 2023-03-08 21:00:26 +00:00
Jay Berkenbilt c99a1ecd4f Update copyright to 2023 2023-02-25 14:18:13 -05:00
m-holger 9096df74fc Replace strchr in QUtil::is_hex_digit and is_space 2023-02-05 08:29:21 -05:00
m-holger 942a2c3f68 Add new function QUtil::hex_encode_char 2023-01-06 18:42:12 -05:00
Jay Berkenbilt 9a9a7ab097 Comment about qpdf/PointerHolder.hh in public headers 2022-09-23 15:15:39 -04:00
Jay Berkenbilt 0a54247652 Add QUtil::get_max_memory_usage for testing 2022-08-31 14:47:27 -04:00
m-holger 45a6100cbb Inline QUtil functions used by QPDFTokenizer 2022-08-18 15:23:35 +01:00
Jay Berkenbilt 04fc7c4bea Add conversions to ISO-8601 date format 2022-05-30 20:03:08 -04:00
Jay Berkenbilt 23fc6756f1 Add QUtil::FileCloser to the public API 2022-05-20 09:16:25 -04:00
Jay Berkenbilt 60ec94a7c3 Add QUtil::is_long_long 2022-05-16 13:39:26 -04:00
Jay Berkenbilt 22b35c4928 Expose QUtil::get_next_utf8_codepoint 2022-04-23 18:25:43 -04:00
Jay Berkenbilt 2a7d2b63c2 Make ABI-breaking changes that don't modify API at all
* Merge overloaded functions by adding default values
* Remove non-const methods that are identical to const methods
2022-04-16 10:41:46 -04:00
Jay Berkenbilt a68703b07e Replace PointerHolder with std::shared_ptr in library sources only
(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-09 17:33:29 -04:00
Jay Berkenbilt 12f1eb15ca Programmatically apply new formatting to code
Run this:

for i in  **/*.cc **/*.c **/*.h **/*.hh; do
  clang-format < $i >| $i.new && mv $i.new $i
done
2022-04-04 08:10:40 -04:00
Jay Berkenbilt a478cbb6dc Silently/transparently recognize UTF-16LE as UTF-16 (fixes #649)
The PDF spec only allows UTF-16BE, but most readers seem to accept
UTF-16LE as well, so now qpdf does too.
2022-02-15 16:13:12 -05:00
Jay Berkenbilt df2f5c6a36 Add QUtil::make_shared_array to help with PointerHolder transition 2022-02-07 14:08:46 -05:00
Jay Berkenbilt 5f3f78822b Improve use of std::unique_ptr
* 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-05 11:24:56 -05:00
Jay Berkenbilt cfaa2de804 Update copyright for 2022 2022-02-04 16:36:22 -05:00
Jay Berkenbilt b02d37bc0a Make QPDFArgParser accept const argv
This makes it much more convention to use the initializeFromArgv
functions since you can use string literals.
2022-02-01 13:50:58 -05:00
Jay Berkenbilt 76c4f78b5c Add QUtil::make_shared_cstr
Replace most of the calls to QUtil::copy_string with this instead.
2022-01-30 13:11:03 -05:00
Jay Berkenbilt af91b5b584 Add QUtil::file_can_be_opened 2021-12-29 13:41:02 -05:00
Jay Berkenbilt 0b1623d07d Add QUtil::path_basename 2021-02-18 09:59:03 -05:00
Jay Berkenbilt 07f40bd254 QUtil::double_to_string: trim trailing zeroes with option to disable 2021-02-13 02:30:00 -05:00
Jay Berkenbilt 8fbc8579f2 Allow zone information to be omitted from timestamp strings 2021-02-11 14:26:55 -05:00
Jay Berkenbilt bf0e6eb302 Add QUtil methods for dealing with PDF timestamp strings 2021-02-09 17:50:24 -05:00
Jay Berkenbilt 553ac7f353 Add QUtil::pipe_file and QUtil::file_provider 2021-02-07 19:41:34 -05:00
Jay Berkenbilt bf8fd41fee Update copyright to 2021 2021-01-04 16:26:58 -05:00
Jay Berkenbilt 77198d5310 Delegate random number generation to crypto provider (fixes #418) 2020-04-06 11:23:02 -04:00
Jay Berkenbilt 619d294e9d Remove QUtil::srandom 2020-04-06 09:49:02 -04:00
Jay Berkenbilt 2100b4ce15 Allow qpdf to be built on systems without wchar_t (fixes #406) 2020-04-03 21:39:44 -04:00
Jay Berkenbilt 54726930df Remove redundant methods in QUtil
This was being saved until we had to break ABI.
2020-04-03 12:17:57 -04:00
Jay Berkenbilt e5cc065598 Update copyright to 2020 2020-01-26 16:57:27 -05:00
Jay Berkenbilt a44b5a34a0 Pull wmain -> main code from qpdf.cc into QUtil.cc 2020-01-14 11:40:51 -05:00
Jay Berkenbilt 9a398504ca Refactor QUtil::read_lines_from_file
This commit adds the preserve_eol flags but doesn't implement EOL
preservation yet.
2020-01-13 09:19:53 -05:00
Jay Berkenbilt 4fa7b1eb60 Add remove_file and rename_file to QUtil 2019-08-31 15:51:04 -04:00
Jay Berkenbilt 1bde5c68a3 Add QUtil::read_file_into_memory
This code was essentially duplicated between test_driver and
standalone_fuzz_target_runner.
2019-06-22 10:14:25 -04:00
Jay Berkenbilt c6cfd64503 Rename QUtil::strcasecmp to QUtil::str_compare_nocase (fixes #242) 2019-06-21 22:29:31 -04:00
Jay Berkenbilt 42306e2ff8 QUtil: add unsigned int/string functions 2019-06-21 13:17:21 -04:00
Jay Berkenbilt e87d149918 Add QUtil::possible_repaired_encodings 2019-01-17 11:43:56 -05:00
Jay Berkenbilt 4630377731 Add status-reporting transcoders to QUtil 2019-01-17 11:43:56 -05:00
Jay Berkenbilt 8f389f14c0 QUtil::analyze_encoding 2019-01-17 11:43:56 -05:00