2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-02 11:46:35 +00:00
Commit Graph

477 Commits

Author SHA1 Message Date
Jay Berkenbilt
8d348974aa Prepare test suite for json v2 2022-05-08 13:45:20 -04:00
Jay Berkenbilt
15272662f6 Fix typo in json output key name
moddify -> modify. Also carefully spell checked all remaining keys by
splitting them into words and running a spell checker, not just
relying on visual proofreading. That was the only one.
2022-05-08 13:45:20 -04:00
Jay Berkenbilt
1bc8abfdd3 Implement JSON v2 for Stream
Not fully exercised in this commit
2022-05-08 13:45:20 -04:00
Jay Berkenbilt
16f4f94cd9 Prepare code for JSON v2
Update getJSON() methods and calls to them
2022-05-07 11:12:01 -04:00
Jay Berkenbilt
a9fbbd5dca Objectinfo json: write incrementally and in numeric order
This script was used on test data:

----------
#!/usr/bin/env python3
import json
import sys
import re

def json_dumps(data):
    return json.dumps(data, ensure_ascii=False,
                      indent=2, separators=(',', ': '))

for filename in sys.argv[1:]:
    with open(filename, 'r') as f:
        data = json.loads(f.read())
    if 'objectinfo' not in data:
        continue
    trailer = None
    to_sort = []
    for k, v in data['objectinfo'].items():
        if k == 'trailer':
            trailer = v
        else:
            m = re.match(r'^(\d+) \d+ R', k)
            if m:
                to_sort.append([int(m.group(1)), k, v])
    newobjectinfo = {x[1]: x[2] for x in sorted(to_sort)}
    if trailer is not None:
        newobjectinfo['trailer'] = trailer
    data['objectinfo'] = newobjectinfo
print(json_dumps(data))
----------
2022-05-07 08:26:31 -04:00
Jay Berkenbilt
7f65a5c21f Test json against schema only on demand
Testing json against schema requires an in-memory copy, so do it only
when requested by the test suite.
2022-05-07 08:26:31 -04:00
Jay Berkenbilt
2a92b1b0d6 TODO: solidify remaining json v2 work 2022-05-07 08:26:31 -04:00
Jay Berkenbilt
0500d4347a JSON: add blob type that generates base64-encoded binary data 2022-05-06 19:14:52 -04:00
Jay Berkenbilt
05fda4afa2 Change JSON parser to parse from an InputSource 2022-05-04 12:07:11 -04:00
Jay Berkenbilt
e259635986 JSON: add write methods and implement unparse() in terms of those 2022-05-04 12:07:11 -04:00
Jay Berkenbilt
f4206a0938 Add new Pl_String Pipeline 2022-05-03 18:54:51 -04:00
Jay Berkenbilt
16139d97c8 Add new Pl_OStream Pipeline 2022-05-03 18:54:51 -04:00
Jay Berkenbilt
f1c6bb97db Add new Pipeline convenience methods 2022-05-03 18:31:22 -04:00
Jay Berkenbilt
b20f051922 TODO note about test suites 2022-05-03 18:31:22 -04:00
Jay Berkenbilt
3d9bac43da Add internal Pl_Base64
Bidirectional base64; will be used by JSON v2.
2022-05-03 18:31:22 -04:00
Jay Berkenbilt
7882b85b06 TODO: more JSON notes 2022-05-03 08:39:50 -04:00
Jay Berkenbilt
3c4d2bfb21 TODO: JSON notes 2022-05-03 08:39:50 -04:00
Jay Berkenbilt
e34dbbfa18 Spell check 2022-05-01 12:56:22 -04:00
Jay Berkenbilt
04118ca44b TODO item 2022-05-01 12:56:22 -04:00
Jay Berkenbilt
8ccd3a8a89 Mark weak encryption with API changes (fixes #576) 2022-04-30 17:24:15 -04:00
Jay Berkenbilt
7608ff4e0b TODO: reminder to look for deprecated APIs in ABI section 2022-04-30 17:23:58 -04:00
Jay Berkenbilt
cff26040d8 Using insecure crytpo from the CLI is now an error by default 2022-04-30 17:23:58 -04:00
Jay Berkenbilt
0122f44865 TODO: remove a few discarded API change ideas
I had some ideas about some more convenience methods from discussions
with some developers, but I decided that the newly added ones cover
most of the use cases. The other ideas were too hard to explain
clearly and therefore too specialized to put into the public API,
where I would have to support them for a long time.
2022-04-30 13:30:53 -04:00
Jay Berkenbilt
e80fad86e9 Add new QPDFObjectHandle methods for more fluent programming 2022-04-29 20:09:10 -04:00
Jay Berkenbilt
ff73d71ec8 Fix TODO typos 2022-04-29 19:06:27 -04:00
Jay Berkenbilt
68e721981a Add new QPDF::warn that takes most of QPDFExc's arguments 2022-04-23 18:25:43 -04:00
Jay Berkenbilt
696ca53205 TODO note about default output streams for QPDFJob 2022-04-23 18:25:43 -04:00
Jay Berkenbilt
22b35c4928 Expose QUtil::get_next_utf8_codepoint 2022-04-23 18:25:43 -04:00
Jay Berkenbilt
5bbb0d4c30 Replace switch statements with static map initializers
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-23 18:25:43 -04:00
Jay Berkenbilt
877694a583 Decide against adding handleWarning back to ParserCallbacks 2022-04-16 13:41:53 -04:00
Jay Berkenbilt
75fe4f60c3 Use anonymous namespaces for file-private classes 2022-04-16 13:35:27 -04:00
Jay Berkenbilt
38edca820e Clarify note in TODO 2022-04-16 13:16:06 -04:00
Jay Berkenbilt
80ed3076a0 Remove deprecated name/number tree constructors
Remove the name/number tree object helper constructors that don't take
a QPDF&.
2022-04-16 13:13:15 -04:00
Jay Berkenbilt
6df6260751 Change default --json from 1 to latest 2022-04-16 12:57:33 -04:00
Jay Berkenbilt
cdd0b4fb7d Use = default and = delete where possible in classes 2022-04-16 11:39:14 -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
dd35966367 Remove remaining cmake steps from TODO 2022-04-10 17:57:26 -04:00
Jay Berkenbilt
5f4675bb24 Mark non-ABI symbols in exported class with QPDF_DLL_PRIVATE 2022-04-10 16:54:23 -04:00
Jay Berkenbilt
90cfe80bac Clean up/fix DLL.h
* Change DLL_EXPORT to libqpdf_EXPORTS (internal to the build). The
  new name is cmake's default, is more conventional, and is less
  likely to clash with other symbols.
* Add QPDF_DLL_PRIVATE for non-Windows
* Make logic around when to define QPDF_DLL et al more explicit
* Add detailed comments
2022-04-10 16:52:36 -04:00
Jay Berkenbilt
07edf96440 Remove methods of private classes from ABI
Prior to the cmake conversion, several private classes had methods
that were exported into the shared library so they could be tested
with libtests. With cmake, we build libtests using an object library,
so this is no longer necessary. The methods that are disappearing from
the ABI were never exposed through public headers, so no code should
be using them. Removal had to wait until the window for ABI-breaking
changes was open.
2022-04-09 17:33:29 -04:00
Jay Berkenbilt
c7e877b88b Update documentation for PointerHolder transition 2022-04-09 17:33:29 -04:00
Jay Berkenbilt
59834db472 Add documentation for code formatting and contribution guidelines 2022-04-09 12:25:08 -04:00
Jay Berkenbilt
2e41b805bd Update TODO with additional notes 2022-04-05 14:56:19 -04:00
Jay Berkenbilt
77e889495f Update some code manually to get better formatting results
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-05 14:56:19 -04:00
Jay Berkenbilt
f20fa61eb4 Add .clang-format and .dir-locals.el files to set coding style
Configure emacs and clang-format 15 to the coding style I am choosing
for qpdf.
2022-04-04 08:10:40 -04:00
Jay Berkenbilt
80801e4c56 TODO note 2022-04-03 17:58:34 -04:00
Jay Berkenbilt
198b96471a Notes for next release 2022-03-19 08:57:47 -04:00
Jay Berkenbilt
11e34f29ce TODO: update section for cmake 2022-03-18 19:53:18 -04:00
Jay Berkenbilt
96839decd0 TODO note about linux32 large file tests 2022-03-18 19:53:18 -04:00
Jay Berkenbilt
f58d2a60d5 Update build-related documentation and comments 2022-03-18 19:53:18 -04:00