| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
| 6 | |
| 7 #ifndef CORE_SRC_FPDFAPI_FPDF_EDIT_EDITINT_H_ | |
| 8 #define CORE_SRC_FPDFAPI_FPDF_EDIT_EDITINT_H_ | |
| 9 | |
| 10 #include <vector> | |
| 11 | |
| 12 #include "core/include/fxcrt/fx_basic.h" | |
| 13 #include "core/include/fxcrt/fx_stream.h" | |
| 14 #include "core/include/fxcrt/fx_system.h" | |
| 15 | |
| 16 class CPDF_Creator; | |
| 17 class CPDF_Object; | |
| 18 | |
| 19 class CPDF_ObjectStream { | |
| 20 public: | |
| 21 CPDF_ObjectStream(); | |
| 22 | |
| 23 FX_BOOL Start(); | |
| 24 | |
| 25 int32_t CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object* pObj); | |
| 26 int32_t CompressIndirectObject(FX_DWORD dwObjNum, | |
| 27 const uint8_t* pBuffer, | |
| 28 FX_DWORD dwSize); | |
| 29 | |
| 30 FX_FILESIZE End(CPDF_Creator* pCreator); | |
| 31 | |
| 32 CFX_DWordArray m_ObjNumArray; | |
| 33 | |
| 34 CFX_ByteTextBuf m_Buffer; | |
| 35 FX_DWORD m_dwObjNum; | |
| 36 int32_t m_index; | |
| 37 | |
| 38 protected: | |
| 39 CFX_DWordArray m_OffsetArray; | |
| 40 }; | |
| 41 class CPDF_XRefStream { | |
| 42 public: | |
| 43 struct Index { | |
| 44 FX_DWORD objnum; | |
| 45 FX_DWORD count; | |
| 46 }; | |
| 47 | |
| 48 CPDF_XRefStream(); | |
| 49 | |
| 50 FX_BOOL Start(); | |
| 51 int32_t CompressIndirectObject(FX_DWORD dwObjNum, | |
| 52 const CPDF_Object* pObj, | |
| 53 CPDF_Creator* pCreator); | |
| 54 int32_t CompressIndirectObject(FX_DWORD dwObjNum, | |
| 55 const uint8_t* pBuffer, | |
| 56 FX_DWORD dwSize, | |
| 57 CPDF_Creator* pCreator); | |
| 58 FX_BOOL End(CPDF_Creator* pCreator, FX_BOOL bEOF = FALSE); | |
| 59 void AddObjectNumberToIndexArray(FX_DWORD objnum); | |
| 60 FX_BOOL EndXRefStream(CPDF_Creator* pCreator); | |
| 61 | |
| 62 std::vector<Index> m_IndexArray; | |
| 63 FX_FILESIZE m_PrevOffset; | |
| 64 FX_DWORD m_dwTempObjNum; | |
| 65 | |
| 66 protected: | |
| 67 int32_t EndObjectStream(CPDF_Creator* pCreator, FX_BOOL bEOF = TRUE); | |
| 68 FX_BOOL GenerateXRefStream(CPDF_Creator* pCreator, FX_BOOL bEOF); | |
| 69 size_t m_iSeg; | |
| 70 CPDF_ObjectStream m_ObjStream; | |
| 71 CFX_ByteTextBuf m_Buffer; | |
| 72 }; | |
| 73 | |
| 74 #endif // CORE_SRC_FPDFAPI_FPDF_EDIT_EDITINT_H_ | |
| OLD | NEW |