diff options
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/CMakeLists.txt | 1 | ||||
-rw-r--r-- | libqpdf/QPDF_Unresolved.cc | 41 | ||||
-rw-r--r-- | libqpdf/qpdf/QPDF_Unresolved.hh | 21 |
3 files changed, 63 insertions, 0 deletions
diff --git a/libqpdf/CMakeLists.txt b/libqpdf/CMakeLists.txt index 51f7476d..7a4ef333 100644 --- a/libqpdf/CMakeLists.txt +++ b/libqpdf/CMakeLists.txt @@ -99,6 +99,7 @@ set(libqpdf_SOURCES QPDF_Reserved.cc QPDF_Stream.cc QPDF_String.cc + QPDF_Unresolved.cc QPDF_encryption.cc QPDF_json.cc QPDF_linearization.cc diff --git a/libqpdf/QPDF_Unresolved.cc b/libqpdf/QPDF_Unresolved.cc new file mode 100644 index 00000000..f348ec36 --- /dev/null +++ b/libqpdf/QPDF_Unresolved.cc @@ -0,0 +1,41 @@ +#include <qpdf/QPDF_Unresolved.hh> + +#include <stdexcept> + +std::shared_ptr<QPDFObject> +QPDF_Unresolved::create() +{ + return do_create(new QPDF_Unresolved()); +} + +std::shared_ptr<QPDFObject> +QPDF_Unresolved::shallowCopy() +{ + return create(); +} + +std::string +QPDF_Unresolved::unparse() +{ + throw std::logic_error( + "attempted to unparse an unresolveded QPDFObjectHandle"); + return ""; +} + +JSON +QPDF_Unresolved::getJSON(int json_version) +{ + return JSON::makeNull(); +} + +QPDFObject::object_type_e +QPDF_Unresolved::getTypeCode() const +{ + return QPDFObject::ot_unresolved; +} + +char const* +QPDF_Unresolved::getTypeName() const +{ + return "unresolved"; +} diff --git a/libqpdf/qpdf/QPDF_Unresolved.hh b/libqpdf/qpdf/QPDF_Unresolved.hh new file mode 100644 index 00000000..4f1c5238 --- /dev/null +++ b/libqpdf/qpdf/QPDF_Unresolved.hh @@ -0,0 +1,21 @@ +#ifndef QPDF_UNRESOLVED_HH +#define QPDF_UNRESOLVED_HH + +#include <qpdf/QPDFObject.hh> + +class QPDF_Unresolved: public QPDFObject +{ + public: + virtual ~QPDF_Unresolved() = default; + static std::shared_ptr<QPDFObject> create(); + virtual std::shared_ptr<QPDFObject> shallowCopy(); + virtual std::string unparse(); + virtual JSON getJSON(int json_version); + virtual QPDFObject::object_type_e getTypeCode() const; + virtual char const* getTypeName() const; + + private: + QPDF_Unresolved() = default; +}; + +#endif // QPDF_UNRESOLVED_HH |