aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_String.cc
AgeCommit message (Collapse)Author
2024-02-24Format codeJay Berkenbilt
2024-02-16Reimplement QPDFObjectHandle::getJSON in terms of writeJSONm-holger
2024-02-16Add new writeJSON methodsm-holger
Create an alternative to getJSON to allow an object handle to be written as JSON without the overhead of creating a JSON object.
2023-06-02Code tidy - reflow comments and stringsm-holger
2023-05-21Rerun clang-formatJay Berkenbilt
2023-05-20Remove unused include directivesm-holger
2022-12-31Add new virtual method QPDFObject::getStringValuem-holger
Avoid dynamic casting.
2022-11-20Rename QPDFObject::shallowCopy to copym-holger
Add optional parameter shallow. Change logic errors to runtime errors.
2022-09-24Tune QPDF_String::useHexString()m-holger
2022-09-23Tune unparsing of hex strings in QPDF_String::unparsem-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-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-01Remove virtual methods QPDFValue::getTypeCode and getTypeNamem-holger
2022-09-01Split QPDFObject into QPDFObject and QPDFValuem-holger
2022-06-27Refactor QPDFObject creation and cloningm-holger
Move responsibility for creating shared pointers to objects and cloning from QPDFObjectHandle to QPDFObject.
2022-05-08Implement JSON v2 for StringJay Berkenbilt
Also refine the herustic for deciding whether to use hexadecimal notation for a string.
2022-05-07Prepare code for JSON v2Jay Berkenbilt
Update getJSON() methods and calls to them
2022-04-24Expose QUtil::get_next_utf8_codepointJay Berkenbilt
2022-04-16Use = default and = delete where possible in classesJay Berkenbilt
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-22Use val.at instead of val[]Jay Berkenbilt
2022-02-22Recognize explicit UTF-8 strings (fixes #654)Jay Berkenbilt
2022-02-16Fix asymmetry between newUnicodeString and getUTF8ValueJay 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.
2021-01-24QPDFObjectHandle::newUnicodeString to uses UTF-16 only when neededJay Berkenbilt
Use the first of ASCII, PDFDocEncoding, or UTF-16 that is capable of encoding the string.
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-01-17Move remaining existing transcoding to QUtilJay Berkenbilt
2019-01-06Move utf8_to_utf16 into QUtilJay Berkenbilt
2019-01-06Refactor string transcoding in QPDF_StringJay Berkenbilt
2018-12-22Add QPDFObjectHandle::getJSON()Jay Berkenbilt
2018-06-21Better support for creating Unicode stringsJay Berkenbilt
2018-02-19Properly handle strings with PDF Doc Encoding (fixes #179)Jay Berkenbilt
The QPDF_String::getUTF8Val() method was not treating strings that weren't explicitly Unicode as PDF Doc Encoded. This only affects characters in the range 0x80 through 0xa0.
2013-10-18Security: replace operator[] with atJay Berkenbilt
For std::string and std::vector, replace operator[] with at. This was done using an automated process. See README.hardening for details.
2013-03-05Remove all calls to sprintfJay Berkenbilt
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
2013-03-04Replace many calls to sprintf with QUtil::hex_encodeJay Berkenbilt
Add QUtil::hex_encode to encode binary data has a hexadecimal string, and use it in place of sprintf where possible.
2013-01-22Add getTypeCode() and getTypeName()Jay Berkenbilt
Add virtual methods to QPDFObject, wrappers to QPDFObjectHandle, and implementations to all the QPDF_Object types.
2012-06-20ABI change: fix use of off_t, size_t, and integer typesJay Berkenbilt
Significantly improve the code's use of off_t for file offsets, size_t for memory sizes, and integer types in cases where there has to be compatibility with external interfaces. Rework sections of the code that would have prevented qpdf from working on files larger than 2 (or maybe 4) GB in size.
2009-10-17tweak when we decide to use hex strings vs literal stringsJay Berkenbilt
git-svn-id: svn+q:///qpdf/trunk@810 71b93d88-0707-0410-a8cf-f5a4172ac649
2009-09-26removed qexc; non-compatible ABI changeJay Berkenbilt
git-svn-id: svn+q:///qpdf/trunk@709 71b93d88-0707-0410-a8cf-f5a4172ac649
2008-11-23handle UTF-16BE fullyJay Berkenbilt
git-svn-id: svn+q:///qpdf/trunk@639 71b93d88-0707-0410-a8cf-f5a4172ac649
2008-04-29update release date to actual daterelease-qpdf-2.0Jay Berkenbilt
git-svn-id: svn+q:///qpdf/trunk@599 71b93d88-0707-0410-a8cf-f5a4172ac649