2018-08-12 14:07:22 -04:00
|
|
|
#ifndef QPDF_ARRAY_HH
|
|
|
|
#define QPDF_ARRAY_HH
|
2008-04-29 12:55:25 +00:00
|
|
|
|
|
|
|
#include <qpdf/QPDFObject.hh>
|
|
|
|
|
|
|
|
#include <vector>
|
2019-08-17 22:28:19 -04:00
|
|
|
#include <list>
|
2019-08-17 22:13:37 -04:00
|
|
|
#include <qpdf/SparseOHArray.hh>
|
2008-04-29 12:55:25 +00:00
|
|
|
|
|
|
|
class QPDF_Array: public QPDFObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
QPDF_Array(std::vector<QPDFObjectHandle> const& items);
|
2019-08-17 22:13:37 -04:00
|
|
|
QPDF_Array(SparseOHArray const& items);
|
2008-04-29 12:55:25 +00:00
|
|
|
virtual ~QPDF_Array();
|
|
|
|
virtual std::string unparse();
|
2018-12-17 17:40:29 -05:00
|
|
|
virtual JSON getJSON();
|
2013-01-22 09:57:07 -05:00
|
|
|
virtual QPDFObject::object_type_e getTypeCode() const;
|
|
|
|
virtual char const* getTypeName() const;
|
2018-02-16 17:25:27 -05:00
|
|
|
virtual void setDescription(QPDF*, std::string const&);
|
2012-06-18 22:38:59 +02:00
|
|
|
|
2008-04-29 12:55:25 +00:00
|
|
|
int getNItems() const;
|
|
|
|
QPDFObjectHandle getItem(int n) const;
|
2019-08-17 19:01:32 -04:00
|
|
|
void getAsVector(std::vector<QPDFObjectHandle>&) const;
|
2012-06-18 22:38:59 +02:00
|
|
|
|
2008-04-29 12:55:25 +00:00
|
|
|
void setItem(int, QPDFObjectHandle const&);
|
2012-06-18 22:38:59 +02: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-17 22:28:19 -04: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.
|
2019-08-17 22:27:55 -04:00
|
|
|
SparseOHArray const& getElementsForShallowCopy() const;
|
2019-08-17 22:28:19 -04:00
|
|
|
void addExplicitElementsToList(std::list<QPDFObjectHandle>&) const;
|
2019-08-17 22:27:55 -04:00
|
|
|
|
2010-06-06 13:32:08 +00:00
|
|
|
protected:
|
|
|
|
virtual void releaseResolved();
|
|
|
|
|
2008-04-29 12:55:25 +00:00
|
|
|
private:
|
2019-08-17 22:13:37 -04:00
|
|
|
SparseOHArray elements;
|
2008-04-29 12:55:25 +00:00
|
|
|
};
|
|
|
|
|
2018-08-12 14:07:22 -04:00
|
|
|
#endif // QPDF_ARRAY_HH
|