OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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_SRC_FPDFAPI_FPDF_EDIT_EDITINT_H_ | 7 #ifndef CORE_SRC_FPDFAPI_FPDF_EDIT_EDITINT_H_ |
8 #define CORE_SRC_FPDFAPI_FPDF_EDIT_EDITINT_H_ | 8 #define CORE_SRC_FPDFAPI_FPDF_EDIT_EDITINT_H_ |
9 | 9 |
| 10 #include <vector> |
| 11 |
10 #include "core/include/fxcrt/fx_basic.h" | 12 #include "core/include/fxcrt/fx_basic.h" |
11 #include "core/include/fxcrt/fx_stream.h" | 13 #include "core/include/fxcrt/fx_stream.h" |
12 #include "core/include/fxcrt/fx_system.h" | 14 #include "core/include/fxcrt/fx_system.h" |
13 | 15 |
14 class CPDF_Creator; | 16 class CPDF_Creator; |
15 class CPDF_Object; | 17 class CPDF_Object; |
16 | 18 |
17 class CPDF_ObjectStream { | 19 class CPDF_ObjectStream { |
18 public: | 20 public: |
19 CPDF_ObjectStream(); | 21 CPDF_ObjectStream(); |
(...skipping 11 matching lines...) Expand all Loading... |
31 | 33 |
32 CFX_ByteTextBuf m_Buffer; | 34 CFX_ByteTextBuf m_Buffer; |
33 FX_DWORD m_dwObjNum; | 35 FX_DWORD m_dwObjNum; |
34 int32_t m_index; | 36 int32_t m_index; |
35 | 37 |
36 protected: | 38 protected: |
37 CFX_DWordArray m_OffsetArray; | 39 CFX_DWordArray m_OffsetArray; |
38 }; | 40 }; |
39 class CPDF_XRefStream { | 41 class CPDF_XRefStream { |
40 public: | 42 public: |
| 43 struct Index { |
| 44 FX_DWORD objnum; |
| 45 FX_DWORD count; |
| 46 }; |
| 47 |
41 CPDF_XRefStream(); | 48 CPDF_XRefStream(); |
42 | 49 |
43 FX_BOOL Start(); | 50 FX_BOOL Start(); |
44 | |
45 int32_t CompressIndirectObject(FX_DWORD dwObjNum, | 51 int32_t CompressIndirectObject(FX_DWORD dwObjNum, |
46 const CPDF_Object* pObj, | 52 const CPDF_Object* pObj, |
47 CPDF_Creator* pCreator); | 53 CPDF_Creator* pCreator); |
48 | |
49 int32_t CompressIndirectObject(FX_DWORD dwObjNum, | 54 int32_t CompressIndirectObject(FX_DWORD dwObjNum, |
50 const uint8_t* pBuffer, | 55 const uint8_t* pBuffer, |
51 FX_DWORD dwSize, | 56 FX_DWORD dwSize, |
52 CPDF_Creator* pCreator); | 57 CPDF_Creator* pCreator); |
53 | |
54 FX_BOOL End(CPDF_Creator* pCreator, FX_BOOL bEOF = FALSE); | 58 FX_BOOL End(CPDF_Creator* pCreator, FX_BOOL bEOF = FALSE); |
55 FX_BOOL AddObjectNumberToIndexArray(FX_DWORD objnum); | 59 void AddObjectNumberToIndexArray(FX_DWORD objnum); |
56 FX_BOOL EndXRefStream(CPDF_Creator* pCreator); | 60 FX_BOOL EndXRefStream(CPDF_Creator* pCreator); |
57 | 61 |
58 CFX_DWordArray m_IndexArray; | 62 std::vector<Index> m_IndexArray; |
59 | |
60 FX_FILESIZE m_PrevOffset; | 63 FX_FILESIZE m_PrevOffset; |
61 FX_DWORD m_dwTempObjNum; | 64 FX_DWORD m_dwTempObjNum; |
62 | 65 |
63 protected: | 66 protected: |
64 int32_t EndObjectStream(CPDF_Creator* pCreator, FX_BOOL bEOF = TRUE); | 67 int32_t EndObjectStream(CPDF_Creator* pCreator, FX_BOOL bEOF = TRUE); |
65 FX_BOOL GenerateXRefStream(CPDF_Creator* pCreator, FX_BOOL bEOF); | 68 FX_BOOL GenerateXRefStream(CPDF_Creator* pCreator, FX_BOOL bEOF); |
66 int32_t m_iSeg; | 69 size_t m_iSeg; |
67 CPDF_ObjectStream m_ObjStream; | 70 CPDF_ObjectStream m_ObjStream; |
68 CFX_ByteTextBuf m_Buffer; | 71 CFX_ByteTextBuf m_Buffer; |
69 }; | 72 }; |
70 | 73 |
71 #endif // CORE_SRC_FPDFAPI_FPDF_EDIT_EDITINT_H_ | 74 #endif // CORE_SRC_FPDFAPI_FPDF_EDIT_EDITINT_H_ |
OLD | NEW |