summaryrefslogtreecommitdiff
path: root/poppler-glib/src/layers_iter.hg
diff options
context:
space:
mode:
Diffstat (limited to 'poppler-glib/src/layers_iter.hg')
-rw-r--r--poppler-glib/src/layers_iter.hg15
1 files changed, 11 insertions, 4 deletions
diff --git a/poppler-glib/src/layers_iter.hg b/poppler-glib/src/layers_iter.hg
index 4080be4..64df78f 100644
--- a/poppler-glib/src/layers_iter.hg
+++ b/poppler-glib/src/layers_iter.hg
@@ -36,11 +36,18 @@ class LayersIter
_WRAP_METHOD(Glib::ustring get_title() const, poppler_layers_iter_get_title)
_WRAP_METHOD(bool next() const, poppler_layers_iter_next)
- /** Returns <tt>true</tt> if this LayersIter contains valid information
- * about layers in the associated document.
- * @return <tt>true</tt>, if the LayersIter is valid
+ /** This typedef is just to make it more obvious that
+ * our operator const void* should be used like operator bool().
*/
- inline operator bool() const { return gobj() != NULL; };
+ typedef const void* BoolExpr;
+
+ /** Tests whether the LayersIter is valid.
+ * For instance,
+ * @code
+ * if (layers_iter) do_something()
+ * @endcode
+ */
+ inline operator BoolExpr() const { return gobj() ? GINT_TO_POINTER(1) : 0; }
};
} // namespace Poppler