OLD | NEW |
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_PARSER_CPDF_SYNTAX_PARSER_H_ | 7 #ifndef CORE_FPDFAPI_PARSER_CPDF_SYNTAX_PARSER_H_ |
8 #define CORE_FPDFAPI_PARSER_CPDF_SYNTAX_PARSER_H_ | 8 #define CORE_FPDFAPI_PARSER_CPDF_SYNTAX_PARSER_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 bool GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch); | 68 bool GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch); |
69 void GetNextWordInternal(bool* bIsNumber); | 69 void GetNextWordInternal(bool* bIsNumber); |
70 bool IsWholeWord(FX_FILESIZE startpos, | 70 bool IsWholeWord(FX_FILESIZE startpos, |
71 FX_FILESIZE limit, | 71 FX_FILESIZE limit, |
72 const CFX_ByteStringC& tag, | 72 const CFX_ByteStringC& tag, |
73 bool checkKeyword); | 73 bool checkKeyword); |
74 | 74 |
75 CFX_ByteString ReadString(); | 75 CFX_ByteString ReadString(); |
76 CFX_ByteString ReadHexString(); | 76 CFX_ByteString ReadHexString(); |
77 unsigned int ReadEOLMarkers(FX_FILESIZE pos); | 77 unsigned int ReadEOLMarkers(FX_FILESIZE pos); |
78 std::unique_ptr<CPDF_Stream> ReadStream(CPDF_Dictionary* pDict, | 78 std::unique_ptr<CPDF_Stream> ReadStream( |
79 uint32_t objnum, | 79 std::unique_ptr<CPDF_Dictionary> pDict, |
80 uint32_t gennum); | 80 uint32_t objnum, |
| 81 uint32_t gennum); |
81 | 82 |
82 inline bool CheckPosition(FX_FILESIZE pos) { | 83 inline bool CheckPosition(FX_FILESIZE pos) { |
83 return m_BufOffset >= pos || | 84 return m_BufOffset >= pos || |
84 static_cast<FX_FILESIZE>(m_BufOffset + m_BufSize) <= pos; | 85 static_cast<FX_FILESIZE>(m_BufOffset + m_BufSize) <= pos; |
85 } | 86 } |
86 | 87 |
87 FX_FILESIZE m_Pos; | 88 FX_FILESIZE m_Pos; |
88 uint32_t m_MetadataObjnum; | 89 uint32_t m_MetadataObjnum; |
89 IFX_SeekableReadStream* m_pFileAccess; | 90 IFX_SeekableReadStream* m_pFileAccess; |
90 FX_FILESIZE m_HeaderOffset; | 91 FX_FILESIZE m_HeaderOffset; |
91 FX_FILESIZE m_FileLen; | 92 FX_FILESIZE m_FileLen; |
92 uint8_t* m_pFileBuf; | 93 uint8_t* m_pFileBuf; |
93 uint32_t m_BufSize; | 94 uint32_t m_BufSize; |
94 FX_FILESIZE m_BufOffset; | 95 FX_FILESIZE m_BufOffset; |
95 std::unique_ptr<CPDF_CryptoHandler> m_pCryptoHandler; | 96 std::unique_ptr<CPDF_CryptoHandler> m_pCryptoHandler; |
96 uint8_t m_WordBuffer[257]; | 97 uint8_t m_WordBuffer[257]; |
97 uint32_t m_WordSize; | 98 uint32_t m_WordSize; |
98 CFX_WeakPtr<CFX_ByteStringPool> m_pPool; | 99 CFX_WeakPtr<CFX_ByteStringPool> m_pPool; |
99 }; | 100 }; |
100 | 101 |
101 #endif // CORE_FPDFAPI_PARSER_CPDF_SYNTAX_PARSER_H_ | 102 #endif // CORE_FPDFAPI_PARSER_CPDF_SYNTAX_PARSER_H_ |
OLD | NEW |