2018-08-12 18:07:22 +00:00
|
|
|
#ifndef QPDF_ARRAY_HH
|
|
|
|
#define QPDF_ARRAY_HH
|
2008-04-29 12:55:25 +00:00
|
|
|
|
2022-08-02 20:35:04 +00:00
|
|
|
#include <qpdf/QPDFValue.hh>
|
2008-04-29 12:55:25 +00:00
|
|
|
|
2019-08-18 02:13:37 +00:00
|
|
|
#include <qpdf/SparseOHArray.hh>
|
2022-04-02 21:14:10 +00:00
|
|
|
#include <list>
|
|
|
|
#include <vector>
|
2008-04-29 12:55:25 +00:00
|
|
|
|
2022-08-02 20:35:04 +00:00
|
|
|
class QPDF_Array: public QPDFValue
|
2008-04-29 12:55:25 +00:00
|
|
|
{
|
|
|
|
public:
|
2022-04-15 23:44:07 +00:00
|
|
|
virtual ~QPDF_Array() = default;
|
2022-09-08 15:29:23 +00:00
|
|
|
static std::shared_ptr<QPDFObject>
|
2022-06-27 16:50:35 +00:00
|
|
|
create(std::vector<QPDFObjectHandle> const& items);
|
2022-09-08 15:29:23 +00:00
|
|
|
static std::shared_ptr<QPDFObject> create(SparseOHArray const& items);
|
|
|
|
virtual std::shared_ptr<QPDFObject> shallowCopy();
|
2008-04-29 12:55:25 +00:00
|
|
|
virtual std::string unparse();
|
2022-05-07 11:53:45 +00:00
|
|
|
virtual JSON getJSON(int json_version);
|
2022-09-08 15:06:15 +00:00
|
|
|
virtual void disconnect();
|
2012-06-18 20:38:59 +00:00
|
|
|
|
2008-04-29 12:55:25 +00:00
|
|
|
int getNItems() const;
|
|
|
|
QPDFObjectHandle getItem(int n) const;
|
2019-08-17 23:01:32 +00:00
|
|
|
void getAsVector(std::vector<QPDFObjectHandle>&) const;
|
2012-06-18 20:38:59 +00:00
|
|
|
|
2008-04-29 12:55:25 +00:00
|
|
|
void setItem(int, QPDFObjectHandle const&);
|
2012-06-18 20:38:59 +00:00
|
|
|
void setFromVector(std::vector<QPDFObjectHandle> const& items);
|
|
|
|
void insertItem(int at, QPDFObjectHandle const& item);
|
|
|
|
void appendItem(QPDFObjectHandle const& item);
|
|
|
|
void eraseItem(int at);
|
2008-04-29 12:55:25 +00:00
|
|
|
|
2019-08-18 02:28:19 +00:00
|
|
|
// Helper methods for QPDF and QPDFObjectHandle -- these are
|
|
|
|
// public methods since the whole class is not part of the public
|
|
|
|
// API. Otherwise, these would be wrapped in accessor classes.
|
|
|
|
void addExplicitElementsToList(std::list<QPDFObjectHandle>&) const;
|
2019-08-18 02:27:55 +00:00
|
|
|
|
2008-04-29 12:55:25 +00:00
|
|
|
private:
|
2022-06-16 16:45:04 +00:00
|
|
|
QPDF_Array(std::vector<QPDFObjectHandle> const& items);
|
|
|
|
QPDF_Array(SparseOHArray const& items);
|
2019-08-18 02:13:37 +00:00
|
|
|
SparseOHArray elements;
|
2008-04-29 12:55:25 +00:00
|
|
|
};
|
|
|
|
|
2018-08-12 18:07:22 +00:00
|
|
|
#endif // QPDF_ARRAY_HH
|