diff options
Diffstat (limited to 'core/include/fpdfapi/fpdf_objects.h')
-rw-r--r-- | core/include/fpdfapi/fpdf_objects.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/include/fpdfapi/fpdf_objects.h b/core/include/fpdfapi/fpdf_objects.h index 4141ec854a..a52132f6b9 100644 --- a/core/include/fpdfapi/fpdf_objects.h +++ b/core/include/fpdfapi/fpdf_objects.h @@ -78,8 +78,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; @@ -117,6 +121,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); } |