diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | include/qpdf/QPDF.hh | 5 | ||||
-rw-r--r-- | libqpdf/QPDF.cc | 6 |
3 files changed, 16 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2021-03-01 Jay Berkenbilt <ejb@ql.org> + + * Add QPDF::numWarnings() -- useful to tell whether any warnings + were issued by a specific bit of code. + 2021-02-26 Jay Berkenbilt <ejb@ql.org> * Bug fix: QPDFFormFieldObjectHelper was mis-handling /DA, /Q, and diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index f9434024..d2161acd 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -236,6 +236,11 @@ class QPDF QPDF_DLL bool anyWarnings() const; + // Indicate the number of warnings that have been issued so far. + // Does not clear the list of warnings. + QPDF_DLL + size_t numWarnings() const; + // Return an application-scoped unique ID for this QPDF object. // This is not a globally unique ID. It is constructing using a // timestamp and a random number and is intended to be unique diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index b751e602..9eb60ced 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -366,6 +366,12 @@ QPDF::anyWarnings() const return ! this->m->warnings.empty(); } +size_t +QPDF::numWarnings() const +{ + return this->m->warnings.size(); +} + bool QPDF::findHeader() { |