aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/qpdf/QPDF_Array.hh
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2023-03-29 20:52:03 +0200
committerm-holger <m-holger@kubitscheck.org>2023-04-01 14:58:06 +0200
commita7b6975132eed94905eb784a0e267e575cade2cb (patch)
tree832972f365977d6bb0678198fd93caa11bd4844f /libqpdf/qpdf/QPDF_Array.hh
parentd3f2dc322b8e6341d1c16b03c8d6f894c363ed8b (diff)
downloadqpdf-a7b6975132eed94905eb784a0e267e575cade2cb.tar.zst
Remove SparseOHArray
Diffstat (limited to 'libqpdf/qpdf/QPDF_Array.hh')
-rw-r--r--libqpdf/qpdf/QPDF_Array.hh14
1 files changed, 6 insertions, 8 deletions
diff --git a/libqpdf/qpdf/QPDF_Array.hh b/libqpdf/qpdf/QPDF_Array.hh
index d0138e5c..4762bb6e 100644
--- a/libqpdf/qpdf/QPDF_Array.hh
+++ b/libqpdf/qpdf/QPDF_Array.hh
@@ -3,7 +3,7 @@
#include <qpdf/QPDFValue.hh>
-#include <qpdf/SparseOHArray.hh>
+#include <map>
#include <vector>
class QPDF_Array: public QPDFValue
@@ -14,9 +14,6 @@ class QPDF_Array: public QPDFValue
create(std::vector<QPDFObjectHandle> const& items);
static std::shared_ptr<QPDFObject>
create(std::vector<std::shared_ptr<QPDFObject>>&& items, bool sparse);
- static std::shared_ptr<QPDFObject> create(SparseOHArray const& items);
- static std::shared_ptr<QPDFObject>
- create(std::vector<std::shared_ptr<QPDFObject>> const& items);
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false);
virtual std::string unparse();
virtual JSON getJSON(int json_version);
@@ -25,7 +22,7 @@ class QPDF_Array: public QPDFValue
int
size() const noexcept
{
- return sparse ? sp_elements.size() : int(elements.size());
+ return sparse ? sp_size : int(elements.size());
}
QPDFObjectHandle at(int n) const noexcept;
bool setAt(int n, QPDFObjectHandle const& oh);
@@ -36,15 +33,16 @@ class QPDF_Array: public QPDFValue
bool erase(int at);
private:
+ QPDF_Array();
+ QPDF_Array(QPDF_Array const&);
QPDF_Array(std::vector<QPDFObjectHandle> const& items);
QPDF_Array(std::vector<std::shared_ptr<QPDFObject>>&& items, bool sparse);
- QPDF_Array(SparseOHArray const& items);
- QPDF_Array(std::vector<std::shared_ptr<QPDFObject>> const& items);
void checkOwnership(QPDFObjectHandle const& item) const;
bool sparse{false};
- SparseOHArray sp_elements;
+ int sp_size{0};
+ std::map<int, std::shared_ptr<QPDFObject>> sp_elements;
std::vector<std::shared_ptr<QPDFObject>> elements;
};