Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: core/fpdfapi/fpdf_edit/include/cpdf_creator.h

Issue 1805603002: core/include/fdpfapi cleanup Part I. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/fpdf_edit/fpdf_edit_image.cpp ('k') | core/fpdfapi/fpdf_font/fpdf_font.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_edit/include/cpdf_creator.h
diff --git a/core/include/fpdfapi/fpdf_serial.h b/core/fpdfapi/fpdf_edit/include/cpdf_creator.h
similarity index 93%
rename from core/include/fpdfapi/fpdf_serial.h
rename to core/fpdfapi/fpdf_edit/include/cpdf_creator.h
index cb0c290783aac7101c6a811f441576f986b60995..5b5671b7e9923c67e13e80e2db8105be613c8795 100644
--- a/core/include/fpdfapi/fpdf_serial.h
+++ b/core/fpdfapi/fpdf_edit/include/cpdf_creator.h
@@ -4,22 +4,23 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef CORE_INCLUDE_FPDFAPI_FPDF_SERIAL_H_
-#define CORE_INCLUDE_FPDFAPI_FPDF_SERIAL_H_
+#ifndef CORE_FPDFAPI_FPDF_EDIT_INCLUDE_CPDF_CREATOR_H_
+#define CORE_FPDFAPI_FPDF_EDIT_INCLUDE_CPDF_CREATOR_H_
#include "core/include/fpdfapi/fpdf_page.h"
#include "core/include/fpdfapi/fpdf_pageobj.h"
+class CPDF_Parser;
class CPDF_XRefStream;
class IPDF_CryptoHandler;
-CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& buf, const CPDF_Object* pObj);
-
#define FPDFCREATE_INCREMENTAL 1
#define FPDFCREATE_NO_ORIGINAL 2
#define FPDFCREATE_PROGRESSIVE 4
#define FPDFCREATE_OBJECTSTREAM 8
+CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& buf, const CPDF_Object* pObj);
+
class CPDF_Creator {
public:
CPDF_Creator(CPDF_Document* pDoc);
@@ -30,47 +31,26 @@ class CPDF_Creator {
int32_t Continue(IFX_Pause* pPause = NULL);
FX_BOOL SetFileVersion(int32_t fileVersion = 17);
- protected:
- CPDF_Document* m_pDocument;
-
- CPDF_Parser* m_pParser;
-
- FX_BOOL m_bCompress;
-
- FX_BOOL m_bSecurityChanged;
-
- CPDF_Dictionary* m_pEncryptDict;
- FX_DWORD m_dwEnryptObjNum;
- FX_BOOL m_bEncryptCloned;
-
- FX_BOOL m_bStandardSecurity;
-
- IPDF_CryptoHandler* m_pCryptoHandler;
- FX_BOOL m_bNewCrypto;
-
- FX_BOOL m_bEncryptMetadata;
-
- CPDF_Object* m_pMetadata;
-
- CPDF_XRefStream* m_pXRefStream;
-
- int32_t m_ObjectStreamSize;
+ private:
+ friend class CPDF_ObjectStream;
+ friend class CPDF_XRefStream;
- FX_DWORD m_dwLastObjNum;
bool Create(FX_DWORD flags);
void ResetStandardSecurity();
void Clear();
+
+ void InitOldObjNumOffsets();
+ void InitNewObjNumOffsets();
+ void InitID(FX_BOOL bDefault = TRUE);
+
+ void AppendNewObjNum(FX_DWORD objbum);
+ int32_t AppendObjectNumberToXRef(FX_DWORD objnum);
+
int32_t WriteDoc_Stage1(IFX_Pause* pPause);
int32_t WriteDoc_Stage2(IFX_Pause* pPause);
int32_t WriteDoc_Stage3(IFX_Pause* pPause);
int32_t WriteDoc_Stage4(IFX_Pause* pPause);
- CFX_FileBufferArchive m_File;
-
- FX_FILESIZE m_Offset;
- void InitOldObjNumOffsets();
- void InitNewObjNumOffsets();
- void AppendNewObjNum(FX_DWORD objbum);
int32_t WriteOldIndirectObject(FX_DWORD objnum);
int32_t WriteOldObjs(IFX_Pause* pPause);
int32_t WriteNewObjs(FX_BOOL bIncremental, IFX_Pause* pPause);
@@ -83,12 +63,28 @@ class CPDF_Creator {
int32_t WriteIndirectObjectToStream(FX_DWORD objnum,
const uint8_t* pBuffer,
FX_DWORD dwSize);
- int32_t AppendObjectNumberToXRef(FX_DWORD objnum);
- void InitID(FX_BOOL bDefault = TRUE);
+
int32_t WriteStream(const CPDF_Object* pStream,
FX_DWORD objnum,
IPDF_CryptoHandler* pCrypto);
+ CPDF_Document* m_pDocument;
+ CPDF_Parser* m_pParser;
+ FX_BOOL m_bCompress;
+ FX_BOOL m_bSecurityChanged;
+ CPDF_Dictionary* m_pEncryptDict;
+ FX_DWORD m_dwEnryptObjNum;
+ FX_BOOL m_bEncryptCloned;
+ FX_BOOL m_bStandardSecurity;
+ IPDF_CryptoHandler* m_pCryptoHandler;
+ FX_BOOL m_bNewCrypto;
+ FX_BOOL m_bEncryptMetadata;
+ CPDF_Object* m_pMetadata;
+ CPDF_XRefStream* m_pXRefStream;
+ int32_t m_ObjectStreamSize;
+ FX_DWORD m_dwLastObjNum;
+ CFX_FileBufferArchive m_File;
+ FX_FILESIZE m_Offset;
int32_t m_iStage;
FX_DWORD m_dwFlags;
FX_POSITION m_Pos;
@@ -97,9 +93,6 @@ class CPDF_Creator {
CFX_DWordArray m_NewObjNumArray;
CPDF_Array* m_pIDArray;
int32_t m_FileVersion;
-
- friend class CPDF_ObjectStream;
- friend class CPDF_XRefStream;
};
-#endif // CORE_INCLUDE_FPDFAPI_FPDF_SERIAL_H_
+#endif // CORE_FPDFAPI_FPDF_EDIT_INCLUDE_CPDF_CREATOR_H_
« no previous file with comments | « core/fpdfapi/fpdf_edit/fpdf_edit_image.cpp ('k') | core/fpdfapi/fpdf_font/fpdf_font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698