From 38cf7c16283ec2d476514a54e2b1a7016b0b770a Mon Sep 17 00:00:00 2001 From: m-holger Date: Sat, 25 Mar 2023 15:30:52 +0000 Subject: Add separate sparse mode to QPDF_Array Add temporary clone of SparseOHArray to implement non-sparse mode. --- libqpdf/qpdf/QPDF_Array.hh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libqpdf/qpdf/QPDF_Array.hh') diff --git a/libqpdf/qpdf/QPDF_Array.hh b/libqpdf/qpdf/QPDF_Array.hh index 88397ba7..1c4227ba 100644 --- a/libqpdf/qpdf/QPDF_Array.hh +++ b/libqpdf/qpdf/QPDF_Array.hh @@ -3,6 +3,7 @@ #include +#include #include #include #include @@ -16,6 +17,7 @@ class QPDF_Array: public QPDFValue static std::shared_ptr create(std::vector>&& items); static std::shared_ptr create(SparseOHArray const& items); + static std::shared_ptr create(OHArray const& items); virtual std::shared_ptr copy(bool shallow = false); virtual std::string unparse(); virtual JSON getJSON(int json_version); @@ -36,7 +38,10 @@ class QPDF_Array: public QPDFValue QPDF_Array(std::vector const& items); QPDF_Array(std::vector>&& items); QPDF_Array(SparseOHArray const& items); - SparseOHArray elements; + QPDF_Array(OHArray const& items); + bool sparse{false}; + SparseOHArray sp_elements; + OHArray elements; }; #endif // QPDF_ARRAY_HH -- cgit v1.2.3-54-g00ecf