summaryrefslogtreecommitdiffstats
path: root/manual
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-02-08 22:48:13 +0100
committerJay Berkenbilt <ejb@ql.org>2022-02-08 22:49:43 +0100
commitec778ef98b0b20e2bf4592b00d0a6ac39b69c511 (patch)
tree370f2beb6784c776791fb14a9e5476f0413da1bb /manual
parentfa0b63846b5bf359539053b4da52997cd6b9eadf (diff)
downloadqpdf-ec778ef98b0b20e2bf4592b00d0a6ac39b69c511.tar.zst
Add additional comments about new accessor methods
Diffstat (limited to 'manual')
-rw-r--r--manual/design.rst9
-rw-r--r--manual/release-notes.rst2
2 files changed, 10 insertions, 1 deletions
diff --git a/manual/design.rst b/manual/design.rst
index cbcded3e..0e50f858 100644
--- a/manual/design.rst
+++ b/manual/design.rst
@@ -746,6 +746,15 @@ and set return values in passed-in pointers, but this would complicate
both the implementation and the use of the library for a case that is
actually quite rare and largely avoidable.
+*How can I avoid type warnings altogether?* For each
+``getSomethingValue`` accessor that returns a value of the requested
+type and issues a warning for objects of the wrong type, there is also
+a ``getValueAsSomething`` method (since qpdf 10.6) that returns false
+for objects of the wrong type and otherwise returns true and
+initializes a reference. These methods never generate type warnings
+and provide an alternative to explicitly checking the type of an
+object before calling an accessor method.
+
.. _smart-pointers:
Smart Pointers
diff --git a/manual/release-notes.rst b/manual/release-notes.rst
index b12e5e7f..a2d21ef8 100644
--- a/manual/release-notes.rst
+++ b/manual/release-notes.rst
@@ -99,7 +99,7 @@ For a detailed list of changes, please see the file
- The newer accessor methods return a boolean indicating whether
or not the object is of the expected type. If it is, a
- reference of the correct type is returned.
+ reference to a variable of the correct type is initialized.
In many cases, the new interfaces will enable more compact code
and will also never generate type warnings. Thanks to M. Holger