summaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFObjectHandle.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/QPDFObjectHandle.cc')
-rw-r--r--libqpdf/QPDFObjectHandle.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc
index 1a8e3223..f2c77dca 100644
--- a/libqpdf/QPDFObjectHandle.cc
+++ b/libqpdf/QPDFObjectHandle.cc
@@ -497,6 +497,34 @@ QPDFObjectHandle::isScalar()
isOperator() || isInlineImage()));
}
+bool
+QPDFObjectHandle::isNameAndEquals(std::string const& name)
+{
+ return isName() && (getName() == name);
+}
+
+bool
+QPDFObjectHandle::isDictionaryOfType(std::string const& type,
+ std::string const& subtype)
+{
+ if (isDictionary() && getKey("/Type").isNameAndEquals(type))
+ {
+ return (subtype == "") ||
+ (hasKey("/Subtype") && getKey("/Subtype").isNameAndEquals(subtype));
+ }
+ else
+ {
+ return false;
+ }
+}
+
+bool
+QPDFObjectHandle::isStreamOfType(std::string const& type,
+ std::string const& subtype)
+{
+ return isStream() && getDict().isDictionaryOfType(type, subtype);
+}
+
// Bool accessors
bool