Kill CFX_ArchiveLoader / CFX_ArchiveSaver and subclasses
[pdfium.git] / core / include / fpdfapi / fpdf_serial.h
index e4a0aec..cccb3ab 100644 (file)
 class CPDF_ObjectStream;
 class CPDF_XRefStream;
 CFX_ByteTextBuf& operator << (CFX_ByteTextBuf& buf, const CPDF_Object* pObj);
-class CPDF_ObjArchiveSaver : public CFX_ArchiveSaver
-{
-public:
-
-    friend CPDF_ObjArchiveSaver&       operator << (CPDF_ObjArchiveSaver& ar, const CPDF_Object* pObj);
-protected:
-
-    CFX_MapPtrToPtr                    m_ObjectMap;
-};
-class CPDF_ObjArchiveLoader : public CFX_ArchiveLoader
-{
-public:
-
-    CPDF_ObjArchiveLoader(FX_LPCBYTE pData, FX_DWORD dwSize) : CFX_ArchiveLoader(pData, dwSize),
-        m_IndirectObjects(NULL) {}
-
-    friend CPDF_ObjArchiveLoader&      operator >> (CPDF_ObjArchiveLoader& ar, CPDF_Object*& pObj);
-protected:
-
-    CPDF_IndirectObjects               m_IndirectObjects;
-};
-class CPDF_PageArchiveSaver : public CPDF_ObjArchiveSaver
-{
-public:
-
-    CPDF_PageArchiveSaver(CPDF_PageObjects* pPageObjs);
-
-    friend CPDF_PageArchiveSaver&      operator << (CPDF_PageArchiveSaver& ar, CPDF_PageObject* pObj);
-
-
-
-    friend CPDF_PageArchiveSaver&      operator << (CPDF_PageArchiveSaver& ar, CPDF_ClipPath clip_path);
-
-    friend CPDF_PageArchiveSaver&      operator << (CPDF_PageArchiveSaver& ar, CPDF_GraphState graph_state);
-
-    friend CPDF_PageArchiveSaver&      operator << (CPDF_PageArchiveSaver& ar, CPDF_TextState text_state);
-
-    friend CPDF_PageArchiveSaver&      operator << (CPDF_PageArchiveSaver& ar, CPDF_ColorState color_state);
-
-    friend CPDF_PageArchiveSaver&      operator << (CPDF_PageArchiveSaver& ar, CPDF_GeneralState general_state);
-
-protected:
-
-    CPDF_ClipPath              m_LastClipPath;
-
-    CPDF_GraphState            m_LastGraphState;
-
-    CPDF_ColorState            m_LastColorState;
-
-    CPDF_TextState             m_LastTextState;
-
-    CPDF_GeneralState  m_LastGeneralState;
-
-    CPDF_PageObjects*  m_pCurPage;
-};
-class CPDF_PageArchiveLoader : public CPDF_ObjArchiveLoader
-{
-public:
-
-    CPDF_PageArchiveLoader(CPDF_PageObjects* pPageObjs, FX_LPCBYTE pData, FX_DWORD dwSize);
-
-    friend CPDF_PageArchiveLoader&     operator >> (CPDF_PageArchiveLoader& ar, CPDF_PageObject*& pObj);
-
-
-
-    friend CPDF_PageArchiveLoader&     operator >> (CPDF_PageArchiveLoader& ar, CPDF_ClipPath& clip_path);
-
-    friend CPDF_PageArchiveLoader&     operator >> (CPDF_PageArchiveLoader& ar, CPDF_GraphState& graph_state);
-
-    friend CPDF_PageArchiveLoader&     operator >> (CPDF_PageArchiveLoader& ar, CPDF_TextState& text_state);
-
-    friend CPDF_PageArchiveLoader&     operator >> (CPDF_PageArchiveLoader& ar, CPDF_ColorState& color_state);
-
-    friend CPDF_PageArchiveLoader&     operator >> (CPDF_PageArchiveLoader& ar, CPDF_GeneralState& general_state);
-
-protected:
-    void                               PostProcColor(CPDF_Color& color);
-
-    CPDF_Object*               AddResource(CPDF_Object* pSrcObj, FX_LPCSTR type);
-
-    CPDF_ClipPath              m_LastClipPath;
-
-    CPDF_GraphState            m_LastGraphState;
-
-    CPDF_ColorState            m_LastColorState;
-
-    CPDF_TextState             m_LastTextState;
-
-    CPDF_GeneralState  m_LastGeneralState;
-
-    CPDF_PageObjects*  m_pCurPage;
-
-    CFX_MapPtrToPtr            m_ObjectMap;
-};
 #define FPDFCREATE_INCREMENTAL         1
 #define FPDFCREATE_NO_ORIGINAL         2
 #define FPDFCREATE_PROGRESSIVE         4
 #define FPDFCREATE_OBJECTSTREAM                8
-class CPDF_Creator 
+class CPDF_Creator
 {
 public:
 
@@ -121,9 +27,9 @@ public:
 
     void                               RemoveSecurity();
 
-    FX_BOOL                            Create(FX_LPCWSTR filename, FX_DWORD flags = 0);
+    FX_BOOL                            Create(const FX_WCHAR* filename, FX_DWORD flags = 0);
 
-    FX_BOOL                            Create(FX_LPCSTR filename, FX_DWORD flags = 0);
+    FX_BOOL                            Create(const FX_CHAR* filename, FX_DWORD flags = 0);
 
     FX_BOOL                            Create(IFX_StreamWrite* pFile, FX_DWORD flags = 0);
 
@@ -179,7 +85,7 @@ protected:
     int32_t                    WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, FX_BOOL bEncrypt = TRUE);
     int32_t                    WriteIndirectObjectToStream(const CPDF_Object* pObj);
     int32_t                    WriteIndirectObj(FX_DWORD objnum, const CPDF_Object* pObj);
-    int32_t                    WriteIndirectObjectToStream(FX_DWORD objnum, FX_LPCBYTE pBuffer, FX_DWORD dwSize);
+    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, CPDF_CryptoHandler* pCrypto);