-
Refactor array handling in `QPDFObjectHandle`: replace `int` with `size_t` for size and index operations, introduce utility functions for type conversions, and simplify sparse array logic.
-
Move all array-specific methods to new class qpdf::Array.
-
Change the return type to a std::pair<bool, QPDFObjectHandle> in order to allow a default constructed object handle (which is currently returned to indicate failure) to become a valid object.
-
Create an alternative to getJSON to allow an object handle to be written as JSON without the overhead of creating a JSON object.
-
Sparse arrays are rare. Dynamically create the variables needed to manage them only when needed.
-
There are no reasons other than historical to use size_t. On balance, using map is more efficient. Hold shared pointers to QPDFObjects rather than QPDFObjectHandles for consistencey with QPDF_Array.