diff options
author | Jay Berkenbilt <ejb@ql.org> | 2018-02-16 23:25:27 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2018-02-19 03:06:27 +0100 |
commit | d0e99f195a987c483bbb6c5449cf39bee34e08a1 (patch) | |
tree | cead8acd60cd14fd5d904ed380c750540cb361f3 /libqpdf/QPDFObject.cc | |
parent | c2e16827b69f3d3ac3721cfcd608b87f28e2a13f (diff) | |
download | qpdf-d0e99f195a987c483bbb6c5449cf39bee34e08a1.tar.zst |
More robust handling of type errors
Give objects descriptions and context so it is possible to issue
warnings instead of fatal errors for attempts to access objects of the
wrong type.
Diffstat (limited to 'libqpdf/QPDFObject.cc')
-rw-r--r-- | libqpdf/QPDFObject.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libqpdf/QPDFObject.cc b/libqpdf/QPDFObject.cc index 8df2b480..cffb8a56 100644 --- a/libqpdf/QPDFObject.cc +++ b/libqpdf/QPDFObject.cc @@ -1 +1,36 @@ #include <qpdf/QPDFObject.hh> + +QPDFObject::Members::Members() : + owning_qpdf(0) +{ +} + +QPDFObject::Members::~Members() +{ +} + +QPDFObject::QPDFObject() : + m(new Members) +{ +} + +void +QPDFObject::setDescription(QPDF* qpdf, std::string const& description) +{ + this->m->owning_qpdf = qpdf; + this->m->object_description = description; +} + +bool +QPDFObject::getDescription(QPDF*& qpdf, std::string& description) +{ + qpdf = this->m->owning_qpdf; + description = this->m->object_description; + return this->m->owning_qpdf; +} + +bool +QPDFObject::hasDescription() +{ + return this->m->owning_qpdf; +} |