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

Side by Side Diff: core/fpdfapi/fpdf_parser/include/cpdf_parser.h

Issue 2136683002: Use smart pointers for class owned member variables (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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_PARSER_INCLUDE_CPDF_PARSER_H_ 7 #ifndef CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_PARSER_H_
8 #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_PARSER_H_ 8 #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_PARSER_H_
9 9
10 #include <map> 10 #include <map>
(...skipping 26 matching lines...) Expand all
37 CPDF_Parser(); 37 CPDF_Parser();
38 ~CPDF_Parser(); 38 ~CPDF_Parser();
39 39
40 Error StartParse(IFX_FileRead* pFile); 40 Error StartParse(IFX_FileRead* pFile);
41 uint32_t GetPermissions() const; 41 uint32_t GetPermissions() const;
42 42
43 void SetPassword(const FX_CHAR* password) { m_Password = password; } 43 void SetPassword(const FX_CHAR* password) { m_Password = password; }
44 CFX_ByteString GetPassword() { return m_Password; } 44 CFX_ByteString GetPassword() { return m_Password; }
45 CPDF_Dictionary* GetTrailer() const { return m_pTrailer; } 45 CPDF_Dictionary* GetTrailer() const { return m_pTrailer; }
46 FX_FILESIZE GetLastXRefOffset() const { return m_LastXRefOffset; } 46 FX_FILESIZE GetLastXRefOffset() const { return m_LastXRefOffset; }
47 CPDF_Document* GetDocument() const { return m_pDocument; } 47 CPDF_Document* GetDocument() const { return m_pDocument.get(); }
48 48
49 uint32_t GetRootObjNum(); 49 uint32_t GetRootObjNum();
50 uint32_t GetInfoObjNum(); 50 uint32_t GetInfoObjNum();
51 CPDF_Array* GetIDArray(); 51 CPDF_Array* GetIDArray();
52 52
53 CPDF_Dictionary* GetEncryptDict() const { return m_pEncryptDict; } 53 CPDF_Dictionary* GetEncryptDict() const { return m_pEncryptDict; }
54 54
55 CPDF_Object* ParseIndirectObject(CPDF_IndirectObjectHolder* pObjList, 55 CPDF_Object* ParseIndirectObject(CPDF_IndirectObjectHolder* pObjList,
56 uint32_t objnum); 56 uint32_t objnum);
57 57
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 FX_BOOL LoadLinearizedAllCrossRefV5(FX_FILESIZE pos); 111 FX_BOOL LoadLinearizedAllCrossRefV5(FX_FILESIZE pos);
112 Error LoadLinearizedMainXRefTable(); 112 Error LoadLinearizedMainXRefTable();
113 CPDF_StreamAcc* GetObjectStream(uint32_t number); 113 CPDF_StreamAcc* GetObjectStream(uint32_t number);
114 FX_BOOL IsLinearizedFile(IFX_FileRead* pFileAccess, uint32_t offset); 114 FX_BOOL IsLinearizedFile(IFX_FileRead* pFileAccess, uint32_t offset);
115 void SetEncryptDictionary(CPDF_Dictionary* pDict); 115 void SetEncryptDictionary(CPDF_Dictionary* pDict);
116 void ShrinkObjectMap(uint32_t size); 116 void ShrinkObjectMap(uint32_t size);
117 // A simple check whether the cross reference table matches with 117 // A simple check whether the cross reference table matches with
118 // the objects. 118 // the objects.
119 bool VerifyCrossRefV4(); 119 bool VerifyCrossRefV4();
120 120
121 CPDF_Document* m_pDocument; 121 std::unique_ptr<CPDF_Document> m_pDocument;
122 std::unique_ptr<CPDF_SyntaxParser> m_pSyntax; 122 std::unique_ptr<CPDF_SyntaxParser> m_pSyntax;
123 bool m_bOwnFileRead; 123 bool m_bOwnFileRead;
124 int m_FileVersion; 124 int m_FileVersion;
125 CPDF_Dictionary* m_pTrailer; 125 CPDF_Dictionary* m_pTrailer;
126 CPDF_Dictionary* m_pEncryptDict; 126 CPDF_Dictionary* m_pEncryptDict;
127 FX_FILESIZE m_LastXRefOffset; 127 FX_FILESIZE m_LastXRefOffset;
128 FX_BOOL m_bXRefStream; 128 FX_BOOL m_bXRefStream;
129 std::unique_ptr<CPDF_SecurityHandler> m_pSecurityHandler; 129 std::unique_ptr<CPDF_SecurityHandler> m_pSecurityHandler;
130 CFX_ByteString m_bsRecipient; 130 CFX_ByteString m_bsRecipient;
131 CFX_ByteString m_FilePath; 131 CFX_ByteString m_FilePath;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 kPostObjNum, 167 kPostObjNum,
168 kGenNum, 168 kGenNum,
169 kPostGenNum, 169 kPostGenNum,
170 kTrailer, 170 kTrailer,
171 kBeginObj, 171 kBeginObj,
172 kEndObj 172 kEndObj
173 }; 173 };
174 }; 174 };
175 175
176 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_PARSER_H_ 176 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_PARSER_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_parser.cpp ('k') | core/fpdfapi/fpdf_render/fpdf_render_image.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698