| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef CORE_FPDFAPI_PAGE_CPDF_STREAMPARSER_H_ | 7 #ifndef CORE_FPDFAPI_PAGE_CPDF_STREAMPARSER_H_ |
| 8 #define CORE_FPDFAPI_PAGE_CPDF_STREAMPARSER_H_ | 8 #define CORE_FPDFAPI_PAGE_CPDF_STREAMPARSER_H_ |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 const CFX_WeakPtr<CFX_ByteStringPool>& pPool); | 27 const CFX_WeakPtr<CFX_ByteStringPool>& pPool); |
| 28 ~CPDF_StreamParser(); | 28 ~CPDF_StreamParser(); |
| 29 | 29 |
| 30 SyntaxType ParseNextElement(); | 30 SyntaxType ParseNextElement(); |
| 31 const uint8_t* GetWordBuf() const { return m_WordBuffer; } | 31 const uint8_t* GetWordBuf() const { return m_WordBuffer; } |
| 32 uint32_t GetWordSize() const { return m_WordSize; } | 32 uint32_t GetWordSize() const { return m_WordSize; } |
| 33 uint32_t GetPos() const { return m_Pos; } | 33 uint32_t GetPos() const { return m_Pos; } |
| 34 void SetPos(uint32_t pos) { m_Pos = pos; } | 34 void SetPos(uint32_t pos) { m_Pos = pos; } |
| 35 std::unique_ptr<CPDF_Object> GetObject() { return std::move(m_pLastObj); } | 35 std::unique_ptr<CPDF_Object> GetObject() { return std::move(m_pLastObj); } |
| 36 std::unique_ptr<CPDF_Object> ReadNextObject(bool bAllowNestedArray, | 36 std::unique_ptr<CPDF_Object> ReadNextObject(bool bAllowNestedArray, |
| 37 uint32_t dwInArrayLevel); | 37 bool bInArray, |
| 38 uint32_t dwRecursionLevel); |
| 38 std::unique_ptr<CPDF_Stream> ReadInlineStream( | 39 std::unique_ptr<CPDF_Stream> ReadInlineStream( |
| 39 CPDF_Document* pDoc, | 40 CPDF_Document* pDoc, |
| 40 std::unique_ptr<CPDF_Dictionary> pDict, | 41 std::unique_ptr<CPDF_Dictionary> pDict, |
| 41 CPDF_Object* pCSObj); | 42 CPDF_Object* pCSObj); |
| 42 | 43 |
| 43 private: | 44 private: |
| 44 friend class cpdf_streamparser_ReadHexString_Test; | 45 friend class cpdf_streamparser_ReadHexString_Test; |
| 45 | 46 |
| 46 void GetNextWord(bool& bIsNumber); | 47 void GetNextWord(bool& bIsNumber); |
| 47 CFX_ByteString ReadString(); | 48 CFX_ByteString ReadString(); |
| 48 CFX_ByteString ReadHexString(); | 49 CFX_ByteString ReadHexString(); |
| 49 bool PositionIsInBounds() const; | 50 bool PositionIsInBounds() const; |
| 50 | 51 |
| 51 const uint8_t* m_pBuf; | 52 const uint8_t* m_pBuf; |
| 52 uint32_t m_Size; // Length in bytes of m_pBuf. | 53 uint32_t m_Size; // Length in bytes of m_pBuf. |
| 53 uint32_t m_Pos; // Current byte position within m_pBuf. | 54 uint32_t m_Pos; // Current byte position within m_pBuf. |
| 54 uint8_t m_WordBuffer[256]; | 55 uint8_t m_WordBuffer[256]; |
| 55 uint32_t m_WordSize; | 56 uint32_t m_WordSize; |
| 56 std::unique_ptr<CPDF_Object> m_pLastObj; | 57 std::unique_ptr<CPDF_Object> m_pLastObj; |
| 57 CFX_WeakPtr<CFX_ByteStringPool> m_pPool; | 58 CFX_WeakPtr<CFX_ByteStringPool> m_pPool; |
| 58 }; | 59 }; |
| 59 | 60 |
| 60 #endif // CORE_FPDFAPI_PAGE_CPDF_STREAMPARSER_H_ | 61 #endif // CORE_FPDFAPI_PAGE_CPDF_STREAMPARSER_H_ |
| OLD | NEW |