summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2021-02-22 17:02:18 +0100
committerJay Berkenbilt <ejb@ql.org>2021-02-22 17:05:39 +0100
commit7b3cbacf5dc78b6f2b57204796f7dd0880a68b66 (patch)
treee84bf6c5d26ffd3d933b4af88bd2937589b2c144 /include
parenta9ae8cadc66daf631f6cbfe7fc3c7c602ac665d8 (diff)
downloadqpdf-7b3cbacf5dc78b6f2b57204796f7dd0880a68b66.tar.zst
Change from QPDF{Array,Dict}Items to aitems() and ditems()
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QPDFObjectHandle.hh35
1 files changed, 29 insertions, 6 deletions
diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh
index dc883102..356eb4e2 100644
--- a/include/qpdf/QPDFObjectHandle.hh
+++ b/include/qpdf/QPDFObjectHandle.hh
@@ -659,8 +659,19 @@ class QPDFObjectHandle
QPDF_DLL
std::string getInlineImageValue();
- // Methods for array objects; see also name and array objects. See
- // also QPDFArrayItems later in this file.
+ // Methods for array objects; see also name and array objects.
+
+ // Return an object that enables iteration over members. You can
+ // do
+ //
+ // for (auto iter: obj.aitems())
+ // {
+ // // iter is an array element
+ // }
+ class QPDFArrayItems;
+ QPDF_DLL
+ QPDFArrayItems aitems();
+
QPDF_DLL
int getArrayNItems();
QPDF_DLL
@@ -684,8 +695,20 @@ class QPDFObjectHandle
QPDF_DLL
Matrix getArrayAsMatrix();
- // Methods for dictionary objects. See also QPDFDictItems later in
- // this file.
+ // Methods for dictionary objects.
+
+ // Return an object that enables iteration over members. You can
+ // do
+ //
+ // for (auto iter: obj.ditems())
+ // {
+ // // iter.first is the key
+ // // iter.second is the value
+ // }
+ class QPDFDictItems;
+ QPDF_DLL
+ QPDFDictItems ditems();
+
QPDF_DLL
bool hasKey(std::string const&);
QPDF_DLL
@@ -1288,7 +1311,7 @@ class QPDFObjectHandle
bool reserved;
};
-class QPDFDictItems
+class QPDFObjectHandle::QPDFDictItems
{
// This class allows C++-style iteration, including range-for
// iteration, around dictionaries. You can write
@@ -1379,7 +1402,7 @@ class QPDFDictItems
QPDFObjectHandle oh;
};
-class QPDFArrayItems
+class QPDFObjectHandle::QPDFArrayItems
{
// This class allows C++-style iteration, including range-for
// iteration, around arrays. You can write