Commit 1bb209a9bf5ade164cf1ba7c3b9399be70c45c24

Authored by Jay Berkenbilt
1 parent 37fcc5ff

Add QPDF::numWarnings

ChangeLog
  1 +2021-03-01 Jay Berkenbilt <ejb@ql.org>
  2 +
  3 + * Add QPDF::numWarnings() -- useful to tell whether any warnings
  4 + were issued by a specific bit of code.
  5 +
1 6 2021-02-26 Jay Berkenbilt <ejb@ql.org>
2 7  
3 8 * Bug fix: QPDFFormFieldObjectHelper was mis-handling /DA, /Q, and
... ...
include/qpdf/QPDF.hh
... ... @@ -236,6 +236,11 @@ class QPDF
236 236 QPDF_DLL
237 237 bool anyWarnings() const;
238 238  
  239 + // Indicate the number of warnings that have been issued so far.
  240 + // Does not clear the list of warnings.
  241 + QPDF_DLL
  242 + size_t numWarnings() const;
  243 +
239 244 // Return an application-scoped unique ID for this QPDF object.
240 245 // This is not a globally unique ID. It is constructing using a
241 246 // timestamp and a random number and is intended to be unique
... ...
libqpdf/QPDF.cc
... ... @@ -366,6 +366,12 @@ QPDF::anyWarnings() const
366 366 return ! this->m->warnings.empty();
367 367 }
368 368  
  369 +size_t
  370 +QPDF::numWarnings() const
  371 +{
  372 + return this->m->warnings.size();
  373 +}
  374 +
369 375 bool
370 376 QPDF::findHeader()
371 377 {
... ...