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 XFA_FXFA_XFA_CHECKSUM_H_ | 7 #ifndef XFA_FXFA_XFA_CHECKSUM_H_ |
8 #define XFA_FXFA_XFA_CHECKSUM_H_ | 8 #define XFA_FXFA_XFA_CHECKSUM_H_ |
9 | 9 |
10 #include "xfa/fde/xml/cfx_saxreader.h" | 10 #include "xfa/fde/xml/cfx_saxreader.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 void OnTagEnd(CXFA_SAXContext* pTag, | 42 void OnTagEnd(CXFA_SAXContext* pTag, |
43 const CFX_ByteStringC& bsTagName, | 43 const CFX_ByteStringC& bsTagName, |
44 uint32_t dwEndPos); | 44 uint32_t dwEndPos); |
45 | 45 |
46 void OnTargetData(CXFA_SAXContext* pTag, | 46 void OnTargetData(CXFA_SAXContext* pTag, |
47 CFX_SAXItem::Type eType, | 47 CFX_SAXItem::Type eType, |
48 const CFX_ByteStringC& bsData, | 48 const CFX_ByteStringC& bsData, |
49 uint32_t dwStartPos); | 49 uint32_t dwStartPos); |
50 | 50 |
51 protected: | 51 protected: |
52 void UpdateChecksum(FX_BOOL bCheckSpace); | 52 void UpdateChecksum(bool bCheckSpace); |
53 | 53 |
54 CXFA_ChecksumContext* m_pContext; | 54 CXFA_ChecksumContext* m_pContext; |
55 CXFA_SAXContext m_SAXContext; | 55 CXFA_SAXContext m_SAXContext; |
56 }; | 56 }; |
57 | 57 |
58 class CXFA_ChecksumContext { | 58 class CXFA_ChecksumContext { |
59 public: | 59 public: |
60 CXFA_ChecksumContext(); | 60 CXFA_ChecksumContext(); |
61 ~CXFA_ChecksumContext(); | 61 ~CXFA_ChecksumContext(); |
62 | 62 |
63 void StartChecksum(); | 63 void StartChecksum(); |
64 void Update(const CFX_ByteStringC& bsText); | 64 void Update(const CFX_ByteStringC& bsText); |
65 FX_BOOL UpdateChecksum(IFX_SeekableReadStream* pSrcFile, | 65 bool UpdateChecksum(IFX_SeekableReadStream* pSrcFile, |
66 FX_FILESIZE offset = 0, | 66 FX_FILESIZE offset = 0, |
67 size_t size = 0); | 67 size_t size = 0); |
68 void FinishChecksum(); | 68 void FinishChecksum(); |
69 CFX_ByteString GetChecksum() const; | 69 CFX_ByteString GetChecksum() const; |
70 | 70 |
71 protected: | 71 protected: |
72 CFX_SAXReader* m_pSAXReader; | 72 CFX_SAXReader* m_pSAXReader; |
73 uint8_t* m_pByteContext; | 73 uint8_t* m_pByteContext; |
74 CFX_ByteString m_bsChecksum; | 74 CFX_ByteString m_bsChecksum; |
75 }; | 75 }; |
76 | 76 |
77 #endif // XFA_FXFA_XFA_CHECKSUM_H_ | 77 #endif // XFA_FXFA_XFA_CHECKSUM_H_ |
OLD | NEW |