summaryrefslogtreecommitdiff
path: root/core/include/fpdfapi/fpdf_objects.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/include/fpdfapi/fpdf_objects.h')
-rw-r--r--core/include/fpdfapi/fpdf_objects.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/include/fpdfapi/fpdf_objects.h b/core/include/fpdfapi/fpdf_objects.h
index d64a0924f8..a5f52832a1 100644
--- a/core/include/fpdfapi/fpdf_objects.h
+++ b/core/include/fpdfapi/fpdf_objects.h
@@ -80,8 +80,12 @@ class CPDF_Object {
FX_BOOL IsModified() const { return FALSE; }
+ bool IsBoolean() const { return m_Type == PDFOBJ_BOOLEAN; }
bool IsDictionary() const { return m_Type == PDFOBJ_DICTIONARY; }
+ CPDF_Boolean* AsBoolean();
+ const CPDF_Boolean* AsBoolean() const;
+
CPDF_Dictionary* AsDictionary();
const CPDF_Dictionary* AsDictionary() const;
@@ -119,6 +123,13 @@ class CPDF_Boolean : public CPDF_Object {
FX_BOOL m_bValue;
friend class CPDF_Object;
};
+inline CPDF_Boolean* ToBoolean(CPDF_Object* obj) {
+ return obj ? obj->AsBoolean() : nullptr;
+}
+inline const CPDF_Boolean* ToBoolean(const CPDF_Object* obj) {
+ return obj ? obj->AsBoolean() : nullptr;
+}
+
class CPDF_Number : public CPDF_Object {
public:
static CPDF_Number* Create(int value) { return new CPDF_Number(value); }