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_FPDFAPI_FPDF_EDIT_EDITINT_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_EDIT_EDITINT_H_ |
8 #define CORE_FPDFAPI_FPDF_EDIT_EDITINT_H_ | 8 #define CORE_FPDFAPI_FPDF_EDIT_EDITINT_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "core/fxcrt/include/fx_basic.h" | 12 #include "core/fxcrt/include/fx_basic.h" |
13 #include "core/fxcrt/include/fx_stream.h" | 13 #include "core/fxcrt/include/fx_stream.h" |
14 #include "core/fxcrt/include/fx_system.h" | 14 #include "core/fxcrt/include/fx_system.h" |
15 | 15 |
16 class CPDF_Creator; | 16 class CPDF_Creator; |
17 class CPDF_Object; | 17 class CPDF_Object; |
18 | 18 |
19 class CPDF_ObjectStream { | 19 class CPDF_ObjectStream { |
20 public: | 20 public: |
| 21 struct Item { |
| 22 uint32_t objnum; |
| 23 FX_STRSIZE offset; |
| 24 }; |
| 25 |
21 CPDF_ObjectStream(); | 26 CPDF_ObjectStream(); |
22 | 27 |
23 FX_BOOL Start(); | 28 void Start(); |
| 29 FX_FILESIZE End(CPDF_Creator* pCreator); |
| 30 void CompressIndirectObject(uint32_t dwObjNum, const CPDF_Object* pObj); |
| 31 void CompressIndirectObject(uint32_t dwObjNum, |
| 32 const uint8_t* pBuffer, |
| 33 uint32_t dwSize); |
24 | 34 |
25 int32_t CompressIndirectObject(uint32_t dwObjNum, const CPDF_Object* pObj); | 35 std::vector<Item> m_Items; |
26 int32_t CompressIndirectObject(uint32_t dwObjNum, | |
27 const uint8_t* pBuffer, | |
28 uint32_t dwSize); | |
29 | |
30 FX_FILESIZE End(CPDF_Creator* pCreator); | |
31 | |
32 CFX_ArrayTemplate<uint32_t> m_ObjNumArray; | |
33 | |
34 CFX_ByteTextBuf m_Buffer; | 36 CFX_ByteTextBuf m_Buffer; |
35 uint32_t m_dwObjNum; | 37 uint32_t m_dwObjNum; |
36 int32_t m_index; | 38 int32_t m_index; |
| 39 }; |
37 | 40 |
38 protected: | |
39 CFX_ArrayTemplate<uint32_t> m_OffsetArray; | |
40 }; | |
41 class CPDF_XRefStream { | 41 class CPDF_XRefStream { |
42 public: | 42 public: |
43 struct Index { | 43 struct Index { |
44 uint32_t objnum; | 44 uint32_t objnum; |
45 uint32_t count; | 45 uint32_t count; |
46 }; | 46 }; |
47 | 47 |
48 CPDF_XRefStream(); | 48 CPDF_XRefStream(); |
49 | 49 |
50 FX_BOOL Start(); | 50 FX_BOOL Start(); |
(...skipping 14 matching lines...) Expand all Loading... |
65 | 65 |
66 protected: | 66 protected: |
67 int32_t EndObjectStream(CPDF_Creator* pCreator, FX_BOOL bEOF = TRUE); | 67 int32_t EndObjectStream(CPDF_Creator* pCreator, FX_BOOL bEOF = TRUE); |
68 FX_BOOL GenerateXRefStream(CPDF_Creator* pCreator, FX_BOOL bEOF); | 68 FX_BOOL GenerateXRefStream(CPDF_Creator* pCreator, FX_BOOL bEOF); |
69 size_t m_iSeg; | 69 size_t m_iSeg; |
70 CPDF_ObjectStream m_ObjStream; | 70 CPDF_ObjectStream m_ObjStream; |
71 CFX_ByteTextBuf m_Buffer; | 71 CFX_ByteTextBuf m_Buffer; |
72 }; | 72 }; |
73 | 73 |
74 #endif // CORE_FPDFAPI_FPDF_EDIT_EDITINT_H_ | 74 #endif // CORE_FPDFAPI_FPDF_EDIT_EDITINT_H_ |
OLD | NEW |