mirror of
https://github.com/qpdf/qpdf.git
synced 2025-02-12 08:38:26 +00:00
Create unresolved objects only for objects in the xref table (except during parsing of the xref table). Do not add indirect nulls into the the object cache as the result of a cache miss during a call to getObject except during parsing or creation/updating from JSON. To support this behaviour, add new private methods getObjectForParser and getObjectForJSON. As a result of this change, dangling references are treated as direct nulls rather than indirect nulls.
28 lines
867 B
C++
28 lines
867 B
C++
#ifndef QPDF_NULL_HH
|
|
#define QPDF_NULL_HH
|
|
|
|
#include <qpdf/QPDFValue.hh>
|
|
|
|
class QPDF_Null: public QPDFValue
|
|
{
|
|
public:
|
|
~QPDF_Null() override = default;
|
|
static std::shared_ptr<QPDFObject> create(QPDF* qpdf = nullptr, QPDFObjGen og = QPDFObjGen());
|
|
static std::shared_ptr<QPDFObject> create(
|
|
std::shared_ptr<QPDFObject> parent,
|
|
std::string_view const& static_descr,
|
|
std::string var_descr);
|
|
static std::shared_ptr<QPDFObject> create(
|
|
std::shared_ptr<QPDFValue> parent,
|
|
std::string_view const& static_descr,
|
|
std::string var_descr);
|
|
std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
|
|
std::string unparse() override;
|
|
void writeJSON(int json_version, JSON::Writer& p) override;
|
|
|
|
private:
|
|
QPDF_Null(QPDF* qpdf = nullptr, QPDFObjGen og = QPDFObjGen());
|
|
};
|
|
|
|
#endif // QPDF_NULL_HH
|