Index: core/include/fpdfapi/fpdf_objects.h |
diff --git a/core/include/fpdfapi/fpdf_objects.h b/core/include/fpdfapi/fpdf_objects.h |
index dbd44952aed8f84d490d571e9174dc5c42951c48..332d3ff4853a1b1de789ca1b32024d16e183bd4c 100644 |
--- a/core/include/fpdfapi/fpdf_objects.h |
+++ b/core/include/fpdfapi/fpdf_objects.h |
@@ -86,6 +86,7 @@ class CPDF_Object { |
bool IsDictionary() const { return m_Type == PDFOBJ_DICTIONARY; } |
bool IsName() const { return m_Type == PDFOBJ_NAME; } |
bool IsNumber() const { return m_Type == PDFOBJ_NUMBER; } |
+ bool IsStream() const { return m_Type == PDFOBJ_STREAM; } |
bool IsString() const { return m_Type == PDFOBJ_STRING; } |
CPDF_Array* AsArray(); |
@@ -103,6 +104,9 @@ class CPDF_Object { |
CPDF_Number* AsNumber(); |
const CPDF_Number* AsNumber() const; |
+ CPDF_Stream* AsStream(); |
+ const CPDF_Stream* AsStream() const; |
+ |
CPDF_String* AsString(); |
const CPDF_String* AsString() const; |
@@ -527,6 +531,13 @@ class CPDF_Stream : public CPDF_Object { |
friend class CPDF_StreamAcc; |
friend class CPDF_AttachmentAcc; |
}; |
+inline CPDF_Stream* ToStream(CPDF_Object* obj) { |
+ return obj ? obj->AsStream() : nullptr; |
+} |
+inline const CPDF_Stream* ToStream(const CPDF_Object* obj) { |
+ return obj ? obj->AsStream() : nullptr; |
+} |
+ |
class CPDF_StreamAcc { |
public: |
CPDF_StreamAcc(); |